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.

Newcomers DBPro Corner / Help with making a healthbar and switching avatars beside the health bar

Author
Message
Beast E Gargoyle
17
Years of Service
User Offline
Joined: 15th Feb 2007
Location: Sunny San Diego, CA
Posted: 10th Mar 2008 19:03 Edited at: 10th Mar 2008 19:04
Hello,

I'm trying to make a health bar using the supplied media I have attached and I want to make a health bar that you can switch the character's avatar beside it. Any help would be appreciated. Here is a short little health bar code I found could somebody help with the avatar part.

Thanks for any replies. All the best,
Beastegargoyle

Streets of Rage the best 3d beat em up ever check out the wip on apollo forums!
The Last Great Swordsmen Wip here http://forum.thegamecreators.com/?m=forum_view&t=124414&b=19

Attachments

Login to view attachments
Vesper103
16
Years of Service
User Offline
Joined: 21st Feb 2008
Location: Beloit WI
Posted: 10th Mar 2008 19:14
okay, first thing is i noticed you had a health bar sprite included in that file. if you want to use that you will have to make it into an animated sprite with each sprite showing a percentage of the sprite. (10% each would be good so you can divide it up equally by 100). as health changes eatither use this:



or:



if health/max health is equal to thats sprite (eg a frame with 10% health would require health/max health to be between .1 and .19)

for the avatar, you would do basicaly the same thing. set up a sprite sheet to have 2 frames and make an animated sprite. and when sprite frame 1 (first avatar) is needed.:



and do the same for 2, hope that helps.




Beast E Gargoyle
17
Years of Service
User Offline
Joined: 15th Feb 2007
Location: Sunny San Diego, CA
Posted: 11th Mar 2008 19:12 Edited at: 15th Mar 2008 05:42
My friend Chris wrote this coding for the health bar here is what he came up with
Now on to applying a avatar beside the health bar and than clearing over it to apply a differnt characters avatar. I'll work on it some more when I get back from work. Till than thanks for any replies and all the best.
Edit: Media now attached.
Beastegargoyle

Streets of Rage the best 3d beat em up ever check out the wip on apollo forums!
The Last Great Swordsmen Wip here http://forum.thegamecreators.com/?m=forum_view&t=124414&b=19

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th Mar 2008 06:45
beast, i did this real quick-like. hope it helps.

(check attachment)

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP

Attachments

Login to view attachments
Beast E Gargoyle
17
Years of Service
User Offline
Joined: 15th Feb 2007
Location: Sunny San Diego, CA
Posted: 14th Mar 2008 16:43
Wow, thanks Virtual Nomad that was just the type of idea for my health bar I had in mind! Although I have a question I have one more avatar I want to use(its attached). How did you get the image to just show the person and not the white background with it? All the best,
Beastegargoyle

Streets of Rage the best 3d beat em up ever check out the wip on apollo forums!
The Last Great Swordsmen Wip here http://forum.thegamecreators.com/?m=forum_view&t=124414&b=19

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th Mar 2008 17:23 Edited at: 14th Mar 2008 17:29
that's the beauty of using .png files with dbpro. alpha / trans is automatic (no set colorkey necessary, etc). i set my magic wand selector to 60% tolerance on the outer white, reversed the selection, then copied and pasted the avatar as a new image (then resized the canvas to get a 90x90 size for consistancy with the others).

.png files can be a little tricky; do a search on the forums for "png" and you'll see some other examples and info.

meanwhile, here's your 3rd avatar prepped similarly. all 3 were done very quickly (my spare time is short lately); goal was to give you the idea. but using pngs and a couple extra steps would provide smooth, clean, anti-aliased sprites in a very short time.



Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-25 05:19:30
Your offset time is: 2024-11-25 05:19:30