Mercurial > hg > Members > tkaito > dandy
comparison mydandy.cc @ 3:dca6d5d2ef46
stage 1 add
author | tkaito |
---|---|
date | Sun, 06 Jun 2010 05:23:51 +0900 |
parents | 69b4108bf4e8 |
children | 57af5c610b34 |
comparison
equal
deleted
inserted
replaced
2:69b4108bf4e8 | 3:dca6d5d2ef46 |
---|---|
1 #include "SceneGraphRoot.h" | 1 #include "game_scene01.h" |
2 #include "dandy.h" | |
3 | |
4 SceneGraphPtr *dandys; | |
5 | 2 |
6 void def_angle(SceneGraphPtr node, void *sgroot_, int w, int h); | 3 void def_angle(SceneGraphPtr node, void *sgroot_, int w, int h); |
7 void left_angle(SceneGraphPtr node, void *sgroot_, int w, int h); | 4 void left_angle(SceneGraphPtr node, void *sgroot_, int w, int h); |
8 void right_angle(SceneGraphPtr node, void *sgroot_, int w, int h); | 5 void right_angle(SceneGraphPtr node, void *sgroot_, int w, int h); |
9 | 6 |
36 node->xyz[1] -= 10.0f; | 33 node->xyz[1] -= 10.0f; |
37 //def_angle(node, sgroot, w, h); | 34 //def_angle(node, sgroot, w, h); |
38 } else if (pad->down.isHold() && h > node->xyz[1]) { | 35 } else if (pad->down.isHold() && h > node->xyz[1]) { |
39 node->xyz[1] += 10.0f; | 36 node->xyz[1] += 10.0f; |
40 } | 37 } |
38 | |
41 } | 39 } |
42 | 40 |
43 void | 41 void |
44 dandy_collision(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree) | 42 dandy_collision(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree) |
45 { | 43 { |
46 | 44 |
47 } | 45 } |
48 | 46 |
49 /* 時機や敵機のオブジェクトや何やらを作成してsetSceneDataまで */ | 47 /* 時機や敵機のオブジェクトや何やらを作成してsetSceneDataまで */ |
50 void | |
51 create_object(void *sgroot_, int w, int h) | |
52 { | |
53 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; | |
54 SceneGraphPtr dandy, rdandy, rtdandy, ldandy, ltdandy; | |
55 //SceneGraphPtr tmp[5] = {ldandy, ltdandy, dandy, rtdandy, rtdandy}; | |
56 //dandys = tmp; | |
57 | |
58 SceneGraphPtr back = sgroot->createSceneGraph(); | |
59 | |
60 dandy = sgroot->createSceneGraph("mydandy"); | |
61 ldandy = sgroot->createSceneGraph("l-dandy"); | |
62 ltdandy = sgroot->createSceneGraph("lt-dandy"); | |
63 rdandy = sgroot->createSceneGraph("r-dandy"); | |
64 rtdandy = sgroot->createSceneGraph("rt-dandy"); | |
65 | |
66 dandy->xyz[0] = w/2; | |
67 dandy->xyz[1] = h*0.9; | |
68 | |
69 dandy->set_move_collision(dandy_move, dandy_collision); | |
70 //ldandy->set_move_collision(dandy_move, dandy_collision); | |
71 ltdandy->set_move_collision(dandy_move, dandy_collision); | |
72 rdandy->set_move_collision(dandy_move, dandy_collision); | |
73 rtdandy->set_move_collision(dandy_move, dandy_collision); | |
74 | |
75 back->addChild(dandy); | |
76 sgroot->setSceneData(back); | |
77 } | |
78 | 48 |
79 void | 49 void |
80 def_angle(SceneGraphPtr node, void *sgroot_, int w, int h) | 50 def_angle(SceneGraphPtr node, void *sgroot_, int w, int h) |
81 { | 51 { |
82 | 52 |