Mercurial > hg > Members > tkaito > task_dandy
changeset 22:958a55ce0d98
add new files.
author | koba <koba@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 18 Oct 2010 02:55:17 +0900 |
parents | fd9deaa67de9 |
children | 3fb8a6a34e24 |
files | ppe/GreenCrabMove.cc ppe/Property.h ppe/TitleMove.h |
diffstat | 3 files changed, 51 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- /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 <stdio.h> +#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; +}
--- /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
--- 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