changeset 8:7c60ef3fca5b

test
author tkaito
date Wed, 07 Jul 2010 03:11:52 +0900
parents c015109a6041
children dea6d34c8e91
files dandy.h main.cc mydandy.cc ppe/Twice.cc ppe/Twice.h schedule.cc spe/Twice.cc spe/Twice.h stage_init.cc title.cc
diffstat 10 files changed, 30 insertions(+), 169 deletions(-) [+]
line wrap: on
line diff
--- a/dandy.h	Tue Jun 29 04:25:32 2010 +0900
+++ b/dandy.h	Wed Jul 07 03:11:52 2010 +0900
@@ -29,6 +29,7 @@
   
 } *ObjPropertyPtr, ObjProperty;
 
+extern ObjProperty back_property;
 extern ObjPropertyPtr charactor;
 
 static const int ENEMY_NUM = 1;
--- a/main.cc	Tue Jun 29 04:25:32 2010 +0900
+++ b/main.cc	Wed Jul 07 03:11:52 2010 +0900
@@ -35,10 +35,10 @@
   sgroot->createFromXMLfile("xml/redbullet.xml");
   sgroot->createFromXMLfile("xml/title2.xml");  
 
-  for (int i = 0; i < ENEMY_NUM; i++) {
-    charactor[0].root  = (void*)sgroot->createSceneGraph(status[0].charano);
-    charactor[0].score = status[0].score;
-    charactor[0].vital = status[0].vital;
+  for (int i = 0; i < 2; i++) {
+    charactor[i].root  = (void*)sgroot->createSceneGraph(status[i].charano);
+    charactor[i].score = status[i].score;
+    charactor[i].vital = status[i].vital;
    }
 
 }
--- a/mydandy.cc	Tue Jun 29 04:25:32 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#include "dandy.h"
-
-void shot_move(SceneGraphPtr node, void *sgroot_, int w, int h);
-void shot_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree);
-
-void
-dandy_move(SceneGraphPtr node, void *sgroot_, int w, int h)
-{
-  SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
-  Pad *pad = sgroot->getController();
-
-  if (pad->right.isHold() && w > node->xyz[0]) {
-    node->xyz[0] += 10.0f;
-  } else if (pad->left.isHold() && 0 < node->xyz[0]) {
-    node->xyz[0] -= 10.0f;
-  }
-  if (pad->up.isHold() && 0 < node->xyz[1]) {
-    node->xyz[1] -= 10.0f;
-  } else if (pad->down.isHold() && h > node->xyz[1]) {
-    node->xyz[1] += 10.0f;
-  }
-  if (pad->circle.isPush()) {
-    SceneGraphPtr shot = sgroot->createSceneGraph("bluebullet");
-    shot->set_move_collision(shot_move, shot_coll);
-    shot->xyz[0] = node->xyz[0];
-    shot->xyz[1] = node->xyz[1] - player_radius;
-    node->addBrother(shot);
-  }
-}
-
-void
-dandy_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree)
-{
-/*
-  SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
-  SceneGraphIteratorPtr it = sgroot->getIterator(tree);
-  collision_obj(it, node, w, h, sgroot);
-*/
-}
-
-
-void
-shot_move(SceneGraphPtr node, void *sgroot_, int w, int h)
-{
-  node->xyz[1] -= shot_speed;
-
-  if (node->xyz[1] < 0) {
-    node->remove();
-  }
-}
-void
-shot_coll(SceneGraphPtr node, void *sgroot_, int w, int h,SceneGraphPtr tree){}
-
-
-void
-collision_obj(SceneGraphIteratorPtr it,SceneGraphPtr node ,int w, int h, void *sgroot_){}
--- a/ppe/Twice.cc	Tue Jun 29 04:25:32 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#include <stdio.h>
-#include "SchedTask.h"
-#include "Twice.h"
-#include "Func.h"
-
-/* これは必須 */
-SchedDefineTask(Twice);
-
-static int
-run(SchedTask *s,void *rbuf, void *wbuf)
-{
-    int *i_data;
-    int *o_data;
-    long length;
-
-    i_data = (int*)s->get_input(rbuf, 0);
-    o_data = (int*)s->get_output(wbuf, 0);
-    length = (long)s->get_param(0);
-    
-    for (int i = 0; i < length; i++) {
-	o_data[i] = i_data[i] * 2;
-    }
-    
-    return 0;
-}
--- a/ppe/Twice.h	Tue Jun 29 04:25:32 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#ifndef INCLUDED_TASK_HELLO
-#define INCLUDED_TASK_HELLO
-
-#ifndef INCLUDED_SCHED_TASK
-#  include "SchedTask.h"
-#endif
-/*
-class Twice : public SchedTask {
-public:
-    SchedConstructor(Twice);
-    
-    int run(void *r, void *w);
-};
- */
-
-#endif
--- a/schedule.cc	Tue Jun 29 04:25:32 2010 +0900
+++ b/schedule.cc	Wed Jul 07 03:11:52 2010 +0900
@@ -8,15 +8,26 @@
 void
 schedule(SceneGraphPtr node, void *sgroot_, int w, int h) 
 {
+  SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
+  Pad *pad = sgroot->getController();
+  if(back_property.flag == 0){
+    if(pad->start.isPush()) {
+      back_property.flag = 1;
+      //node->children->remove();
+      sgroot->setSceneData(node);
+    }
+  }
+
+  if(back_property.flag == 1) {
   switch (node->frame) {
   case 1:
     break;    
-  case FRAME_RATE * 2:
-    Putenemy(1, w/2, 0, 2, 4, MOVE_00, MOVE_00, node, sgroot_);
+  case FRAME_RATE * 10:
+    Putenemy(1, w/2, 0, 2, 4, MOVE_00, MOVE_00, node, sgroot);
     break;
-  case FRAME_RATE * 3:
-    Putenemy(1, w/3, 0, 0, 8, MOVE_00, MOVE_00, node, sgroot_);
-    Putenemy(1, w/2, 0, 0, 8, MOVE_00, MOVE_00, node, sgroot_);
+  case FRAME_RATE * 20:
+    Putenemy(1, w/3, 0, 0, 8, MOVE_00, MOVE_00, node, sgroot);
+    Putenemy(1, w/2, 0, 0, 8, MOVE_00, MOVE_00, node, sgroot);
     break;
     /*
   case FRAME_RATE * 4:
@@ -225,6 +236,7 @@
   }
     */
   }
+  }
 }
 
 ObjProperty enemy[300];
