Hello, I want to create an event where it restarts the layout after sprite1 and sprite2 collide/overlap for 3 seconds.
I know how to get it to restart after the instant collison but dont know how to make it only restart after 3 seconds.
thanks
Develop games in your browser. Powerful, performant & highly capable.
Using the timer behaviour would work..
Sprite1 on collision with sprite2
start timer for 3 seconds
sprite1 is not overlapping sprite2
stop timer
on timer
restart layout
Quick one from the top of my head.
Create "collisionTime" variable. When objects collide start counter, and add 1 to "collisionTime" every second. If collision breaks then clear "collisionTime" if not then restart layout when counter = 3.