Exemplo n.º 1
0
void aftermove_misery_ring(Object *o)
{
  if (o->state == 1 && o->linkedobject)
  {
    o->angle += 2;

    int dist = (o->timer * CSFI) / 4;
    o->x     = o->linkedobject->x + xinertia_from_angle(o->angle, dist);
    o->y     = o->linkedobject->y + yinertia_from_angle(o->angle, dist);
  }
}
Exemplo n.º 2
0
// wave shot
void ai_doctor_shot(Object *o)
{
	if (o->x < 0 || o->x > ((map.xsize * TILE_W) << CSF))
	{
		o->Delete();
		return;
	}
	
	switch(o->state)
	{
		case 0:
		{
			o->state = 1;
			o->xmark = o->x;
			o->ymark = o->y;
		}
		case 1:
		{
			// distance apart from each other
			if (o->timer2 < 128)
				o->timer2++;
			
			// spin
			o->angle += 6;
			
			// travel
			o->speed += (o->dir == LEFT) ? -0x15 : 0x15;
			o->xmark += o->speed;
			
			o->x = o->xmark + (xinertia_from_angle(o->angle, o->timer2<<CSF) / 8);
			o->y = o->ymark + (yinertia_from_angle(o->angle, o->timer2<<CSF) / 2);
			
			Object *trail = CreateObject(o->x, o->y, OBJ_DOCTOR_SHOT_TRAIL);
			trail->sprite = SPR_DOCTOR_SHOT;
			trail->frame = 1;
			trail->PushBehind(o);
		}
		break;
	}
}