# HG changeset patch # User tkaito # Date 1275774465 -32400 # Node ID e089ac9ea221b1383ce6ac34c26a2aa7c31951f2 # Parent dca6d5d2ef46ffc5204b788764cd2fe43fa31612 greenclab add. not complete... diff -r dca6d5d2ef46 -r e089ac9ea221 Makefile.macosx --- a/Makefile.macosx Sun Jun 06 05:23:51 2010 +0900 +++ b/Makefile.macosx Sun Jun 06 06:47:45 2010 +0900 @@ -20,7 +20,7 @@ viewer : $(VIEWER_OBJ) $(CC) -o $@ $? $(LIBS) -DANDY_OBJ = dandy.o title.o game_over.o mydandy.o game_scene01.o +DANDY_OBJ = dandy.o title.o game_over.o mydandy.o game_scene01.o greenclab.o dandy : $(DANDY_OBJ) $(CC) -o $@ $? $(LIBS) diff -r dca6d5d2ef46 -r e089ac9ea221 blender/enemy_greenclab.blend Binary file blender/enemy_greenclab.blend has changed diff -r dca6d5d2ef46 -r e089ac9ea221 blender/enemy_greenclab.blend1 Binary file blender/enemy_greenclab.blend1 has changed diff -r dca6d5d2ef46 -r e089ac9ea221 dandy.cc --- a/dandy.cc Sun Jun 06 05:23:51 2010 +0900 +++ b/dandy.cc Sun Jun 06 06:47:45 2010 +0900 @@ -2,13 +2,6 @@ #include "SceneGraphRoot.h" #include "dandy.h" - -void -dandy_move_idle(SceneGraphPtr node, int w, int h) -{ - -} - void title_idle(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h) { @@ -20,9 +13,11 @@ { SceneGraphPtr back, title; - sgroot->createFromXMLfile( "xml/mydandy.xml"); - sgroot->createFromXMLfile( "xml/title2.xml"); - sgroot->createFromXMLfile( "xml/gameover.xml"); + sgroot->createFromXMLfile("xml/mydandy.xml"); + sgroot->createFromXMLfile("xml/title2.xml"); + sgroot->createFromXMLfile("xml/gameover.xml"); + sgroot->createFromXMLfile("xml/enemy_greenclab.xml"); + back = sgroot->createSceneGraph(); title = sgroot->createSceneGraph("title001"); diff -r dca6d5d2ef46 -r e089ac9ea221 game_scene01.cc --- a/game_scene01.cc Sun Jun 06 05:23:51 2010 +0900 +++ b/game_scene01.cc Sun Jun 06 06:47:45 2010 +0900 @@ -4,27 +4,45 @@ create_object(void *sgroot_, int w, int h) { SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_; - SceneGraphPtr dandy, rdandy, rtdandy, ldandy, ltdandy; //SceneGraphPtr tmp[5] = {ldandy, ltdandy, dandy, rtdandy, rtdandy}; //dandys = tmp; SceneGraphPtr back = sgroot->createSceneGraph(); - + + /* 自機 */ + SceneGraphPtr dandy, rdandy, rtdandy, ldandy, ltdandy; dandy = sgroot->createSceneGraph("mydandy"); ldandy = sgroot->createSceneGraph("l-dandy"); ltdandy = sgroot->createSceneGraph("lt-dandy"); rdandy = sgroot->createSceneGraph("r-dandy"); rtdandy = sgroot->createSceneGraph("rt-dandy"); - dandy->xyz[0] = w/2; - dandy->xyz[1] = h*0.9; + dandy->xyz[0] = w/2; + dandy->xyz[1] = h*0.9; dandy->set_move_collision(dandy_move, dandy_collision); - //ldandy->set_move_collision(dandy_move, dandy_collision); + ldandy->set_move_collision(dandy_move, dandy_collision); ltdandy->set_move_collision(dandy_move, dandy_collision); rdandy->set_move_collision(dandy_move, dandy_collision); rtdandy->set_move_collision(dandy_move, dandy_collision); + + /* 敵機 */ + SceneGraphPtr gclab; + gclab = sgroot->createSceneGraph("green_clab"); + + gclab->xyz[0] = w/2; + gclab->xyz[1] = h/2; - back->addChild(dandy); + gclab->set_move_collision(gclab_move, gclab_collision); + + //stage_plan(); + + back->addChild(dandy); + back->addChild(gclab); sgroot->setSceneData(back); } + +void +stage_plan() { + //TODO : stageの設計。stageも幾つかに分けるべき? +} diff -r dca6d5d2ef46 -r e089ac9ea221 game_scene01.h --- a/game_scene01.h Sun Jun 06 05:23:51 2010 +0900 +++ b/game_scene01.h Sun Jun 06 06:47:45 2010 +0900 @@ -3,3 +3,8 @@ void dandy_move(SceneGraphPtr node, void *sgroot_, int w, int h); void dandy_collision(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree); + +void gclab_move(SceneGraphPtr node, void *sgroot_, int w, int h); +void gclab_collision(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree); + + diff -r dca6d5d2ef46 -r e089ac9ea221 greenclab.cc --- a/greenclab.cc Sun Jun 06 05:23:51 2010 +0900 +++ b/greenclab.cc Sun Jun 06 06:47:45 2010 +0900 @@ -1,47 +1,23 @@ -#include -#include "SceneGraphRoot.h" -#include "SGList.h" +#include "game_scene01.h" + +void +gclab_move(SceneGraphPtr node, void *sgroot_, int w, int 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); +/* + if (w > node->xyz[0]) { + } else if (0 < node->xyz[0]) { + } + if (0 < node->xyz[1]) { + } else if (h > node->xyz[1]) { + } +*/ +} -static void -greenclab_move(SceneGraphPtr node, int w, int h) +void +gclab_collision(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree) { } -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); -} diff -r dca6d5d2ef46 -r e089ac9ea221 xml/enemy_greenclab.h --- a/xml/enemy_greenclab.h Sun Jun 06 05:23:51 2010 +0900 +++ b/xml/enemy_greenclab.h Sun Jun 06 06:47:45 2010 +0900 @@ -1,1 +1,1 @@ -#define greenclab scene_graph +#define green_clab scene_graph diff -r dca6d5d2ef46 -r e089ac9ea221 xml/enemy_greenclab.xml --- a/xml/enemy_greenclab.xml Sun Jun 06 05:23:51 2010 +0900 +++ b/xml/enemy_greenclab.xml Sun Jun 06 06:47:45 2010 +0900 @@ -1,6 +1,6 @@ - + 30.113185 30.098001 0.000000 -30.052460 30.098014 0.000000