Help: Looped moving actors
rovioxo@gmail.com
Member Posts: 1
Ok so I have a game where a collectable item moves left and right on an infinite loop, I had it set like this, basically a boolean attribute set to false and on a 2 second timer it switch between false and true and move accordingly. The problem posed when I added a retry button, when you reset the scene it starts moving from its current point it was previous to resetting, so it goes through walls etc. Is there a formula to make it move from 1 point to another that will not have this problem?
Comments
Constrain Self.X to AAA*sin(game.time*BBB)+CCC
AAA = range of movement, how far left and right you want the actor to move.
BBB = speed.
CCC = centre point of movement.