view dandy.cc @ 10:93d9db48775f default tip

Property add not move. 30%
author tkaito
date Mon, 14 Jun 2010 17:20:03 +0900
parents b87dcc11a6d0
children
line wrap: on
line source

#include <math.h>
#include "SceneGraphRoot.h"
#include "dandy.h"

void
title_idle(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
{

}

void
init_charactor(Viewer *sgroot)
{
  sgroot->createFromXMLfile("xml/mydandy.xml");
  sgroot->createFromXMLfile("xml/gameover.xml");
  sgroot->createFromXMLfile("xml/greencrab.xml");
  sgroot->createFromXMLfile("xml/bluebullet.xml");
  sgroot->createFromXMLfile("xml/redbullet.xml");

}

MainLoopPtr
dandy::init(Viewer *sgroot, int w, int h)
{
  SceneGraphPtr back, title;
  sgroot->createFromXMLfile("xml/title2.xml");  
  
  init_charactor(sgroot);

  back  = sgroot->createSceneGraph();
  title = sgroot->createSceneGraph("title001");
  title->xyz[0] = w/2;
  title->xyz[1] = h/2;
  title->set_move_collision(title_idle, title_collision);  
  back->addChild(title);

  sgroot->setSceneData(back);

  //mydandy = sgroot->getSgid("mydandy01");
  //enemy = sgroot->getSgid("ENEMY");
  
  return sgroot;
}

extern Application *
application() {
    return new dandy();
}

const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";

extern int init(TaskManager *manager, int argc, char *argv[]);
extern void task_initialize();
static void TMend(TaskManager *manager);

int
TMmain(TaskManager *manager, int argc, char *argv[])
{
    task_initialize();
    manager->set_TMend(TMend);
    return init(manager, argc, argv);

}

void
TMend(TaskManager *manager)
{
    printf("game end\n");
}