Mercurial > hg > Game > Cerium
changeset 214:cd3fda5a24ae draft
fix
author | gongo@localhost.localdomain |
---|---|
date | Sun, 01 Feb 2009 20:46:39 +0900 |
parents | 8ac35507094d |
children | 59f4129a9562 e9a52d68db42 |
files | TaskManager/Test/test_render/init_position.cpp |
diffstat | 1 files changed, 36 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/TaskManager/Test/test_render/init_position.cpp Sun Feb 01 20:46:39 2009 +0900 @@ -0,0 +1,36 @@ +#include "SceneGraphRoot.h" +#include "SGList.h" +#include "player_action.h" +#include "enemy_action.h" +#include "camera_action.h" + +void +init_position(int w, int h) +{ + SceneGraphPtr back; + SceneGraphPtr player; + SceneGraphPtr enemy; + SceneGraphPtr bullet; + + sgroot->createFromXMLfile("xml_file/player.xml"); + back = sgroot->createSceneGraph(BACK); + player = sgroot->createSceneGraph(IDLE); + //bullet = sgroot->createSceneGraph(BULEBULLET); + + camera_init(back, w, h); + back->set_move_collision(camera_init, camera_collision); + player->set_move_collision(player_move_all, player_collision); + + + back->addChild(player); + + for (int i = 0; i < 15; i++) { + enemy = sgroot->createSceneGraph(E_PLANE); + enemy->set_move_collision(enemy_move, enemy_collision); + enemy->xyz[0] = 50.0*i; + back->addChild(enemy); + } + //bullet->set_move_collision(null_move, null_collision); + + sgroot->setSceneData(back); +}