ZFGC

Resources => Coding => Topic started by: Rayo on June 01, 2011, 02:21:47 pm

Title: Direction Problem
Post by: Rayo on June 01, 2011, 02:21:47 pm
Hello, now I have another problem.
I have two objects. [Object 1] and [Object 2].
[Object 1] is an enemy, that can't move. But the enemy can spit cores.
[Object 2] is Link. He can move.
Now the enemy should split cores to Link.
But this is every time different, therefore I need help with this code.
How do you would build this code?
Title: Re: Direction Problem
Post by: shongshui on June 01, 2011, 08:15:45 pm
What do you mean by "spit cores"? Is that a projectile weapon?

And what do you mean by it being everytime different?

If you want the enemy to shoot a projectile in link's direction, then use point_direction(link.x,linky.y,x,y) and set the direction of the projectile to the value of the point_direction function.
Title: Re: Direction Problem
Post by: MG-Zero on June 02, 2011, 12:09:53 am
By cores, I assume you mean something along the lines of a deku scrub spitting deku nuts.

Quote
If you want the enemy to shoot a projectile in link's direction, then use point_direction(link.x,linky.y,x,y) and set the direction of the projectile to the value of the point_direction function.

This will be your best bet without getting into too much math, although I suggest you also learn how to do it manually just for your own education.
Title: Re: Direction Problem
Post by: Rayo on June 02, 2011, 10:26:25 am
Oh, I used "cores". But I meant nuts.
And thank you for the command. Now this problem is finished.XD

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved