summaryrefslogtreecommitdiff
path: root/src/gun.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-05-28 19:25:15 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-05-28 19:25:15 +0000
commite5120505b21ff38dc25efcad129a440bbfa9996d (patch)
tree583e0683fb1f71f65bb81b0fcdf2e71587e1fe46 /src/gun.c
parentc94fd664bba352732bf0e5c9a77e709b49f1aa4f (diff)
- 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
Diffstat (limited to 'src/gun.c')
-rw-r--r--src/gun.c33
1 files changed, 23 insertions, 10 deletions
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;
}