Trying to create boost-able progress bars!

» Fri Oct 21, 2011 3:16 am

I'm making an Idle game (a game you let run in the background while you do other things and it pretty much automatically proceeds without you, but that's beside the point) and here is an example of my progress bar:

The green fills up the orange bar at 1 pixel per 30 ms, and when it reaches the other end of the bar, it gives EXP and coins, as seen here for example:

When the game is "completed", the progress speed will be far, far lower, it's only fast as is so that I can level up quickly to test things, which comes to the problem I am having. Here is what I would like to do with it:

There is a button you can press to spend some coins and temporarily increase the speed of the progress bar, and it can be repeatedly clicked to speed the boost up even more, at least until you are out of coins. I know how to make the button and I know what to do with it, but the problem is that I have no clue how to make temporary boosts.

If you want to mess with the .cap, download it here. You will likely need the Sprite Button Plugin to open it, however.

I would really appreciate a tutorial of some sort instead of "just do X and Y will happen", it'd be much more helpful.Doomish2011-10-21 03:17:14
B
3
G
2
Posts: 17
Reputation: 759

» Fri Oct 21, 2011 5:45 am

It's late and I'm about to go to bed, so I'll check it out tomorrow, but as a quick thought to do what you want, here's my suggestion.

If Coins > Cost
--> If Spend Coins : Add 10 to global('Temp Boost')

If global('Temp Boost') > 0 : Set global('Temp Boost') = global('Temp Boost') - 1 * TimeDelta
--> Trigger Once : Set Progress Speed = Progress Speed * Boost Multiplier

If global('Temp Boost') <= 0 : set global('Temp Boost') = 0
:Set Progress Speed = Default Progress Speed

Where "Progress Speed" is how fast your Progress speed normally is, and Boost Multiplier can be 1.5 for half time faster or 2 for twice as fast.

Like I said, didn't look yet, but I feel like that would do what you're asking. That's what first came to mind anyway.TL222011-10-21 05:48:41
B
56
S
20
G
7
Posts: 305
Reputation: 8,754

» Sat Oct 22, 2011 7:57 am

It worked flawlessly, thank you so much, now I can stop being frustrated and work on the rest of the game ! Doomish2011-10-22 08:04:40
B
3
G
2
Posts: 17
Reputation: 759

Who is online

Users browsing this forum: No registered users and 1 guest