Mercurial > hg > Members > tkaito > dandy
comparison game_scene01.cc @ 5:57af5c610b34
iroiro add
author | tkaito |
---|---|
date | Mon, 07 Jun 2010 02:16:02 +0900 |
parents | e089ac9ea221 |
children | 581fa1888e2e |
comparison
equal
deleted
inserted
replaced
4:e089ac9ea221 | 5:57af5c610b34 |
---|---|
1 #include "game_scene01.h" | 1 #include "game_scene01.h" |
2 | |
3 SceneGraphPtr back_; | |
4 SceneGraphPtr dandys[5]; | |
2 | 5 |
3 void | 6 void |
4 create_object(void *sgroot_, int w, int h) | 7 create_object(void *sgroot_, int w, int h) |
5 { | 8 { |
6 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; | 9 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; |
7 //SceneGraphPtr tmp[5] = {ldandy, ltdandy, dandy, rtdandy, rtdandy}; | 10 back_ = sgroot->createSceneGraph(); |
8 //dandys = tmp; | 11 SceneGraphPtr back = back_; |
9 | |
10 SceneGraphPtr back = sgroot->createSceneGraph(); | |
11 | 12 |
12 /* 自機 */ | 13 /* 自機 */ |
13 SceneGraphPtr dandy, rdandy, rtdandy, ldandy, ltdandy; | 14 //SceneGraphPtr dandys[5]; |
14 dandy = sgroot->createSceneGraph("mydandy"); | 15 dandys[0] = sgroot->createSceneGraph("l-dandy"); |
15 ldandy = sgroot->createSceneGraph("l-dandy"); | 16 dandys[1] = sgroot->createSceneGraph("lt-dandy"); |
16 ltdandy = sgroot->createSceneGraph("lt-dandy"); | 17 dandys[2] = sgroot->createSceneGraph("mydandy"); |
17 rdandy = sgroot->createSceneGraph("r-dandy"); | 18 dandys[3] = sgroot->createSceneGraph("rt-dandy"); |
18 rtdandy = sgroot->createSceneGraph("rt-dandy"); | 19 dandys[4] = sgroot->createSceneGraph("r-dandy"); |
20 | |
21 dandys[0]->set_move_collision(ldandy_move, dandy_coll); | |
22 dandys[1]->set_move_collision(ltdandy_move, dandy_coll); | |
23 dandys[2]->set_move_collision(mydandy_move, mydandy_coll); | |
24 dandys[3]->set_move_collision(rtdandy_move, dandy_coll); | |
25 dandys[4]->set_move_collision(rdandy_move, dandy_coll); | |
19 | 26 |
20 dandy->xyz[0] = w/2; | 27 for(int i = 0; i < 5; i++) { |
21 dandy->xyz[1] = h*0.9; | 28 dandys[i]->xyz[0] = w/2; |
22 | 29 dandys[i]->xyz[1] = h*0.9; |
23 dandy->set_move_collision(dandy_move, dandy_collision); | 30 dandys[i]->xyz[2] = 100000.0f; |
24 ldandy->set_move_collision(dandy_move, dandy_collision); | 31 back->addChild(dandys[i]); |
25 ltdandy->set_move_collision(dandy_move, dandy_collision); | 32 } |
26 rdandy->set_move_collision(dandy_move, dandy_collision); | 33 |
27 rtdandy->set_move_collision(dandy_move, dandy_collision); | 34 dandys[2]->xyz[2] = 0.0f; |
28 | 35 |
29 /* 敵機 */ | 36 /* 敵機 */ |
30 SceneGraphPtr gclab; | 37 SceneGraphPtr gclab; |
31 gclab = sgroot->createSceneGraph("green_clab"); | 38 gclab = sgroot->createSceneGraph("green_clab"); |
32 | 39 |
33 gclab->xyz[0] = w/2; | 40 gclab->xyz[0] = w/2; |
34 gclab->xyz[1] = h/2; | 41 gclab->xyz[1] = -100; |
42 gclab->xyz[2] = 5; | |
35 | 43 |
36 gclab->set_move_collision(gclab_move, gclab_collision); | 44 gclab->set_move_collision(gclab_move, gclab_collision); |
37 | 45 |
38 //stage_plan(); | 46 //stage_plan(); |
39 | 47 |
40 back->addChild(dandy); | |
41 back->addChild(gclab); | 48 back->addChild(gclab); |
42 sgroot->setSceneData(back); | 49 sgroot->setSceneData(back); |
43 } | 50 } |
44 | 51 |
45 void | 52 void |