Variable for each tile

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Mora

Hello.
I am doing a 2 d prataform Game an I wont a way of creating Maps each player.
I CAME Up with the idea of creating a file with año the tiles data that can be load.
The problema is that I hav yo create around 10,650 of variables and more than 10,650 condicionales to sabe. I dont care creating alto of variables bit the real problema is the condicionales. Someone know how to reduce condicional or make one condicional that could be for allí of them.
Thanks

:bust_in_silhouette: Reply From: Yuminous

You could put all your variable data into an array var array = [] and then use a for loop for i in array: and an if statement if array[i] == comparison:

But based on what you’re asking would procedural generation based off noise maps fit what you’re after? With noise you could reduce the amount of data you have stored and generate “more” map layouts. You can see a demo what that would entail: