annotate dandy.h @ 10:93d9db48775f default tip

Property add not move. 30%
author tkaito
date Mon, 14 Jun 2010 17:20:03 +0900
parents b87dcc11a6d0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
1 #include <math.h>
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
2 #include <stdlib.h>
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
3 #include "SceneGraph.h"
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
4 #include "Application.h"
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
5 #include "MainLoop.h"
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
6
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
7 class dandy : public Application {
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
8 MainLoopPtr init(Viewer *viewer, int screen_w, int screen_h);
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
9 };
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
10
10
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
11 typedef void (*move_func)(SceneGraphPtr node, void *sgroot_, int w, int h);
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
12 typedef void (*coll_func)(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree);
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
13
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
14 typedef struct {
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
15 double x, y;
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
16 double vx, vy;
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
17 double angle[3];
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
18 int vit;
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
19 int score;
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
20 move_func move;
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
21 coll_func func;
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
22 SceneGraphPtr parent;
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
23 SceneGraphPtr root;
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
24
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
25 } *ObjPropertyPtr, ObjProperty;
93d9db48775f Property add not move. 30%
tkaito
parents: 8
diff changeset
26
6
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
27 static const float player_speed = 10.0f;
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
28 static const float player_radius = 42.0f;
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
29
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
30 static const float boss_radius_x = 65.4f;
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
31 static const float boss_radius_y = 130.8f;
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
32 static const float first_boss1_speed = 10.0;
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
33 static const float first_boss1_depth = 500.0;
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
34 static const float return_boss1_depth_speed = 10.0;
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
35
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
36 static const float shot_speed = 30.0f;
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
37 static const float shot_radius = 42.4f;
581fa1888e2e add bullet
tkaito
parents: 3
diff changeset
38
2
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
39 extern void title_collision(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree);
69b4108bf4e8 refact few
tkaito
parents:
diff changeset
40 extern void gameover_scene(void *sgroot_, int w, int h);
8
tkaito
parents: 7
diff changeset
41 extern void create_stage(void *sgroot_, int w, int h);