Arne2 / GameDesign

The game project of the lecture Game Design
1 stars 0 forks source link

collision detection #4

Closed maximilian-zollbrecht closed 8 years ago

maximilian-zollbrecht commented 8 years ago

In Greenfoot there are multiple ways to do direction dependant collision detection. We can either use getIntersectingObjects or getObjectsAtOffset. The Problem with the second one is, that we might not register a collision when it is not centered. We could use multiple calls to reduce that risk. getIntersectingObjects works based on the images of Actors. The drawback here is, that we need to get what direction the collision was at.

In this branch the getIntersectingObjects method is implemented. It should detect collisions on all sides. If you want to better see what's going on I recommend to change the spiders image to something with the edges of the image visible.

Please leave your opinion on what we should use or what needs to change.