# How to create N number of objects?

Get help using Construct 2

### » 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

### » Sun Sep 29, 2013 12:27 pm

With maths
B
53
S
21
G
94
Posts: 2,425
Reputation: 55,563

### » Sun Sep 29, 2013 1:13 pm

@plinkie mind share some examples ?
B
91
S
27
G
14
Posts: 391
Reputation: 13,133

### » Sun Sep 29, 2013 1:50 pm

@tumira
What exactly do you want to happen?
B
53
S
21
G
94
Posts: 2,425
Reputation: 55,563

### » 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

### » Sun Sep 29, 2013 2:21 pm

N number of objects that have a certain value?
Use For Each Object (Condition) > Create Object
B
53
S
21
G
94
Posts: 2,425
Reputation: 55,563

### » Sun Sep 29, 2013 2:29 pm

B
91
S
27
G
14
Posts: 391
Reputation: 13,133

### » 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
21
Posts: 735
Reputation: 12,142

### » 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