view game_scene01.cc @ 3:dca6d5d2ef46

stage 1 add
author tkaito
date Sun, 06 Jun 2010 05:23:51 +0900
parents
children e089ac9ea221
line wrap: on
line source

#include "game_scene01.h"

void
create_object(void *sgroot_, int w, int h) 
{
  SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
  SceneGraphPtr dandy, rdandy, rtdandy, ldandy, ltdandy;
  //SceneGraphPtr tmp[5] = {ldandy, ltdandy, dandy, rtdandy, rtdandy};
  //dandys = tmp;

  SceneGraphPtr back = sgroot->createSceneGraph(); 
  
  dandy   = sgroot->createSceneGraph("mydandy");
  ldandy  = sgroot->createSceneGraph("l-dandy");
  ltdandy = sgroot->createSceneGraph("lt-dandy");
  rdandy  = sgroot->createSceneGraph("r-dandy");
  rtdandy = sgroot->createSceneGraph("rt-dandy");

  dandy->xyz[0]   = w/2;
  dandy->xyz[1]   = h*0.9;

  dandy->set_move_collision(dandy_move, dandy_collision);
  //ldandy->set_move_collision(dandy_move, dandy_collision);
  ltdandy->set_move_collision(dandy_move, dandy_collision);
  rdandy->set_move_collision(dandy_move, dandy_collision);
  rtdandy->set_move_collision(dandy_move, dandy_collision);
  
  back->addChild(dandy);  
  sgroot->setSceneData(back);
}