Author |
Message |
|
omni
Member
Joined: 14 Jun 2003 Posts: 115
|
Posted: 14 Jul 2003 02:35:59 pm Post subject: |
|
|
I'm trying to make an HP and MP bar like in some rpgs, but I can't seem to get it to work properly.
I read a tutorial and it's source went like this:
('A' is the current HP and 'B' is the max HP)
: Line(5,-27,50,-27
: Line(5,-29,50,-29
: Pt-On(4,-28
: Pt-On(51,-28
: (A/B)50 -> C
: Line(5,-28,C,-28
// The first four lines are setting up the frame of the bar and the next two lines determine where the actual bar is going to stop.
The problem with this is that it only looks good when the character is at max HP, but when HP level is at like maybe 90% the line isn't even half way across.
Is there a better way to make a bar?
Last edited by Guest on 14 Jul 2003 02:37:24 pm; edited 1 time in total |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 14 Jul 2003 03:04:33 pm Post subject: |
|
|
try this:
Code: Line(5,-27,50,-27
Line(5,-29,50,-29
Line(4,-28,51,-28 //Draw full HP Meter
//Battle code here
45-A/B45->C //Increase C so the next line turns off more pixels as HP drops
Line(50,-28,C,-28 //Update Meter
//Rest of code
|
|
Back to top |
|
|
omni
Member
Joined: 14 Jun 2003 Posts: 115
|
Posted: 15 Jul 2003 01:20:11 pm Post subject: |
|
|
is there supposed to be a 0 after the last line command? |
|
Back to top |
|
|
Spyderbyte
Advanced Member
Joined: 29 May 2003 Posts: 372
|
Posted: 15 Jul 2003 03:30:02 pm Post subject: |
|
|
A 0 after the Line( command draws a blank line. (Erases the pixels)
Does that help?
Spyderbyte |
|
Back to top |
|
|
Babyboy
Advanced Member
Joined: 11 Jun 2003 Posts: 499
|
Posted: 15 Jul 2003 06:45:00 pm Post subject: |
|
|
ok, this may be very unoptimized and ugly but coulden't you just use an if command to se what the HP is and then write the pixles according to that? the size of the bar would depend on the max HP |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 16 Jul 2003 12:36:51 am Post subject: |
|
|
mine works fine, faster,and smaller. and yes, there should be a ,0 on the last line. sry about the error. |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 16 Jul 2003 07:24:11 am Post subject: |
|
|
Babyboy wrote: ok, this may be very unoptimized and ugly but coulden't you just use an if command to se what the HP is and then write the pixles according to that? the size of the bar would depend on the max HP
That would be much slower and takes much more memory.
25->H //25 HP
Line(5,5,55,5 //draw full health
Line(5+H,5,55,5,0 //erase empty part of health bar
Line(X_Min,Y,X_Max,Y
Line(X_Min+Health,Y,X_Max,Y,0
Last edited by Guest on 16 Jul 2003 07:25:19 am; edited 1 time in total |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 16 Jul 2003 10:22:59 am Post subject: |
|
|
i usually know the best routes to do stuff, and if not, im willing to learn, but that doesnt happen very oftain. |
|
Back to top |
|
|
Tyler
Advanced Member
Joined: 29 May 2003 Posts: 352
|
Posted: 16 Jul 2003 11:31:48 am Post subject: |
|
|
Now we all, most of us anyways, need to learn the routes to spellin godd |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 16 Jul 2003 02:07:34 pm Post subject: |
|
|
Tyler wrote: Now we all, most of us anyways, need to learn the routes to spellin godd
its "good"...
yes, we do. accidental mistokes dont count though. well, they can be fixed, so yeah, those count to.
Last edited by Guest on 16 Jul 2003 02:07:46 pm; edited 1 time in total |
|
Back to top |
|
|
Babyboy
Advanced Member
Joined: 11 Jun 2003 Posts: 499
|
Posted: 16 Jul 2003 04:38:06 pm Post subject: |
|
|
do spelling mistakes matter? besides being a nusiance its not all bad |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 16 Jul 2003 05:17:09 pm Post subject: |
|
|
well, ur right there |
|
Back to top |
|
|
ceslayer
Newbie
Joined: 15 Jul 2003 Posts: 15
|
Posted: 16 Jul 2003 09:22:53 pm Post subject: |
|
|
bar like this??
Look me
last screenshot |
|
Back to top |
|
|
JacobdeHaan
Member
Joined: 10 Jul 2003 Posts: 165
|
Posted: 17 Jul 2003 01:37:41 am Post subject: |
|
|
Spyderbyte wrote: A 0 after the Line( command draws a blank line. (Erases the pixels)
Thank you, I really needed a command like that, I never guessed that it existed, A Thousand Blessings! |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 17 Jul 2003 07:46:20 am Post subject: |
|
|
Babyboy wrote: do spelling mistakes matter? besides being a nusiance its not all bad
Besides being a nousiance it can create misunderstandings and such. Also, people who actually use correct grammar and spelling tend to get more respect of others, and it makes you look smarter . If you don't use proper grammar and spelling people tend to ignore (or just won't bother to reply) your posts more.
My opinion is that since you're not in a hurry to type your reply's/questions (this is a forum, not a chatroom) you might as well take your time to write everything properly since this is only a good thing and not writing things properly is a nousiance for others.
Last edited by Guest on 17 Jul 2003 07:47:42 am; edited 1 time in total |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 19 Jul 2003 06:13:57 am Post subject: |
|
|
i fully and absoluetly agree with Arcane Wizard |
|
Back to top |
|
|
|