@@ -242,7 +254,7 @@
   enemy1->xyz[1] = e->y;
 
   back1->addChild(enemy1);
-
+  
 }
 
 void
@@ -272,16 +284,16 @@
   e->score = charactor[charano].score;
   //e->dt1 = e->dt2 = 0;
   //e->tama = tf;
-
+  
   obj->xyz[0] = x;
   obj->xyz[1] = y;
   obj->stack_xyz[0] = sx;
   obj->stack_xyz[1] = sy;
 
-  int size = sizeof(ObjPropertyPtr);
+  int size = sizeof(ObjPropertyPtr)*16;
   //obj->set_move_collision(move, coll);
   sgroot->set_game_task(move, e, size, create_enemy);
-
-  node->addChild(obj);
   
+  //node->addChild(obj);
+  //node->setSceneData();
 }
--- a/spe/Twice.cc	Tue Jun 29 04:25:32 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#include <stdio.h>
-#include "SchedTask.h"
-#include "Twice.h"
-#include "Func.h"
-
-/* これは必須 */
-SchedDefineTask(Twice);
-
-static int
-run(SchedTask *s, void *rbuf, void *wbuf)
-{
-    int *i_data;
-    int *o_data;
-    int length;
-
-    i_data = (int*)s->get_input(rbuf, 0);
-    o_data = (int*)s->get_output(wbuf, 0);
-    length = (long)s->get_param(0);
-    
-    for (int i = 0; i < length; i++) {
-	o_data[i] = i_data[i] * 2;
-    }
-    
-    return 0;
-}
--- a/spe/Twice.h	Tue Jun 29 04:25:32 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#ifndef INCLUDED_TASK_HELLO
-#define INCLUDED_TASK_HELLO
-
-#ifndef INCLUDED_SCHED_TASK
-#  include "SchedTask.h"
-#endif
-/*
-class Twice : public SchedTask {
-public:
-    SchedConstructor(Twice);
-    
-    int run(void *r, void *w);
-};
- */
-
-#endif
--- a/stage_init.cc	Tue Jun 29 04:25:32 2010 +0900
+++ b/stage_init.cc	Wed Jul 07 03:11:52 2010 +0900
@@ -27,6 +27,8 @@
 
 }
 
+ObjProperty back_property;
+
 void
 create_back(void *sgroot_, int w, int h) 
 {
@@ -36,6 +38,7 @@
   back = sgroot->createSceneGraph();
   back->set_move_collision(back_move, back_coll);
   sgroot->setSceneData(back);
+  back_property.flag = 0;
 
   charactor[0].x  = w/2;
   charactor[0].y  = h/2;
--- a/title.cc	Tue Jun 29 04:25:32 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#include "dandy.h"
-
-void
-title_move(SceneGraphPtr node, void *sgroot_, int w, int h, ObjPropertyPtr charactor)
-{
-  SceneGraphRoot *sgroot = (SceneGraphRoot *)sgroot_;
-  Pad *pad = sgroot->getController();
-  
-  if(pad->start.isPush()) {
-    create_stage(sgroot, w, h, charactor);
-  }
-}
-
-void
-title_coll(SceneGraphPtr node, void *sgroot_, int w, int h, SceneGraphPtr tree)
-{
-}