I want to make an enemy patrol between two points on the screen.
I made this:
function moveghost(event)
ghost1.y = ghost1.y +1
if ghost1.y == 162 then
ghost1.y = ghost1.y -1
end
end
Runtime:addEventListener( "enterFrame", moveghost)
When I start the scene, the ghost moves down to y162 and stays there.
How can i make it, that it moves permanently between starting point and my defined point?
The movement is also not really nice. It’s somehow jerky. Is there a solution, so the movement gets more fluent?
Thanks in advance! [import]uid: 6587 topic_id: 5695 reply_id: 305695[/import]
[import]uid: 6587 topic_id: 5695 reply_id: 19565[/import]