Isometric worlds and Real Time games!

Isometric worlds!

Tile-Based Games


2D arrays to create the world



Tiled, flexible map editor

Phaser uses top left, Tiled bottom left

Phaser TileMap utilities

create() { ='world');'flower');'star');

Create the tilemap'flower', 'assets/flower.png');'star', 'assets/star.png');'world', 'assets/world.json', null, Phaser.Tilemap.TILED_JSON);

Load images and JSON file

  this.coinsLayer ='coinsLayer');
  this.backgroundLayer ='backgroundLayer');
  this.worldLayer ='worldLayer');		

  //[4, 5, 8, 9]);[], true, this.worldLayer);
update(){, this.worldLayer);

Create layers, collisions, resize the world!

create() {
  this.enemiesLayer ='enemiesLayer');
createEnemies() {
  this.enemies =;
  this.enemies.enableBody = true;, null, 'enemy1', this.enemiesLayer, this.enemies);, null, 'enemy2', this.enemiesLayer, this.enemies);
  this.enemies.forEach(function (enemy) {
    enemy.x += enemy.width/2;
    enemy.y += enemy.height/2;
    //A enemy without movement
    enemy.body.immovable = true;
    enemy.body.allowGravity = false;
    //Assign a body to the enemy
    enemy.body.setSize(enemy.width, enemy.height);
  //Manipulate properties of all objects of a group
  //this.enemies.setAll("visible", false);

Create enemies from a layer

Extra Utilities!

//find objects in a Tiled layer that containt a property called "type" equal to a certain value
findObjectsByType(type, map, layer) {
  var result = new Array();
  map.objects[layer].forEach(element => {
    if( === type) {
      //Phaser uses top left, Tiled bottom left so we have to adjust the y position
      //also keep in mind that the cup images are a bit smaller than the tile
      //so they might not be placed in the exact pixel position as in Tiled
      element.y -= map.tileHeight;
  return result;
//create a sprite from an object
createFromTiledObject(element, group) {
  var sprite = group.create(
  //copy all properties to the sprite
  Object.keys( => {
    sprite[key] =[key];
//Remove tiles
removeEnemyTiles() {
  var tilesToRemove = [57, 58, 59, 60]
  var width =
  var height =
  var tiles = this.enemiesLayer.getTiles(0, 0, width, height)
  this.enemiesLayer.tiles.forEach(tile => {
    if(tilesToRemove.indexOf(tile.index) >= 0) {, tile.y, this.enemiesLayer)

Isometric Projection

We tilt our camera along two axes (roll the camera 45 degrees to the side, then 30 degrees down). This creates a diamond (diamond) grid where the grid spaces are twice as wide as they are high. This style was popularized by strategy games and action role-playing games. If we look at a cube in this view, three sides are visible (top side and two facing sides).


asynchronous pathfinding in javascript

Our goal is to find nodes connecting a start node and an end node. From the start node we visit the eight neighboring nodes and mark them as visited; This core process is repeated for each newly visited node, recursively. Each thread tracks the visited nodes. When jumping to neighboring nodes, nodes that have already been visited are skipped (recursion stops); otherwise, the process continues until we reach the end node, where the recursion ends and the full path followed is returned as an array of nodes. Sometimes the end node is never reached, in which case the route search fails. Usually, we end up finding multiple routes between the two nodes, in which case we take the one with the fewest nodes.


Real time games!

Send and receive messages...


times per second!

HTTP requests must die!

Welcome WebSockets!

Players will try to cheat!

And they will!

The server must put the room in order!

Time and again you must enforce your authority ...

- Input prediction 🔎
- Lag compensation 🙅

- Client interpolation 📈

Increase complexity

Desired interaction

  • The client presses the key -> therefore it must move immediately to the right.
  • The server receives the position message and saves it for the next update. 
  • In the next server update, the player's position is applied by moving it in the direction of the server state.
  • All state changes are sent to all clients.
  • The client receives the message immediately configuring the positions of the players (authorized)
  • Customer can correct prediction errors from the first step

Authority Server

Constant updates from the Server


- Real Time Multiplayer in HTML5:

- Fast-Paced Multiplayer:

Real time games!

By Juan David Nicholls

Real time games!

A talk about isometric worlds 2D and real time games!

  • 3,718