# HG changeset patch # User koba # Date 1287338117 -32400 # Node ID 958a55ce0d98d89455dd4a5d1827751b5d95d9aa # Parent fd9deaa67de926f76bcf4234ff44dc5b68556eab add new files. diff -r fd9deaa67de9 -r 958a55ce0d98 ppe/GreenCrabMove.cc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppe/GreenCrabMove.cc Mon Oct 18 02:55:17 2010 +0900 @@ -0,0 +1,30 @@ +#include +#include "SchedTask.h" +#include "Property.h" +#include "Pad.h" +#include "Func.h" + +/* これは必須 */ +SchedDefineTask1(CrabMove, crabmove); + +static int +crabmove(SchedTask *s,void *rbuf, void *wbuf) +{ + Pad* pad; + ObjPropertyPtr i_obj, o_obj; + + i_obj = (ObjPropertyPtr)s->get_input(rbuf, 0); + pad = (Pad*)s->get_input(rbuf, 1); + o_obj = (ObjPropertyPtr)s->get_output(wbuf, 0); + + if(pad->right.isPush() || pad->right.isHold()) { + i_obj->x += i_obj->vx; + } + if(pad->down.isPush() || pad->down.isHold()) { + i_obj->y += i_obj->vy; + } + + o_obj = i_obj; + + return 0; +} diff -r fd9deaa67de9 -r 958a55ce0d98 ppe/Property.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ppe/Property.h Mon Oct 18 02:55:17 2010 +0900 @@ -0,0 +1,21 @@ +#ifndef INCLUDED_TASK_HELLO +#define INCLUDED_TASK_HELLO + +#ifndef INCLUDED_SCHED_TASK +# include "SchedTask.h" +#endif + +typedef struct { + double x, y; //16 + double vx, vy; //16 + int frame; //4 + const char *chara; //1 + int vital; //4 + int score; //4 + void *parent; //4 + void *root; //4 + int flag; //4 + char a, i, u; //3 +} *ObjPropertyPtr, ObjProperty; + +#endif diff -r fd9deaa67de9 -r 958a55ce0d98 ppe/TitleMove.h --- a/ppe/TitleMove.h Mon Oct 18 02:52:52 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +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); -}; - */ - -typedef struct { - double x, y; //8? - double vx, vy; //8? - int frame; //4 - const char *chara; - int vital; //4 - int score; //4 - void *parent; - void *root; - int flag; - -} *ObjPropertyPtr, ObjProperty; - -#endif