How to move towards actor on non-scrollable layer
karlpower
Member Posts: 17
My game is a vertical scroller. Here's what I'm trying to do:
When one of my actors gets killed, it spawns an actor which is actually just an image showing the points earned for killing that actor. I then want the image showing the points to move towards my HUD at the top of the screen, land on top the existing points and disappear.
Here's my problem:
My HUD is on a non-scrollable layer, so as far as I know the X/Y of actors on it doesn't change - I can't move the actor towards their position.
What do I do?
Thanks a lot.
Answers
Create an actor in the non scrollable layer, put it in the screen somewhere but make it invisible. Then have that invisible actor spawn the points so they will be in the non scrollable later as well.
For non scrollable layers, x/y = 0/0 in the centre of the screen.
To move it to the top left, that would be around x/y= -300/350. Try interpolating to that position.