View Full Version : 2D Game engine allows for terrain destruction

11-29-2011, 03:30 PM
Hello, I'm a newbie at game programming, but it's one of my hobbies.

My 2D game engine (Written in Java) at this point uses primitive rectangles and circles to detect collisions but I realized that if I wanted destructable terrain, I can't just take a chunk off the rectangle.

The new game engine will use a 2D array of integers. Each element represents a pixel. 0 meaning empty, and greater than 1 meaning some other type of terrain be it water, rock, or grass. Or have a 2D array of Terrain Objects.

1) Is this setup commonly used?
2) I know collision detection will be a breeze but will the computer be able to change all those elements quickly enough to simulate movement?
3) If this is a bad setup, what would you reccommend?