Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
11-29-2011, 03:30 PM #1
- Join Date
- Nov 2011
- Darien, IL
- Thanked 0 Times in 0 Posts
2D Game engine allows for terrain destruction
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?
Last edited by AsianNinjaPro; 11-29-2011 at 03:33 PM. Reason: Change the icon