Hey all,
Making a simple HP and damage system, ran into a few issues
Running release 178 (64bit) and tried this on node-webkit, chrome and phonegap
PROGRESS BARS
- Ignore Z-Order and Layers, Always show on top
- CSS Style wont work, setting colour or color to red is ignored
- Some CSS Style properties will default the progress bar to a green and grey CSS style
I am also making a DPS (Damage Per Second) System, and want the HP bar to decline smoothly, instead of just having a chunk of it disappear every second.
To do this I created a system event so that every 0.1 seconds it will subtract 1/10th of the DPS from the Health
This works fine but it gives strange numbers to the HP, instead of being:
99.9, 99.8, 99.7 etc, it is showing numbers like
99.90000000054, 99.80000000023, 99.7000000064 etc
I could just hide the number using floor, ceil or round but it is causing issues with timing, I calculated it to take 10 seconds to kill an enemy of a certain HP with my level of DPS, and it took an extra 6 seconds because of the strange fractions.
And if i set the DPS timer to fire every 0.01 seconds and subtract (DPS / 100) it looks even smoother but the time calculation becomes even more unreliable and HP shows numbers like 99.999999999999754
Heres the CAPX
http://s000.tinyupload.com/index.php?fi ... 2955337379