I’m working on a Scorched Earth / Worms type game. The map is randomly generated “uneven” terrain. Checking for collision is easy enough with .getRGB(), however I want some projectiles to bounce around before exploding. How should I go about finding the angle of the surface that the projectile hit in a map like this?
http://p.twimg.com/Ab2HVZqCEAMuW2F.png
The blue background is a separate image from the ground graphic, and is not used for collision detection. Also, when a projectile explodes, I will be erasing a circle out of the ground image. I thought about using an array of lines to define the outline of the surface, but trying to figure out how to cut out a segment and adding lines for the hole that was created, sounds like a pain. The easiest way seems to be scanning pixels around the projectile (after it collides with the ground) to try to figure out the angle, but then how far out should I check, and how would I figure what is too far out? Has anyone here done something like this before?