How do I destroy ball within box for x time

Get help using Construct 2

Post » Sat Apr 29, 2017 11:57 pm

Hello. Im trying to figure out how i detect if my Ball has been overlapping a sprite for x time so i can destroy the ball afterwards.

I can't seem to figure out how i get it working, guess im just stuck atm :/

I hope you can give me some example on how this could be done easily and lightly.

example:
Ball is overlapping sprite("balldestroyer") for 2sec after that the ball gets destroyed, allthough the ball cannot leave the area of the balldestroyer, the ball HAS to be within the balldestroyers X and Y to be destroyed after 2sec.
B
11
S
3
Posts: 31
Reputation: 814

Post » Sun Apr 30, 2017 1:27 am

every 1 sec
ball overlapping sprite --> add 1 to instance variable
else --> set instance variable to 0


instance >= 2 --> destroy ball
B
25
S
16
G
26
Posts: 125
Reputation: 16,103

Post » Sun Apr 30, 2017 9:18 pm

celstrider wrote:every 1 sec
ball overlapping sprite --> add 1 to instance variable
else --> set instance variable to 0


instance >= 2 --> destroy ball


Thanks buddy, it works perfectly.
B
11
S
3
Posts: 31
Reputation: 814


Return to How do I....?

Who is online

Users browsing this forum: blue visionary, Lordshiva1948, OBLIVION and 16 guests