From e5120505b21ff38dc25efcad129a440bbfa9996d Mon Sep 17 00:00:00 2001 From: oroborus Date: Wed, 28 May 2008 19:25:15 +0000 Subject: - zrychlenie hry, bez toho aby sa menila rychlost hlavneho casovaca - oprava chyby v ID managery - ID manager spravuje ID-y pre vsetky objekty git-svn-id: http://opensvn.csie.org/tuxanci_ng@55 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- src/gun.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) (limited to 'src/gun.c') diff --git a/src/gun.c b/src/gun.c index c18fa07..96d0f21 100644 --- a/src/gun.c +++ b/src/gun.c @@ -63,21 +63,32 @@ static void addShotTrivial(tux_t *tux, int x, int y, int px, int py, int gun) modificiationCopuse(tux->position, px, py, &dest_px, &dest_py); modificiationCopuse(tux->position, x, y, &dest_x, &dest_y); - switch( tux->position ) + if( gun == GUN_LASSER ) { - case TUX_UP : - dest_y -= TUX_WIDTH; - break; - case TUX_RIGHT : + switch( tux->position ) + { + case TUX_UP : + dest_y -= GUN_LASSER_HORIZONTAL; break; - case TUX_LEFT : - dest_x -= TUX_WIDTH; - break; - case TUX_DOWN : - break; + case TUX_RIGHT : + break; + case TUX_LEFT : + dest_x -= GUN_LASSER_HORIZONTAL; + break; + case TUX_DOWN : + break; + } } shot = newShot(tux->x + dest_x, tux->y + dest_y, dest_px, dest_py, gun, tux->id); + +/* + if( isFreeSpace( getCurrentArena(), shot->x, shot->y, shot->w, shot->h ) == 0 ) + { + destroyShot(shot); + return; + } +*/ addList( getCurrentArena()->listShot, shot ); if( getNetTypeGame() == NET_GAME_TYPE_SERVER ) @@ -206,7 +217,9 @@ static void timer_addLaserTimer(void *p) gun = tux->gun; tux->gun = GUN_LASSER; + addShot(tux, 0, 0, +10, 0); + tux->gun = gun; } -- cgit v1.2.3