annotate Renderer/Test_/game_over.cc @ 4:b5b462ac9b3b

Cerium Blender ball_bound
author Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
date Mon, 29 Nov 2010 16:42:42 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include "SceneGraphRoot.h"
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #include "vacuum.h"
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 void
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 gameover_scene(int w,int h,SceneGraphPtr node, SceneGraphRoot *sgroot)
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 {
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 SceneGraphPtr over;
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 over = sgroot->createSceneGraph("GAMEOVER");
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 over->xyz[0] = w/2;
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 over->xyz[1] = h/2;
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 over->set_move_collision(gameover_idle,gameover_collision);
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 node->addBrother(over);
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 }
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 void
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 gameover_idle(SceneGraphPtr node, void *sgroot_, int screen_w,int screen_h)
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 {
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 }
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 void
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 gameover_collision(SceneGraphPtr node, void *sgroot_, int screen_w,int screen_h,SceneGraphPtr tree)
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 {
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 Pad *pad = sgroot->getController();
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 if(pad->start.isPush()) {
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 SceneGraphPtr title;
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 title = sgroot->createSceneGraph("TITLE");
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 title->xyz[0] = screen_w/2;
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 title->xyz[1] = screen_h/2;
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 title->set_move_collision(no_move_idle, title_collision);
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 sgroot->setSceneData(title);
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 }
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39
b5b462ac9b3b Cerium Blender ball_bound
Daiki KINJYO <e085722@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 }