fixes, but still not done ;)

This commit is contained in:
soeren 2010-01-15 12:31:58 +00:00
parent 45dc9282fd
commit 44a69a04af
1 changed files with 14 additions and 24 deletions

View File

@ -4,23 +4,10 @@ uint8_t brick_damage (uint8_t in_x, uint8_t in_y)
{ {
game_field_t newtype; game_field_t newtype;
switch (playfiled[in_x][in_y]) if (playfield[in_x][in_y] > bs || playfield[in_x][in_y] == 0)
{ return;
case brick_1:
playfield[in_x][in_y] = freespace; playfield[in_x][in_y]--;
break;
case brick_2:
playfield[in_x][in_y] = brick_1;
break;
case brick_3:
playfield[in_x][in_y] = brick_2;
break;
default:
return;
}
score_add (1); score_add (1);
} }
@ -36,19 +23,22 @@ uint8_t check_bounce (uint8_t in_x, uint8_t in_y)
/* collisions with real objects */ /* collisions with real objects */
switch (playfield[in_x][in_y]) switch (playfield[in_x][in_y])
{ {
case freespace: case sp:
case ball: case bl:
return 0; return 0;
case brick_2: case b2:
case brick_3: case b3:
case brick_1: case b1:
brick_damage (in_x, in_y); brick_damage (in_x, in_y);
/* intentional fallthrough */ /* intentional fallthrough */
case brick_solid: case bs:
case bouncer:
return 1; return 1;
/* bouncing on the rebound needs special care */
case rb:
return 2;
} }
} }