From 9433a8e7bf5a50cbd3c59262eee8fee3e1a6b5d6 Mon Sep 17 00:00:00 2001 From: Robert Hak Date: Fri, 3 May 2002 05:27:49 +0000 Subject: Fixed global values for tetris game not being reset. This prevented you from playing another game if you lost your first. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@396 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/tetris.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'uisimulator') diff --git a/uisimulator/tetris.c b/uisimulator/tetris.c index 5cf1e1068d..18cf36a575 100644 --- a/uisimulator/tetris.c +++ b/uisimulator/tetris.c @@ -324,8 +324,28 @@ void game_loop(void) } } +void init_tetris() +{ + memset(&virtual, 0, sizeof(virtual)); + start_x = 1; + start_y = 1; + max_x = 14; + max_y = 24; + current_x = 0; + current_y = 0; + current_f = 0; + current_b = 0; + level = 0; + lines = 0; + score = 0; + next_b = 0; + next_f = 0; +} + void tetris(void) { + init_tetris(); + draw_frame(start_x-1,start_x+max_x,start_y-1,start_y+max_y); lcd_puts(TETRIS_TITLE_XLOC, TETRIS_TITLE_YLOC, TETRIS_TITLE, TETRIS_TITLE_FONT); -- cgit v1.2.3