How do I time-out power ups?

Get help using Construct 2

Post » Thu Aug 01, 2013 12:38 am

How do I time-out power ups?

Ok, so now I have a super awesome super speed power up, but I only want it to last 3 seconds. I tried to do varibles on "system" and on "player" but the game doesn't seem to register either.

Any suggestions?
B
15
S
5
G
2
Posts: 164
Reputation: 3,080

Post » Thu Aug 01, 2013 1:16 am

Um...A timer.
Here's what it would look like:

Event: Touch Powerup
Action: Player.PowerupTimer = 3
Action: Player.Powerup = True

Event: Player.PowerupTimer > 0
Event: Player.Powerup = True
Action: Subtract dt from Player.PowerupTimer

Event: Player.PowerupTimer <= 0
Action: Player.Powerup = False

Something like that anyway. Basically the 3 is in seconds and you subtract the time from 3, and while the timer is above 0 seconds the powerup is active.            Sushin2013-08-01 01:17:51
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu Aug 01, 2013 1:23 am

You can use the new Timer behaviour.
ImageImageImage
B
71
S
19
G
180
Posts: 3,483
Reputation: 103,187

Post » Thu Aug 01, 2013 1:48 am

needed a break from learning to animate ,heres the lamest way possible to do it
https://www.dropbox.com/s/qra36wl71xz4us6/sh*ttyfellow.capx
B
4
Posts: 24
Reputation: 248

Post » Thu Aug 01, 2013 3:38 am

[QUOTE=blackhornet] You can use the new Timer behaviour.[/QUOTE] Oh my god...
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Thu Aug 01, 2013 5:45 am

Thanks all,
@Blackhornet, How do I use the timer, I can add the timer, but how do I set the power up to stop working?

@Sushin. "PowerupTimer" is an "instantance varible"?

@MustacheGolem, thanks man, but the file url doesn't work.
B
15
S
5
G
2
Posts: 164
Reputation: 3,080

Post » Thu Aug 01, 2013 6:09 am

ImageImageImage
B
71
S
19
G
180
Posts: 3,483
Reputation: 103,187

Post » Thu Aug 01, 2013 8:15 am

I see, but I'm trying to time out the ability the player gets from the power up.

Screen ShotBurningWood2013-08-01 08:17:39
B
15
S
5
G
2
Posts: 164
Reputation: 3,080

Post » Thu Aug 01, 2013 5:13 pm

OK, assuming the Timer is on Player, in event 21, add Start Timer "coffee" to 3.0 (Once) and replace Every 3 seconds with On Timer "coffee"
ImageImageImage
B
71
S
19
G
180
Posts: 3,483
Reputation: 103,187


Return to How do I....?

Who is online

Users browsing this forum: mercuryus, Moordhuis, RetroSpock, TRMG and 9 guests