This site requires JavaScript, please enable it in your browser!
Greenfoot back
Francis1004
Francis1004 wrote ...

2015/8/4

im a newbie.

Francis1004 Francis1004

2015/8/4

#
how to make things stop when reached edge of the world and makes it move backwards on x axis?
danpost danpost

2015/8/4

#
First, there are multiple ways to "move" your actors. How to make your actor move backwards depends on which technique you use to move it. Unless your world is unbounded, your actors will automatically be prevented from moving past any edge of your world. So, if moving in any one of the four cardinal directions (horizontally or vertically), you actor will stop at any edge. Then, it location (x- or y-coordinate value) can be used as a condition to change directions.
You need to login to post a reply.