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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
7 #include <stdbool.h>
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
8 #include "libps2.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
9 #include "ps2util.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
10 #include "field.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
11 #include "car.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
12 #include "gSprite.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
13 #include "gFont.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
14 #include "game.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
15 #include "controler.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
16 #include "camera.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
17 #include "carNode.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
18 #include "car.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
19 #include "light.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
20 #include "title_scene.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
21 #include "game_time.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
22 #include "schedule.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
23 #include "game.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
24
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
25 #include "mytype.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
26 #include "linda.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
27
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
28 #include "sjoy.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
29 //magoroku 関係ココまで
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
30
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
41 //#include "syokika.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
45 //#include "bom.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
46 //#include "count2.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
47 //#include "tokuten.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
48 //#include "tama.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
49 //#include "debug.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
56 //#include "Character.h"
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
67 extern bool padCheck(SDL_Joystick *joy);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
114 //Magoroku の初期化など
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
115 /* timer */
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
116 static int start_time,time_count;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
117 static int RUNNIG=0;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
118 char raptime[10];
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
119
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
120 static int ranking = 0;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
121 static LIGHT l;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
122 static int i=0;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
123
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
124 // schedule.ccで使用してる
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
125 void linda_env_init( void );
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
126
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
127
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
128 //Magoroku の処理
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
129 static void set_schedule(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
130 static void sche_game_init(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
131 static void sche_game_opening(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
132 static void sche_game_select_car(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
133 static void sche_game_select_course(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
134 static void sche_game_ready(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
135 static void sche_game_main_init(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
136 static void sche_game_main_ready(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
137 static void sche_game_main(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
138 static void sche_game_main_pause(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
139 static void sche_game_main_goal(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
140 static void sche_game_main_finish(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
141 static void sche_game_main_finish2(Game *game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
142
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
156 //ゲームの分岐に使用(コールバック)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
157 //static int gamef = 0;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
158 static void (*sche_func_assumption)(Game*);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
159 static void (*sche_func)(Game*) = &sche_game_init;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
7600cdfa8779 copy sound
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 110
diff changeset
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
7600cdfa8779 copy sound
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 110
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
230 static void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
233 sche_func = sche_func_assumption;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
237 static void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
240 gSprite_Init(); // グラフィック関連の初期化
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
244 static void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
245 play_init( Game *game )
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
246 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
247 game->jiki = car_init(game->car_id);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
248 carNode_append(game->jiki);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
249 field_init(game->course_id);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
250 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
251
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
252 // 適当に自作 :miya
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
255 printf("linda_env_init\n");
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
256 }
106
0c4b7d74e292 add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff changeset
257
113
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
258 static void game_env_init ( Game *game )
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
259 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
260 game->car_id = 1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
261 game->course_id = 1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
262 game->camera_type = 0;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
263 game->rap = 1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
264 game->jiki = NULL;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
265
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
266 ranking = 0;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
267
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
268 wait_init();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
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
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
274 void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
275 sche_game_init(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
276 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
277 game_env_init(game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
278 graphic_init();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
279 camera_init();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
280
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
281 #ifdef LINDA
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
282 //sche_func = &sche_game_wait;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
283 //set_schedule_assumption(sche_game_wait);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
284 #else
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
285 set_schedule_assumption(sche_game_opening);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
286 #endif
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
287 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
288
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
289 /**
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
290 * 通信対戦専用
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
291 * 全ユーザが接続するまで待つ
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
292 * ・・・だったんだけど、現在 linda を切っているため worning が出る。
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
293 * ので cut する。
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
294 */
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
295
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
296 /* linda を使用しないのでカットした
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
297 static void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
298 sche_game_wait(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
299 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
300 gFont_SetString("WAITING...", 200, 100);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
301 set_schedule_assumption(sche_game_wait_ready);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
302 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
303 */
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
304
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
305
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
306 /**
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
307 * 通信対戦専用
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
308 * 全ユーザの接続を確認したら呼び出す
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
309 * こいつも、linda がないので cut
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
310 */
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
311 /*
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
312 static void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
313 sche_game_wait_ready(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
314 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
315 gFont_SetString("CONNECT OK!!", 170, 300);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
316 if (game->play_id == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
317 gFont_SetString(" PUSH START ", 170, 400);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
318 if (pad.st != 1) { goto WAIT_READY; }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
319 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
320
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
321 set_schedule_assumption(sche_game_opening);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
322
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
323 WAIT_READY:
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
324 return;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
325 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
326 */
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
327
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
328
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
329 void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
330 sche_game_opening(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
331 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
332 static int blink_count = 0;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
333 if (game->play_id==1){
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
334 if (blink_count < 35) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
335 gFont_SetString("PUSH START !!", 170, 380);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
336 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
337 blink_count = (blink_count > 70) ? 0 : blink_count + 1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
338
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
339 if (pad.st != 1) { goto OPENING; }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
340 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
341
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
342
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
343 set_schedule_assumption(sche_game_select_car);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
344
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
345 OPENING:
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
346 return;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
347
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
348
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
349 if (game->play_id == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
350 if (title_scene() < 0){
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
351 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
352 } else if (game->play_id == 2) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
353 if (i==0){
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
354 title_init_call();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
355 i=1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
356 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
357 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
358
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
359
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
360 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
361
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
362 void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
363 sche_game_select_car(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
364 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
365 if (i==1){
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
366 title_finish_call();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
367 i=2;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
368 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
369 gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 190, 200, 1.5, 1.5);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
370 gSprite_PutSprite(24, 460, 300);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
371 gSprite_PutSprite(25, 120, 300);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
372 gFont_SetString("SELECT CAR", 180, 50);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
373
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
374 if (pad.right == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
375 game->car_id =
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
376 (game->car_id > MAXCAR-1) ? 1 : game->car_id + 1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
377 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
378 if (pad.left == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
379 game->car_id =
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
380 (game->car_id < 2) ? MAXCAR : game->car_id - 1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
381 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
382
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
383 if (game->play_id == 1)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
384 if (pad.circle != 1) { goto SELECT_CAR; }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
385
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
386
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
387 set_schedule_assumption(sche_game_select_course);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
388
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
389 SELECT_CAR:
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
390 return;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
391 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
392
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
393 void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
394 sche_game_select_course(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
395 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
396 gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 190, 200, 1.7, 1.8);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
397 gSprite_PutSprite(24, 460, 300);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
398 gSprite_PutSprite(25, 120, 300);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
399
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
400 gFont_SetString("SELECT COURSE", 150, 50);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
401
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
402 if (game->play_id == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
403 if (pad.right == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
404 game->course_id =
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
405 (game->course_id > MAXFIELD-1) ? 1 : game->course_id + 1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
406 goto SELECT_COURSE;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
407 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
408 if (pad.left == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
409 game->course_id =
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
410 (game->course_id < 2) ? MAXFIELD : game->course_id - 1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
411 goto SELECT_COURSE;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
412 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
413
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
414 if (pad.circle != 1) { goto SELECT_COURSE; }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
415 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
416
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
417 set_schedule_assumption(sche_game_ready);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
418
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
419 SELECT_COURSE:
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
420 return;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
421
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
422 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
423
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
424 void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
425 sche_game_ready(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
426 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
427 static int blink_count = 0;//
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
428
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
429 gSprite_PutSprite(27+game->play_id,265,10);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
430 gSprite_PutSpriteEx(SP_SEL_CAR+game->car_id, 50, 120, 1.5, 1.5);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
431 gSprite_PutSpriteEx(SP_SEL_COURSE+game->course_id, 340, 120, 1.7, 1.8);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
432
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
433 /* 点滅 */
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
434 if (blink_count < 35) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
435 gFont_SetString("GAME START !!", 170, 380);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
436 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
437 blink_count = (blink_count > 70) ? 0 : blink_count + 1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
438
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
439 set_schedule_assumption(sche_game_main_init);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
440
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
441
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
442 if (pad.st == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
443 set_schedule_assumption(sche_game_main_init);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
444 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
445 if (pad.cross > 0) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
446 set_schedule_assumption(sche_game_select_car);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
447 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
448
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
449 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
450
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
451 void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
452 sche_game_main_init(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
453 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
454 if (!game->jiki)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
455 play_init(game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
456 RUNNIG=0;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
457
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
458 set_schedule_assumption(sche_game_main_ready);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
459 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
460
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
461 static void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
462 sche_game_main_ready(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
463 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
464 gFont_SetString("Loading....", 180, 100);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
465 set_schedule_assumption(sche_game_main);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
466 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
467
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
468 static void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
469 sche_game_main(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
470 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
471 //flip
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
472
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
473 /** begin: dispaly RAP TIME **/
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
474 if(RUNNIG==0){
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
475 start_time = game_time_get_msec();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
476 RUNNIG=1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
477 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
478
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
479 time_count = game_time_get_msec() - start_time;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
480 game_time_set_raptime(raptime,time_count);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
481 gFont_SetString("TIME",300,20);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
482 gFont_SetString(raptime,400,20);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
483 /** end: dispaly RAP TIME **/
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
484
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
485 // light_init と init_lightの書き間違え?
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
486 init_light(&l);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
487 set_light(&l);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
488
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
489 car_id_update(game, game->jiki);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
490
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
491 field_update(game->jiki);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
492 camera_update(game,game->jiki->body->transfer);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
493 carNode_draw();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
494
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
495 gFont_SetStringInt(game->rap, 50, 100);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
496
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
497 /* スピードメーター */
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
498 gSprite_DefSprite(23, 1, 1,(int)(106.0*(game->jiki->speed/game->jiki->speed_max)), 34);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
499 gSprite_PutSprite(23, 400, 400);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
500 /* km/h */
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
501 gSprite_PutSprite(26, 470, 350);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
502 /* Rap */
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
503 gSprite_PutSprite(27, 80, 100);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
504
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
505 if (game->rap > MAXRAP) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
506 ranking = 1;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
507 set_schedule_assumption(sche_game_main_goal);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
508 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
509
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
510 gFont_SetStringInt((int)(100.0*game->jiki->speed), 380, 350);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
511
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
512
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
513 if ((pad.right > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
514 car_swerve(game->jiki, 1);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
515 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
516 if ((pad.left > 0) && ((game->jiki->speed != 0) || (pad.circle > 0))) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
517 car_swerve(game->jiki, -1);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
518 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
519 if (pad.circle > 0) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
520 car_accelerate(game->jiki, 1);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
521 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
522 if (pad.cross > 0) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
523 car_accelerate(game->jiki, -1);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
524 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
525
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
526 if (pad.r1 == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
527 game->camera_type = !game->camera_type;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
528 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
529 if (pad.st == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
530 set_schedule_assumption(sche_game_main_pause);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
531 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
532
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
533 //S-dandy の obj てきな
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
534 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
535
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
536
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
537 void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
538 sche_game_main_pause(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
539 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
540 static int select = 0;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
541
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
542 field_update(game->jiki);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
543 carNode_draw();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
544
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
545 if (game->play_id == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
546 // 選択マーク
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
547 gSprite_PutSprite(17, 100, 190+select*100);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
548
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
549 gFont_SetString("BACK TO GAME", 200, 200);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
550 gFont_SetString("GO TO TITLE", 200, 300);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
551 } else {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
552 gFont_SetString("Pause ...", 200, 200);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
553 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
554
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
555
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
556 if (pad.circle == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
557 if (select == 0) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
558 set_schedule_assumption(sche_game_main);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
559 } else {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
560 set_schedule_assumption(sche_game_main_finish);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
561 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
562 } else if (pad.st == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
563 set_schedule_assumption(sche_game_main);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
564 } else if (pad.up == 1 || pad.down == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
565 select = !select;
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
566 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
567
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
568 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
569
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
570
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
571 void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
572 sche_game_main_goal(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
573 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
574 /** dispaly TOTAL TIME **/
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
575 game_time_set_raptime(raptime,time_count);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
576
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
577 gFont_SetString("TOTAL TIME",150,20);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
578 gFont_SetString(raptime,400,20);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
579 gFont_SetString("GOAL !!", 220, 150);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
580
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
581 #ifdef LINDA
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
582 if (ranking == 1)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
583 gFont_SetString("You WIN!!", 200, 250);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
584 else
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
585 gFont_SetString("You Lose...", 200, 250);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
586 #endif
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
587
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
588
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
589 // 宣言では引数が二つだったから、第一引数に game を入れてみた
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
590 car_update(game, game->jiki);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
591 field_update(game->jiki);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
592 carNode_draw();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
593 camera_update(game,game->jiki->body->transfer);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
594
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
595 if (pad.st == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
596 set_schedule_assumption(sche_game_main_finish);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
597 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
598
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
599 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
600
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
601 void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
602 sche_game_main_finish(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
603 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
604 field_destroy();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
605 carNode_destroy();
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
606 game_env_init(game);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
607
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
608 set_schedule_assumption(sche_game_main_finish2);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
609 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
610
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
611 void
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
612 sche_game_main_finish2(Game *game)
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
613 {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
614 gFont_SetString("GAME OVER ...", 200, 200);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
615
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
616
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
617 if (pad.st == 1) {
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
618 set_schedule_assumption(sche_game_opening);
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
619 }
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
620
8c96cadde050 after game_team
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents: 112
diff changeset
621 }