Jump to content

Sloping tiles anyone? :)


rich
 Share

Recommended Posts

It's nothing to do with pixel data at all, each type of slope has an ID. There are 34 in total. The json file the demo uses is just the sprite sheet used for rendering loaded into Tiled and exported.

Note that lots of tile types MUST be square, if they're not you'll get weird collisions happening. See ninja / Tile,js for the id to slope mappings at the bottom of the file, or look in the resources folder and you'll see the tiles as pngs.

Link to comment
Share on other sites

Just to make sure I understand:

 

1. You made a tilemap in Tiled using the debug tilemap image as the layer image. Exported it to JSON.

2. The N+ifying happened in this line: game.physics.ninja.enableTile(tile, tile.frame);

3. You just happened to use the tile's spritesheet frame as the ID, but we can set that however we need to for our maps (e.g. 5 completely solid tiles followed by twenty-seven different concave, whatever).

 

Very cool. I dig. Equal width and height sound like no big limitation to me if this is what I get. ( =

 

Can you explain what the suffixes mean in the tile definitions at the bottom of ninja/Tile.js? "p", "n", "S", "B", etc? I'm assuming "drul" => down right up left, but for the rest I had to manually look it up by referencing the images.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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