|
@ -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) |
|
|
{ |
|
|
|
|
|
case brick_1: |
|
|
|
|
|
playfield[in_x][in_y] = freespace; |
|
|
|
|
|
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; |
|
|
return; |
|
|
} |
|
|
|
|
|
|
|
|
playfield[in_x][in_y]--; |
|
|
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; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|