How do I spawn x objects at start of layout?

Get help using Construct 2

Post » Sat Apr 26, 2014 10:55 am

I want to generate x objects at layout start spread around the layout randomly. I know how to do the random bit, and I'm also able to create objects every x second, but I want this to happen before the game start, to get a sense of variation.
B
14
S
3
Posts: 123
Reputation: 1,571

Post » Sat Apr 26, 2014 10:58 am

@Oceldot why not place the object on the layout manually?
~Everyone can make GAMEs~
B
54
S
10
G
1
Posts: 411
Reputation: 5,655

Post » Sat Apr 26, 2014 11:02 am

Hardty wrote:@Oceldot why not place the object on the layout manually?


Well, it's physically possible of course, but I want to have quite a lot them, and it would be nice if they didn't show up at the same place every time.
B
14
S
3
Posts: 123
Reputation: 1,571

Post » Sat Apr 26, 2014 11:06 am

@Oceldot maybe you can use random set position action on event sheet
~Everyone can make GAMEs~
B
54
S
10
G
1
Posts: 411
Reputation: 5,655

Post » Sat Apr 26, 2014 3:16 pm

on start of layout
repeat x times ----> system|create *x_object* on layer *Y* at ( random(LayoutWidth), random(LayoutHeight) )

-EDIT-

Oh sorry, this isn't what you want. You want to create and distribute the objects randomly from within the editor, not at run time. There isn't a way that I know of...

Closest thing for variation purposes is to do what Hardty said.

on start of layout ----> x_object | set position to ( random(LayoutWidth), random(LayoutHeight) )
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649

Post » Sat Apr 26, 2014 3:53 pm

eli0s wrote:on start of layout
repeat x times ----> system|create *x_object* on layer *Y* at ( random(LayoutWidth), random(LayoutHeight) )

-EDIT-

Oh sorry, this isn't what you want. You want to create and distribute the objects randomly from within the editor, not at run time. There isn't a way that I know of...

Closest thing for variation purposes is to do what Hardty said.

on start of layout ----> x_object | set position to ( random(LayoutWidth), random(LayoutHeight) )


Actually, I think your first suggestion looks interesting. I haven't seen the Repeat event before. Thanks!
B
14
S
3
Posts: 123
Reputation: 1,571

Post » Sat Apr 26, 2014 4:04 pm

Well, you can repeat an action to your heart's content, but that will happen after you run the layout, you wont be able to see the result in the editor... But you're welcome!
composer - multimedia artist
www.eli0s.com/en/
B
68
S
26
G
4
Posts: 1,146
Reputation: 9,649


Return to How do I....?

Who is online

Users browsing this forum: Syazanie Amirin and 7 guests