0 votes

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.

Godot version Godot 3.2.3
in Engine by (23 points)

1 Answer

0 votes

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:

by (1,002 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.