2
|
1 #include <math.h>
|
|
2 #include <stdlib.h>
|
|
3 #include "SceneGraph.h"
|
|
4 #include "Application.h"
|
|
5 #include "MainLoop.h"
|
|
6
|
|
7 class dandy : public Application {
|
|
8 MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
|
|
9 };
|
|
10
|
10
|
11 typedef void (*move_func)(SceneGraphPtr node, void *sgroot_, int w, int h);
|
|
12 typedef void (*coll_func)(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree);
|
|
13
|
|
14 typedef struct {
|
|
15 double x, y;
|
|
16 double vx, vy;
|
|
17 double angle[3];
|
|
18 int vit;
|
|
19 int score;
|
|
20 move_func move;
|
|
21 coll_func func;
|
|
22 SceneGraphPtr parent;
|
|
23 SceneGraphPtr root;
|
|
24
|
|
25 } *ObjPropertyPtr, ObjProperty;
|
|
26
|
6
|
27 static const float player_speed = 10.0f;
|
|
28 static const float player_radius = 42.0f;
|
|
29
|
|
30 static const float boss_radius_x = 65.4f;
|
|
31 static const float boss_radius_y = 130.8f;
|
|
32 static const float first_boss1_speed = 10.0;
|
|
33 static const float first_boss1_depth = 500.0;
|
|
34 static const float return_boss1_depth_speed = 10.0;
|
|
35
|
|
36 static const float shot_speed = 30.0f;
|
|
37 static const float shot_radius = 42.4f;
|
|
38
|
2
|
39 extern void title_collision(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree);
|
|
40 extern void gameover_scene(void *sgroot_, int w, int h);
|
8
|
41 extern void create_stage(void *sgroot_, int w, int h);
|