How do I add a 'life timer' to reward player for not dying?

Get help using Construct 2

Post » Tue Jan 17, 2017 1:52 pm

I'd like to reward the player with a single power-up if they can go X minutes without dying.

I've looked at game time but that won't let me. Timer behavior doesn't seem to work either.

I also thought about adding dt to a GV. Then if that GV is equal to X minutes (secs) reward the player and reset the GV.

Would this work?
B
38
S
18
G
19
Posts: 664
Reputation: 14,112

Post » Tue Jan 17, 2017 6:12 pm

Should do, yeah. Or 'wallclocktime' might help.
<iframe frameborder="0" src="https://itch.io/embed/146124?linkback=true&dark=true" width="552" height="167"></iframe>
B
26
S
7
Posts: 254
Reputation: 2,389

Post » Tue Jan 17, 2017 6:20 pm

Using your GV:

Initially (or at Start of Layout) set GV to [X minutes] * 60.

Every Tick | GV-dt

If GV <= 0 | [Reward the Life Timer]

I don't know what you mean by life timer but I'm assuming it's a timer of your player's life that starts at a certain amount and decreases?

If so, you need more variables. Say:

LT [Life Timer] = [Your desired life]
IsRewarded = 0

You would then add:

If GV <= 0 | [Reward the Life Timer] Set IsRewarded to 1

If IsRewarded == 1 | LT-dt
If LT <= 0 | Set LT to 0 (So your life timer won't go negative.)
"The intent is to provide subscribers with a sense of pride and accomplishment for unlocking different features...."
B
42
S
18
G
32
Posts: 818
Reputation: 20,779

Post » Tue Jan 17, 2017 7:39 pm

No. Nothing that complex. It's just to see if the player can play (say 10 mins) without dying, they get a reward.

After i fix this 1 bug that popped up, gonna try it out.

Thanks for the replies.
B
38
S
18
G
19
Posts: 664
Reputation: 14,112


Return to How do I....?

Who is online

Users browsing this forum: SERGIOManOwaR and 4 guests