Tile map collisions

 Tile map collisions:

In the previous part we finished up our tile map loader class.
In this one we will be finishing up the tilemap collisions.

Want a video version?




The implementation:

For the implementation of the tilemap I have used the object layer functionality of the Tiled editor.
An object layer allows us to create shapes like rectangle(which we will be using for our collisions),
polygons, etc.

The rectangles created by us are they passed on into a list of rectangles from which we can then check 
if our player is colliding with one of them.

The Code:


Comments

Popular posts from this blog

Introduction

Loading the tile map