In the endless runner in the tutorial the start always start with a pattern:
2 in the air("middle) and then another 1 in the ground, but in the code it randomize the height so why does it follows this pattern?
I know it has only 3 numbers to randomize, but why its still a pattern?
Like every time you start the game the start follows this pattern again and again
The first three heights are hard coded, an afterwards, it uses math.random to generate new heights.
Randomisation functions generally need to have a seed set at the init, in order to ensure that the sequence appears random. If you initialise with the same seed every time, you will get the same sequence again. A common thing is to set the seed to be dependent on something external, e.g. the current time of the computer:
I have a question it is not related to the topic(I want to avoid spaming the forums)
Will you support more languages? and if not will you let people access to the API and use it with other languages?
Nothing really. I changed it from (Solved) to (SOLVED) for consistency since we usually marked topics where an accepted answer has been provided as (SOLVED). It’s a manual process and has no real impact, but it gives us a hint sometimes if a question has been answered or not.
No, not likely. Lua is the supported language for writing game code in. Lua is a popular scripting language with very good performance.
You can also move game logic to a native extension for even better performance. In theory you could move all game logic to C/C++ and only use script files to call your game logic in the extension.
There are examples of 3rd party solutions for writing game code in one language and then as a pre-build step it gets translated into Lua and the Defold API. Examples: