Jump to content

[2.0.X] CSV Tilemap & collision


Chapelin
 Share

Recommended Posts

Hi,

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

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...