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

2016/3/9

How to know if one object can move?

Dino.Chia Dino.Chia

2016/3/9

#
I have to do that one object move until he gets to the edge of the world or simply gets interrupted by other object, then the actor had to change his direction randomly and keep moving, only if he can move to that direction. pls help
danpost danpost

2016/3/9

#
Use the following set of steps:
move();
if (interrupted())
{
    moveBack();
    changeDirections();
}
This is pseudo-like coded in that all parts were converted to method calls.
Dino.Chia Dino.Chia

2016/3/10

#
Ok, I just realized that interrupted() its not a method xD, so the question is, what do i put inside interrupted?
You need to login to post a reply.