diff options
| author | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-03-07 21:12:57 +0000 |
|---|---|---|
| committer | oroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e> | 2008-03-07 21:12:57 +0000 |
| commit | 858f01dedbb681c8e62c9dae4d7c3174991844bf (patch) | |
| tree | efe86d519ff4965373b1a2fe1f59b30e14d73d7e /src/tux.c | |
| parent | 44404eb5063bd5f040c7a4d8605aa3d43e3a968a (diff) | |
-podpora teleportov
-podpora rur
git-svn-id: http://opensvn.csie.org/tuxanci_ng@9 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/tux.c')
| -rw-r--r-- | src/tux.c | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -13,6 +13,8 @@ #include "shot.h" #include "gun.h" #include "wall.h" +#include "teleport.h" +#include "pipe.h" #include "item.h" #include "arena.h" #include "myTimer.h" @@ -385,7 +387,7 @@ void tuxTeleport(tux_t *tux) } } -void eventConflictShotWithTux(list_t *listTux, list_t *listShot) +void eventConflictTuxWithShot(list_t *listTux, list_t *listShot) { shot_t *thisShot; tux_t *thisTux; @@ -428,6 +430,29 @@ void eventConflictShotWithTux(list_t *listTux, list_t *listShot) } } +void eventConflictTuxWithTeleport(list_t *listTux, list_t *listTeleport) +{ + teleport_t *thisTeleport; + tux_t *thisTux; + + int i; + + assert( listTux != NULL ); + assert( listTeleport != NULL ); + + for( i = 0 ; i < listTeleport->count ; i++ ) + { + thisTeleport = (teleport_t *)listTeleport->list[i]; + assert( thisTeleport != NULL ); + + if( ( thisTux = isConflictWithListTux(listTux, thisTeleport->x, thisTeleport->y, + thisTeleport->w, thisTeleport->h) ) != NULL ) + { + eventTeleportTux(listTeleport, thisTeleport, thisTux); + } + } +} + void moveTux(tux_t *tux, int n) { int px, py; @@ -480,9 +505,11 @@ void moveTux(tux_t *tux, int n) getTuxProportion(tux, &x, &y, &w, &h); + if( tux->bonus != BONUS_GHOST && ( isConflictTuxWithListTux(tux, arena->listTux) || - isConflictWithListWall(arena->listWall, x, y, w, h) ) ) + isConflictWithListWall(arena->listWall, x, y, w, h) || + isConflictWithListPipe(arena->listPipe, x, y, w, h) ) ) { tux->x = zal_x; tux->y = zal_y; |