i want to have a working progress bar in my game...
for example i want to have a "mana" bar. if i cast a big spell, it will take 100 mana points (maximum), then mana will be automaticly restored for 2 minutes. when it will be full again (100 points), it will be possible to cast this spell again.
can you help me how can i do this?
Create a global variable called "mana". Set the value of that to 100, then make an always event that sets the value of a sprite to the value of global('mana'). You can then use a timer or some other mechanism for restoring mana over time. For this we will need to do some math. If you need to get 100 points in 120 seconds(2 minutes) then you need to divide 100 by 120. You end up with 0.83. So you set an event that every 120000 miliseconds, you add 0.83 to the global variable mana. Now when you want to cast a spell, just do a compare variable as one of the conditions. You want global('mana') to be greater than or equal too 100.
Develop games in your browser. Powerful, performant & highly capable.
Heres an example. Left click to "cast" a spell. dl.dropbox.com/u/11232449/manacap.cap
great! thanks very much, this is exactly what i need
How can I make this in Construct 2??