Ask here your questions to get help using GDevelop.
By komencanto
#43282 How to repeat creation of the object several times? For example, how to create a pattern of hexagons in a shape of honeycombs and be able to refer to each hexagon? Where are iteration operators like for-next and how to use them?
Last edited by komencanto on Sat 30 Aug 2014, 23:43, edited 2 times in total.
User avatar
By Lizard-13
#43286 GD has 3 loops: "Repeat x times", "While" and "For each object"
In the loop, each time you create an object, it becomes the reference object, and every action in this event and sub-events will be executed in this object, for example (from an old post):
Image
And you get:
Image

Note: - In this example you can use Repeat 25 times instead the While.
- I set the object color and position to emphasize the created object is the reference one.
- Set the initial variables value is not necessary , GD set it = 0 automatically, and you can change it in the editor.

In the example I change the color and position, but you could set a variable ("ID") different in each one. Then, in any event, you can add the condition "Variable ID of Object = 3" to work with the object that has Variable "ID" = 3 :)
By komencanto
#43294
komencanto wrote:
GD has 3 loops: "Repeat x times", "While" and "For each object"

Where are they located? Can not find them anywhere in the Event Editor. :(

I found them! :) The top ribbon, sign "+" with small arrow under it.
screen1.png
screen1.png (13.73 KiB) Viewed 2495 times