How to create N number of objects?

Get help using Construct 2

Post » Sun Sep 29, 2013 11:02 am

How to create N number of objects in a single event?
B
4
S
1
Posts: 21
Reputation: 776

Post » Sun Sep 29, 2013 12:27 pm

With maths
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Sun Sep 29, 2013 1:13 pm

@plinkie mind share some examples ?
B
76
S
22
G
14
Posts: 389
Reputation: 12,249

Post » Sun Sep 29, 2013 1:50 pm

@tumira
What exactly do you want to happen?
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Sun Sep 29, 2013 2:16 pm

just help to create an event that will create N number of objects in a single go, i'm not able to figure it out :(
B
4
S
1
Posts: 21
Reputation: 776

Post » Sun Sep 29, 2013 2:21 pm

N number of objects that have a certain value?
Use For Each Object (Condition) > Create Object
B
46
S
16
G
74
Posts: 2,089
Reputation: 44,187

Post » Sun Sep 29, 2013 2:29 pm

@plinkie , yeah I think I get the idea already. Thanks
B
76
S
22
G
14
Posts: 389
Reputation: 12,249

Post » Sun Sep 29, 2013 3:03 pm

You could use the "repeat" condition combined with another trigger condition, like

variable = 1
+
repeat N times > create object.

you could combine it with a sub event to create a different object depending on the loop index.

variable = 1
+
repeat N times
>sub events>
loopindex = 0 >create object type 1
loopindex =1 >create object type 2

etc.
B
43
S
23
G
20
Posts: 735
Reputation: 12,027

Post » Sun Sep 29, 2013 5:02 pm

Here is a cool way using an array.

https://www.scirra.com/tutorials/360/generating-a-random-tile-map

Nice if you want to line things up, and to make sure there are no extras drawn.
B
29
S
8
G
4
Posts: 767
Reputation: 5,985


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, Yahoo [Bot] and 22 guests