In the above example, for each item in the list [code][0, 1, 2][/code], Godot sets [code]number[/code] to the item, then executes the code in the [code]for[/code] loop. We'll explain arrays more throughly in the next lesson, but notice that [code]number[/code] is just a temporary variable. You create it when defining the loop, and the loop takes care of changing its value. Also, you can name this variable anything you want. This code behaves the same as the previous example:
Ve výše uvedeném příkladu Godot pro každou položku seznamu [code][0, 1, 2][/code] nastaví [code]number[/code] na položku a poté provede kód ve smyčce [code]for[/code]. V tomto příkladu vypisujeme hodnotu [code]number[/code], jak Godot prochází smyčkou. Do bloku kódu smyčky můžeme vložit libovolný kód, včetně volání dalších funkcí, například [code]draw_rectangle()[/code].
We'll explain arrays more throughly in the next lesson, but notice that [code]number[/code] is just a temporary variable. You create it when defining the loop, and the loop takes care of changing its value. Also, you can name this variable anything you want.
This code behaves the same as the previous example:
V tomto příkladu vypisujeme hodnotu [code]number[/code], jak Godot prochází smyčkou.
Do bloku kódu smyčky můžeme vložit libovolný kód, včetně volání dalších funkcí, například [code]draw_rectangle()[/code].