Showing posts with label Phaser. Show all posts
Showing posts with label Phaser. Show all posts

Saturday, June 27, 2015

Tilemaps with invisible collision layer in Phaser

Phaser, Tiled and Physics

While there are several TileMap tutorials for Phaser out there, I didn't find any using Phaser 2.3 with the P2 physics. For this reason I decided to write my own tutorial about. Phaser is a cool javascript library that for turning a HTML5 canvas elements into games.

Goal

Our goal in this tutorial is to use the program Tiled to create a map for our game. We will have a separate layer for collision data. In phaser we will display the background and foreground layer, but use the invisible collision layer for collision. We will use P2 physics, as some comments suggest that this physic works best with tilemaps.