Page 1 of 1

fast and easy Q.

PostPosted: Mon Mar 19, 2007 9:18 pm
by kes
this is my first message in a long time, im just having trouble with making an actor (view) follow another actor on the specified axis (x, y, you know) when at first i did it the view followed the actor but when the enemies where out of vision, i return to that place and the enemy disapeared. so i need another code.
excuse my english im Argentinian

PostPosted: Mon Mar 19, 2007 9:56 pm
by UltimatHedgehog
make your guy the veiws parent

Re: fast and easy Q.

PostPosted: Tue Mar 20, 2007 4:57 am
by Sgt. Sparky
kes wrote:this is my first message in a long time, im just having trouble with making an actor (view) follow another actor on the specified axis (x, y, you know) when at first i did it the view followed the actor but when the enemies where out of vision, i return to that place and the enemy disapeared. so i need another code.
excuse my english im Argentinian

first, make an actor that is in the center of the view,
make center view actor the parent to the view,
draw actor event for center view
Code: Select all
angle = direction(x, y, player.x, player.y);
directional_velocity = distance(x, y, player.x, player.y) / 25;

(Game A Gogo I am not copying your code, I am using my version of it)
if the x and y do not work,
try using xscreen and yscreen instead :D

PostPosted: Tue Mar 20, 2007 10:59 pm
by Game A Gogo
i don't care even if its my code :P, its free to use by anyone!
But tell me, how is it changed?

PostPosted: Tue Mar 20, 2007 11:21 pm
by UltimatHedgehog
how do you make it just follow the x not the y

PostPosted: Wed Mar 21, 2007 12:14 am
by Game A Gogo
replace the player.y to y