view TaskManager/Test/test_render/init_position.cpp @ 228:c254a2bd1b34

remove SceneGraph::data, add SceneGraph::coord_xyz, coord_tex, normal
author gongo@gendarme.cr.ie.u-ryukyu.ac.jp
date Thu, 12 Feb 2009 16:31:38 +0900
parents 5ffee529dc59
children d734af296d38
line wrap: on
line source

#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 < 10; 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);
}