collision-detection

Collision detection on a rectangle, how to know which side was hit

I want to do a collision detection system for a rectangle to use some physics, so there will be a normal for each of the sides. How do I determine which side of the square was hit by the object. The other object would be a circle. Thank you.; ...

per-pixel collision using getRGB of a BufferedImage (Java2D Api)

Hello I'm currently working on a 2D platformer game. I would like to have per-pixel collisions between my player (a Rectangle) and a freeform terrain (uses slopes, a BufferedImage). I am a bit confused on the concept to check if any part of my rectangle collides with the terrain. Currently I'm trying to see if a part of my terrain cont...