0 Favourites

Thruster Bar

  • Hello :)

    I have a thruster bar that is supposed to increase over time (up until a max). Then be "used up" when a key is pressed. The level of thruster available is displayed as a sprite with different animations (example: when thrustervariable = 5, display animation: thruster5).

    What has been happening is: when the x button is pressed, you cannot see the thruster bar move. It goes from max to zero.

    The code is essentially:

    • When "X" pressed, increase speed & start thruster decrease

    -When Thruster decrease = on,

       -Wait 5 seconds, decrease "thrustervariable" by 1

    • When "X" released, set speed to normal
    • When "X" released, set thruster decrease to off, set thruster increase to on.

    -When thruster increase is on, wait 10 seconds, then increase thrustervariable by 1

    ---

    *For any variable that is supposed to increase or decrease over time, do I have to give its display sprite priority over the event adjusting the variable?

    For example:

    every tick/display animation "thruster(thrustervariable)"

    when(x) pressed/wait 5 seconds/decrease thrustervariable by 1

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
46 2,059
guannstar's avatar
guannstar
Unread hot topic
41 2,796
guannstar's avatar
guannstar
Unread hot topic
35 2,126
Frap1K's avatar
Frap1K