Mercurial > hg > old > magoroku_racing.bad
annotate schedule.c @ 97:afddacdf30dd
compile on Mac OS X -no Warning
author | Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 02 Jun 2011 16:15:00 +0900 |
parents | 0b65ca27f113 |
children | 1033fece71ce |
rev | line source |
---|---|
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
1 /* schedule.c */ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
2 |
0 | 3 #include <stdio.h> |
4 #include <stdlib.h> | |
5 #include <string.h> | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
6 #include <stdbool.h> |
91 | 7 #include "libps2.h" |
8 #include "ps2util.h" | |
0 | 9 #include "field.h" |
10 #include "car.h" | |
11 #include "gSprite.h" | |
12 #include "gFont.h" | |
13 #include "game.h" | |
14 #include "controler.h" | |
15 #include "camera.h" | |
91 | 16 #include "carNode.h" |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
17 #include "light.h" |
0 | 18 #include "title_scene.h" |
19 #include "game_time.h" | |
45 | 20 #include "schedule.h" |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
21 #include "game.h" |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
22 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
23 #include "mytype.h" |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
24 #include "linda.h" |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
25 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
26 #include "sjoy.h" |
0 | 27 |
62 | 28 #ifdef LINDA |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
29 bool linda_update(int p, Game *game); |
62 | 30 #else |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
31 #define linda_update(change_state, game) true |
62 | 32 #endif |
0 | 33 |
88 | 34 #define MAXCAR 3 // 選択可能機体 |
35 #define MAXFIELD 2 // 選択可能コース | |
36 #define MAXRAP 3 // ラップ数 | |
0 | 37 #define SP_SEL_CAR 50 |
38 #define SP_SEL_COURSE 80 | |
4 | 39 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
40 // controler.cより |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
41 extern SGO_PAD pad; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
42 |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
43 |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
44 static void set_schedule(Game *game); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
45 static void sche_game_init(Game *game); |
97
afddacdf30dd
compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
46 //static void sche_game_wait(Game *game); //プロトタイプも消しといた |
afddacdf30dd
compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
47 //static void sche_game_wait_ready(Game *game); |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
48 static void sche_game_opening(Game *game); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
49 static void sche_game_select_car(Game *game); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
50 static void sche_game_select_course(Game *game); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
51 static void sche_game_ready(Game *game); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
52 static void sche_game_main_init(Game *game); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
53 static void sche_game_main_ready(Game *game); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
54 static void sche_game_main(Game *game); |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
55 static void sche_game_main_pause(Game *game); |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
56 static void sche_game_main_goal(Game *game); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
57 static void sche_game_main_finish(Game *game); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
58 static void sche_game_main_finish2(Game *game); |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
59 |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
60 |
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
61 |
20 | 62 /* timer */ |
63 static int start_time,time_count; | |
64 static int RUNNIG=0; | |
65 char raptime[10]; | |
0 | 66 |
67 static int ranking = 0; | |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
68 static LIGHT l; |
0 | 69 static int i=0; |
70 | |
62 | 71 static void (*sche_func_assumption)(); |
72 static void (*sche_func)() = &sche_game_init; | |
58 | 73 static int change_state = 0; |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
74 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
75 // schedule.cで使用してる |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
76 void linda_env_init( void ); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
77 |
58 | 78 static void |
79 set_schedule_assumption(void *_func) | |
11 | 80 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
81 sche_func_assumption = _func; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
82 change_state = 1; |
58 | 83 } |
84 | |
85 static void | |
62 | 86 unset_schedule() |
87 { | |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
88 change_state = 0; |
62 | 89 } |
90 | |
91 static void | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
92 set_schedule(Game *game) |
58 | 93 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
94 sche_func = sche_func_assumption; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
95 change_state = 0; |
11 | 96 } |
0 | 97 |
98 static void | |
2 | 99 graphic_init() |
0 | 100 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
101 gSprite_Init(); // グラフィック関連の初期化 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
102 gFont_Init(); // フォント関連の初期化 |
0 | 103 } |
104 | |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
105 static void |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
106 play_init( Game *game ) |
0 | 107 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
108 game->jiki = car_init(game->car_id); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
109 carNode_append(game->jiki); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
110 field_init(game->course_id); |
0 | 111 } |
112 | |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
113 // 適当に自作 :miya |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
114 void linda_env_init( void ) |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
115 { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
116 printf("hogehoge"); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
117 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
118 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
119 static void game_env_init ( Game *game ) |
0 | 120 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
121 game->car_id = 1; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
122 game->course_id = 1; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
123 game->camera_type = 0; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
124 game->rap = 1; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
125 game->jiki = NULL; |
0 | 126 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
127 ranking = 0; |
0 | 128 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
129 wait_init(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
130 linda_env_init(); |
0 | 131 } |
132 | |
133 | |
134 | |
2 | 135 void |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
136 sche_game_init(Game *game) |
2 | 137 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
138 game_env_init(game); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
139 graphic_init(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
140 camera_init(); |
8 | 141 |
46 | 142 #ifdef LINDA |
97
afddacdf30dd
compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
143 //sche_func = &sche_game_wait; |
afddacdf30dd
compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
144 //set_schedule_assumption(sche_game_wait); |
46 | 145 #else |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
146 set_schedule_assumption(sche_game_opening); |
46 | 147 #endif |
2 | 148 } |
149 | |
44 | 150 /** |
88 | 151 * 通信対戦専用 |
152 * 全ユーザが接続するまで待つ | |
95 | 153 * ・・・だったんだけど、現在 linda を切っているため worning が出る。 |
154 * ので cut する。 | |
44 | 155 */ |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
156 |
97
afddacdf30dd
compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
157 /* linda を使用しないのでカットした |
44 | 158 static void |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
159 sche_game_wait(Game *game) |
44 | 160 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
161 gFont_SetString("WAITING...", 200, 100); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
162 set_schedule_assumption(sche_game_wait_ready); |
44 | 163 } |
97
afddacdf30dd
compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
164 */ |
44 | 165 |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
166 |
44 | 167 /** |
88 | 168 * 通信対戦専用 |
169 * 全ユーザの接続を確認したら呼び出す | |
95 | 170 * こいつも、linda がないので cut |
97
afddacdf30dd
compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
171 */ |
afddacdf30dd
compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
172 /* |
44 | 173 static void |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
174 sche_game_wait_ready(Game *game) |
44 | 175 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
176 gFont_SetString("CONNECT OK!!", 170, 300); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
177 if (game->play_id == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
178 gFont_SetString(" PUSH START ", 170, 400); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
179 if (pad.st != 1) { goto WAIT_READY; } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
180 } |
44 | 181 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
182 set_schedule_assumption(sche_game_opening); |
44 | 183 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
184 WAIT_READY: |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
185 return; |
44 | 186 } |
97
afddacdf30dd
compile on Mac OS X -no Warning
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
96
diff
changeset
|
187 */ |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
188 |
44 | 189 |
2 | 190 void |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
191 sche_game_opening(Game *game) |
2 | 192 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
193 static int blink_count = 0; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
194 if (game->play_id==1){ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
195 if (blink_count < 35) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
196 gFont_SetString("PUSH START !!", 170, 380); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
197 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
198 blink_count = (blink_count > 70) ? 0 : blink_count + 1; |
44 | 199 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
200 if (pad.st != 1) { goto OPENING; } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
201 } |
2 | 202 |
62 | 203 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
204 set_schedule_assumption(sche_game_select_car); |
44 | 205 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
206 OPENING: |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
207 return; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
208 |
2 | 209 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
210 if (game->play_id == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
211 if (title_scene() < 0){ |
2 | 212 } |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
213 } else if (game->play_id == 2) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
214 if (i==0){ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
215 title_init_call(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
216 i=1; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
217 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
218 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
219 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
220 |
2 | 221 } |
222 | |
223 void | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
224 sche_game_select_car(Game *game) |
2 | 225 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
226 if (i==1){ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
227 title_finish_call(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
228 i=2; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
229 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
230 gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 190, 200, 1.5, 1.5); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
231 gSprite_PutSprite(24, 460, 300); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
232 gSprite_PutSprite(25, 120, 300); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
233 gFont_SetString("SELECT CAR", 180, 50); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
234 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
235 if (pad.right == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
236 game->car_id = |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
237 (game->car_id > MAXCAR-1) ? 1 : game->car_id + 1; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
238 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
239 if (pad.left == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
240 game->car_id = |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
241 (game->car_id < 2) ? MAXCAR : game->car_id - 1; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
242 } |
44 | 243 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
244 if (game->play_id == 1) |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
245 if (pad.circle != 1) { goto SELECT_CAR; } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
246 |
62 | 247 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
248 set_schedule_assumption(sche_game_select_course); |
44 | 249 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
250 SELECT_CAR: |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
251 return; |
2 | 252 } |
253 | |
254 void | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
255 sche_game_select_course(Game *game) |
2 | 256 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
257 gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 190, 200, 1.7, 1.8); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
258 gSprite_PutSprite(24, 460, 300); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
259 gSprite_PutSprite(25, 120, 300); |
2 | 260 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
261 gFont_SetString("SELECT COURSE", 150, 50); |
44 | 262 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
263 if (game->play_id == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
264 if (pad.right == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
265 game->course_id = |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
266 (game->course_id > MAXFIELD-1) ? 1 : game->course_id + 1; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
267 goto SELECT_COURSE; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
268 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
269 if (pad.left == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
270 game->course_id = |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
271 (game->course_id < 2) ? MAXFIELD : game->course_id - 1; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
272 goto SELECT_COURSE; |
2 | 273 } |
44 | 274 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
275 if (pad.circle != 1) { goto SELECT_COURSE; } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
276 } |
44 | 277 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
278 set_schedule_assumption(sche_game_ready); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
279 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
280 SELECT_COURSE: |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
281 return; |
44 | 282 |
2 | 283 } |
284 | |
285 void | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
286 sche_game_ready(Game *game) |
2 | 287 { |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
288 static int blink_count = 0;// |
2 | 289 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
290 gSprite_PutSprite(27+game->play_id,265,10); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
291 gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 50, 120, 1.5, 1.5); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
292 gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 340, 120, 1.7, 1.8); |
2 | 293 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
294 /* 点滅 */ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
295 if (blink_count < 35) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
296 gFont_SetString("GAME START !!", 170, 380); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
297 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
298 blink_count = (blink_count > 70) ? 0 : blink_count + 1; |
2 | 299 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
300 set_schedule_assumption(sche_game_main_init); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
301 |
52 | 302 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
303 if (pad.st == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
304 set_schedule_assumption(sche_game_main_init); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
305 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
306 if (pad.cross > 0) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
307 set_schedule_assumption(sche_game_select_car); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
308 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
309 |
2 | 310 } |
311 | |
312 void | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
313 sche_game_main_init(Game *game) |
2 | 314 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
315 if (!game->jiki) |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
316 play_init(game); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
317 RUNNIG=0; |
52 | 318 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
319 set_schedule_assumption(sche_game_main_ready); |
72 | 320 } |
321 | |
322 static void | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
323 sche_game_main_ready(Game *game) |
72 | 324 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
325 gFont_SetString("Loading....", 180, 100); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
326 set_schedule_assumption(sche_game_main); |
2 | 327 } |
328 | |
72 | 329 static void |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
330 sche_game_main(Game *game) |
2 | 331 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
332 /** begin: dispaly RAP TIME **/ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
333 if(RUNNIG==0){ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
334 start_time = game_time_get_msec(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
335 RUNNIG=1; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
336 } |
2 | 337 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
338 time_count = game_time_get_msec() - start_time; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
339 game_time_set_raptime(raptime,time_count); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
340 gFont_SetString("TIME",300,20); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
341 gFont_SetString(raptime,400,20); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
342 /** end: dispaly RAP TIME **/ |
2 | 343 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
344 // light_init と init_lightの書き間違え? |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
345 init_light(&l); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
346 set_light(&l); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
347 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
348 car_id_update(game, game->jiki); |
20 | 349 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
350 field_update(game->jiki); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
351 camera_update(game,game->jiki->body->transfer); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
352 carNode_draw(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
353 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
354 gFont_SetStringInt(game->rap, 50, 100); |
2 | 355 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
356 /* スピードメーター */ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
357 gSprite_DefSprite(23, 1, 1,(int)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
358 gSprite_PutSprite(23, 400, 400); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
359 /* km/h */ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
360 gSprite_PutSprite(26, 470, 350); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
361 /* Rap */ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
362 gSprite_PutSprite(27, 80, 100); |
2 | 363 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
364 if (game->rap > MAXRAP) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
365 ranking = 1; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
366 set_schedule_assumption(sche_game_main_goal); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
367 } |
2 | 368 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
369 gFont_SetStringInt((int)(100.0*game->jiki->speed), 380, 350); |
20 | 370 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
371 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
372 if ((pad.right > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
373 car_swerve(game->jiki, 1); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
374 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
375 if ((pad.left > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
376 car_swerve(game->jiki, -1); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
377 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
378 if (pad.circle > 0) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
379 car_accelerate(game->jiki, 1); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
380 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
381 if (pad.cross > 0) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
382 car_accelerate(game->jiki, -1); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
383 } |
20 | 384 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
385 if (pad.r1 == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
386 game->camera_type = !game->camera_type; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
387 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
388 if (pad.st == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
389 set_schedule_assumption(sche_game_main_pause); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
390 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
391 |
2 | 392 } |
393 | |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
394 |
2 | 395 void |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
396 sche_game_main_pause(Game *game) |
2 | 397 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
398 static int select = 0; |
26 | 399 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
400 field_update(game->jiki); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
401 carNode_draw(); |
2 | 402 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
403 if (game->play_id == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
404 // 選択マーク |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
405 gSprite_PutSprite(17, 100, 190+select*100); |
2 | 406 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
407 gFont_SetString("BACK TO GAME", 200, 200); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
408 gFont_SetString("GO TO TITLE", 200, 300); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
409 } else { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
410 gFont_SetString("Pause ...", 200, 200); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
411 } |
2 | 412 |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
413 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
414 if (pad.circle == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
415 if (select == 0) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
416 set_schedule_assumption(sche_game_main); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
417 } else { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
418 set_schedule_assumption(sche_game_main_finish); |
2 | 419 } |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
420 } else if (pad.st == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
421 set_schedule_assumption(sche_game_main); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
422 } else if (pad.up == 1 || pad.down == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
423 select = !select; |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
424 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
425 |
2 | 426 } |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
427 |
2 | 428 |
429 void | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
430 sche_game_main_goal(Game *game) |
2 | 431 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
432 /** dispaly TOTAL TIME **/ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
433 game_time_set_raptime(raptime,time_count); |
2 | 434 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
435 gFont_SetString("TOTAL TIME",150,20); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
436 gFont_SetString(raptime,400,20); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
437 gFont_SetString("GOAL !!", 220, 150); |
2 | 438 |
439 #ifdef LINDA | |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
440 if (ranking == 1) |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
441 gFont_SetString("You WIN!!", 200, 250); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
442 else |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
443 gFont_SetString("You Lose...", 200, 250); |
2 | 444 #endif |
445 | |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
446 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
447 // 宣言では引数が二つだったから、第一引数に game を入れてみた |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
448 car_update(game, game->jiki); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
449 field_update(game->jiki); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
450 carNode_draw(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
451 camera_update(game,game->jiki->body->transfer); |
91 | 452 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
453 if (pad.st == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
454 set_schedule_assumption(sche_game_main_finish); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
455 } |
91 | 456 |
2 | 457 } |
458 | |
459 void | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
460 sche_game_main_finish(Game *game) |
2 | 461 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
462 field_destroy(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
463 carNode_destroy(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
464 game_env_init(game); |
30 | 465 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
466 set_schedule_assumption(sche_game_main_finish2); |
30 | 467 } |
468 | |
469 void | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
470 sche_game_main_finish2(Game *game) |
30 | 471 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
472 gFont_SetString("GAME OVER ...", 200, 200); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
473 |
2 | 474 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
475 if (pad.st == 1) { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
476 set_schedule_assumption(sche_game_opening); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
477 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
478 |
2 | 479 } |
3 | 480 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
481 // 適当に作りました |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
482 void wait_sync(Game *game) |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
483 { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
484 printf("wait_sync\n"); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
485 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
486 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
487 // 適当に |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
488 void swap_dbuff() |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
489 { |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
490 printf("swap_dbuff()\n"); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
491 } |
3 | 492 |
493 void | |
90
8edae89a3877
compile on Mac OS X
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
88
diff
changeset
|
494 schedule(Game *game) |
3 | 495 { |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
496 sche_func(game); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
497 |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
498 if (linda_update(change_state, game) == true){ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
499 set_schedule(game); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
500 } |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
501 else{ |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
502 unset_schedule(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
503 } |
58 | 504 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
505 wait_sync(game); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
506 swap_dbuff(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
507 sjoy_poll(); |
3 | 508 |
96
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
509 ps2util_sprite_Draw(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
510 gSprite_Draw_Reset(); |
0b65ca27f113
compile on Mac OS X 2
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
95
diff
changeset
|
511 gFont_Draw_Reset(); |
3 | 512 } |