I'm building a game that has a progress bar for the remaining time, but when user do a action, the progress bar does not remain stable at the same speed.
This action uses much of Math.floor((Math.random() * limit)
:
You can check my code in GitHub and see it running and tests passing (except that I described above): https://github.com/acazsouza/twinoo
How can I improve that code?
(Although I'm passing the link to the entire repository, the code is small)
velocity
option. Unless you want to rewrite plugin, you should change that you change the value of the progress bar instead. – RoToRa Apr 26 '12 at 9:20