Jump to content

problem with Phaser collissions after tilemap scaling


Recommended Posts


I have tilest 16x16. It is exported to json format. I used Tiled app.

It works fine until using scaling function.  After that colission is not working.

Here's my code:

create: function() {

this.map = this.game.add.tilemap('tiled');

this.map.addTilesetImage('tiled', 'tiles');

this.layer = this.map.createLayer('background');

this.layer.scale.setTo(3, 3); //It disables collissions


this.walls = this.map.createLayer('walls');
this.walls.scale.setTo(3, 3); //It disables collissions



this.map.setCollisionBetween(1, 2000, true, 'walls');

this.sprite = this.game.add.sprite(70, 70, 'soldier');

this.sprite.anchor.setTo(0.5, 0.5);


this.sprite.body.setSize(8, 8, 4, 4);

this.sprite.scale.setTo(3, 3);


update: function() {

this.game.physics.arcade.collide(this.sprite, this.walls);



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.

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.


  • Recently Browsing   0 members

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