Mercurial > hg > Members > koba > t_dandy
view ppe/asteroid.cc @ 65:b97628fca317
int -> long. not move on ABIBIT=64.
author | tkaito |
---|---|
date | Thu, 17 Feb 2011 04:49:47 +0900 |
parents | 7aaaaf5dde40 |
children |
line wrap: on
line source
#include "task_base.h" #include "task_object.h" SchedDefineTask1(Asteroid, asteroid_task); static int asteroid_task(SchedTask *smanager, void *rbuf, void *wbuf) { long asteroidi = (long)smanager->get_param(0); CHARACTER *p = (CHARACTER*)smanager->get_input(rbuf, 0); p->x += p->vx; p->y += p->vy; if (asteroidi > 0) { CHARACTER* asteroiddt = (CHARACTER*)smanager->get_input(rbuf, 1); for (int i = 0; i < asteroidi; i++) { if ((asteroiddt[i].x + 32 > p->x) && (p->x + 32 > asteroiddt[i].x) && (asteroiddt[i].y + 32 > p->y) && (asteroiddt[i].y < p->y + 32)) { p->vx *= -1; p->vy *= -1; } } } CHARACTER *q = (CHARACTER*)smanager->get_output(wbuf, 0); *q = *p; return 0; }