Hello,
I am currently attempting to update an Action I have running, i have created a simple MoveTo action which moves a sprite to my players position. The sprite is an enemy that follows the player at a set speed.
When I move the player I'd like to update the new position so that my enemy sprite will follow. although I cannot seem to work out how.
I have tried to cancel the previous action and update with a new one using the players new position and calculating the time from speed and distance. Then i found the endPosition variable within the MoveTo declaration.. which is read only.
Is there a very simple way for me to do this? am i overlooking the obvious. or do i have to subclass MoveTo or IntervalAction etc.. to make the endPosition variable readonly?? An enemy following a player must be implemented in many games.. How do i do this?
Should I forget about using actions and calculate the next point myself and simply change enemy.position?
Any help would be greatly appreciated
Thanks
Byron