How do I Make objects not overlap each others

Get help using Construct 2

Post » Fri Sep 11, 2015 11:24 am

I want object "one","two"three"four" and object "five" to randomly spawn on the screen when user press Startbtn
but I don't want them to spawn over each other. How do I do it?
Image
B
10
S
1
Posts: 93
Reputation: 722

Post » Fri Sep 11, 2015 12:23 pm

You could check "On created" if it "is overlapping another object". If it does, destroy it and spawn it again at a random position.

This will spawn it on random positions until it found a spot where it is not overlapping another object. For easiest use I recommend making an object-family for your 5 objects.
B
16
S
3
Posts: 69
Reputation: 1,048

Post » Fri Sep 11, 2015 12:23 pm

EVENT If object ONE is overlapping another object ACTION: destroy ONE
EVENT If object TWO is overlapping another object ACTION: destroy TWO
EVENT If object THREE is overlapping another object ACTION: destroy THREE
EVENT If object FOUR is overlapping another object ACTION: destroy FOUR
EVENT If object FIVE is overlapping another object ACTION: destroy FIVE

also you can use on collision with another object
B
6
S
1
Posts: 50
Reputation: 502


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider] and 9 guests