mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-23 23:17:38 -04:00
brickmania: improve game saving to save current status.
fix position of message text and remove unused defines. fix bug "Congratulations!" won't be shown when cleared all levels. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22112 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ef0c9da7dd
commit
e3f7184e60
1 changed files with 329 additions and 336 deletions
|
|
@ -247,34 +247,22 @@ CONFIG_KEYPAD == SANSA_M200_PAD
|
||||||
|
|
||||||
#define TOPMARGIN (BRICK_HEIGHT * 2)
|
#define TOPMARGIN (BRICK_HEIGHT * 2)
|
||||||
|
|
||||||
#define HIGHSCORE_XPOS (LCD_WIDTH - 60)
|
#if LCD_WIDTH<=LCD_HEIGHT
|
||||||
#define HIGHSCORE_YPOS 0
|
/* Maintain a 4/3 ratio (Width/Height) */
|
||||||
|
#define GAMESCREEN_HEIGHT (LCD_WIDTH * 3 / 4)
|
||||||
|
#else
|
||||||
|
#define GAMESCREEN_HEIGHT LCD_HEIGHT
|
||||||
|
#endif
|
||||||
|
|
||||||
#define STRINGPOS_FINISH (LCD_HEIGHT - (LCD_HEIGHT / 6))
|
#define STRINGPOS_FINISH (GAMESCREEN_HEIGHT - (GAMESCREEN_HEIGHT / 6))
|
||||||
#define STRINGPOS_CONGRATS (STRINGPOS_FINISH - 20)
|
#define STRINGPOS_CONGRATS (STRINGPOS_FINISH - 20)
|
||||||
#define STRINGPOS_NAVI (STRINGPOS_FINISH - 10)
|
#define STRINGPOS_NAVI (STRINGPOS_FINISH - 10)
|
||||||
#define STRINGPOS_FLIP (STRINGPOS_FINISH - 10)
|
#define STRINGPOS_FLIP (STRINGPOS_FINISH - 10)
|
||||||
|
|
||||||
#if LCD_WIDTH<=LCD_HEIGHT
|
|
||||||
/* Maintain a 4/3 ratio (Width/Height) */
|
|
||||||
#define GAMESCREEN_HEIGHT (LCD_WIDTH * 3 / 4)
|
|
||||||
#define BMPYOFS_start (LCD_HEIGHT / 2)
|
|
||||||
#else
|
|
||||||
#define GAMESCREEN_HEIGHT LCD_HEIGHT
|
|
||||||
#define BMPYOFS_start (LCD_HEIGHT / 3)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* calculate menu item offsets from the first defined and the height*/
|
|
||||||
#define BMPYOFS_resume (BMPYOFS_start + MENU_ITEMHEIGHT)
|
|
||||||
#define BMPYOFS_help (BMPYOFS_start + 2*MENU_ITEMHEIGHT)
|
|
||||||
#define BMPYOFS_quit (BMPYOFS_start + 3*MENU_ITEMHEIGHT)
|
|
||||||
|
|
||||||
/*calculate paddle y-position */
|
/*calculate paddle y-position */
|
||||||
#define PAD_POS_Y (GAMESCREEN_HEIGHT - PAD_HEIGHT - 1)
|
#define PAD_POS_Y (GAMESCREEN_HEIGHT - PAD_HEIGHT - 1)
|
||||||
|
|
||||||
|
|
||||||
#define MARGIN 5
|
|
||||||
|
|
||||||
int levels_num = 29;
|
int levels_num = 29;
|
||||||
|
|
||||||
static unsigned char levels[29][8][10] = {
|
static unsigned char levels[29][8][10] = {
|
||||||
|
|
@ -573,23 +561,22 @@ static unsigned char levels[29][8][10] = {
|
||||||
#define MAX_BALLS 10
|
#define MAX_BALLS 10
|
||||||
|
|
||||||
enum difficulty_options {
|
enum difficulty_options {
|
||||||
EASY, HARD
|
EASY, NORMAL
|
||||||
};
|
};
|
||||||
|
|
||||||
int pad_pos_x;
|
int pad_pos_x;
|
||||||
int x[MAX_BALLS],y[MAX_BALLS];
|
|
||||||
int life;
|
int life;
|
||||||
int start_game,con_game;
|
enum { ST_READY, ST_START, ST_PAUSE } game_state = ST_READY;
|
||||||
int pad_type;
|
int pad_type;
|
||||||
int score=0,vscore=0;
|
int score=0,vscore=0;
|
||||||
bool flip_sides=false;
|
bool flip_sides=false;
|
||||||
int level=0;
|
int level=0;
|
||||||
int brick_on_board=0;
|
int brick_on_board=0;
|
||||||
int used_balls=1;
|
int used_balls=1;
|
||||||
bool saved_game=false;
|
int difficulty = NORMAL;
|
||||||
int l_score=0;
|
|
||||||
int difficulty = EASY;
|
|
||||||
int pad_width;
|
int pad_width;
|
||||||
|
int num_count;
|
||||||
|
bool resume = false;
|
||||||
|
|
||||||
typedef struct cube {
|
typedef struct cube {
|
||||||
int powertop;
|
int powertop;
|
||||||
|
|
@ -621,21 +608,17 @@ typedef struct sfire {
|
||||||
sfire fire[30];
|
sfire fire[30];
|
||||||
|
|
||||||
#define CONFIG_FILE_NAME "brickmania.cfg"
|
#define CONFIG_FILE_NAME "brickmania.cfg"
|
||||||
|
#define SAVE_FILE PLUGIN_GAMES_DIR "/brickmania.save"
|
||||||
static struct configdata config[] = {
|
|
||||||
{TYPE_INT, 0, 1, { .int_p = &difficulty }, "difficulty", NULL},
|
|
||||||
{TYPE_BOOL, 0, 1, { .bool_p = &saved_game }, "saved_game", NULL},
|
|
||||||
{TYPE_INT, 0, 40000, { .int_p = &l_score }, "l_score", NULL},
|
|
||||||
{TYPE_INT, 0, 29, { .int_p = &level }, "level", NULL},
|
|
||||||
{TYPE_INT, 0, 30, { .int_p = &life }, "life", NULL},
|
|
||||||
};
|
|
||||||
|
|
||||||
#define HIGH_SCORE PLUGIN_GAMES_DIR "/brickmania.score"
|
#define HIGH_SCORE PLUGIN_GAMES_DIR "/brickmania.score"
|
||||||
#define NUM_SCORES 5
|
#define NUM_SCORES 5
|
||||||
|
|
||||||
|
static struct configdata config[] = {
|
||||||
|
{TYPE_INT, 0, 1, { .int_p = &difficulty }, "difficulty", NULL},
|
||||||
|
};
|
||||||
|
|
||||||
struct highscore highest[NUM_SCORES];
|
struct highscore highest[NUM_SCORES];
|
||||||
|
|
||||||
static void brickmania_int_game(int new_game)
|
static void brickmania_init_game(int new_game)
|
||||||
{
|
{
|
||||||
int i,j;
|
int i,j;
|
||||||
|
|
||||||
|
|
@ -652,11 +635,11 @@ static void brickmania_int_game(int new_game)
|
||||||
}
|
}
|
||||||
|
|
||||||
used_balls=1;
|
used_balls=1;
|
||||||
start_game =1;
|
game_state=ST_READY;
|
||||||
con_game =0;
|
|
||||||
pad_type=0;
|
pad_type=0;
|
||||||
pad_width=PAD_WIDTH;
|
pad_width=PAD_WIDTH;
|
||||||
flip_sides=false;
|
flip_sides=false;
|
||||||
|
num_count=10;
|
||||||
|
|
||||||
if (new_game==1) {
|
if (new_game==1) {
|
||||||
brick_on_board=0;
|
brick_on_board=0;
|
||||||
|
|
@ -666,11 +649,12 @@ static void brickmania_int_game(int new_game)
|
||||||
life++;
|
life++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for(i=0;i<30;i++) {
|
||||||
|
fire[i].top=-8;
|
||||||
|
}
|
||||||
for(i=0;i<=7;i++) {
|
for(i=0;i<=7;i++) {
|
||||||
for(j=0;j<=9;j++) {
|
for(j=0;j<=9;j++) {
|
||||||
brick[i*10+j].poweruse=(levels[level][i][j]==0?0:1);
|
brick[i*10+j].poweruse=(levels[level][i][j]==0?0:1);
|
||||||
if (i*10+j<=30)
|
|
||||||
fire[i*10+j].top=-8;
|
|
||||||
if (new_game==1) {
|
if (new_game==1) {
|
||||||
brick[i*10+j].power=rb->rand()%25;
|
brick[i*10+j].power=rb->rand()%25;
|
||||||
/* +8 make the game with less powerups */
|
/* +8 make the game with less powerups */
|
||||||
|
|
@ -690,7 +674,66 @@ static void brickmania_int_game(int new_game)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int sw,i,w;
|
static void brickmania_loadgame(void)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
resume = false;
|
||||||
|
|
||||||
|
/* open game file */
|
||||||
|
fd = rb->open(SAVE_FILE, O_RDONLY);
|
||||||
|
if(fd < 0) return;
|
||||||
|
|
||||||
|
/* read in saved game */
|
||||||
|
while(true) {
|
||||||
|
if(rb->read(fd, &pad_pos_x, sizeof(pad_pos_x)) <= 0) break;
|
||||||
|
if(rb->read(fd, &life, sizeof(life)) <= 0) break;
|
||||||
|
if(rb->read(fd, &game_state, sizeof(game_state)) <= 0) break;
|
||||||
|
if(rb->read(fd, &pad_type, sizeof(pad_type)) <= 0) break;
|
||||||
|
if(rb->read(fd, &score, sizeof(score)) <= 0) break;
|
||||||
|
if(rb->read(fd, &flip_sides, sizeof(flip_sides)) <= 0) break;
|
||||||
|
if(rb->read(fd, &level, sizeof(level)) <= 0) break;
|
||||||
|
if(rb->read(fd, &brick_on_board, sizeof(brick_on_board)) <= 0) break;
|
||||||
|
if(rb->read(fd, &used_balls, sizeof(used_balls)) <= 0) break;
|
||||||
|
if(rb->read(fd, &pad_width, sizeof(pad_width)) <= 0) break;
|
||||||
|
if(rb->read(fd, &num_count, sizeof(num_count)) <= 0) break;
|
||||||
|
if(rb->read(fd, &brick, sizeof(brick)) <= 0) break;
|
||||||
|
if(rb->read(fd, &ball, sizeof(ball)) <= 0) break;
|
||||||
|
if(rb->read(fd, &fire, sizeof(fire)) <= 0) break;
|
||||||
|
vscore = score;
|
||||||
|
resume = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
rb->close(fd);
|
||||||
|
|
||||||
|
/* delete saved file */
|
||||||
|
rb->remove(SAVE_FILE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void brickmania_savegame(void)
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
|
||||||
|
/* write out the game state to the save file */
|
||||||
|
fd = rb->open(SAVE_FILE, O_WRONLY|O_CREAT);
|
||||||
|
rb->write(fd, &pad_pos_x, sizeof(pad_pos_x));
|
||||||
|
rb->write(fd, &life, sizeof(life));
|
||||||
|
rb->write(fd, &game_state, sizeof(game_state));
|
||||||
|
rb->write(fd, &pad_type, sizeof(pad_type));
|
||||||
|
rb->write(fd, &score, sizeof(score));
|
||||||
|
rb->write(fd, &flip_sides, sizeof(flip_sides));
|
||||||
|
rb->write(fd, &level, sizeof(level));
|
||||||
|
rb->write(fd, &brick_on_board, sizeof(brick_on_board));
|
||||||
|
rb->write(fd, &used_balls, sizeof(used_balls));
|
||||||
|
rb->write(fd, &pad_width, sizeof(pad_width));
|
||||||
|
rb->write(fd, &num_count, sizeof(num_count));
|
||||||
|
rb->write(fd, &brick, sizeof(brick));
|
||||||
|
rb->write(fd, &ball, sizeof(ball));
|
||||||
|
rb->write(fd, &fire, sizeof(fire));
|
||||||
|
rb->close(fd);
|
||||||
|
}
|
||||||
|
|
||||||
/* brickmania_sleep timer counting the score */
|
/* brickmania_sleep timer counting the score */
|
||||||
static void brickmania_sleep(int secs)
|
static void brickmania_sleep(int secs)
|
||||||
|
|
@ -698,6 +741,7 @@ static void brickmania_sleep(int secs)
|
||||||
bool done=false;
|
bool done=false;
|
||||||
char s[20];
|
char s[20];
|
||||||
int count=0;
|
int count=0;
|
||||||
|
int sw, w;
|
||||||
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
if (vscore == score) {
|
if (vscore == score) {
|
||||||
|
|
@ -725,7 +769,6 @@ static void brickmania_sleep(int secs)
|
||||||
|
|
||||||
static int brickmania_help(void)
|
static int brickmania_help(void)
|
||||||
{
|
{
|
||||||
rb->lcd_setfont(FONT_UI);
|
|
||||||
#define WORDS (sizeof help_text / sizeof (char*))
|
#define WORDS (sizeof help_text / sizeof (char*))
|
||||||
static char *help_text[] = {
|
static char *help_text[] = {
|
||||||
"Brickmania", "", "Aim", "",
|
"Brickmania", "", "Aim", "",
|
||||||
|
|
@ -772,7 +815,7 @@ static int brickmania_help(void)
|
||||||
"B", "Ball:", "generates", "another", "ball", "",
|
"B", "Ball:", "generates", "another", "ball", "",
|
||||||
"FL", "Flip:", "flips", "left / right", "movement", "",
|
"FL", "Flip:", "flips", "left / right", "movement", "",
|
||||||
"<->", "or", "<E>:", "enlarges", "the", "paddle", "",
|
"<->", "or", "<E>:", "enlarges", "the", "paddle", "",
|
||||||
">-<", "or", ">B<:", "shrinks", "the", "paddle", "",
|
">-<", "or", ">S<:", "shrinks", "the", "paddle", "",
|
||||||
};
|
};
|
||||||
static struct style_text formation[]={
|
static struct style_text formation[]={
|
||||||
{ 0, TEXT_CENTER|TEXT_UNDERLINE },
|
{ 0, TEXT_CENTER|TEXT_UNDERLINE },
|
||||||
|
|
@ -788,18 +831,20 @@ static int brickmania_help(void)
|
||||||
{ 80, C_RED },
|
{ 80, C_RED },
|
||||||
{ -1, 0 }
|
{ -1, 0 }
|
||||||
};
|
};
|
||||||
|
int button;
|
||||||
|
|
||||||
|
rb->lcd_setfont(FONT_UI);
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
rb->lcd_set_background(LCD_BLACK);
|
rb->lcd_set_background(LCD_BLACK);
|
||||||
rb->lcd_set_foreground(LCD_WHITE);
|
rb->lcd_set_foreground(LCD_WHITE);
|
||||||
#endif
|
#endif
|
||||||
int button;
|
|
||||||
if (display_text(WORDS, help_text, formation, NULL)==PLUGIN_USB_CONNECTED)
|
if (display_text(WORDS, help_text, formation, NULL))
|
||||||
return PLUGIN_USB_CONNECTED;
|
return 1;
|
||||||
do {
|
do {
|
||||||
button = rb->button_get(true);
|
button = rb->button_get(true);
|
||||||
if (button == SYS_USB_CONNECTED) {
|
if (rb->default_event_handler(button) == SYS_USB_CONNECTED) {
|
||||||
return PLUGIN_USB_CONNECTED;
|
return 1;
|
||||||
}
|
}
|
||||||
} while( ( button == BUTTON_NONE )
|
} while( ( button == BUTTON_NONE )
|
||||||
|| ( button & (BUTTON_REL|BUTTON_REPEAT) ) );
|
|| ( button & (BUTTON_REL|BUTTON_REPEAT) ) );
|
||||||
|
|
@ -807,57 +852,43 @@ static int brickmania_help(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool _ingame;
|
|
||||||
static int brickmania_menu_cb(int action, const struct menu_item_ex *this_item)
|
static int brickmania_menu_cb(int action, const struct menu_item_ex *this_item)
|
||||||
{
|
{
|
||||||
|
int i = ((intptr_t)this_item);
|
||||||
if(action == ACTION_REQUEST_MENUITEM
|
if(action == ACTION_REQUEST_MENUITEM
|
||||||
&& !_ingame && ((intptr_t)this_item)==0)
|
&& !resume && (i==0 || i==6))
|
||||||
return ACTION_EXIT_MENUITEM;
|
return ACTION_EXIT_MENUITEM;
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int brickmania_menu(bool ingame)
|
static int brickmania_menu(void)
|
||||||
{
|
{
|
||||||
rb->button_clear_queue();
|
int selected = 0;
|
||||||
int choice = 0;
|
|
||||||
|
|
||||||
_ingame = ingame;
|
|
||||||
|
|
||||||
static struct opt_items options[] = {
|
static struct opt_items options[] = {
|
||||||
{ "Easy", -1 },
|
{ "Easy", -1 },
|
||||||
{ "Hard", -1 },
|
{ "Normal", -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
MENUITEM_STRINGLIST (main_menu, "Brickmania Menu", brickmania_menu_cb,
|
MENUITEM_STRINGLIST(main_menu, "Brickmania Menu", brickmania_menu_cb,
|
||||||
"Resume Game",
|
"Resume Game", "Start New Game",
|
||||||
"Start New Game",
|
"Difficulty", "Help", "High Scores",
|
||||||
"Difficulty",
|
|
||||||
"Help",
|
|
||||||
"High Score",
|
|
||||||
"Playback Control",
|
"Playback Control",
|
||||||
"Quit");
|
"Quit without Saving", "Quit");
|
||||||
|
|
||||||
|
rb->button_clear_queue();
|
||||||
while (true) {
|
while (true) {
|
||||||
switch (rb->do_menu(&main_menu, &choice, NULL, false)) {
|
switch (rb->do_menu(&main_menu, &selected, NULL, false)) {
|
||||||
case 0:
|
case 0:
|
||||||
if (saved_game) {
|
if(game_state!=ST_READY)
|
||||||
saved_game = false;
|
game_state = ST_PAUSE;
|
||||||
vscore=l_score-1;
|
|
||||||
score=l_score;
|
|
||||||
brickmania_int_game(1);
|
|
||||||
} else {
|
|
||||||
int i;
|
|
||||||
for(i=0;i<used_balls;i++)
|
|
||||||
if (ball[i].x!=0 && ball[i].y !=0)
|
|
||||||
con_game=1;
|
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
case 1:
|
case 1:
|
||||||
score=0;
|
score=0;
|
||||||
vscore=0;
|
vscore=0;
|
||||||
life=2;
|
life=2;
|
||||||
level=0;
|
level=0;
|
||||||
brickmania_int_game(1);
|
brickmania_init_game(1);
|
||||||
return 0;
|
return 0;
|
||||||
case 2:
|
case 2:
|
||||||
rb->set_option("Difficulty", &difficulty, INT, options, 2, NULL);
|
rb->set_option("Difficulty", &difficulty, INT, options, 2, NULL);
|
||||||
|
|
@ -870,16 +901,15 @@ static int brickmania_menu(bool ingame)
|
||||||
highscore_show(NUM_SCORES, highest, NUM_SCORES);
|
highscore_show(NUM_SCORES, highest, NUM_SCORES);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
playback_control(NULL);
|
if (playback_control(NULL))
|
||||||
|
return 1;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (level>0 && ingame) {
|
return 1;
|
||||||
saved_game=true;
|
case 7:
|
||||||
rb->splash(HZ*1, "Saving last achieved level ...");
|
if (resume) {
|
||||||
configfile_save(CONFIG_FILE_NAME,config,5,0);
|
rb->splash(HZ*1, "Saving game ...");
|
||||||
} else {
|
brickmania_savegame();
|
||||||
saved_game=false;
|
|
||||||
configfile_save(CONFIG_FILE_NAME,config,1,0);
|
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
case MENU_ATTACHED_USB:
|
case MENU_ATTACHED_USB:
|
||||||
|
|
@ -910,7 +940,7 @@ static int brickmania_pad_check(int ballxc, int mode, int pon ,int ballnum)
|
||||||
static int brickmania_fire_space(void)
|
static int brickmania_fire_space(void)
|
||||||
{
|
{
|
||||||
int t;
|
int t;
|
||||||
for(t=0;t<=30;t++)
|
for(t=0;t<30;t++)
|
||||||
if (fire[t].top+7 < 0)
|
if (fire[t].top+7 < 0)
|
||||||
return t;
|
return t;
|
||||||
|
|
||||||
|
|
@ -920,23 +950,15 @@ static int brickmania_fire_space(void)
|
||||||
static int brickmania_game_loop(void)
|
static int brickmania_game_loop(void)
|
||||||
{
|
{
|
||||||
int j,i,k,bricky,brickx;
|
int j,i,k,bricky,brickx;
|
||||||
|
int sw;
|
||||||
char s[30];
|
char s[30];
|
||||||
int sec_count=0,num_count=10;
|
int sec_count=0;
|
||||||
int end;
|
int end;
|
||||||
int position;
|
|
||||||
|
|
||||||
configfile_load(CONFIG_FILE_NAME,config,5,0);
|
if (brickmania_menu()!=0) {
|
||||||
|
|
||||||
rb->srand( *rb->current_tick );
|
|
||||||
if (saved_game) {
|
|
||||||
if (brickmania_menu(true)!=0) {
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
} else {
|
resume = false;
|
||||||
if (brickmania_menu(false)!=0) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
/* Convert CYCLETIME (in ms) to HZ */
|
/* Convert CYCLETIME (in ms) to HZ */
|
||||||
|
|
@ -1000,7 +1022,7 @@ static int brickmania_game_loop(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* continue game */
|
/* continue game */
|
||||||
if (con_game== 1 && start_game!=1) {
|
if (game_state==ST_PAUSE) {
|
||||||
#if CONFIG_KEYPAD == ONDIO_PAD
|
#if CONFIG_KEYPAD == ONDIO_PAD
|
||||||
rb->snprintf(s, sizeof(s), "MENU To Continue");
|
rb->snprintf(s, sizeof(s), "MENU To Continue");
|
||||||
#elif CONFIG_KEYPAD == IRIVER_H300_PAD
|
#elif CONFIG_KEYPAD == IRIVER_H300_PAD
|
||||||
|
|
@ -1025,9 +1047,9 @@ static int brickmania_game_loop(void)
|
||||||
brick_on_board--;
|
brick_on_board--;
|
||||||
|
|
||||||
/* if the pad is fire */
|
/* if the pad is fire */
|
||||||
for(i=0;i<=30;i++) {
|
for(i=0;i<30;i++) {
|
||||||
if (fire[i].top+7>0) {
|
if (fire[i].top+7>0) {
|
||||||
if (con_game!=1)
|
if (game_state!=ST_PAUSE)
|
||||||
fire[i].top-=4;
|
fire[i].top-=4;
|
||||||
rb->lcd_vline(fire[i].left, fire[i].top, fire[i].top+7);
|
rb->lcd_vline(fire[i].left, fire[i].top, fire[i].top+7);
|
||||||
}
|
}
|
||||||
|
|
@ -1038,15 +1060,14 @@ static int brickmania_game_loop(void)
|
||||||
for (j=0;j<=9;j++) {
|
for (j=0;j<=9;j++) {
|
||||||
if (brick[i*10+j].power<9) {
|
if (brick[i*10+j].power<9) {
|
||||||
if (brick[i*10+j].poweruse==2) {
|
if (brick[i*10+j].poweruse==2) {
|
||||||
if (con_game!=1)
|
if (game_state!=ST_PAUSE)
|
||||||
brick[i*10+j].powertop+=2;
|
brick[i*10+j].powertop+=2;
|
||||||
rb->lcd_bitmap_part(brickmania_powerups,0,
|
rb->lcd_bitmap_part(brickmania_powerups,0,
|
||||||
POWERUP_HEIGHT*brick[i*10+j
|
POWERUP_HEIGHT*brick[i*10+j
|
||||||
].power,
|
].power,
|
||||||
POWERUP_WIDTH,
|
POWERUP_WIDTH,
|
||||||
LEFTMARGIN+j*BRICK_WIDTH+
|
LEFTMARGIN+j*BRICK_WIDTH+
|
||||||
(BRICK_WIDTH/2-
|
(BRICK_WIDTH/2-POWERUP_WIDTH/2),
|
||||||
POWERUP_WIDTH/2),
|
|
||||||
brick[i*10+j].powertop,
|
brick[i*10+j].powertop,
|
||||||
POWERUP_WIDTH,
|
POWERUP_WIDTH,
|
||||||
POWERUP_HEIGHT);
|
POWERUP_HEIGHT);
|
||||||
|
|
@ -1065,7 +1086,7 @@ static int brickmania_game_loop(void)
|
||||||
case 1:
|
case 1:
|
||||||
life--;
|
life--;
|
||||||
if (life>=0) {
|
if (life>=0) {
|
||||||
brickmania_int_game(0);
|
brickmania_init_game(0);
|
||||||
brickmania_sleep(2);
|
brickmania_sleep(2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1096,10 +1117,13 @@ static int brickmania_game_loop(void)
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
score+=23;
|
score+=23;
|
||||||
used_balls++;
|
if(used_balls<MAX_BALLS) {
|
||||||
ball[used_balls-1].x= rb->rand()%1 == 0 ?
|
ball[used_balls].x= rb->rand()%2 == 0 ?
|
||||||
-1 : 1;
|
-1 : 1;
|
||||||
ball[used_balls-1].y= -4;
|
ball[used_balls].y= -4;
|
||||||
|
ball[used_balls].glue= false;
|
||||||
|
used_balls++;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
score+=23;
|
score+=23;
|
||||||
|
|
@ -1136,7 +1160,7 @@ static int brickmania_game_loop(void)
|
||||||
brickx=LEFTMARGIN+j*BRICK_WIDTH;
|
brickx=LEFTMARGIN+j*BRICK_WIDTH;
|
||||||
bricky=TOPMARGIN+i*BRICK_HEIGHT;
|
bricky=TOPMARGIN+i*BRICK_HEIGHT;
|
||||||
if (pad_type==2) {
|
if (pad_type==2) {
|
||||||
for (k=0;k<=30;k++) {
|
for (k=0;k<30;k++) {
|
||||||
if (fire[k].top+7>0) {
|
if (fire[k].top+7>0) {
|
||||||
if (brick[i*10+j].used==1 &&
|
if (brick[i*10+j].used==1 &&
|
||||||
(fire[k].left+1 >= brickx &&
|
(fire[k].left+1 >= brickx &&
|
||||||
|
|
@ -1169,14 +1193,12 @@ static int brickmania_game_loop(void)
|
||||||
BRICK_WIDTH, BRICK_HEIGHT);
|
BRICK_WIDTH, BRICK_HEIGHT);
|
||||||
#ifdef HAVE_LCD_COLOR /* No transparent effect for greyscale lcds for now */
|
#ifdef HAVE_LCD_COLOR /* No transparent effect for greyscale lcds for now */
|
||||||
if (brick[i*10+j].hiteffect>0)
|
if (brick[i*10+j].hiteffect>0)
|
||||||
rb->lcd_bitmap_transparent_part(brickmania_break,
|
rb->lcd_bitmap_transparent_part(brickmania_break,0,
|
||||||
0,
|
|
||||||
BRICK_HEIGHT*brick[i*10+j].hiteffect,
|
BRICK_HEIGHT*brick[i*10+j].hiteffect,
|
||||||
BRICK_WIDTH,
|
BRICK_WIDTH,
|
||||||
LEFTMARGIN+j*BRICK_WIDTH,
|
LEFTMARGIN+j*BRICK_WIDTH,
|
||||||
TOPMARGIN+i*BRICK_HEIGHT,
|
TOPMARGIN+i*BRICK_HEIGHT,
|
||||||
BRICK_WIDTH,
|
BRICK_WIDTH, BRICK_HEIGHT);
|
||||||
BRICK_HEIGHT);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
/* Somewhere in here collision checking is done b/w ball and
|
/* Somewhere in here collision checking is done b/w ball and
|
||||||
|
|
@ -1330,10 +1352,13 @@ static int brickmania_game_loop(void)
|
||||||
} /* for i */
|
} /* for i */
|
||||||
|
|
||||||
/* draw the pad */
|
/* draw the pad */
|
||||||
rb->lcd_bitmap_part(pad_width==PAD_WIDTH?brickmania_pads:pad_width==LONG_PAD_WIDTH?brickmania_long_pads:brickmania_short_pads,0,pad_type*PAD_HEIGHT,
|
rb->lcd_bitmap_part(pad_width==PAD_WIDTH?brickmania_pads:
|
||||||
pad_width,pad_pos_x, PAD_POS_Y, pad_width,
|
pad_width==LONG_PAD_WIDTH?brickmania_long_pads:
|
||||||
PAD_HEIGHT);
|
brickmania_short_pads,
|
||||||
|
0,pad_type*PAD_HEIGHT,pad_width,
|
||||||
|
pad_pos_x, PAD_POS_Y, pad_width, PAD_HEIGHT);
|
||||||
|
|
||||||
|
if (game_state!=ST_PAUSE) {
|
||||||
for(k=0;k<used_balls;k++) {
|
for(k=0;k<used_balls;k++) {
|
||||||
|
|
||||||
if ((ball[k].pos_x >= pad_pos_x &&
|
if ((ball[k].pos_x >= pad_pos_x &&
|
||||||
|
|
@ -1378,7 +1403,7 @@ static int brickmania_game_loop(void)
|
||||||
} else {
|
} else {
|
||||||
life--;
|
life--;
|
||||||
if (life>=0) {
|
if (life>=0) {
|
||||||
brickmania_int_game(0);
|
brickmania_init_game(0);
|
||||||
brickmania_sleep(2);
|
brickmania_sleep(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1394,7 +1419,7 @@ static int brickmania_game_loop(void)
|
||||||
if ((ball[k].pos_y+BALL >= PAD_POS_Y &&
|
if ((ball[k].pos_y+BALL >= PAD_POS_Y &&
|
||||||
(ball[k].pos_x >= pad_pos_x &&
|
(ball[k].pos_x >= pad_pos_x &&
|
||||||
ball[k].pos_x <= pad_pos_x+pad_width)) &&
|
ball[k].pos_x <= pad_pos_x+pad_width)) &&
|
||||||
start_game != 1 && !ball[k].glue) {
|
game_state!=ST_READY && !ball[k].glue) {
|
||||||
|
|
||||||
if ((ball[k].pos_x+HALFBALL >= pad_pos_x &&
|
if ((ball[k].pos_x+HALFBALL >= pad_pos_x &&
|
||||||
ball[k].pos_x+HALFBALL <=
|
ball[k].pos_x+HALFBALL <=
|
||||||
|
|
@ -1406,9 +1431,9 @@ static int brickmania_game_loop(void)
|
||||||
ball[k].y = -2;
|
ball[k].y = -2;
|
||||||
if (ball[k].pos_x != 0 &&
|
if (ball[k].pos_x != 0 &&
|
||||||
ball[k].pos_x+BALL!=LCD_WIDTH)
|
ball[k].pos_x+BALL!=LCD_WIDTH)
|
||||||
ball[k].x = brickmania_pad_check(6,0,ball[k].pos_x+2<=
|
ball[k].x = brickmania_pad_check(6,0,
|
||||||
pad_pos_x+(pad_width/2)?
|
ball[k].pos_x+2<=pad_pos_x+
|
||||||
0:1,k);
|
(pad_width/2)?0:1,k);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ((ball[k].pos_x+HALFBALL >=
|
else if ((ball[k].pos_x+HALFBALL >=
|
||||||
|
|
@ -1423,9 +1448,9 @@ static int brickmania_game_loop(void)
|
||||||
ball[k].y = -3;
|
ball[k].y = -3;
|
||||||
if (ball[k].pos_x != 0 &&
|
if (ball[k].pos_x != 0 &&
|
||||||
ball[k].pos_x+BALL!=LCD_WIDTH)
|
ball[k].pos_x+BALL!=LCD_WIDTH)
|
||||||
ball[k].x = brickmania_pad_check(4,0,ball[k].pos_x+2<=
|
ball[k].x = brickmania_pad_check(4,0,
|
||||||
pad_pos_x+(pad_width/2)?
|
ball[k].pos_x+2<=pad_pos_x+
|
||||||
0:1,k);
|
(pad_width/2)?0:1,k);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ((ball[k].pos_x+HALFBALL >=
|
else if ((ball[k].pos_x+HALFBALL >=
|
||||||
|
|
@ -1440,9 +1465,9 @@ static int brickmania_game_loop(void)
|
||||||
ball[k].y = -4;
|
ball[k].y = -4;
|
||||||
if (ball[k].pos_x != 0 &&
|
if (ball[k].pos_x != 0 &&
|
||||||
ball[k].pos_x+BALL!=LCD_WIDTH)
|
ball[k].pos_x+BALL!=LCD_WIDTH)
|
||||||
ball[k].x = brickmania_pad_check(3,0,ball[k].pos_x+2<=
|
ball[k].x = brickmania_pad_check(3,0,
|
||||||
pad_pos_x+(pad_width/2)?
|
ball[k].pos_x+2<=pad_pos_x+
|
||||||
0:1,k);
|
(pad_width/2)?0:1,k);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if ((ball[k].pos_x+HALFBALL >=
|
else if ((ball[k].pos_x+HALFBALL >=
|
||||||
|
|
@ -1481,16 +1506,16 @@ static int brickmania_game_loop(void)
|
||||||
ball[k].glue=true;
|
ball[k].glue=true;
|
||||||
}
|
}
|
||||||
} /* for k */
|
} /* for k */
|
||||||
|
}
|
||||||
|
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
||||||
if (brick_on_board < 0) {
|
if (brick_on_board < 0) {
|
||||||
if (level+1<levels_num) {
|
if (level+1<levels_num) {
|
||||||
level++;
|
level++;
|
||||||
if (difficulty==HARD)
|
if (difficulty==NORMAL)
|
||||||
score+=100;
|
score+=100;
|
||||||
l_score=score;
|
brickmania_init_game(1);
|
||||||
brickmania_int_game(1);
|
|
||||||
brickmania_sleep(2);
|
brickmania_sleep(2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -1508,24 +1533,11 @@ static int brickmania_game_loop(void)
|
||||||
"You have finished the game!");
|
"You have finished the game!");
|
||||||
#endif
|
#endif
|
||||||
vscore=score;
|
vscore=score;
|
||||||
rb->lcd_clear_display();
|
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
rb->sleep(2);
|
brickmania_sleep(2);
|
||||||
position=highscore_update(score, level+1, "",
|
|
||||||
highest,NUM_SCORES);
|
|
||||||
if (position == 0) {
|
|
||||||
rb->splash(HZ*2, "New High Score");
|
|
||||||
}
|
|
||||||
if (position != -1) {
|
|
||||||
highscore_show(position, highest, NUM_SCORES);
|
|
||||||
} else {
|
|
||||||
brickmania_sleep(3);
|
|
||||||
}
|
|
||||||
if (brickmania_menu(false)!=0) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int move_button,button;
|
int move_button,button;
|
||||||
int button_right,button_left;
|
int button_right,button_left;
|
||||||
|
|
@ -1552,7 +1564,7 @@ static int brickmania_game_loop(void)
|
||||||
else if(pad_pos_x+pad_width > LCD_WIDTH)
|
else if(pad_pos_x+pad_width > LCD_WIDTH)
|
||||||
pad_pos_x = LCD_WIDTH-pad_width;
|
pad_pos_x = LCD_WIDTH-pad_width;
|
||||||
for(k=0;k<used_balls;k++)
|
for(k=0;k<used_balls;k++)
|
||||||
if ((start_game==1 || ball[k].glue))
|
if (game_state==ST_READY || ball[k].glue)
|
||||||
ball[k].pos_x = pad_pos_x+pad_width/2;
|
ball[k].pos_x = pad_pos_x+pad_width/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1570,19 +1582,19 @@ static int brickmania_game_loop(void)
|
||||||
button_right=((move_button & RIGHT) || (SCROLL_FWD(button)));
|
button_right=((move_button & RIGHT) || (SCROLL_FWD(button)));
|
||||||
button_left=((move_button & LEFT) || (SCROLL_BACK(button)));
|
button_left=((move_button & LEFT) || (SCROLL_BACK(button)));
|
||||||
#endif
|
#endif
|
||||||
if ((con_game== 1 && start_game!=1) && (button_right || button_left))
|
if ((game_state==ST_PAUSE) && (button_right || button_left))
|
||||||
continue;
|
continue;
|
||||||
if ((button_right && flip_sides==false) ||
|
if ((button_right && flip_sides==false) ||
|
||||||
(button_left && flip_sides==true)) {
|
(button_left && flip_sides==true)) {
|
||||||
if (pad_pos_x+8+pad_width > LCD_WIDTH) {
|
if (pad_pos_x+8+pad_width > LCD_WIDTH) {
|
||||||
for(k=0;k<used_balls;k++)
|
for(k=0;k<used_balls;k++)
|
||||||
if (start_game==1 || ball[k].glue)
|
if (game_state==ST_READY || ball[k].glue)
|
||||||
ball[k].pos_x+=LCD_WIDTH-pad_pos_x-pad_width;
|
ball[k].pos_x+=LCD_WIDTH-pad_pos_x-pad_width;
|
||||||
pad_pos_x+=LCD_WIDTH-pad_pos_x-pad_width;
|
pad_pos_x+=LCD_WIDTH-pad_pos_x-pad_width;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for(k=0;k<used_balls;k++)
|
for(k=0;k<used_balls;k++)
|
||||||
if ((start_game==1 || ball[k].glue))
|
if ((game_state==ST_READY || ball[k].glue))
|
||||||
ball[k].pos_x+=8;
|
ball[k].pos_x+=8;
|
||||||
pad_pos_x+=8;
|
pad_pos_x+=8;
|
||||||
}
|
}
|
||||||
|
|
@ -1591,13 +1603,13 @@ static int brickmania_game_loop(void)
|
||||||
(button_right && flip_sides==true)) {
|
(button_right && flip_sides==true)) {
|
||||||
if (pad_pos_x-8 < 0) {
|
if (pad_pos_x-8 < 0) {
|
||||||
for(k=0;k<used_balls;k++)
|
for(k=0;k<used_balls;k++)
|
||||||
if (start_game==1 || ball[k].glue)
|
if (game_state==ST_READY || ball[k].glue)
|
||||||
ball[k].pos_x-=pad_pos_x;
|
ball[k].pos_x-=pad_pos_x;
|
||||||
pad_pos_x-=pad_pos_x;
|
pad_pos_x-=pad_pos_x;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for(k=0;k<used_balls;k++)
|
for(k=0;k<used_balls;k++)
|
||||||
if (start_game==1 || ball[k].glue)
|
if (game_state==ST_READY || ball[k].glue)
|
||||||
ball[k].pos_x-=8;
|
ball[k].pos_x-=8;
|
||||||
pad_pos_x-=8;
|
pad_pos_x-=8;
|
||||||
}
|
}
|
||||||
|
|
@ -1610,61 +1622,38 @@ static int brickmania_game_loop(void)
|
||||||
switch(button) {
|
switch(button) {
|
||||||
case UP:
|
case UP:
|
||||||
case SELECT:
|
case SELECT:
|
||||||
if (start_game==1 && con_game!=1 && pad_type!=1) {
|
if (game_state==ST_READY) {
|
||||||
for(k=0;k<used_balls;k++) {
|
for(k=0;k<used_balls;k++) {
|
||||||
ball[k].y=-4;
|
ball[k].y=-4;
|
||||||
ball[k].x=pad_pos_x+(pad_width/2)-2>=
|
ball[k].x=pad_pos_x+(pad_width/2)-2>=
|
||||||
LCD_WIDTH/2?2:-2;
|
LCD_WIDTH/2?2:-2;
|
||||||
}
|
}
|
||||||
start_game =0;
|
game_state=ST_START;
|
||||||
|
}
|
||||||
|
else if (game_state==ST_PAUSE) {
|
||||||
|
game_state=ST_START;
|
||||||
}
|
}
|
||||||
else if (pad_type==1) {
|
else if (pad_type==1) {
|
||||||
for(k=0;k<used_balls;k++) {
|
for(k=0;k<used_balls;k++) {
|
||||||
if (ball[k].glue)
|
if (ball[k].glue)
|
||||||
ball[k].glue=false;
|
ball[k].glue=false;
|
||||||
else if (start_game==1) {
|
|
||||||
ball[k].x = x[k];
|
|
||||||
ball[k].y = y[k];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (pad_type==2) {
|
||||||
if (start_game!=1 && con_game==1) {
|
k=brickmania_fire_space();
|
||||||
start_game =0;
|
fire[k].top=PAD_POS_Y-7;
|
||||||
con_game=0;
|
fire[k].left=pad_pos_x+1;
|
||||||
}
|
k=brickmania_fire_space();
|
||||||
} else if (pad_type==2 && con_game!=1) {
|
fire[k].top=PAD_POS_Y-7;
|
||||||
int tfire;
|
fire[k].left=pad_pos_x+pad_width-1;
|
||||||
tfire=brickmania_fire_space();
|
|
||||||
fire[tfire].top=PAD_POS_Y-7;
|
|
||||||
fire[tfire].left=pad_pos_x+1;
|
|
||||||
tfire=brickmania_fire_space();
|
|
||||||
fire[tfire].top=PAD_POS_Y-7;
|
|
||||||
fire[tfire].left=pad_pos_x+pad_width-1;
|
|
||||||
} else if (con_game==1 && start_game!=1) {
|
|
||||||
for(k=0;k<used_balls;k++) {
|
|
||||||
ball[k].x=x[k];
|
|
||||||
ball[k].y=y[k];
|
|
||||||
}
|
|
||||||
con_game=0;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#ifdef RC_QUIT
|
#ifdef RC_QUIT
|
||||||
case RC_QUIT:
|
case RC_QUIT:
|
||||||
#endif
|
#endif
|
||||||
case QUIT:
|
case QUIT:
|
||||||
if (brickmania_menu(true)!=0) {
|
resume = true;
|
||||||
return 1;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
for(k=0;k<used_balls;k++) {
|
|
||||||
if (ball[k].x!=0)
|
|
||||||
x[k]=ball[k].x;
|
|
||||||
ball[k].x=0;
|
|
||||||
if (ball[k].y!=0)
|
|
||||||
y[k]=ball[k].y;
|
|
||||||
ball[k].y=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -1686,38 +1675,26 @@ static int brickmania_game_loop(void)
|
||||||
#endif
|
#endif
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
brickmania_sleep(2);
|
brickmania_sleep(2);
|
||||||
position=highscore_update(score, level+1, "", highest, NUM_SCORES);
|
|
||||||
if (position == 0) {
|
|
||||||
rb->splash(HZ*2, "New High Score");
|
|
||||||
}
|
|
||||||
if (position != -1) {
|
|
||||||
highscore_show(position, highest, NUM_SCORES);
|
|
||||||
} else {
|
|
||||||
brickmania_sleep(3);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(k=0;k<used_balls;k++) {
|
|
||||||
ball[k].x=0;
|
|
||||||
ball[k].y=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (brickmania_menu(false)!=0) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (end > *rb->current_tick)
|
if (end > *rb->current_tick)
|
||||||
rb->sleep(end-*rb->current_tick);
|
rb->sleep(end-*rb->current_tick);
|
||||||
else
|
else
|
||||||
rb->yield();
|
rb->yield();
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this is the plugin entry point */
|
/* this is the plugin entry point */
|
||||||
enum plugin_status plugin_start(const void* parameter)
|
enum plugin_status plugin_start(const void* parameter)
|
||||||
{
|
{
|
||||||
(void)parameter;
|
(void)parameter;
|
||||||
|
int last_difficulty;
|
||||||
|
|
||||||
highscore_load(HIGH_SCORE,highest,NUM_SCORES);
|
highscore_load(HIGH_SCORE,highest,NUM_SCORES);
|
||||||
|
configfile_load(CONFIG_FILE_NAME,config,1,0);
|
||||||
|
last_difficulty = difficulty;
|
||||||
|
|
||||||
rb->lcd_setfont(FONT_SYSFIXED);
|
rb->lcd_setfont(FONT_SYSFIXED);
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
rb->lcd_set_backdrop(NULL);
|
rb->lcd_set_backdrop(NULL);
|
||||||
|
|
@ -1726,9 +1703,25 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
backlight_force_on(); /* backlight control in lib/helper.c */
|
backlight_force_on(); /* backlight control in lib/helper.c */
|
||||||
|
|
||||||
/* now go ahead and have fun! */
|
/* now go ahead and have fun! */
|
||||||
brickmania_game_loop();
|
rb->srand( *rb->current_tick );
|
||||||
|
brickmania_loadgame();
|
||||||
|
while(brickmania_game_loop() == 0) {
|
||||||
|
if(!resume) {
|
||||||
|
int position = highscore_update(score, level+1, "", highest, NUM_SCORES);
|
||||||
|
if (position == 0) {
|
||||||
|
rb->splash(HZ*2, "New High Score");
|
||||||
|
}
|
||||||
|
if (position != -1) {
|
||||||
|
highscore_show(position, highest, NUM_SCORES);
|
||||||
|
} else {
|
||||||
|
brickmania_sleep(3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
highscore_save(HIGH_SCORE,highest,NUM_SCORES);
|
highscore_save(HIGH_SCORE,highest,NUM_SCORES);
|
||||||
|
if(last_difficulty != difficulty)
|
||||||
|
configfile_save(CONFIG_FILE_NAME,config,1,0);
|
||||||
/* Restore user's original backlight setting */
|
/* Restore user's original backlight setting */
|
||||||
rb->lcd_setfont(FONT_UI);
|
rb->lcd_setfont(FONT_UI);
|
||||||
/* Turn on backlight timeout (revert to settings) */
|
/* Turn on backlight timeout (revert to settings) */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue