Rev 5231 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5231 | Rev 5232 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include "game.h" |
1 | #include "game.h" |
Line 2... | Line 2... | ||
2 | 2 | ||
3 | struct { |
3 | struct { |
- | 4 | rect new_game_button;// new game button place |
|
4 | rect new_game_button;// new game button place |
5 | rect highscore_rect; // highscore place |
5 | rect score_rect; // score place |
6 | rect score_rect; // score place |
6 | __u8 over; // flag for game over |
7 | __u8 over; // flag for game over |
Line 7... | Line 8... | ||
7 | } game; |
8 | } game; |
Line 17... | Line 18... | ||
17 | NEW_GAME_BUTTON, |
18 | NEW_GAME_BUTTON, |
18 | BOARD_BG_COLOR); |
19 | BOARD_BG_COLOR); |
19 | rect_draw_text(&game.new_game_button,"NEW GAME",8,GAME_BG_COLOR); |
20 | rect_draw_text(&game.new_game_button,"NEW GAME",8,GAME_BG_COLOR); |
20 | } |
21 | } |
Line -... | Line 22... | ||
- | 22 | ||
- | 23 | rect_draw(&game.highscore_rect,BOARD_BG_COLOR); |
|
- | 24 | rect_draw_value(&game.highscore_rect,board_highscore(),GAME_BG_COLOR); |
|
21 | 25 | ||
22 | rect_draw(&game.score_rect,BOARD_BG_COLOR); |
26 | rect_draw(&game.score_rect,BOARD_BG_COLOR); |
23 | rect_draw_value(&game.score_rect,board_score(),GAME_BG_COLOR); |
27 | rect_draw_value(&game.score_rect,board_score(),GAME_BG_COLOR); |
Line 24... | Line 28... | ||
24 | } |
28 | } |
Line 64... | Line 68... | ||
64 | 68 | ||
Line 65... | Line 69... | ||
65 | board_init(&av_area); |
69 | board_init(&av_area); |
66 | 70 | ||
67 | game.new_game_button.x = av_area.x; |
71 | game.new_game_button.x = av_area.x; |
68 | game.new_game_button.y = (av_area.y - SCORE_HEIGHT) / 2; |
72 | game.new_game_button.y = (av_area.y - SCORE_HEIGHT) / 2; |
Line 69... | Line 73... | ||
69 | game.new_game_button.width = (av_area.width - BOARD_SPACING) / 2; |
73 | game.new_game_button.width = (av_area.width - BOARD_SPACING) / 3; |
- | 74 | game.new_game_button.height = SCORE_HEIGHT; |
|
- | 75 | ||
- | 76 | game.highscore_rect.x = av_area.x + (av_area.width + BOARD_SPACING) / 3; |
|
- | 77 | game.highscore_rect.y = (av_area.y - SCORE_HEIGHT) / 2; |
|
- | 78 | game.highscore_rect.width = (av_area.width - BOARD_SPACING) / 3; |
|
70 | game.new_game_button.height = SCORE_HEIGHT; |
79 | game.highscore_rect.height = SCORE_HEIGHT; |
71 | 80 | ||
72 | game.score_rect.x = av_area.x + (av_area.width + BOARD_SPACING) / 2; |
81 | game.score_rect.x = av_area.x + (av_area.width + BOARD_SPACING) * 2 / 3; |
Line 73... | Line 82... | ||
73 | game.score_rect.y = (av_area.y - SCORE_HEIGHT) / 2; |
82 | game.score_rect.y = (av_area.y - SCORE_HEIGHT) / 2; |
Line 74... | Line 83... | ||
74 | game.score_rect.width = (av_area.width - BOARD_SPACING) / 2; |
83 | game.score_rect.width = (av_area.width - BOARD_SPACING) / 3; |