Spawning objects on a number of fixed places at random

Get help using Construct 2

Post » Tue May 30, 2017 9:33 pm

So, yeah in know its now problem to spawn objects in random locations on the layout.
But i wanna know, is there a simple solution to spawn objects from a random number of differend fixed points?
If i use the "choose" command, i can only choose between a specific x or x or x AND y or y or y position.
But i need a choose between xy or xy or xy.
I hope its clear what i mean.
(I have some free days and i spend them with friend, drinking, making graphics, drinking, playing around in construct and drinking.......did i mentioned drinking? ^^ Soooo, if there are some spelling mistakes, its the alcohol ^^)
B
16
S
5
G
2
Posts: 52
Reputation: 1,662

Post » Tue May 30, 2017 9:57 pm

Bring some fixed positioned 'spawners' in the layout, all instances of the same Sprite.
Give those a boolean 'Occupied'.

+ System: Trigger once
+ (no conditions)
-----> Sprite: Destroy
----+ System: Repeat floor(random(0,11)) times <-- this is a random between 0 and 10, fill in what suits you
--------+ Spawner: [X] Is Occupied
--------+ System: Pick a random Spawner instance
---------> Spawner: Set Occupied to True
---------> Spawner: Spawn Sprite on layer 0 (image point 0)
+ (no conditions)
-----> Spawner: Destroy
B
33
S
18
G
27
Posts: 2,431
Reputation: 20,326

Post » Wed May 31, 2017 11:40 am

I´m a bit confused.
Thats what i have right now: Image
B
16
S
5
G
2
Posts: 52
Reputation: 1,662

Post » Wed May 31, 2017 5:49 pm

--------+ Spawner: [X] Is Occupied <--- the [X] means inverted (official scirra pseudo code).
B
33
S
18
G
27
Posts: 2,431
Reputation: 20,326

Post » Wed May 31, 2017 6:41 pm

I am such an idiot. Thx man. ^^
B
16
S
5
G
2
Posts: 52
Reputation: 1,662


Return to How do I....?

Who is online

Users browsing this forum: Clark Thy Lord and 1 guest