How to add to max speed over time?

0 favourites
  • 3 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • 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)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • No syntax error for me:

    Sprite.Platform.MaxSpeed+1

  • 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 ;)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)