Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
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.
Develop games in your browser. Powerful, performant & highly capable.
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.
The condition should be:
If the timeCounter < timeLimit then the game can add to the timeCounter.