[Help] Wired problem with tilemap collision

Recommended Posts

Hi, I have create a simple tilemap using tiled editor the map has just single layer but when I tried to collide my player with tilemap then this wired problem happened.

Sometimes my player collide correctly sometime it overlapping. pic more more details understanding.

here is the minimal code 

for full project

MyGame.playState.prototype = {

    create: function () {
        // create the layer 
        this.layer =; 
       , 133);


    update: function () {, this.layer);


the first image is overlapping and the second image is colliding with the tile. it happens randomly when I move my player around.



Share this post

Link to post
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.