How do I increase speed with a "Power Up" item?

  • How do I increase or decrease a players movment with a "power up" item?

    So in my game coding, I realize if I set the max speed to 3000 in the left window under beaviors: 8Direction: I can create a power a sprite that when on colision can make the character go 3000.

    However, I don't want the player to acclerate to 3000 at the strat of the layer. I want the power up to give them that ability.

    Also, how do I set a timer, so that the power-up will stop working?

  • Create an instance variable on the player sprite like "speedCD"

    On collision with the power up set maxspeed to 3000 and add 3 to "speedCD".

    If speedCD > 0

    subtract dt to speedCD

    If speedCD <= 0

    set maxspeed to default.

    It's an idea, you have multiple way to do that.

  • Thanks that worked perfectly, now just to figure how to time out the power up.

  • I would like my sprite to move automatically (ie without me pressing on the direction keys) at an increased speed, at a set angle, for a set amount of time upon contact with a "power up" item; does the above solution apply?

    Also, I'm lost at the "subtract dt" part - where do I find that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have a look at basic physics equations involving s, u, a, v and t - especially velocity and acceleration.

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