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

2011/11/21

Collision Sensing

Steve_888 Steve_888

2011/11/21

#
Hi Im looking for some help on a project. I have a robot which has to get from one side of the screen to the other where there is a goal avoiding obstacles. (barrels that are randomly placed) I so far have the robot going over the barrel itself before moving right and carrying on. How do i get the robot to move out the way of the barrel before actually hitting it? e.g. moving like a square before?
mjrb4 mjrb4

2011/11/22

#
You probably want to look at the getObjectsInRange method which will allow you to get a list of all the objects a certain radius (or closer) away from the actor.
You need to login to post a reply.