Collision Detection in Java for a game
Posted
by
gordsmash
on Game Development
See other posts from Game Development
or by gordsmash
Published on 2011-03-05T15:26:30Z
Indexed on
2011/03/05
15:32 UTC
Read the original article
Hit count: 419
java
|collision-detection
Im making a game in Java with a few other people but we are stuck on one part of it, making the collision detection. The game is an RPG and I know how to do the collision detection with the characters using Rectangles, but what I dont know how to do is the collision detection for the maps. What I mean by that is like so the character cant walk over trees or water and that stuff but using rectangles doesnt seem like the best option here.
Well to explain what the game maps are gonna look like, here is an example http://i980.photobucket.com/albums/ae287/gordsmash/7-8.jpg
Now I could use rectangles to get bounds and stop the player from walking over the trees and water but that would take a lot of them.
But is there another easier way to prevent the player from walking over the trees and obstacles besides using Rectangles?
© Game Development or respective owner