comparison schedule.c @ 14:e01292a3bcc5

*** empty log message ***
author gongo
date Sat, 04 Nov 2006 09:00:42 +0000
parents 64ec983dd5db
children 32b270ceef34
comparison
equal deleted inserted replaced
13:64ec983dd5db 14:e01292a3bcc5
129 game_env_init(); 129 game_env_init();
130 graphic_init(); 130 graphic_init();
131 camera_init(); 131 camera_init();
132 132
133 game.state = GAME_SELECT_CAR; 133 game.state = GAME_SELECT_CAR;
134 game.exec = sche_game_opening; 134 set_sche(sche_game_opening);
135 } 135 }
136 136
137 void 137 void
138 sche_game_opening() 138 sche_game_opening()
139 { 139 {
145 blink_count = (blink_count > 70) ? 0 : blink_count+1; 145 blink_count = (blink_count > 70) ? 0 : blink_count+1;
146 } 146 }
147 147
148 if (pad.st == 1) { 148 if (pad.st == 1) {
149 game.state = GAME_SELECT_CAR; 149 game.state = GAME_SELECT_CAR;
150 game.exec = sche_game_select_car; 150 set_sche(sche_game_select_car);
151 } 151 }
152 152
153 /* 153 /*
154 if (game.play_id == 1) { 154 if (game.play_id == 1) {
155 if (title_scene() < 0){ 155 if (title_scene() < 0){
184 game.car_id = 184 game.car_id =
185 (game.car_id < 2) ? MAXCAR : game.car_id - 1; 185 (game.car_id < 2) ? MAXCAR : game.car_id - 1;
186 } 186 }
187 if (pad.circle == 1) { 187 if (pad.circle == 1) {
188 game.state = GAME_SELECT_COURSE; 188 game.state = GAME_SELECT_COURSE;
189 game.exec = sche_game_select_course; 189 set_sche(sche_game_select_course);
190 } 190 }
191 } 191 }
192 192
193 void 193 void
194 sche_game_select_course() 194 sche_game_select_course()
207 game.course_id = 207 game.course_id =
208 (game.course_id < 2) ? MAXFIELD : game.course_id - 1; 208 (game.course_id < 2) ? MAXFIELD : game.course_id - 1;
209 } 209 }
210 if (pad.circle == 1) { 210 if (pad.circle == 1) {
211 game.state = GAME_READY; 211 game.state = GAME_READY;
212 game.exec = sche_game_ready; 212 set_sche(sche_game_ready);
213 } 213 }
214 } 214 }
215 215
216 void 216 void
217 sche_game_ready() 217 sche_game_ready()
228 } 228 }
229 blink_count = (blink_count > 70) ? 0 : blink_count + 1; 229 blink_count = (blink_count > 70) ? 0 : blink_count + 1;
230 230
231 if (pad.st > 0) { 231 if (pad.st > 0) {
232 game.state = GAME_MAIN_INIT; 232 game.state = GAME_MAIN_INIT;
233 game.exec = sche_game_main_init; 233 set_sche(sche_game_main_init);
234 } 234 }
235 if (pad.cross > 0) { 235 if (pad.cross > 0) {
236 game.state = GAME_SELECT_CAR; 236 game.state = GAME_SELECT_CAR;
237 game.exec = sche_game_select_car; 237 set_sche(sche_game_select_car);
238 } 238 }
239 } 239 }
240 240
241 void 241 void
242 sche_game_main_init() 242 sche_game_main_init()
243 { 243 {
244 if (!game.jiki) 244 if (!game.jiki)
245 play_init(); 245 play_init();
246 RUNNIG=0; 246 RUNNIG=0;
247 game.state = GAME_MAIN; 247 game.state = GAME_MAIN;
248 game.exec = sche_game_main; 248 set_sche(sche_game_main);
249 } 249 }
250 250
251 void 251 void
252 sche_game_main() 252 sche_game_main()
253 { 253 {
284 284
285 if (game.rap > MAXRAP) { 285 if (game.rap > MAXRAP) {
286 wait_init(); 286 wait_init();
287 ranking = 1; 287 ranking = 1;
288 game.state = GAME_GOAL; 288 game.state = GAME_GOAL;
289 game.exec = sche_game_main_goal; 289 set_sche(sche_game_main_goal);
290 } 290 }
291 291
292 gFont_SetStringInt((int)(100.0*game.jiki->speed), 380, 350); 292 gFont_SetStringInt((int)(100.0*game.jiki->speed), 380, 350);
293 293
294 if ((pad.right > 0) && ((game.jiki->speed != 0) || (pad.circle > 0))) { 294 if ((pad.right > 0) && ((game.jiki->speed != 0) || (pad.circle > 0))) {
306 if (pad.r1 == 1) { 306 if (pad.r1 == 1) {
307 game.camera_type = !game.camera_type; 307 game.camera_type = !game.camera_type;
308 } 308 }
309 if (pad.st == 1) { 309 if (pad.st == 1) {
310 game.state = GAME_PAUSE; 310 game.state = GAME_PAUSE;
311 game.exec = sche_game_main_pause; 311 set_sche(sche_game_main_pause);
312 } 312 }
313 } 313 }
314 314
315 void 315 void
316 sche_game_main_pause() 316 sche_game_main_pause()
329 } 329 }
330 330
331 if (pad.circle == 1) { 331 if (pad.circle == 1) {
332 if (game.select == 0) { 332 if (game.select == 0) {
333 game.state = GAME_MAIN; 333 game.state = GAME_MAIN;
334 game.exec = sche_game_main; 334 set_sche(sche_game_main);
335 } else { 335 } else {
336 game.state = GAME_FINISH; 336 game.state = GAME_FINISH;
337 game.exec = sche_game_main_finish; 337 set_sche(sche_game_main_finish);
338 } 338 }
339 } 339 }
340 if (pad.st == 1) { 340 if (pad.st == 1) {
341 game.state = GAME_MAIN; 341 game.state = GAME_MAIN;
342 game.exec = sche_game_main; 342 set_sche(sche_game_main);
343 } 343 }
344 if (pad.up == 1 || pad.down == 1) { 344 if (pad.up == 1 || pad.down == 1) {
345 game.select = !game.select; 345 game.select = !game.select;
346 } 346 }
347 } 347 }
371 field_update(game.jiki); 371 field_update(game.jiki);
372 carNode_draw(); 372 carNode_draw();
373 camera_update(game.jiki->body->transfer); 373 camera_update(game.jiki->body->transfer);
374 if (pad.st == 1) { 374 if (pad.st == 1) {
375 game.state = GAME_FINISH; 375 game.state = GAME_FINISH;
376 game.exec = sche_game_main_finish; 376 set_sche(sche_game_main_finish);
377 } 377 }
378 } 378 }
379 379
380 void 380 void
381 sche_game_main_finish() 381 sche_game_main_finish()
388 demo_closeFp(); 388 demo_closeFp();
389 game_env_init(); 389 game_env_init();
390 } 390 }
391 if (pad.st == 1) { 391 if (pad.st == 1) {
392 game.state = GAME_OPENING; 392 game.state = GAME_OPENING;
393 game.exec = sche_game_opening; 393 set_sche(sche_game_game_opening);
394 } 394 }
395 } 395 }
396 396
397 397
398 void 398 void