Chasing fire

Non-platform specific questions.

Chasing fire

Postby Bee-Ant » Wed Sep 12, 2007 9:46 am

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
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Chasing fire

Postby Troodon » Wed Sep 12, 2007 6:50 pm

MoveTo function is your friend when it's in the draw actor. This is the most accurate chase. :)
I can't die, I already tried
~on the forums since GE 1.3.3~
User avatar
Troodon
 
Posts: 1539
Joined: Thu Jan 12, 2006 3:29 pm
Location: HELL
Score: 56 Give a positive score

Re: Chasing fire

Postby Bee-Ant » Wed Sep 19, 2007 12:33 pm

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..
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: Chasing fire

Postby metal_pt » Wed Sep 19, 2007 1:35 pm

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.
]v[eta[_ - Using GE since June, 15 2007
Currently using v1.3.8 Registered
metal_pt
 
Posts: 117
Joined: Sat Jun 16, 2007 12:57 pm
Location: Sintra, Portugal
Score: 2 Give a positive score

Re: Chasing fire

Postby Bee-Ant » Wed Sep 19, 2007 2:05 pm

Nay nay thanks
I'll try it :D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest