Skip to content

Commit

Permalink
changed key maping and showed key to quit in main menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Nejezchleb committed May 5, 2021
1 parent 4a9c2e5 commit e28fe04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions final_score.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
bool draw_final_score(int score, fb_data *frame_buff, unsigned char *lcd_mem_base, font_descriptor_t *font)
{
char c = ' ';
while (c != 's' && c != 'q')
while (c != 's' && c != 't')
{
set_background(frame_buff, 0);
draw_text_center(frame_buff, "SKORE", frame_buff->width / 2, frame_buff->height / 10, 3, font, 0xffff);
char string_tmp[20];
snprintf(string_tmp, 20, "%d", score);
draw_text_center(frame_buff, string_tmp, frame_buff->width / 2, frame_buff->height / 2, 4, font, 0xffff);
draw_text_center(frame_buff, "ZNOVU [s] KONEC [q]", frame_buff->width / 2, frame_buff->height - frame_buff->height / 10, 2, font, 0xffff);
draw_text_center(frame_buff, "ZNOVU [s] KONEC [t]", frame_buff->width / 2, frame_buff->height - frame_buff->height / 10, 2, font, 0xffff);
// update display
lcd_from_fb(frame_buff, lcd_mem_base);
// scan input
Expand Down
6 changes: 3 additions & 3 deletions menu_utilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void run_init_game_menu(fb_data *frame_buff, unsigned char *lcd_mem_base,
lcd_from_fb(frame_buff, lcd_mem_base);
// listen symbol
char read = ' ';
while (read != 's' && read != 'q')
while (read != 's' && read != 't')
{
// scan input
pthread_mutex_lock(&mtx);
Expand All @@ -63,7 +63,7 @@ void run_init_game_menu(fb_data *frame_buff, unsigned char *lcd_mem_base,
draw_menu(frame_buff, font, game);
lcd_from_fb(frame_buff, lcd_mem_base);
}
if (read != 'q')
if (read != 't')
{
// run game
int game_score = run_game(&game, &peripherals);
Expand All @@ -89,7 +89,7 @@ void draw_menu(fb_data *frame_buff, font_descriptor_t *font, game_init_data_t ga
draw_text_center(frame_buff, string_tmp, frame_buff->width / 2, HEIGHT_M / 2, 2, font, 0xffff);
snprintf(string_tmp, 40, "pocet duchu: %d [g]", game_data.ghost_nr);
draw_text_center(frame_buff, string_tmp, frame_buff->width / 2, HEIGHT_M / 2 + HEIGHT_M / 7, 2, font, 0xffff);
draw_text_center(frame_buff, "SPUSIT HRU: [s]", frame_buff->width / 2, HEIGHT_M - HEIGHT_M / 10, 2, font, 0xffff);
draw_text_center(frame_buff, "SPUSIT HRU: [s] KONEC HRY: [t]", frame_buff->width / 2, HEIGHT_M - HEIGHT_M / 10, 2, font, 0xffff);
}

game_init_data_t sub_menu_lives(fb_data *frame_buff, unsigned char *lcd_mem_base, font_descriptor_t *font, game_init_data_t game_data)
Expand Down

0 comments on commit e28fe04

Please sign in to comment.