Home LittleBigPlanet 2 - 3 - Vita - Karting LittleBigPlanet 2 [LBP2] Help!
#1
Converting a 17-bit system into a health bar display?
Archive: 3 posts
So far the most efficient method of creating a very flexible damage and healing system has been through making a 17-bit system, giving me full 5 digit additions and subtractions. It is both much more capable of handling any value, and takes up very little thermometer. The problem I have is that I now need to display the value of the bits in some visual form, preferably a timer. I can display the numbers for the attack, just using several ANDs with some NOTs, but for my level, this is kinda impossible. I wanted every battle to be absolutely ridiculous (hence the name), so the number of emit projectiles will be quite a lot. If I were to have a damage popup for every hit, I'd probably crash the game. So, is there any way to use my 17-bit system to display the amount of health/damage stored within the bits as a timer or counter or other 'bar'? I suppose I could use a hologram display, but that isn't very accurate, and would appear to jump every now and then when switching values. | 2011-02-28 04:42:00 Author: SSTAGG1 Posts: 1136 |
A timer is really easy to do. First, I'd only work with, say, 5 or 6 bits of your health for the display. It makes things easier, and unless you make it really wide it won't make much difference. Create a simple digital to analog converter. (AND the high bit with a 50% battery, next with a 25%, next with a 13%, next with a 6%, next with 3%, then add them all together (Or rather, subtract them all from 100% and take the NOT of the output.) Then subtract the result from the output from the display timer and feed that back into the input, with the timer set to speed scale. Then whenever the value changes, the timer will change to match. (Note that it will "glide" in over a half a second-ish. If you want it quicker you'll need to multiply the positive and negative of the difference by 3 and re-combine, and do something else to deal with de-bouncing the signal as well.) If you really want more bits precision than that you'll need to add a division circuit along the way somewhere for the digital to analog converter. | 2011-02-28 05:00:00 Author: Tygers Posts: 114 |
Ah, yeah. I was avoiding making each analogue part to avoid complexity, though now that I've thought about it, it isn't really that bad. Since I already made a division based damage setup, I've pretty much already made it. | 2011-02-28 06:07:00 Author: SSTAGG1 Posts: 1136 |
LBPCentral Archive Statistics
Posts: 1077139
Threads: 69970
Members: 9661
Archive-Date: 2019-01-19
Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.