Page 1 of 1

Chasing fire

PostPosted: Wed Sep 12, 2007 9:46 am
by Bee-Ant
Maybe anyone can help me to make chasing fire...
My mean that : Enemy can throw a fire which can chase the Player...
That code please...
Thanks, :D

Re: Chasing fire

PostPosted: Wed Sep 12, 2007 6:50 pm
by Troodon
MoveTo function is your friend when it's in the draw actor. This is the most accurate chase. :)

Re: Chasing fire

PostPosted: Wed Sep 19, 2007 12:33 pm
by Bee-Ant
Yeah...but it doesn't work perfectly...
If the enemy shoot to right, and the player on the left side of the enemy...the enemies fire turn to left...It's just an ugly action...anyway thanks..

Re: Chasing fire

PostPosted: Wed Sep 19, 2007 1:35 pm
by metal_pt
Ok, here's the way I would make it:

Use a local integer variable named "chase" (for instance) and make it equal to 0(zero).
Create a timer in the fireball.
When timer finishes chase=1;
In the drawactor:

if(chase==1)
{
follow the player;
(if you use the MoveTo function) chase=2;
}else
if(chase==0)
shoot in the direction enemy is facing;

And you should use the MoveTo function like tekdino said. This way you can avoid walls or other kind of things.

Re: Chasing fire

PostPosted: Wed Sep 19, 2007 2:05 pm
by Bee-Ant
Nay nay thanks
I'll try it :D