comparison TaskManager/Test/test_render/ieshoot.cpp @ 206:dee3b5092a70

add Camera
author gongo@gendarme.cr.ie.u-ryukyu.ac.jp
date Thu, 29 Jan 2009 13:52:47 +0900
parents efb1df3176f4
children 953811245b63
comparison
equal deleted inserted replaced
205:efb1df3176f4 206:dee3b5092a70
54 54
55 SceneGraphPtr iebosstama = sgroot->createSceneGraph(Earth); 55 SceneGraphPtr iebosstama = sgroot->createSceneGraph(Earth);
56 iebosstama->set_move_collision(iebosstama_move, ietama_collision); 56 iebosstama->set_move_collision(iebosstama_move, ietama_collision);
57 iebosstama->xyz[0] = node->xyz[0]; 57 iebosstama->xyz[0] = node->xyz[0];
58 iebosstama->xyz[1] = node->xyz[1] + boss_radius_y; 58 iebosstama->xyz[1] = node->xyz[1] + boss_radius_y;
59 iebosstama->xyz[2] = 30000.0f; 59 //iebosstama->xyz[2] = 50.0f;
60 node->addBrother(iebosstama); 60 node->addBrother(iebosstama);
61 61
62 damage++; 62 damage++;
63 } 63 }
64 } 64 }
74 /** 74 /**
75 * TODO 75 * TODO
76 * Boss が複数居た場合、これじゃ駄目 76 * Boss が複数居た場合、これじゃ駄目
77 */ 77 */
78 static int x_speed = 5.0f; 78 static int x_speed = 5.0f;
79 static int z_speed = 5.0f;
79 80
80 node->xyz[0] += x_speed; 81 node->xyz[0] += x_speed;
81 82
82 if (node->xyz[0] - boss_radius_x < 0) { 83 if (node->xyz[0] - boss_radius_x < 0) {
83 x_speed = -x_speed; 84 x_speed = -x_speed;
84 node->xyz[0] = boss_radius_x; 85 node->xyz[0] = boss_radius_x;
85 } else if (node->xyz[0] + boss_radius_x > screen_w) { 86 } else if (node->xyz[0] + boss_radius_x > screen_w) {
86 x_speed = -x_speed; 87 x_speed = -x_speed;
87 node->xyz[0] = screen_w - boss_radius_x; 88 node->xyz[0] = screen_w - boss_radius_x;
88 } 89 }
90
91 //node->xyz[2] += z_speed;
92 if (node->xyz[2] >= 100.0f) {
93 node->xyz[2] = 99.99f;
94 z_speed = -z_speed;
95 } else if (node->xyz[2] <= -100.0f) {
96 node->xyz[2] = -99.99f;
97 z_speed = -z_speed;
98 }
89 } 99 }
90 100
91 static void 101 static void
92 ieboss_collision_invincibil(SceneGraphPtr node, int screen_w, int screen_h, 102 ieboss_collision_invincibil(SceneGraphPtr node, int screen_w, int screen_h,
93 SceneGraphPtr tree) 103 SceneGraphPtr tree)
192 202
193 back = sgroot->createSceneGraph(); 203 back = sgroot->createSceneGraph();
194 204
195 iejiki = sgroot->createSceneGraph(IEJIKI); 205 iejiki = sgroot->createSceneGraph(IEJIKI);
196 iejiki->set_move_collision(iejiki_move, iejiki_collision); 206 iejiki->set_move_collision(iejiki_move, iejiki_collision);
207 iejiki->xyz[2] = 20;
197 back->addChild(iejiki); 208 back->addChild(iejiki);
198 209
199 enemy = sgroot->createSceneGraph(IEBOSS); 210 enemy = sgroot->createSceneGraph(IEBOSS);
200 enemy->set_move_collision(ieboss_move, ieboss_collision); 211 enemy->set_move_collision(ieboss_move, ieboss_collision);
201 enemy->xyz[1] = boss_radius_y; 212 enemy->xyz[1] = boss_radius_y;