diff options
-rw-r--r-- | uisimulator/tetris.c | 20 |
1 files changed, 20 insertions, 0 deletions
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) | |||
324 | } | 324 | } |
325 | } | 325 | } |
326 | 326 | ||
327 | void init_tetris() | ||
328 | { | ||
329 | memset(&virtual, 0, sizeof(virtual)); | ||
330 | start_x = 1; | ||
331 | start_y = 1; | ||
332 | max_x = 14; | ||
333 | max_y = 24; | ||
334 | current_x = 0; | ||
335 | current_y = 0; | ||
336 | current_f = 0; | ||
337 | current_b = 0; | ||
338 | level = 0; | ||
339 | lines = 0; | ||
340 | score = 0; | ||
341 | next_b = 0; | ||
342 | next_f = 0; | ||
343 | } | ||
344 | |||
327 | void tetris(void) | 345 | void tetris(void) |
328 | { | 346 | { |
347 | init_tetris(); | ||
348 | |||
329 | draw_frame(start_x-1,start_x+max_x,start_y-1,start_y+max_y); | 349 | draw_frame(start_x-1,start_x+max_x,start_y-1,start_y+max_y); |
330 | lcd_puts(TETRIS_TITLE_XLOC, TETRIS_TITLE_YLOC, | 350 | lcd_puts(TETRIS_TITLE_XLOC, TETRIS_TITLE_YLOC, |
331 | TETRIS_TITLE, TETRIS_TITLE_FONT); | 351 | TETRIS_TITLE, TETRIS_TITLE_FONT); |