Hi all,
I am writing a platform game in MIDP 2.0. My problem (besides others) is that i try to make a sprite move between two points in a specific part of the screen (an enemy that will move from point A to point B and backwards until it gets killed).
The player should be able to see the sprite when he approaches there.
the problem is that when i scroll the background to move my hero (by moving all the layers, including the sprite), the sprite that i want to move between the 2 points, is moving too. so if i dont stop moving it wont stop either!
i need a way to decide when the sprite will change direction (from point A to point B and backwards), without comparing the x and/or y coordinates of this sprite (Which is changing when i move the player)
any advise of how i should do this?
many thanks in advance