Mercurial > hg > old > magoroku_racing
annotate Magoroku.cc @ 110:8a525ec378fc
bool.h change stdbool.h
author | Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 09 Jun 2011 01:45:25 +0900 |
parents | 0c4b7d74e292 |
children | 7600cdfa8779 |
rev | line source |
---|---|
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #include "Magoroku.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 #include "SgoexCerium.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 #include <stdio.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 #include <stdlib.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 #include <string.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 #include <ctype.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 #include <math.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 #include <time.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 #include <SDL.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 #include "SDL_opengl.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 #include "object.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 #include "tree_controll.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 #include "xml.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 #include "profile.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 #include "syokika.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 #include "sankaku.h" |
110
8a525ec378fc
bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
106
diff
changeset
|
17 //#include "sgoex.h" |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 #include "sound.h" |
110
8a525ec378fc
bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
106
diff
changeset
|
19 #include <stdbool.h> |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 #include "bom.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 #include "count2.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 #include "tokuten.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 #include "schedule.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 #include "tama.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 #include "debug.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 #include "trace.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 #include "LoadSprite.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 #include <SDL_mixer.h> |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 #include "error.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 #include "matrix_calc.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 #include "Character.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 #include "Character_state.h" |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 static int use_keybord = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 // static int cdp[20] = { 16, 16, 16, 17, 18, 0 }; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 static int i; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 static int rswait = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 static int cf = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 static int cc = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 static int test_mode = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 static const char *test_object = "" ; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 //static SDL_Surface *screen; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 // static Uint32 background; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 // static char *pad_trace_file; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 extern void schedule(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 extern void tokuten(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 extern void Pad(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
53 extern void keybord(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 static int gamesyokika(int gamef); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 static int game_pause(int); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
56 //static char *pad_trace_file; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 |
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 * runmode: |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 * 0 - normal game |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
61 * 1 - capture mode |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
62 * 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
|
63 * dump it into a file |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
64 * 2 - trace mode |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
65 * 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
|
66 * by capture-mode |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 */ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 int runmode; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 SDL_Joystick *joy; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 |
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 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
|
75 -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
|
76 -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
|
77 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
78 Viewer *droot; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
79 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
80 static int screen_w; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
81 static int screen_h; |
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 //ウィンドウのサイズとかを指定? |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
84 MainLoopPtr |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
85 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
|
86 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 screen_w = w; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 screen_h = h; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 droot = sgroot_; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 return droot; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 } |
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 Application * |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 application() { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
95 return new Magoroku(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
96 } |
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 static int opening(int gamef); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
100 static int dandy_closing(int gamef); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
101 static int dandy_main_loop(int gamef); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
102 static int dandy_main_init(int gamef); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
103 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
|
104 extern void task_initialize(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
105 static void TMend(TaskManager *manager); |
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 //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
|
108 bool |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 Magoroku::app_loop(Viewer *viewer){ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 // don't use allExecute |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
111 return 0; |
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 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 //ゲームの分岐に使用 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 static int gamef = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 //ゲームの分岐っぽそう。magoroku の schedule の処理と同等と考えてオッケーかな? |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 HTaskPtr |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 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
|
120 // printf("gamef = %d\n",gamef); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
121 switch (gamef) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
122 case 0: gamef= dandy_main_init(gamef); break; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
123 case 1: gamef= gamesyokika(gamef); break; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
124 case 2: gamef= opening(gamef); break; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
125 case 3: gamef= dandy_main_loop(gamef); break; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
126 case 4: gamef= dandy_closing(gamef); break; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
127 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
128 return next; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
129 }; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
130 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
131 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
132 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
133 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 static void |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
135 task_init() |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
136 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
137 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
138 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
139 int |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
140 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
|
141 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
142 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
|
143 if (strcmp(argv[i],"-t")) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
144 test_mode=1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 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
|
146 i++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147 test_object=argv[i]; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
148 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
150 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
151 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
152 task_init(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 task_initialize(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
154 manager->set_TMend(TMend); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156 return init(manager,argc, argv); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
159 void |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
160 TMend(TaskManager *manager) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
161 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
162 printf("game end\n"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
163 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
164 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
165 static int light_sysswitch = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
166 static int light_num = 4; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
167 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
168 static void |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
169 LightSysSwitch(Viewer *sgroot) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 if (light_sysswitch == 1) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 sgroot->OnLightSysSwitch(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
172 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
|
173 SceneGraphPtr light = sgroot->getLight(i); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
174 sgroot->OnLightSwitch(i); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175 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
|
176 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
|
177 light->xyz[2] = -100; |
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 } else if (light_sysswitch == 0) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
180 sgroot->OffLightSysSwitch(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
181 } |
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 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
184 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
185 static int |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
186 dandy_main_init(int gamef) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
187 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
188 //Timeprof timeprof_move; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
189 //timeprof_move = timeprof_new(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
190 dbg_init("/dev/stdout"); |
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 * timeprof があるんだけどね |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
194 */ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
195 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
196 droot->createFromXMLfile("xml/character.xml"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
197 droot->createFromXMLfile("xml/font.xml"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
198 droot->createFromXMLfile("xml/effect.xml"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
199 droot->createFromXMLfile("xml/boss.xml"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
200 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
201 LightSysSwitch(droot); |
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 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
204 init_sprite(0,0,0,0); |
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 __debug("syokikaが呼びだされました\n"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
207 joy=SDL_JoystickOpen(0); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
208 if(!joy) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
209 fprintf(stderr,"failed to open joystick 0\n"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
210 use_keybord = 1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
211 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
212 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
213 /** |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
214 * sound.c に移しました |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
215 * 代わりに InitSdlMixer(void); を使います。 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
216 * まあ中身一緒なんだけどね |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
217 */ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
218 /** |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
219 if (Mix_OpenAudio(MIX_DEFAULT_FREQUENCY,MIX_DEFAULT_FORMAT,2,1024) < 0) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
220 fprintf(stderr,"failed to initialize SDL_mixer.\n"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
221 SDL_Quit(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
222 exit(-1); |
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 */ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
225 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
226 // SDL_mixer とかいろいろ初期化 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
227 // もし Init に失敗したら |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
228 // 以後の Mixer 関連の関数を呼び出しても |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
229 // 中では何も行われないとかいう小細工を入れました。 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
230 InitSdlMixer(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
231 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
232 // 音楽ファイルの読み込み |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
233 LoadSdlMixer(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
234 |
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 InitVolume(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
237 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
238 // 音出しテスト |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
239 PlaySdlMixer(-1, BGM); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
240 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
241 if(!(init_chara_list(1024))){ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
242 __debug("failed to init_chara_list\n"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
243 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
244 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
245 __debug("finished init_chara_list\n"); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
246 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
247 return 1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
248 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
249 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
250 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
251 static int |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
252 dandy_main_loop(int gamef) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
253 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
254 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
255 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
256 if ((pad[0].l1 != 0) && (pad[0].r1 != 0) && |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
257 (pad[0].l2 != 0) && (pad[0].r2 != 0)) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
258 gamef = gamesyokika(gamef); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
259 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
260 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
261 if (pad[0].quit != 0) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
262 gamef = 4; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
263 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
264 flip(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
265 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
266 //SDL_FillRect(screen, NULL, background); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
267 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
268 schedule(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
269 enemyfaste = count; |
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 // timeprof_begin(timeprof_move); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
272 //Move(); //enemy move |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
273 collision_detect(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
274 outofwindow(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
275 // timeprof_end(timeprof_move); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
276 state_update(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
277 asteroidi = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
278 //charpatern(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
279 //bosguage(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
280 |
110
8a525ec378fc
bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
106
diff
changeset
|
281 if (jiki.bf == true) { |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
282 Player(0); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
283 count++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
284 PutSprite(count, jiki.x, jiki.y, jiki.ch); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
285 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
286 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
287 Putbom(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
288 tokuten(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
289 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
290 count++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
291 //PutSprite(count, 0, 960 - 96, 10); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
292 /*インフレゲージ */ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
293 count++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
294 //PutSprite(count, 0, 0, 48); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
295 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
296 obj_draw(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
297 gamef = game_pause(gamef); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
298 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
299 if (use_keybord) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
300 keybord(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
301 } else { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
302 Pad(joy); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
303 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
304 filpcount++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
305 count = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
306 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
307 return gamef; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
308 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
309 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
310 static int |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
311 dandy_closing(int gamef) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
312 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
313 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
314 //_______________________________________________ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
315 // SDL_mixerの後始末 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
316 Mix_CloseAudio(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
317 Mix_HaltMusic(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
318 FreeSdlMixer() ; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
319 //_______________________________________________ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
320 return 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
321 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
322 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
323 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
324 static int |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
325 gamesyokika(int gamef) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
326 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
327 laser_lv3[0].r = 62; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
328 laser_lv3[0].r = 62; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
329 for (i = 0; i < 3; i++) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
330 tlv3[i].y = -1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
331 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
332 filpcount = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
333 stage = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
334 //for (i = 0; i < 300; i++) |
110
8a525ec378fc
bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
106
diff
changeset
|
335 //enemy[i].f = false; |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
336 jiki.zanki = 3; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
337 jiki.x = 60; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
338 jiki.y = 200; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
339 jiki.ch = 3; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
340 jiki.point = 0; |
110
8a525ec378fc
bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
106
diff
changeset
|
341 jiki.bf = false; |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
342 jiki.muteki = 120; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
343 enemycount = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
344 lg.stg = 4096; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
345 pg.stg = 4096; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
346 infg.stg = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
347 infg_level = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
348 //kyeenemyno = -1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
349 fastebos = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
350 jiki.ccount = 99; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
351 p_extend = 200000; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
352 pad[0].up=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
353 pad[0].down=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
354 pad[0].right=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
355 pad[0].left=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
356 pad[0].st=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
357 pad[0].se=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
358 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
359 SoundStop(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
360 SoundPlay(7); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
361 gamef = 2; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
362 flip(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
363 return gamef; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
364 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
365 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
366 static int |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
367 opening(int gamef) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
368 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
369 if(use_keybord == 1) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
370 keybord(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
371 } else { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
372 Pad(joy); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
373 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
374 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
375 count = 1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
376 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
377 PutSprite(count, 700, 480, 53); // put `push start' string on screen. |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
378 count++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
379 PutSprite(count, 224, 776, 119); // put `super dandy' |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
380 count++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
381 // PutSprite(count, 200, 64, 190); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
382 // PutSpriteEx(count, 8192, 8192, 0); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
383 PutSpriteEx(190, 800, 264, 2, 2, 5); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
384 count++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
385 PutSprite(count, 396, 432, 191); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
386 //PutSpriteEx(count, 8192, 8192, 0); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
387 count++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
388 PutSprite(count, 640, 640, 192); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
389 //PutSpriteEx(count, 8192, 8192, 0); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
390 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
391 if (pad[0].st > 1) { |
110
8a525ec378fc
bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
106
diff
changeset
|
392 jiki.bf = true; |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
393 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
394 //CdPlay(1,&cdp[0],0); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
395 SoundStop(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
396 SoundPlay(0); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
397 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
398 gamef = 3; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
399 pad[0].st = 1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
400 } else if ((pad[0].se > 0) && (pad[0].st > 0)) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
401 gamef = 2; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
402 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
403 flip(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
404 return gamef; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
405 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
406 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
407 static int |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
408 game_pause(int gamef) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
409 { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
410 gamef = 3; |
110
8a525ec378fc
bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
106
diff
changeset
|
411 if (jiki.zanki != 0 && jiki.bf != false) { |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
412 if (pad[0].se == 1) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
413 //Mix_Pause(BGM); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
414 PauseSdlMixer(BGM); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
415 while(1){ |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
416 if(use_keybord == 1) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
417 keybord(); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
418 } else { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
419 Pad(joy); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
420 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
421 if(pad[0].st == 0) |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
422 continue; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
423 pad[0].up=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
424 pad[0].down=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
425 pad[0].right=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
426 pad[0].left=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
427 pad[0].se=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
428 pad[0].st=0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
429 //Mix_Resume(BGM); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
430 ResumeSdlMixer(BGM); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
431 break; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
432 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
433 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
434 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
435 if (jiki.zanki == 0) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
436 // RECT *recp; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
437 if ((jiki.ccount > 0) && (cf == 0)) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
438 cf = 1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
439 count++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
440 //cgcg(2); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
441 PutSprite(count, 480, 480, 110); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
442 count++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
443 //cgcg(1); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
444 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
445 if ((jiki.ccount > 0) && (cf == 1)) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
446 while (1) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
447 if (pad[0].st > 0) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
448 cf = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
449 jiki.ccount--; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
450 jiki.zanki = 3; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
451 enemycount++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
452 cc = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
453 for (i = 0; i < 4; i++) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
454 clear_result[i] = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
455 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
456 goto f; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
457 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
458 cc++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
459 if (29 - cc / 60 < 20) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
460 cc = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
461 cf = 3; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
462 break; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
463 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
464 SDL_Delay(100); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
465 PutSprite(1, 640, 640, 29 - cc / 60); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
466 // PutSpriteEx(1, 409 * ((cc % 60) + 1), 409 * ((cc % 60) + 1), 0); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
467 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
468 Pad(joy); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
469 flip(); // this is not correct |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
470 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
471 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
472 if (rswait > 60 * 6) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
473 cf = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
474 rswait = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
475 gamef = gamesyokika(gamef); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
476 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
477 rswait++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
478 count++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
479 //cgcg(1); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
480 PutSprite(1, 480, 480, 19); |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
481 return gamef; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
482 } |
110
8a525ec378fc
bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
106
diff
changeset
|
483 if (jiki.bf == false) { |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
484 f: |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
485 if (rswait < 80) { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
486 rswait++; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
487 return gamef; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
488 } else { |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
489 rswait = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
490 jiki.x = 60; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
491 jiki.y = 200; |
110
8a525ec378fc
bool.h change stdbool.h
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
106
diff
changeset
|
492 jiki.bf = true; |
106
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
493 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
494 pad[0].st = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
495 lg.stg = 4096; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
496 pg.stg = 4096; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
497 laser_lv3[0].r = 62; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
498 tlv3[0].r = 0; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
499 tlv3[0].y = -1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
500 return gamef; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
501 // sb_size = -1; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
502 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
503 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
504 return gamef; |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
505 } |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
506 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
507 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
508 |
0c4b7d74e292
add Magoroku.cc & .h (Dandy.cc & .h)
Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
509 /* end */ |