Mercurial > hg > Members > tkaito > dandy
comparison greenclab.cc @ 4:e089ac9ea221
greenclab add. not complete...
author | tkaito |
---|---|
date | Sun, 06 Jun 2010 06:47:45 +0900 |
parents | 69b4108bf4e8 |
children | 57af5c610b34 |
comparison
equal
deleted
inserted
replaced
3:dca6d5d2ef46 | 4:e089ac9ea221 |
---|---|
1 #include <math.h> | 1 #include "game_scene01.h" |
2 #include "SceneGraphRoot.h" | |
3 #include "SGList.h" | |
4 | 2 |
5 static void greenclab_move(SceneGraphPtr node, int screen_w, int screen_h); | 3 void |
6 static void greenclab_move_idle(SceneGraphPtr node, int screen_w, int screen_h); | 4 gclab_move(SceneGraphPtr node, void *sgroot_, int w, int h) |
7 static void greenclab_collision(SceneGraphPtr node, int screen_w, int screen_h, | 5 { |
8 SceneGraphPtr tree); | |
9 void create_greenclab(TaskManager *manager, int number); | |
10 | 6 |
11 static void | 7 /* |
12 greenclab_move(SceneGraphPtr node, int w, int h) | 8 if (w > node->xyz[0]) { |
9 } else if (0 < node->xyz[0]) { | |
10 } | |
11 if (0 < node->xyz[1]) { | |
12 } else if (h > node->xyz[1]) { | |
13 } | |
14 */ | |
15 } | |
16 | |
17 void | |
18 gclab_collision(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree) | |
13 { | 19 { |
14 | 20 |
15 } | 21 } |
16 | 22 |
17 static void | |
18 greenclab_move_idle(SceneGraphPtr node, int w, int h) | |
19 { | |
20 node->xyz[1] += 2.0f; | |
21 node->xyz[2] = 0.0f; | |
22 } | |
23 | 23 |
24 static void | |
25 greenclab_collision(SceneGraphPtr node, int w, int h, SceneGraphPtr tree) | |
26 { | |
27 | |
28 } | |
29 | |
30 void | |
31 create_greenclab(TaskManager *manager, int w, int h) | |
32 { | |
33 SceneGraphPtr greenclab; | |
34 SceneGraphPtr back; | |
35 | |
36 sgroot->createFromXMLfile(manager, "xml/enemy_greenclab.xml"); | |
37 | |
38 back = sgroot->createSceneGraph(); | |
39 greenclab = sgroot->createSceneGraph(greenclab); | |
40 greenclab->xyz[0] = w/2; | |
41 greenclab->xyz[1] = 0.0f; | |
42 greenclab->set_move_collision(greenclab_move_idle, greenclab_collision); | |
43 | |
44 back->addChild(greenclab); | |
45 | |
46 sgroot->setSceneData(back); | |
47 } |