2
|
1 #include <math.h>
|
|
2 #include "SceneGraphRoot.h"
|
|
3 #include "dandy.h"
|
|
4
|
|
5 void
|
|
6 title_idle(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
|
|
7 {
|
|
8
|
|
9 }
|
|
10
|
|
11 MainLoopPtr
|
|
12 dandy::init(Viewer *sgroot, int w, int h)
|
|
13 {
|
|
14 SceneGraphPtr back, title;
|
|
15
|
4
|
16 sgroot->createFromXMLfile("xml/mydandy.xml");
|
|
17 sgroot->createFromXMLfile("xml/title2.xml");
|
|
18 sgroot->createFromXMLfile("xml/gameover.xml");
|
|
19 sgroot->createFromXMLfile("xml/enemy_greenclab.xml");
|
6
|
20 sgroot->createFromXMLfile("xml/bluebullet.xml");
|
|
21 sgroot->createFromXMLfile("xml/redbullet.xml");
|
|
22
|
4
|
23
|
2
|
24
|
|
25 back = sgroot->createSceneGraph();
|
|
26 title = sgroot->createSceneGraph("title001");
|
|
27 title->xyz[0] = w/2;
|
|
28 title->xyz[1] = h/2;
|
|
29 title->set_move_collision(title_idle, title_collision);
|
|
30 back->addChild(title);
|
|
31
|
|
32 sgroot->setSceneData(back);
|
|
33
|
|
34 //mydandy = sgroot->getSgid("mydandy01");
|
|
35 //enemy = sgroot->getSgid("ENEMY");
|
|
36
|
|
37 return sgroot;
|
|
38 }
|
|
39
|
|
40 extern Application *
|
|
41 application() {
|
|
42 return new dandy();
|
|
43 }
|
|
44
|
|
45 const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";
|
|
46
|
|
47 extern int init(TaskManager *manager, int argc, char *argv[]);
|
|
48 extern void task_initialize();
|
|
49 static void TMend(TaskManager *manager);
|
|
50
|
|
51 int
|
|
52 TMmain(TaskManager *manager, int argc, char *argv[])
|
|
53 {
|
|
54 task_initialize();
|
|
55 manager->set_TMend(TMend);
|
|
56 return init(manager, argc, argv);
|
|
57
|
|
58 }
|
|
59
|
|
60 void
|
|
61 TMend(TaskManager *manager)
|
|
62 {
|
|
63 printf("game end\n");
|
|
64 }
|