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

2012/5/17

Radius Collision

Gazzzah Gazzzah

2012/5/17

#
If I have an actor that is just a simple drawn circle (50 pixels diameter), how might I go about making radial collisions. Ideally it would be stopped by 'Wall.class' (most likely on right angles but diagonal detection would be good) and to be stopped by 'Character.class' (other circles).
danpost danpost

2012/5/17

#
Did you check the Actor class in the Greenfoot API? There might just be a method that would work for this situation.
Gazzzah Gazzzah

2012/5/18

#
There is getOneInterceptingObject (I think that's right) and there is getOneObjectAtOffset... but I'm not really sure how I can use that to conviniently detect objects around a radius and then react appropriately in terms of motion (stopping, sliding along the wall, two characters pushing each other away, etc).
davmac davmac

2012/5/18

#
Gazzzah, I think the suggestion was that you actually check the documentation, and see what methods are available. In terms of getting the finer details working, I think you need to narrow your questions down a bit, and perhaps post some code (whatever you have) to provide a basis for suggestions.
You need to login to post a reply.