diff greenclab.cc @ 2:69b4108bf4e8

refact few
author tkaito
date Sun, 06 Jun 2010 03:22:11 +0900
parents
children e089ac9ea221
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/greenclab.cc	Sun Jun 06 03:22:11 2010 +0900
@@ -0,0 +1,47 @@
+#include <math.h>
+#include "SceneGraphRoot.h"
+#include "SGList.h"
+
+static void greenclab_move(SceneGraphPtr node, int screen_w, int screen_h);
+static void greenclab_move_idle(SceneGraphPtr node, int screen_w, int screen_h);
+static void greenclab_collision(SceneGraphPtr node, int screen_w, int screen_h,
+			   SceneGraphPtr tree);
+void create_greenclab(TaskManager *manager, int number);
+
+static void 
+greenclab_move(SceneGraphPtr node, int w, int h)
+{
+
+}
+
+static void 
+greenclab_move_idle(SceneGraphPtr node, int w, int h)
+{
+  node->xyz[1] += 2.0f;
+  node->xyz[2] = 0.0f;
+}
+
+static void 
+greenclab_collision(SceneGraphPtr node, int w, int h, SceneGraphPtr tree)
+{
+
+}
+
+void 
+create_greenclab(TaskManager *manager, int w, int h)
+{
+  SceneGraphPtr greenclab;
+  SceneGraphPtr back;
+
+  sgroot->createFromXMLfile(manager, "xml/enemy_greenclab.xml");
+
+  back = sgroot->createSceneGraph();
+  greenclab = sgroot->createSceneGraph(greenclab);
+  greenclab->xyz[0] = w/2;
+  greenclab->xyz[1] = 0.0f;
+  greenclab->set_move_collision(greenclab_move_idle, greenclab_collision);
+
+  back->addChild(greenclab);
+
+  sgroot->setSceneData(back);
+}