annotate schedule.c @ 95:b0249b856488

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