annotate schedule.cc @ 122:5219bf3d5e71

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