Jump to content

Confused about tiled map collision, is it a bug?


qichunren
 Share

Recommended Posts

I am using Phaser 2.1.3. I create a tiled map with Tiled 0.9.1

There is only one defualt layer, and one tileset image,4 colr tiles 32x32 .post-11732-0-72395700-1416472963.jpeg

 

I want to make the orange tile solid, player can't go through this kind of tile. But in my game, the player can't go through orange tiles block and red tiles block on stage. I don't why.

 

This is some of my code, full code here: https://github.com/qichunren/game1/blob/gh-pages/assets/js/game.js

var map = this.add.tilemap('map1');map.addTilesetImage('tileset');map.setCollisionByExclusion([1]);this.layer1 = map.createLayer('Tile Layer 1');this.layer1.resizeWorld();map.setTileIndexCallback(4, this.reachedDoorEvent, this);

You can test it here: http://qichunren.github.io/game1/index.html, move the player(candy) by arrow key.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...