Respawning Object

Get help using Construct 2

Post » Sun Mar 24, 2013 12:21 am

How would I make it so when an object collides with another it will be destroyed and respawn randomly on the layer?
B
18
S
5
G
4
Posts: 63
Reputation: 3,912

Post » Sun Mar 24, 2013 4:43 am

on event object 1 collides with object 2
action destroy object 1
action create object 1 on the layer at x = random(Range), y = random(Range)

for Range, type in the minimum and maximum boundaries you want the object to spawn inside.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Sun Mar 24, 2013 5:47 am

Thanks! That helped alot! Is there a way to get the object not to spawn inside other objects?Carbon642013-03-24 05:51:13
B
18
S
5
G
4
Posts: 63
Reputation: 3,912

Post » Sun Mar 24, 2013 5:53 am

you could check if the object is overlapping whatever object you don't want it to spawn in. if that happens, delete it and respawn it again.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467


Return to How do I....?

Who is online

Users browsing this forum: WhosWho and 22 guests