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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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