annotate TaskManager/Test/test_render/Application/ieshoot.cc @ 539:7b4434d6f078

SGList isn't used
author tkaito@henri.cr.ie.u-ryukyu.ac.jp
date Wed, 21 Oct 2009 19:56:00 +0900
parents d47c5d865970
children e40b32f0f71e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
1 #include "SceneGraphRoot.h"
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
2
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
3 static const float jiki_speed = 6.0f;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
4 static const float jiki_radius = 32.0f;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
5
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
6 static const float tama_speed = 10.0f;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
7 static const float tama_radius = 16.0f;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
8
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
9 static const float boss_radius_x = 64.0f;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
10 static const float boss_radius_y = 128.0f;
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
11
205
gongo@localhost.localdomain
parents: 203
diff changeset
12 static const float iebosstama_speed = 15.0f;
gongo@localhost.localdomain
parents: 203
diff changeset
13
gongo@localhost.localdomain
parents: 203
diff changeset
14 static void
gongo@localhost.localdomain
parents: 203
diff changeset
15 ieboss_collision(SceneGraphPtr node, int screen_w, int screen_h,
gongo@localhost.localdomain
parents: 203
diff changeset
16 SceneGraphPtr tree);
gongo@localhost.localdomain
parents: 203
diff changeset
17 static void
gongo@localhost.localdomain
parents: 203
diff changeset
18 ieboss_collision_invincibil(SceneGraphPtr node, int screen_w, int screen_h, SceneGraphPtr tree);
gongo@localhost.localdomain
parents: 203
diff changeset
19 static void ieboss_move(SceneGraphPtr node, int screen_w, int screen_h);
gongo@localhost.localdomain
parents: 203
diff changeset
20
gongo@localhost.localdomain
parents: 203
diff changeset
21 static void iebosstama_move(SceneGraphPtr node, int screen_w, int screen_h);
gongo@localhost.localdomain
parents: 203
diff changeset
22
gongo@localhost.localdomain
parents: 203
diff changeset
23
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
24 static void
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
25 iejiki_collision(SceneGraphPtr node, int screen_w, int screen_h,
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
26 SceneGraphPtr tree)
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
27 {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
28 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
29
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
30 static void
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
31 ietama_collision(SceneGraphPtr node, int screen_w, int screen_h,
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
32 SceneGraphPtr tree)
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
33 {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
34 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
35
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
36 static void
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
37 ieboss_collision(SceneGraphPtr node, int screen_w, int screen_h,
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
38 SceneGraphPtr tree)
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
39 {
539
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
40 #if 0
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
41 SceneGraphIteratorPtr it = sgroot->getIterator(tree);
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
42 static int damage = 0;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
43
202
3f4c6a75d7e0 fix SceneGraphIterator::hasNext(), next()
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 201
diff changeset
44 for (; it->hasNext(IETAMA);) {
3f4c6a75d7e0 fix SceneGraphIterator::hasNext(), next()
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 201
diff changeset
45 it->next(IETAMA);
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
46 SceneGraphPtr tama = it->get();
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
47
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
48 if (node->xyz[0] - boss_radius_x < tama->xyz[0] + tama_radius
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
49 && node->xyz[0] + boss_radius_x > tama->xyz[0] - tama_radius
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
50 && node->xyz[1] + boss_radius_y > tama->xyz[1] - tama_radius) {
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
51 tama->remove();
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
52
205
gongo@localhost.localdomain
parents: 203
diff changeset
53 node->set_move_collision(ieboss_move, ieboss_collision_invincibil);
gongo@localhost.localdomain
parents: 203
diff changeset
54
539
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
55 SceneGraphPtr iebosstama = sgroot->createSceneGraph("Earth");
205
gongo@localhost.localdomain
parents: 203
diff changeset
56 iebosstama->set_move_collision(iebosstama_move, ietama_collision);
gongo@localhost.localdomain
parents: 203
diff changeset
57 iebosstama->xyz[0] = node->xyz[0];
gongo@localhost.localdomain
parents: 203
diff changeset
58 iebosstama->xyz[1] = node->xyz[1] + boss_radius_y;
206
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
59 //iebosstama->xyz[2] = 50.0f;
205
gongo@localhost.localdomain
parents: 203
diff changeset
60 node->addBrother(iebosstama);
gongo@localhost.localdomain
parents: 203
diff changeset
61
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
62 damage++;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
63 }
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
64 }
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
65
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
66 if (damage > 10) {
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
67 node->remove();
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
68 }
539
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
69 #endif
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
70 }
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
71
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
72 static void
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
73 ieboss_move(SceneGraphPtr node, int screen_w, int screen_h)
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
74 {
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
75 /**
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
76 * TODO
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
77 * Boss が複数居た場合、これじゃ駄目
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
78 */
357
953811245b63 fix spe/DrawSpan.{cpp, h} spe/DrawSpanRenew.cpp
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 206
diff changeset
79 static float x_speed = 5.0f;
953811245b63 fix spe/DrawSpan.{cpp, h} spe/DrawSpanRenew.cpp
root@henri.cr.ie.u-ryukyu.ac.jp
parents: 206
diff changeset
80 static float z_speed = 5.0f;
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
81
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
82 node->xyz[0] += x_speed;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
83
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
84 if (node->xyz[0] - boss_radius_x < 0) {
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
85 x_speed = -x_speed;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
86 node->xyz[0] = boss_radius_x;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
87 } else if (node->xyz[0] + boss_radius_x > screen_w) {
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
88 x_speed = -x_speed;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
89 node->xyz[0] = screen_w - boss_radius_x;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
90 }
206
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
91
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
92 //node->xyz[2] += z_speed;
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
93 if (node->xyz[2] >= 100.0f) {
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
94 node->xyz[2] = 99.99f;
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
95 z_speed = -z_speed;
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
96 } else if (node->xyz[2] <= -100.0f) {
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
97 node->xyz[2] = -99.99f;
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
98 z_speed = -z_speed;
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
99 }
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
100 }
539
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
101 #if 0
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
102 static void
205
gongo@localhost.localdomain
parents: 203
diff changeset
103 ieboss_collision_invincibil(SceneGraphPtr node, int screen_w, int screen_h,
gongo@localhost.localdomain
parents: 203
diff changeset
104 SceneGraphPtr tree)
gongo@localhost.localdomain
parents: 203
diff changeset
105 {
gongo@localhost.localdomain
parents: 203
diff changeset
106 static int frame = 0;
gongo@localhost.localdomain
parents: 203
diff changeset
107
gongo@localhost.localdomain
parents: 203
diff changeset
108 frame++;
gongo@localhost.localdomain
parents: 203
diff changeset
109
gongo@localhost.localdomain
parents: 203
diff changeset
110 node->flag_drawable ^= 1;
gongo@localhost.localdomain
parents: 203
diff changeset
111
gongo@localhost.localdomain
parents: 203
diff changeset
112 if (frame > 60) {
gongo@localhost.localdomain
parents: 203
diff changeset
113 frame = 0;
gongo@localhost.localdomain
parents: 203
diff changeset
114 node->flag_drawable = 1;
gongo@localhost.localdomain
parents: 203
diff changeset
115 node->set_move_collision(ieboss_move, ieboss_collision);
gongo@localhost.localdomain
parents: 203
diff changeset
116 }
gongo@localhost.localdomain
parents: 203
diff changeset
117 }
gongo@localhost.localdomain
parents: 203
diff changeset
118
gongo@localhost.localdomain
parents: 203
diff changeset
119 static void
gongo@localhost.localdomain
parents: 203
diff changeset
120 iebosstama_move(SceneGraphPtr node, int screen_w, int screen_h)
gongo@localhost.localdomain
parents: 203
diff changeset
121 {
gongo@localhost.localdomain
parents: 203
diff changeset
122 node->xyz[1] += iebosstama_speed;
gongo@localhost.localdomain
parents: 203
diff changeset
123
gongo@localhost.localdomain
parents: 203
diff changeset
124 // 描画領域から抜けたら削除
gongo@localhost.localdomain
parents: 203
diff changeset
125 if (node->xyz[1] > screen_h) {
gongo@localhost.localdomain
parents: 203
diff changeset
126 node->remove();
gongo@localhost.localdomain
parents: 203
diff changeset
127 }
gongo@localhost.localdomain
parents: 203
diff changeset
128 }
539
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
129 #endif
205
gongo@localhost.localdomain
parents: 203
diff changeset
130
gongo@localhost.localdomain
parents: 203
diff changeset
131 static void
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
132 ietama_move(SceneGraphPtr node, int screen_w, int screen_h)
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
133 {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
134 node->xyz[1] -= tama_speed;
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
135
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
136 // 描画領域から抜けたら削除
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
137 if (node->xyz[1] < 0) {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
138 node->remove();
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
139 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
140 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
141
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
142 static void
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
143 iejiki_move(SceneGraphPtr node, int screen_w, int screen_h)
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
144 {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
145 Pad *pad = sgroot->getController();
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
146
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
147 if (pad->left.isPush()
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
148 || pad->left.isHold()) {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
149 node->xyz[0] -= jiki_speed;
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
150
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
151 if (node->xyz[0] - jiki_radius< 0) {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
152 node->xyz[0] = jiki_radius;
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
153 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
154 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
155
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
156 if (pad->right.isPush()
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
157 || pad->right.isHold()) {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
158 node->xyz[0] += jiki_speed;
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
159
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
160 if (node->xyz[0] + jiki_radius > screen_w) {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
161 node->xyz[0] = screen_w - jiki_radius;
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
162 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
163 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
164
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
165 if (pad->up.isPush()
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
166 || pad->up.isHold()) {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
167 node->xyz[1] -= jiki_speed;
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
168
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
169 if (node->xyz[1] - jiki_radius < 0) {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
170 node->xyz[1] = jiki_radius;
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
171 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
172 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
173
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
174 if (pad->down.isPush()
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
175 || pad->down.isHold()) {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
176 node->xyz[1] += jiki_speed;
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
177
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
178 if (node->xyz[1] + jiki_radius > screen_h) {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
179 node->xyz[1] = screen_h - jiki_radius;
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
180 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
181 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
182
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
183 if (pad->circle.isPush()) {
539
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
184 SceneGraphPtr ietama = sgroot->createSceneGraph("IETAMA");
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
185 ietama->set_move_collision(ietama_move, ietama_collision);
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
186 ietama->xyz[0] = node->xyz[0];
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
187 ietama->xyz[1] = node->xyz[1];
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
188 node->addBrother(ietama);
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
189 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
190 }
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
191
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
192
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
193 void
397
a4f690f44842 delete manager (in kernel/ppe/TaskManager.h)
game@henri.cr.ie.u-ryukyu.ac.jp
parents: 357
diff changeset
194 ieshoot_init(TaskManager *manager)
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
195 {
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
196 SceneGraphPtr iejiki;
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
197 SceneGraphPtr enemy;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
198 SceneGraphPtr back;
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
199
539
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
200 sgroot->createFromXMLmemory(manager, "xml_file/ietama.xml");
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
201 sgroot->createFromXMLmemory(manager, "xml_file/ieboss.xml");
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
202 sgroot->createFromXMLmemory(manager, "xml_file/iejiki.xml");
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
203 sgroot->createFromXMLmemory(manager, "xml_file/universe.xml");
203
5c6c9667ac61 fix CreateSpan::run
gongo@localhost.localdomain
parents: 202
diff changeset
204
5c6c9667ac61 fix CreateSpan::run
gongo@localhost.localdomain
parents: 202
diff changeset
205 back = sgroot->createSceneGraph();
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
206
539
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
207 iejiki = sgroot->createSceneGraph("IEJIKI");
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
208 iejiki->set_move_collision(iejiki_move, iejiki_collision);
206
dee3b5092a70 add Camera
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 205
diff changeset
209 iejiki->xyz[2] = 20;
203
5c6c9667ac61 fix CreateSpan::run
gongo@localhost.localdomain
parents: 202
diff changeset
210 back->addChild(iejiki);
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
211
539
7b4434d6f078 SGList isn't used
tkaito@henri.cr.ie.u-ryukyu.ac.jp
parents: 405
diff changeset
212 enemy = sgroot->createSceneGraph("IEBOSS");
201
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
213 enemy->set_move_collision(ieboss_move, ieboss_collision);
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
214 enemy->xyz[1] = boss_radius_y;
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
215 back->addChild(enemy);
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
216
b257e27d995c add SceneGraphIterator
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents: 199
diff changeset
217 sgroot->setSceneData(back);
199
eb20274baa7c add SceneGraph(ieshoot), add SystemSceneGraph(Camera)
gongo@gendarme.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
218 }