2010-01-15 16:02:31 +00:00
|
|
|
#include <stdint.h>
|
2010-01-15 14:42:46 +00:00
|
|
|
#include "common.h"
|
|
|
|
void borg_breakout();
|
2010-01-15 12:19:54 +00:00
|
|
|
|
2010-01-15 12:52:15 +00:00
|
|
|
#ifdef MENU_SUPPORT
|
2010-01-15 16:02:31 +00:00
|
|
|
//static uint8_t breakout_icon[8] PROGMEM = {0x03, 0x03, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00}; /* our Icon */
|
|
|
|
static uint8_t breakout_icon[8] PROGMEM = {0x03, 0x03, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00}; /* our Icon */
|
2010-01-15 12:19:54 +00:00
|
|
|
|
2010-01-15 14:42:46 +00:00
|
|
|
game_descriptor_t breakout_game_descriptor __attribute__((section(".game_descriptors"))) =
|
|
|
|
{
|
2010-01-15 12:19:54 +00:00
|
|
|
&borg_breakout,
|
2010-01-15 16:02:31 +00:00
|
|
|
breakout_icon
|
2010-01-15 12:19:54 +00:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void borg_breakout()
|
|
|
|
{
|
|
|
|
uint8_t rungame = 1, num_balls = 1;
|
|
|
|
ball_t balls[1];
|
|
|
|
|
2010-01-15 14:42:46 +00:00
|
|
|
rebound_init();
|
2010-01-15 12:19:54 +00:00
|
|
|
|
|
|
|
/* spawn a ball in the middle bottom of the field, let it move upwards with random speed & x-direction */
|
2010-01-15 16:02:31 +00:00
|
|
|
ball_spawn (&balls[0], (NUM_COLS / 2) << 8, (NUM_ROWS-2) << 8, - (random8() % 8), (random8() % 8), START_LIFES);
|
2010-01-15 12:19:54 +00:00
|
|
|
level_init(1);
|
|
|
|
|
|
|
|
while (rungame)
|
|
|
|
{
|
2010-01-15 16:02:31 +00:00
|
|
|
wait(50);
|
2010-01-15 14:42:46 +00:00
|
|
|
rebound_tick();
|
2010-01-15 16:02:31 +00:00
|
|
|
ball_think(&balls[0]);
|
2010-01-15 12:19:54 +00:00
|
|
|
playfield_draw();
|
2010-01-15 16:02:31 +00:00
|
|
|
ball_draw(&balls[0]);
|
2010-01-15 12:19:54 +00:00
|
|
|
}
|
|
|
|
}
|