annotate dandy.h @ 2:6e1afe1016dc

Task is not yet.
author tkaito
date Thu, 17 Jun 2010 05:11:29 +0900
parents 7dc2d920fc7c
children 7b4c2cfeba45
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
1 #include <math.h>
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
2 #include <stdlib.h>
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
3 #include "SceneGraph.h"
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
4 #include "Application.h"
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
5 #include "MainLoop.h"
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
6
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
7 class dandy : public Application {
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
8 MainLoopPtr init(Viewer *viewer, int w, int h);
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
9 };
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
10
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
11 typedef void (*move)(SceneGraphPtr node, void *sgroot_, int w, int h);
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
12 typedef void (*coll)(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree);
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
13
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
14 typedef struct {
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
15 double x, y;
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
16 double vx, vy;
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
17 const char *chara;
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
18 int vital;
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
19 int score;
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
20 void *parent;
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
21 void *root;
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
22
7dc2d920fc7c local update. xml,image, blender add. ppe/move, ppe/coll add.
tkaito
parents:
diff changeset
23 } *ObjPropertyPtr, ObjProperty;
2
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
24
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
25 static const int ENEMY_NUM = 1;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
26 extern ObjProperty charactor[ENEMY_NUM];
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
27
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
28 static const float player_speed = 10.0f;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
29 static const float player_radius = 42.0f;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
30
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
31 static const float boss_radius_x = 65.4f;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
32 static const float boss_radius_y = 130.8f;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
33 static const float first_boss1_speed = 10.0;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
34 static const float first_boss1_depth = 500.0;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
35 static const float return_boss1_depth_speed = 10.0;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
36
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
37 static const float shot_speed = 30.0f;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
38 static const float shot_radius = 42.4f;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
39
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
40 extern void title_move(SceneGraphPtr node, void *sgroot_, int w, int h);
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
41 extern void title_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree);
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
42 extern void dandy_move(SceneGraphPtr node, void *sgroot_, int w, int h);
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
43 extern void dandy_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree);
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
44 extern void create_title(void *sgroot, int w, int h);
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
45 extern void create_stage(void *sgroot, int w, int h);
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
46
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
47 typedef struct enemy_state {
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
48 const char *charano;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
49 int score;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
50 int vital;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
51
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
52 } state;
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
53
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
54 #define ENEMY_STATUS_TABLE { \
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
55 ENEMY_STATUS("test00", 0, 0), \
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
56 ENEMY_STATUS("greencrab", 330, 98) \
6e1afe1016dc Task is not yet.
tkaito
parents: 1
diff changeset
57 }