Jump to content

[2.0.X] CSV Tilemap & collision


Recommended Posts


I a newbie and i was fooling around with tileMap today.

I found out that the separateTile function, from Phaser.Physics.Arcade throw an exception when i want to use game.physics.arcade.collide(player,layer), my layer coming from a map build with CSV file.

It seems that tile.layer return an object when you initialize the map with a Json file, but it returns an integer when you use a CSV file.

   separateTile: function (i, body, tile) {       [..]        else if (tile.layer.callbacks[tile.index] && !tile.layer.callbacks[tile.index].callback.call(tile.layer.callbacks[tile.index].callbackContext, body.sprite, tile))        {            //  If it returns true then we can carry on, otherwise we should abort.            return false;        }

My CSV seems ok, the game run without problems when i comment the collision test, and the layer.debug option show that some tiles are flagged as obstacle.


Exemple : https://github.com/Chapelin/Bomber/blob/master/index.html


Did anybody already had this problem ?

Maybe i did something wrong ?


(English is not my native language, so i'm sorry for the grammar mistakes)

Link to comment
Share on other sites


  • Recently Browsing   0 members

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