How to add to max speed over time?

Get help using Construct 2

Post » Sat Aug 18, 2012 8:53 pm

So I'm making a small platformer,
and I want to make it so that when the player has been moving for more then 5 second, +1.0 is added to the max speed.

I was thinking something like,
"if player is moving,
than every 5.0 seconds add +1.0 to max speed."
but I can't add +1.0 to max speed, because I get a syntax error when I try to input +.

So does anyone have a idea on how I could achieve this?
Also, I'm just using the platformer behavior, and the current max speed is 230.

(Also, I searched around the forum but didn't find anything, sorry if this has been answered before)
B
5
Posts: 5
Reputation: 565

Post » Sat Aug 18, 2012 9:07 pm

No syntax error for me:

Sprite.Platform.MaxSpeed+1
B
79
S
32
G
23
Posts: 119
Reputation: 14,937

Post » Sat Aug 18, 2012 9:25 pm

Every time if you want to add or subtract something to existing value you have do put that value first.
if you eant to change opacity over time you can't put:
Set opacity to +1

You have to do:
Sprite: Set opacity to Sprite.opacity+1 (it says - current opacity value +1)
same for size, speed, position etc.

and make sure you use time delta to change value over time with the same speed for faster and lower framerates

Sprite: Set opacity to Sprite.opacity+1*dt - it will add 1 to current opacity every 1 second

You can use "self" instead of instance name

Sprite: Set opacity to self.opacity+1*dt


ps. i have no idea why i used opacity in that examples ;)
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests