Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Extremely Dynamic Health Bar

Author
Message
Ralen
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location:
Posted: 8th Dec 2003 01:26
Here is an extremely dynamic healthbar function I came up with.

You can change every aspect of this healthbar simply by adjusting variables.

It is easy to understand, and easy to use. You may have to come up with your own conditions however to prevent some undesirable effects.

I included some additional code to show off how dynanmic and adjustable this healthbar really is.

This code can be adapted to any information that you would want to display on a bar graph.
Doucan
20
Years of Service
User Offline
Joined: 26th Nov 2003
Location: Vermont USA
Posted: 10th Dec 2003 02:04
I don't see any code

But I'm interested



If you come to a fork in the road, take it!

-Yogi Berra
Ralen
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location:
Posted: 10th Dec 2003 03:59
Click the button that says source :p
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 11th Dec 2003 23:21 Edited at: 11th Dec 2003 23:22
How's this?

genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 12th Dec 2003 00:33
I had to write something like that for my RTS, very good!

Be happy, tomorrow is another day
PurpleHeart
20
Years of Service
User Offline
Joined: 9th Dec 2003
Location:
Posted: 30th Dec 2003 19:27
hmm....i tried both the healthbars there for my 3D game, but neither of them showed up. I followed the directions exactly and im not getting any errors there just not there??? here's a snippet. What am i doin wrong?



Purple Heart - The Ultimate WWI FPS on DBPro
http://www.geocities.com/andrewdewitt55
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 31st Dec 2003 22:16
Yup, almost identical to what I'm using . Mine has X-Y-X2-Y2 though, and input for the for and background colors.

--Mouse: Famous (Avatarless) Fighting Furball

I am the chainsaw paladin.
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 31st Dec 2003 22:21
Oh, I see your has most of that-- was looking at the less complex one Phaelax posted. Nevermind.

--Mouse: Famous (Avatarless) Fighting Furball

I am the chainsaw paladin.
Ralen
21
Years of Service
User Offline
Joined: 22nd Jul 2003
Location:
Posted: 19th Jan 2004 04:59
Purpleheart,

Probably a little late to reply. I hardly check these boards.

I'm not sure why its not working for you.

sync makes the bar do wierd things. Its possible that if you remove the single the bar will be visible. You might move the function call right up under where you are displaying your text as something in the functions right above it might be cause the bar to behave oddly.

I would actually try using a image rather than the 2d commands when it comes down to it.

Ralen
RebirthAnime
22
Years of Service
User Offline
Joined: 11th Oct 2002
Location:
Posted: 16th Feb 2004 02:10
how would you go about using your healthbar for several different characters at once ralen, I'm trying to see if I could use yours in my rpg or develop one off it? I tried fooling with your code phaelax but it wouldn't work.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Feb 2004 00:16
darn those dynamic variables!
I also found another mistake in my function. The first box that is drawn has no width, so it'll never show. You can tell I never tested my code. Ok, here's a tested, working function. And an example of how to use it with multiple units. You use an array. More customizable and easier with a type.



"eureka" - Archimedes
RebirthAnime
22
Years of Service
User Offline
Joined: 11th Oct 2002
Location:
Posted: 18th Feb 2004 02:46
can you provide a more detailed explanation into how you set it up and what the different things are for? no one ever seems to put much detail into explanations and I'd like to understand how to do it so I can do it on my own again without having to return to try to modify someone elses code for my own use.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 18th Feb 2004 10:16 Edited at: 18th Feb 2004 10:17
Well the function should explain everything you need to know about it. You know what an array is?




The point?

so if you wanted to do something like lets say display the data in all those variables, you could easily do it like so:



that's like saying



This thread is turning out to be not so code-snippet-like.

"eureka" - Archimedes

Login to post a reply

Server time is: 2024-11-23 21:19:14
Your offset time is: 2024-11-23 21:19:14