Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Health bar, Need a little help
Unspecified
FoxGuy(R)
Posted: Jul 9 2008, 11:36 PM
Quote Post


Regular
[*]

Group Icon
Group: Members
Posts: 444
Member No.: 3417
Joined: 10-March 07

Status: (0d) [--]


I already know how to make variables appear on screen and etc but i don't know how to draw multiple health bars.I've seen it done but i don't know how.Any suggestions maybe?


--------------------
THinking.....

TotMK Great things...
PMYahoo
Top
Unspecified
Draco Icebane
Posted: Jul 10 2008, 12:34 AM
Quote Post


Standard Member
[*][*][*][*][*]


Group Icon
Group: Banned
Posts: 52997
Member No.: 10
Joined: 13-October 03

Status: (71582612m) [XX]


uh is this klik or gamemaker
PM
Top
Unspecified
FoxGuy(R)
Posted: Jul 10 2008, 12:54 AM
Quote Post


Regular
[*]

Group Icon
Group: Members
Posts: 444
Member No.: 3417
Joined: 10-March 07

Status: (0d) [--]


Sorry i forgot.Gamemaker.


--------------------
THinking.....

TotMK Great things...
PMYahoo
Top
Canada
Mewizkuit
Posted: Jul 10 2008, 01:10 AM
Quote Post


CHARMANDER
[*][*][*][*]

Group Icon
Group: Members
Posts: 4397
Member No.: 2508
Joined: 16-August 06

Status: (0d) [--]


just use the command you used to draw the health bar and repeat it...


--------------------
QUOTE
whenever i feel like clicking "reply"
i stop and think to myself, "why"
will it be a post to be remembered by?
or will i scare off a n00b and tell him to die?
PMEmail PosterMSN
Top
Unspecified
FoxGuy(R)
Posted: Jul 10 2008, 01:20 AM
Quote Post


Regular
[*]

Group Icon
Group: Members
Posts: 444
Member No.: 3417
Joined: 10-March 07

Status: (0d) [--]


Maybe i should be more specific on my goal but before trying are the health bars independent(each have a value)or they have the same(They all change if one changes value).I'm trying for independent.


--------------------
THinking.....

TotMK Great things...
PMYahoo
Top
Unspecified
Miaxis
Posted: Jul 10 2008, 02:27 AM
Quote Post


hagan bromas
[*]

Group Icon
Group: Members
Posts: 1799
Member No.: 2793
Joined: 12-October 06

Status: (0d) [--]


if you use health as the variable each have the same
though if you use a custom variable only the rest is a bit complicated

draw_rectangle_color(x,y,x+yourhpvari,y+4,c_green,c_green,c_green,c_green,1)

put that in the draw event and change the vari(and the colors if you want)

that draws a healthbar with 1 HP being 1 pixel
if you have more HP than the screen width just use a formula


--------------------
user posted image

user posted imageuser posted imageuser posted imageuser posted image
PMEmail PosterUsers WebsiteMSN
Top
Japan
Soiyeruda
Posted: Jul 10 2008, 02:38 AM
Quote Post


Because retarded looking women is fun. :S
[*][*][*][*][*]
[*][*][*]

Group Icon
Group: Members
Posts: 3589
Member No.: 5004
Joined: 6-March 08

Status: (0d) [--]


What I like to do is just create the healthbar itself. This is about the only way you can make a health bar that isn't one flat color.

Sure, it'll take like 30 minutes to do, but it's worth the neatness :P

If you wanted to create something like every character on screen has a healthbar, I'd suggest using parents.

If you want to be particularly lazy, use the draw_healthbar command
It's incredibly easy to use. It's slightly more complicated than the rectangle, but you should still be able to use it well.

And yes, it's possible to do HP higher than the usual 100.

Just put this under amount:
(hp/mxhp)*100

Basically, you have your current hp, divided by max hp, and then the *100 is so it's a value that the healthbar can read.

Eg.

83/467 = about .18.
* 100 will give you about 17.8. The healthbar will then interpret the value as such (17.8), and your healthar will appear as if you had 17 hp (aka, 17% of your max hp.).

This post has been edited by Soiyeruda on Jul 10 2008, 02:43 AM
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0660 ]   [ 14 queries used ]   [ GZIP Enabled ]   [ Server Load: 2.23 ]