libgdx - collision detection with tiled map java

Posted by user2875021 on Game Development See other posts from Game Development or by user2875021
Published on 2014-03-04T16:57:45Z Indexed on 2014/06/05 15:41 UTC
Read the original article Hit count: 175

Filed under:
|
|

currently, I am working on a 2d rpg game which is similar to final fantasy 1-4. I can load up a tiled map and the sprite can walk freely on the map. However, I will like to create a wall for it to stop walking through it.

I created three tiled layer Background, Collision, Overhead and one Collision object layer with rectangles only.

"How do I handle collisions with the object layer in the tiled map?"

"Do I have to create every single rectangle that is in the object layer with Rectangle rectangle = new Rectangle() and rectangle.set(x, y, width, height)in the code?"

Thank you very much in advance. Any help is greatly appreciated!

© Game Development or respective owner

Related posts about java

Related posts about collision-detection