Jump to content

Tilemap Copy/Pasted tiles not rendering


johann_dev
 Share

Recommended Posts

I'm working on an endless runner than uses multiple tilemaps as segments in order to achieve a procedurally generated effect.

I'm copying tile data from a buffered tilemap (not being rendered) and pasting that data to another tilemap (currently being rendered) but not all the tiles show up.

I copy and paste the tiles in three separate batches. The first batch works fine. The second and third batch of tiles don't render at all, but the collision tiles still work. All the tiles are copied from the same tilemap.

Attached is the relevant file.

 

 

Runner.js

Link to comment
Share on other sites

Never done code like this but have some general questions.

Can you via the console confirm the data is where you think it is.

That the level you are on is where you think it is (I had a recent problem when I went to level 2 from level 1 I ended up on three).

Can you use the console to manipualte things and manually change the tiles - then click on the brower to see what it updates too?

Link to comment
Share on other sites

I've tried manually debugging what's in the tilemap and it's pretty difficult to parse.

From what I can see, all layers of my "worldMap" are correctly populated with tiles and seemingly all the tiles I'm expecting to not be blank have indices != -1 and alphas of 1. So it definitely looks like all the information is there.

Link to comment
Share on other sites

I figured out the problem:

I wasn't creating layers for the buffered tilemaps (the ones not being rendered) once I did that everything showed up correctly. I'm still very confused why this is, as I didnt need to create the collision layers, and they still worked.

Nevermind the problem still persists. I thought I had found a fix but I was wrong.

Edited by johann_dev
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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