|
@ -59,38 +59,43 @@ void borg_breakout(uint8_t demomode) |
|
|
ball_spawn_default(&(balls[0])); |
|
|
ball_spawn_default(&(balls[0])); |
|
|
balls[0].strength = START_LIFES; |
|
|
balls[0].strength = START_LIFES; |
|
|
level_init(level); |
|
|
level_init(level); |
|
|
|
|
|
uint8_t tick_divider = 0; |
|
|
rebound_init(); |
|
|
rebound_init(); |
|
|
|
|
|
|
|
|
while (cycles != 0) |
|
|
while (cycles != 0) |
|
|
{ |
|
|
{ |
|
|
wait(50); |
|
|
wait(25); |
|
|
|
|
|
|
|
|
if (demomode) |
|
|
if ((tick_divider % 2) || JOYISFIRE) |
|
|
rebound_tick(&balls[0]); |
|
|
rebound_tick(demomode ? &balls[0] : NULL); |
|
|
else |
|
|
|
|
|
rebound_tick(NULL); |
|
|
|
|
|
|
|
|
|
|
|
ball_think(&(balls[0])); |
|
|
|
|
|
playfield_draw(); |
|
|
|
|
|
ball_draw(&(balls[0])); |
|
|
|
|
|
if (!balls[0].strength) |
|
|
|
|
|
{ |
|
|
|
|
|
print_score(); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!level_getscorediff()) |
|
|
if (tick_divider % 2) |
|
|
{ |
|
|
{ |
|
|
level++; |
|
|
ball_think(&(balls[0])); |
|
|
/* respawn ball at rebound position */ |
|
|
playfield_draw(); |
|
|
ball_spawn_default (&(balls[0])); |
|
|
ball_draw(&(balls[0])); |
|
|
balls[0].strength++; |
|
|
if (!balls[0].strength) |
|
|
level_init(level); |
|
|
{ |
|
|
rebound_init(); |
|
|
print_score(); |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!level_getscorediff()) |
|
|
|
|
|
{ |
|
|
|
|
|
level++; |
|
|
|
|
|
/* respawn ball at rebound position */ |
|
|
|
|
|
ball_spawn_default (&(balls[0])); |
|
|
|
|
|
balls[0].strength++; |
|
|
|
|
|
level_init(level); |
|
|
|
|
|
rebound_init(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (demomode) |
|
|
if (demomode) |
|
|
--cycles; |
|
|
--cycles; |
|
|
|
|
|
|
|
|
|
|
|
// alternate the value of the tick divider
|
|
|
|
|
|
tick_divider = tick_divider ? 0 : 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
ignorescore = ignorescore_buffer; |
|
|
ignorescore = ignorescore_buffer; |
|
|