Browse Source

* cosmetic code changes.

* fixed a bug in the tunnel munching.
tags/v0.99.beta14
Sam Hocevar sam 22 years ago
parent
commit
9d92e2f41b
2 changed files with 11 additions and 21 deletions
  1. +2
    -0
      TODO
  2. +9
    -21
      src/collide.c

+ 2
- 0
TODO View File

@@ -40,3 +40,5 @@ Things to do


* the nuke should break the tunnel * the nuke should break the tunnel


* the laser stays alive when the ship exploded


+ 9
- 21
src/collide.c View File

@@ -3,7 +3,7 @@
* Copyright (c) 2002 Sam Hocevar <sam@zoy.org> * Copyright (c) 2002 Sam Hocevar <sam@zoy.org>
* All Rights Reserved * All Rights Reserved
* *
* $Id: collide.c,v 1.10 2002/12/23 16:21:38 sam Exp $
* $Id: collide.c,v 1.11 2003/01/06 12:22:58 sam Exp $
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@@ -55,11 +55,11 @@ void collide_weapons_tunnel( game *g, weapons *wp, tunnel *t, explosions *ex )


if( x <= t->left[y] ) if( x <= t->left[y] )
{ {
if( y-2 >= 0 ) t->right[y-2] -= damage - 1;
if( y-2 >= 0 ) t->left[y-2] -= damage - 1;
if( y-1 >= 0 ) t->left[y-1] -= damage; if( y-1 >= 0 ) t->left[y-1] -= damage;
t->left[y] -= damage + 1; t->left[y] -= damage + 1;
if( y+1 < g->h ) t->left[y+1] -= damage; if( y+1 < g->h ) t->left[y+1] -= damage;
if( y+2 < g->h ) t->right[y+2] -= damage - 1;
if( y+2 < g->h ) t->left[y+2] -= damage - 1;
} }
else else
{ {
@@ -97,27 +97,15 @@ void collide_weapons_tunnel( game *g, weapons *wp, tunnel *t, explosions *ex )


if( x <= t->left[y+j] ) if( x <= t->left[y+j] )
{ {
if( y+j-1 >= 0 )
{
t->left[y+j-1]--;
}
if( y+j-1 >= 0 ) t->left[y+j-1]--;
t->left[y+j] -= 2; t->left[y+j] -= 2;
if( y+j+1 < g->h )
{
t->left[y+j+1]--;
}
if( y+j+1 < g->h ) t->left[y+j+1]--;
} }
else else
{ {
if( y+j-1 >= 0 )
{
t->right[y+j-1]++;
}
if( y+j-1 >= 0 ) t->right[y+j-1]++;
t->right[y+j] += 2; t->right[y+j] += 2;
if( y+j+1 < g->h )
{
t->right[y+j+1]++;
}
if( y+j+1 < g->h ) t->right[y+j+1]++;
} }
break; break;
} }
@@ -293,14 +281,14 @@ void collide_player_tunnel( game *g, player *p, tunnel *t, explosions *ex )
p->x += 3; p->x += 3;
p->vx = 2; p->vx = 2;
add_explosion( g, ex, p->x+1, p->y-1, 0, 0, EXPLOSION_SMALL ); add_explosion( g, ex, p->x+1, p->y-1, 0, 0, EXPLOSION_SMALL );
p->life -= 80;
p->life -= 180;
} }
else if( p->x + 5 >= t->right[p->y] ) else if( p->x + 5 >= t->right[p->y] )
{ {
p->x -= 3; p->x -= 3;
p->vx = -2; p->vx = -2;
add_explosion( g, ex, p->x+4, p->y-1, 0, 0, EXPLOSION_SMALL ); add_explosion( g, ex, p->x+4, p->y-1, 0, 0, EXPLOSION_SMALL );
p->life -= 80;
p->life -= 180;
} }
} }



Loading…
Cancel
Save