Mercurial > hg > old > magoroku_racing.bad
annotate Magoroku.cc @ 113:8c96cadde050
after game_team
author | Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 09 Jun 2011 18:07:46 +0900 |
parents | 5106d8d12ded |
children | 3ffda5b493c2 31dd5c07f7c1 |
rev | line source |
---|---|
113 | 1 //magoroku 関係ココから |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 #include "Magoroku.h" |
113 | 3 |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 #include <stdio.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 #include <stdlib.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 #include <string.h> |
113 | 7 #include <stdbool.h> |
8 #include "libps2.h" | |
9 #include "ps2util.h" | |
10 #include "field.h" | |
11 #include "car.h" | |
12 #include "gSprite.h" | |
13 #include "gFont.h" | |
14 #include "game.h" | |
15 #include "controler.h" | |
16 #include "camera.h" | |
17 #include "carNode.h" | |
18 #include "car.h" | |
19 #include "light.h" | |
20 #include "title_scene.h" | |
21 #include "game_time.h" | |
22 #include "schedule.h" | |
23 #include "game.h" | |
24 | |
25 #include "mytype.h" | |
26 #include "linda.h" | |
27 | |
28 #include "sjoy.h" | |
29 //magoroku 関係ココまで | |
30 | |
31 #include "SgoexCerium.h" | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 #include <ctype.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 #include <math.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 #include <time.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 #include <SDL.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 #include "SDL_opengl.h" |
112
5106d8d12ded
Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
111
diff
changeset
|
37 |
113 | 38 //#include "tree_controll.h" |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 #include "xml.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 #include "profile.h" |
113 | 41 //#include "syokika.h" |
42 //#include "sankaku.h" | |
112
5106d8d12ded
Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
111
diff
changeset
|
43 |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 #include "sound.h" |
113 | 45 //#include "bom.h" |
46 //#include "count2.h" | |
47 //#include "tokuten.h" | |
48 //#include "tama.h" | |
49 //#include "debug.h" | |
50 //#include "trace.h" | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 #include "LoadSprite.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 #include <SDL_mixer.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 #include "error.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 #include "matrix_calc.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 |
113 | 56 //#include "Character.h" |
57 //#include "Character_state.h" | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 //static SDL_Surface *screen; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 // static Uint32 background; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
63 // static char *pad_trace_file; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65 extern void schedule(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 extern void tokuten(); |
113 | 67 extern bool padCheck(SDL_Joystick *joy); |
68 extern bool keybord(void); | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 static int gamesyokika(int gamef); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 static int game_pause(int); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 //static char *pad_trace_file; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 /** |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
74 * runmode: |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 * 0 - normal game |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 * 1 - capture mode |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
77 * program will capture all pad traces on a play and |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 * dump it into a file |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 * 2 - trace mode |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 * program will run with a trace file which is generated |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 * by capture-mode |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
82 */ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
83 int runmode; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 SDL_Joystick *joy; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
86 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 const char *usr_help_str = "Usage: ./twice [-length data_length] [-count task_num]\n\ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 -length Number of data (default DATA_NUM (Func.h))\n\ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 -count Number of task (default 1)\n"; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 Viewer *droot; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 static int screen_w; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 static int screen_h; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
97 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
98 //ウィンドウのサイズとかを指定? |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
99 MainLoopPtr |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100 Magoroku::init(Viewer *sgroot_, int w, int h) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 screen_w = w; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 screen_h = h; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
104 droot = sgroot_; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 return droot; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
106 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
107 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
108 Application * |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 application() { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 return new Magoroku(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
112 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 |
113 | 114 //Magoroku の初期化など |
115 /* timer */ | |
116 static int start_time,time_count; | |
117 static int RUNNIG=0; | |
118 char raptime[10]; | |
119 | |
120 static int ranking = 0; | |
121 static LIGHT l; | |
122 static int i=0; | |
123 | |
124 // schedule.ccで使用してる | |
125 void linda_env_init( void ); | |
126 | |
127 | |
128 //Magoroku の処理 | |
129 static void set_schedule(Game *game); | |
130 static void sche_game_init(Game *game); | |
131 static void sche_game_opening(Game *game); | |
132 static void sche_game_select_car(Game *game); | |
133 static void sche_game_select_course(Game *game); | |
134 static void sche_game_ready(Game *game); | |
135 static void sche_game_main_init(Game *game); | |
136 static void sche_game_main_ready(Game *game); | |
137 static void sche_game_main(Game *game); | |
138 static void sche_game_main_pause(Game *game); | |
139 static void sche_game_main_goal(Game *game); | |
140 static void sche_game_main_finish(Game *game); | |
141 static void sche_game_main_finish2(Game *game); | |
142 | |
143 | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 extern int init(TaskManager *manager, int argc, char *argv[]); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 extern void task_initialize(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 static void TMend(TaskManager *manager); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147 |
113 | 148 |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149 //class Application の中の virtual bool app_loop( return 1 だけの関数?) を継承 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
150 bool |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
151 Magoroku::app_loop(Viewer *viewer){ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
152 // don't use allExecute |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 return 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
154 }; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 |
113 | 156 //ゲームの分岐に使用(コールバック) |
157 //static int gamef = 0; | |
158 static void (*sche_func_assumption)(Game*); | |
159 static void (*sche_func)(Game*) = &sche_game_init; | |
160 static int change_state = 0; | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
161 |
112
5106d8d12ded
Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
111
diff
changeset
|
162 /* |
5106d8d12ded
Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
111
diff
changeset
|
163 ゲームの分岐。magoroku の schedule の処理と同等と考えてオッケーかな? |
5106d8d12ded
Changing Magoroku.cc
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
111
diff
changeset
|
164 */ |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
165 HTaskPtr |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
166 Magoroku::application_task(HTaskPtr next, Viewer* viewer){ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
167 // printf("gamef = %d\n",gamef); |
113 | 168 schedule(&game); |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
169 return next; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 }; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
172 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
173 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
174 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175 static void |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
176 task_init() |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
177 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
178 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
179 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
180 int |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
181 TMmain(TaskManager *manager,int argc, char *argv[]) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
182 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
183 for(int i = 1; i<argc ; i++) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
184 if (strcmp(argv[i],"-t")) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
185 test_mode=1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
186 if (i+1<argc && argv[i+1]) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
187 i++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
188 test_object=argv[i]; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
189 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
190 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
191 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
192 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
193 task_init(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
194 task_initialize(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
195 manager->set_TMend(TMend); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
196 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
197 return init(manager,argc, argv); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
198 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
199 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
200 void |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
201 TMend(TaskManager *manager) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
202 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
203 printf("game end\n"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
204 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
205 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
206 static int light_sysswitch = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
207 static int light_num = 4; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
208 |
111 | 209 /* |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
210 static void |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
211 LightSysSwitch(Viewer *sgroot) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
212 if (light_sysswitch == 1) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
213 sgroot->OnLightSysSwitch(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
214 for (int i = 0; i < light_num; i++) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
215 SceneGraphPtr light = sgroot->getLight(i); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
216 sgroot->OnLightSwitch(i); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
217 light->xyz[0] = screen_w / 2; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
218 light->xyz[1] = screen_h / 2; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
219 light->xyz[2] = -100; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
220 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
221 } else if (light_sysswitch == 0) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
222 sgroot->OffLightSysSwitch(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
223 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
224 } |
111 | 225 */ |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
226 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
227 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
228 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
229 |
113 | 230 static void |
231 set_schedule(Game *game) | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
232 { |
113 | 233 sche_func = sche_func_assumption; |
234 change_state = 0; | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
235 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
236 |
113 | 237 static void |
238 graphic_init() | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
239 { |
113 | 240 gSprite_Init(); // グラフィック関連の初期化 |
241 gFont_Init(); // フォント関連の初期化 | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
242 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
243 |
113 | 244 static void |
245 play_init( Game *game ) | |
246 { | |
247 game->jiki = car_init(game->car_id); | |
248 carNode_append(game->jiki); | |
249 field_init(game->course_id); | |
250 } | |
251 | |
252 // 適当に自作 :miya | |
253 void linda_env_init( void ) | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
254 { |
113 | 255 printf("linda_env_init\n"); |
256 } | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
257 |
113 | 258 static void game_env_init ( Game *game ) |
259 { | |
260 game->car_id = 1; | |
261 game->course_id = 1; | |
262 game->camera_type = 0; | |
263 game->rap = 1; | |
264 game->jiki = NULL; | |
265 | |
266 ranking = 0; | |
267 | |
268 wait_init(); | |
269 linda_env_init(); | |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
270 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
271 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
272 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
273 |
113 | 274 void |
275 sche_game_init(Game *game) | |
276 { | |
277 game_env_init(game); | |
278 graphic_init(); | |
279 camera_init(); | |
280 | |
281 #ifdef LINDA | |
282 //sche_func = &sche_game_wait; | |
283 //set_schedule_assumption(sche_game_wait); | |
284 #else | |
285 set_schedule_assumption(sche_game_opening); | |
286 #endif | |
287 } | |
288 | |
289 /** | |
290 * 通信対戦専用 | |
291 * 全ユーザが接続するまで待つ | |
292 * ・・・だったんだけど、現在 linda を切っているため worning が出る。 | |
293 * ので cut する。 | |
294 */ | |
295 | |
296 /* linda を使用しないのでカットした | |
297 static void | |
298 sche_game_wait(Game *game) | |
299 { | |
300 gFont_SetString("WAITING...", 200, 100); | |
301 set_schedule_assumption(sche_game_wait_ready); | |
302 } | |
303 */ | |
304 | |
305 | |
306 /** | |
307 * 通信対戦専用 | |
308 * 全ユーザの接続を確認したら呼び出す | |
309 * こいつも、linda がないので cut | |
310 */ | |
311 /* | |
312 static void | |
313 sche_game_wait_ready(Game *game) | |
314 { | |
315 gFont_SetString("CONNECT OK!!", 170, 300); | |
316 if (game->play_id == 1) { | |
317 gFont_SetString(" PUSH START ", 170, 400); | |
318 if (pad.st != 1) { goto WAIT_READY; } | |
319 } | |
320 | |
321 set_schedule_assumption(sche_game_opening); | |
322 | |
323 WAIT_READY: | |
324 return; | |
325 } | |
326 */ | |
327 | |
328 | |
329 void | |
330 sche_game_opening(Game *game) | |
331 { | |
332 static int blink_count = 0; | |
333 if (game->play_id==1){ | |
334 if (blink_count < 35) { | |
335 gFont_SetString("PUSH START !!", 170, 380); | |
336 } | |
337 blink_count = (blink_count > 70) ? 0 : blink_count + 1; | |
338 | |
339 if (pad.st != 1) { goto OPENING; } | |
340 } | |
341 | |
342 | |
343 set_schedule_assumption(sche_game_select_car); | |
344 | |
345 OPENING: | |
346 return; | |
347 | |
348 | |
349 if (game->play_id == 1) { | |
350 if (title_scene() < 0){ | |
351 } | |
352 } else if (game->play_id == 2) { | |
353 if (i==0){ | |
354 title_init_call(); | |
355 i=1; | |
356 } | |
357 } | |
358 | |
359 | |
360 } | |
361 | |
362 void | |
363 sche_game_select_car(Game *game) | |
364 { | |
365 if (i==1){ | |
366 title_finish_call(); | |
367 i=2; | |
368 } | |
369 gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 190, 200, 1.5, 1.5); | |
370 gSprite_PutSprite(24, 460, 300); | |
371 gSprite_PutSprite(25, 120, 300); | |
372 gFont_SetString("SELECT CAR", 180, 50); | |
373 | |
374 if (pad.right == 1) { | |
375 game->car_id = | |
376 (game->car_id > MAXCAR-1) ? 1 : game->car_id + 1; | |
377 } | |
378 if (pad.left == 1) { | |
379 game->car_id = | |
380 (game->car_id < 2) ? MAXCAR : game->car_id - 1; | |
381 } | |
382 | |
383 if (game->play_id == 1) | |
384 if (pad.circle != 1) { goto SELECT_CAR; } | |
385 | |
386 | |
387 set_schedule_assumption(sche_game_select_course); | |
388 | |
389 SELECT_CAR: | |
390 return; | |
391 } | |
392 | |
393 void | |
394 sche_game_select_course(Game *game) | |
395 { | |
396 gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 190, 200, 1.7, 1.8); | |
397 gSprite_PutSprite(24, 460, 300); | |
398 gSprite_PutSprite(25, 120, 300); | |
399 | |
400 gFont_SetString("SELECT COURSE", 150, 50); | |
401 | |
402 if (game->play_id == 1) { | |
403 if (pad.right == 1) { | |
404 game->course_id = | |
405 (game->course_id > MAXFIELD-1) ? 1 : game->course_id + 1; | |
406 goto SELECT_COURSE; | |
407 } | |
408 if (pad.left == 1) { | |
409 game->course_id = | |
410 (game->course_id < 2) ? MAXFIELD : game->course_id - 1; | |
411 goto SELECT_COURSE; | |
412 } | |
413 | |
414 if (pad.circle != 1) { goto SELECT_COURSE; } | |
415 } | |
416 | |
417 set_schedule_assumption(sche_game_ready); | |
418 | |
419 SELECT_COURSE: | |
420 return; | |
421 | |
422 } | |
423 | |
424 void | |
425 sche_game_ready(Game *game) | |
426 { | |
427 static int blink_count = 0;// | |
428 | |
429 gSprite_PutSprite(27+game->play_id,265,10); | |
430 gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 50, 120, 1.5, 1.5); | |
431 gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 340, 120, 1.7, 1.8); | |
432 | |
433 /* 点滅 */ | |
434 if (blink_count < 35) { | |
435 gFont_SetString("GAME START !!", 170, 380); | |
436 } | |
437 blink_count = (blink_count > 70) ? 0 : blink_count + 1; | |
438 | |
439 set_schedule_assumption(sche_game_main_init); | |
440 | |
441 | |
442 if (pad.st == 1) { | |
443 set_schedule_assumption(sche_game_main_init); | |
444 } | |
445 if (pad.cross > 0) { | |
446 set_schedule_assumption(sche_game_select_car); | |
447 } | |
448 | |
449 } | |
450 | |
451 void | |
452 sche_game_main_init(Game *game) | |
453 { | |
454 if (!game->jiki) | |
455 play_init(game); | |
456 RUNNIG=0; | |
457 | |
458 set_schedule_assumption(sche_game_main_ready); | |
459 } | |
460 | |
461 static void | |
462 sche_game_main_ready(Game *game) | |
463 { | |
464 gFont_SetString("Loading....", 180, 100); | |
465 set_schedule_assumption(sche_game_main); | |
466 } | |
467 | |
468 static void | |
469 sche_game_main(Game *game) | |
470 { | |
471 //flip | |
472 | |
473 /** begin: dispaly RAP TIME **/ | |
474 if(RUNNIG==0){ | |
475 start_time = game_time_get_msec(); | |
476 RUNNIG=1; | |
477 } | |
478 | |
479 time_count = game_time_get_msec() - start_time; | |
480 game_time_set_raptime(raptime,time_count); | |
481 gFont_SetString("TIME",300,20); | |
482 gFont_SetString(raptime,400,20); | |
483 /** end: dispaly RAP TIME **/ | |
484 | |
485 // light_init と init_lightの書き間違え? | |
486 init_light(&l); | |
487 set_light(&l); | |
488 | |
489 car_id_update(game, game->jiki); | |
490 | |
491 field_update(game->jiki); | |
492 camera_update(game,game->jiki->body->transfer); | |
493 carNode_draw(); | |
494 | |
495 gFont_SetStringInt(game->rap, 50, 100); | |
496 | |
497 /* スピードメーター */ | |
498 gSprite_DefSprite(23, 1, 1,(int)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34); | |
499 gSprite_PutSprite(23, 400, 400); | |
500 /* km/h */ | |
501 gSprite_PutSprite(26, 470, 350); | |
502 /* Rap */ | |
503 gSprite_PutSprite(27, 80, 100); | |
504 | |
505 if (game->rap > MAXRAP) { | |
506 ranking = 1; | |
507 set_schedule_assumption(sche_game_main_goal); | |
508 } | |
509 | |
510 gFont_SetStringInt((int)(100.0*game->jiki->speed), 380, 350); | |
511 | |
512 | |
513 if ((pad.right > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) { | |
514 car_swerve(game->jiki, 1); | |
515 } | |
516 if ((pad.left > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) { | |
517 car_swerve(game->jiki, -1); | |
518 } | |
519 if (pad.circle > 0) { | |
520 car_accelerate(game->jiki, 1); | |
521 } | |
522 if (pad.cross > 0) { | |
523 car_accelerate(game->jiki, -1); | |
524 } | |
525 | |
526 if (pad.r1 == 1) { | |
527 game->camera_type = !game->camera_type; | |
528 } | |
529 if (pad.st == 1) { | |
530 set_schedule_assumption(sche_game_main_pause); | |
531 } | |
532 | |
533 //S-dandy の obj てきな | |
534 } | |
535 | |
536 | |
537 void | |
538 sche_game_main_pause(Game *game) | |
539 { | |
540 static int select = 0; | |
541 | |
542 field_update(game->jiki); | |
543 carNode_draw(); | |
544 | |
545 if (game->play_id == 1) { | |
546 // 選択マーク | |
547 gSprite_PutSprite(17, 100, 190+select*100); | |
548 | |
549 gFont_SetString("BACK TO GAME", 200, 200); | |
550 gFont_SetString("GO TO TITLE", 200, 300); | |
551 } else { | |
552 gFont_SetString("Pause ...", 200, 200); | |
553 } | |
554 | |
555 | |
556 if (pad.circle == 1) { | |
557 if (select == 0) { | |
558 set_schedule_assumption(sche_game_main); | |
559 } else { | |
560 set_schedule_assumption(sche_game_main_finish); | |
561 } | |
562 } else if (pad.st == 1) { | |
563 set_schedule_assumption(sche_game_main); | |
564 } else if (pad.up == 1 || pad.down == 1) { | |
565 select = !select; | |
566 } | |
567 | |
568 } | |
569 | |
570 | |
571 void | |
572 sche_game_main_goal(Game *game) | |
573 { | |
574 /** dispaly TOTAL TIME **/ | |
575 game_time_set_raptime(raptime,time_count); | |
576 | |
577 gFont_SetString("TOTAL TIME",150,20); | |
578 gFont_SetString(raptime,400,20); | |
579 gFont_SetString("GOAL !!", 220, 150); | |
580 | |
581 #ifdef LINDA | |
582 if (ranking == 1) | |
583 gFont_SetString("You WIN!!", 200, 250); | |
584 else | |
585 gFont_SetString("You Lose...", 200, 250); | |
586 #endif | |
587 | |
588 | |
589 // 宣言では引数が二つだったから、第一引数に game を入れてみた | |
590 car_update(game, game->jiki); | |
591 field_update(game->jiki); | |
592 carNode_draw(); | |
593 camera_update(game,game->jiki->body->transfer); | |
594 | |
595 if (pad.st == 1) { | |
596 set_schedule_assumption(sche_game_main_finish); | |
597 } | |
598 | |
599 } | |
600 | |
601 void | |
602 sche_game_main_finish(Game *game) | |
603 { | |
604 field_destroy(); | |
605 carNode_destroy(); | |
606 game_env_init(game); | |
607 | |
608 set_schedule_assumption(sche_game_main_finish2); | |
609 } | |
610 | |
611 void | |
612 sche_game_main_finish2(Game *game) | |
613 { | |
614 gFont_SetString("GAME OVER ...", 200, 200); | |
615 | |
616 | |
617 if (pad.st == 1) { | |
618 set_schedule_assumption(sche_game_opening); | |
619 } | |
620 | |
621 } |