How do I use wait for special condition?

Get help using Construct 2

Post » Fri Jul 24, 2015 6:15 am

Hi,

I have a curse spell, which make character decrease health for 10 seconds, what I am doing is

1、subtract spell damage from health
2、wait 10 sec
3、add spell damage to health

everything works fine, but there is a bug, if during the 10 sec I died and go to another layout the last code will not be execute, the health will never add back, so how to solve the problem, please help thanks
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Fri Jul 24, 2015 7:28 am

can you attach the screenshot of eventsheet?
B
14
S
3
Posts: 29
Reputation: 882

Post » Fri Jul 24, 2015 7:40 am

please see the file https://www.dropbox.com/s/6swodr6cctpxv ... .capx?dl=0

when I touch curse(green sprite), HP become to 50, and 10 sec it go back to 100, but if I go to layout 2 during the 10 sec, it will never go back to 100, how to do with this? thanks
B
11
S
3
Posts: 172
Reputation: 1,178

Post » Fri Jul 24, 2015 2:19 pm

https://www.dropbox.com/s/w3uql9ridn4wb ... .capx?dl=0

Timers give you better control. On destroyed let's you cleanup.
Last edited by blackhornet on Fri Jul 24, 2015 2:36 pm, edited 1 time in total.
ImageImageImage
B
71
S
22
G
240
Posts: 3,732
Reputation: 133,990

Post » Fri Jul 24, 2015 2:32 pm

@laoniustudio You can use delta time
Image

@blackhornet Curse is object is not global. I think when you switch another layout timer behavior wont work
B
21
S
8
G
6
Posts: 177
Reputation: 8,134


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, plinkie and 22 guests