How do I create a progress bar using a tiled background sprite?

0 favourites
  • 6 posts
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • Hello,

    I have been able to create a health bar using tiled background sprite and variables. It drains when the player is hit and it works perfectly.

    Now I want to make a bar that fills up every second up to a max width and I'm having some trouble.

    Thanks!

  • You should use variables for this:

    timeCounter = 0

    timeLimit = your max time

    timeBarWidth = the max width that you want

    Here is the formula:

    timeCounter / timeLimit* timeBarWidth

    Then you add value to timeCounter

  • Thanks, the bar fills up now.

    I'm just having some trouble making it stop. It just fills up past the screen.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The condition should be:

    If the timeCounter < timeLimit then the game can add to the timeCounter.

  • Hi! I'm having a similar problem and I do not understand most of the above, I'm new at construct 3, so could you help me?

    I want a tiled background that can increase in width like a progress bar when an object is held on, but no matter what I do, it will increase by 30 pixels (as I implemented) but it won't go on, it just stays that number. I intended it to go 3O + 30 + 30 and so on until max 270, but as I said, it just stays. I'd like some help with that.

    Thank you for your time.

  • Add 30 to the timeCounter in my formula.

    Your timeLimit will be 270.

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