enchant.js | Maps and Tiles

Mithat Konar

Maps and Tiles

This section uses images from Ubiquitous Entertainment Inc. that are not licenced for unlimitted use.

Surfaces and tiles

Download starter project

In enchant.js, Surface objects are often used with tilesheets to create complex backgrounds.


    

Run


    

Run


    

Run


    

Run


    

Run


    

Run

Interactive maps

The example developed here is a simplified version of an example presented in McInnis, Brandon, Ryo Shimizu, Hidekazu Furukawa, Ryohei Fushimi, Ryo Tanaka, and Kevin Kratzer. "Advanced Features of enchant.js." In HTML5 game programming with enchant.js. Berkely, Calif.: Apress, 2013. 89-97, and uses images that are not licenced for unlimited use. As such, it may be subject to copyright or other intellectual property conditions that are different from the other resources used here.

Download starter project

Maps in enchant.js can be used for composing backgrounds with tiles and for creating more interesting kinds of interactions with an environment. In the trail below, we develop a simple maze game using a map. In all the examples below, map0.png refers to the following tilesheet:
tilesheet example

Maps for backgrounds


    

Run

Adding an overlay layer


    

Run

Add a player


    

Run

Establishing boundaries


    

Run

Offsetting the player


    

Run

Real player, real prize


    

Run