Hello, I need some help.
I want to make an actor that can move back and forth, without turning any direction or make any angle rotation, just moving forward and reverse. As I cannot find any tutorial for this type of movement.
this are my currently code. as the problem is, when the object is moving forward until it arrive at the edge,it will continuously reverse one step only but then move forward and thus make a looping there,
so, how to make the object goes from getX() == 0 to getX() == 600 and vice versa. using forwad and reverse movement only?
1 2 3 4 5 | move(); if (atWorldEdge()) { reverse( 5 ); } |