The specific part in question is under Load and it's the for each loop. I believe that is where the error is. You should be able to save and load your 3x3 tile board with the S and L however upon loading something the "Nothing" sprites are deleted (as wanted) but then not replaced (where needed) Except at the top 3 (Even when another tile is there)
Please answer quickly as I'm on a library computer and it's closing soon lmao
dropbox.com/s/7z8qvryghx45y48/TileEditor.c3p
Yesssss Dop2000 is viewing so you know he is about to answered lmao
Develop games in your browser. Powerful, performant & highly capable.
LOL
Your code is terribly inefficient. What if you need a 20x20 grid - will you create 400 events for loading and 400 for saving?
If your sprites are always snapped to grid, you should use a TileMap. Either snap sprites to tilemap, or don't use sprites at all.
Sorry I'm still not sure how I should be handling the for each loop issue.
Also how would I go about making it more efficient?
(Eventually it will be 6x6x2)
(Also this project is so I can learn how to use a tile editor so I can then add it to a different game I'm working on)
If you need to repeat the same event more than 2-3 times, this is an indication that it can be optimized. For 6x6 grid, the way you are doing it now, you'll need 144 events for saving and loading!
What's 2 here? 2 colors or 2 depth?
.
Anyway, here is how I would do it:
dropbox.com/s/pde2vgxpfnubx9l/TileEditor.c3p
2 depth. The colors represent the different tiles.
The game will eventually take place in a
6x6x2 (But may become larger)
Many tiles (Currently Ice, Water, Snow and Grace)
Many above ground items (Currently above 10)
Wait. I should be able to optimize with functions right?
If you need 2 depth layers, you'll have to add a second tilemap.
You can do the whole thing with sprites, but don't hard-code x/y coordinates - this is never a good idea. Add gridX/gridY/gridZ variables to the tile sprites, that will correspond to array x/y/z. And calculate layout coordinates based on these variables.
Alright. Thanks!