Mercurial > hg > Game > Cerium
annotate Renderer/Test/init_position.cc @ 2069:26aa08c9a1de draft default tip
cuda example fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 12 Feb 2017 10:04:55 +0900 |
parents | 764772be1e3c |
children |
rev | line source |
---|---|
539 | 1 #include "SceneGraphRoot.h" |
2 #include "player_action.h" | |
3 #include "enemy_action.h" | |
4 #include "camera_action.h" | |
557
764772be1e3c
fix examlples (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
540
diff
changeset
|
5 #include "init_position.h" |
539 | 6 |
557
764772be1e3c
fix examlples (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
540
diff
changeset
|
7 MainLoopPtr |
764772be1e3c
fix examlples (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
540
diff
changeset
|
8 posiotion::init(Viewer *sgroot, int w, int h) |
539 | 9 { |
10 SceneGraphPtr back; | |
11 SceneGraphPtr player; | |
12 SceneGraphPtr enemy; | |
13 //SceneGraphPtr bullet; | |
14 | |
15 sgroot->createFromXMLfile(manager, "xml_file/player.xml"); | |
16 back = sgroot->createSceneGraph(BACK); | |
17 //back = sgroot->createSceneGraph(); | |
18 player = sgroot->createSceneGraph(IDLE); | |
19 //bullet = sgroot->createSceneGraph(BULEBULLET); | |
20 | |
21 camera_init(back, w, h); | |
22 back->set_move_collision(camera_init, camera_collision); | |
23 player->set_move_collision(player_move_all, player_collision); | |
24 | |
25 | |
26 back->addChild(player); | |
27 | |
28 for (int i = 0; i < 10; i++) { | |
29 enemy = sgroot->createSceneGraph(E_PLANE); | |
30 enemy->set_move_collision(enemy_move, enemy_collision); | |
31 enemy->xyz[0] = 50.0*i; | |
32 back->addChild(enemy); | |
33 } | |
34 | |
35 sgroot->setSceneData(back); | |
557
764772be1e3c
fix examlples (on going)
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
540
diff
changeset
|
36 return sgroot; |
539 | 37 } |