Jump to content


Photo
- - - - -

Healthbar Example!


  • Please log in to reply
60 replies to this topic

#1 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4098 posts
  • Version:GM6

Posted 06 June 2007 - 11:09 AM

Healthbar Example!

  • Description: This tutorial explains the basics on how to make multiple healthbars and includes both D&D and code.
  • GM Version: :GM7:
  • Registered: no
  • File Type: .gmk
  • File Size: 30 kb
  • File Link: Healthbar Example

Summary

Here is a simple healthbar example I made for all those people in the Novice Questions and Answers asking how to make multiple healthbars. This example features...

// More than one healthbar
// Shooting towards the mouse (with inaccuracy)
// Setting a cursor sprite
// Making blood and guts spurt everywhere
// Using the random function
// Using gravity
// Moving diagonaly
// Changing weapons


If you use this for one of your games I would appreciate it if you give some credit to me - it's just a nice thing to do.

Warning! Contains violence!
healthbarexamplesr9.png

Download Count: 03784! - 27 of Nov, 2008
Download Count: 04070! - 21 of Dec, 2008
Download Count: 04226! - 13 of Jan, 2009
Download Count: 04403! - 04 of Feb, 2009
Download Count: 04987! - 04 of Apr, 2009
Download Count: 05543! - 15 of Jul, 2009
Download Count: 05675! - 30 of Aug, 2009
Download Count: 05791! - 22 of Sep, 2009
Download Count: 05902! - 18 of Oct, 2009
Download Count: 07264! - 09 of Nov, 2010

Download Count: 11128! - 05 of May, 2013

 

I also made it into a GM6 file for all you Game Maker 6.1 users!
Link GM6: Healthbar Example


Created by Stubbjax.


Edited by Stubbjax, 05 May 2013 - 02:54 AM.

  • 1

#2 FireWire Games

FireWire Games

    GMC Member

  • New Member
  • 1548 posts

Posted 07 June 2007 - 03:45 AM

OMG! I love this!
  • 0

#3 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4098 posts
  • Version:GM6

Posted 07 June 2007 - 05:19 AM

if only it worked on Vista :(

<{POST_SNAPBACK}>


I've converted it into a GM6 if you wanted. :( I have GM6 Registered so it was no problem.

OMG! I love this!

<{POST_SNAPBACK}>


Thanks! :huh:

Edited by stubbjax02, 13 January 2009 - 03:15 AM.

  • 0

#4 BloodReaver

BloodReaver

    GMC Member

  • Banned Users
  • 97 posts

Posted 07 June 2007 - 08:39 PM

i personally don't think anybody would need this kind of example...

for drawing multiple healthbars, you should use the healthbar code ( gml, not D&D) and just use variables...

#5 XxSyThExX

XxSyThExX

    GMC Member

  • New Member
  • 183 posts

Posted 09 June 2007 - 05:04 AM

This was an awsome example really good how you did the gml and the d&d together great tutorial only if all tutorials were like this! Very good 10/10 I'll definetly use this! Thanks! :blink:

~XxSyThExX

Edited by KC LC, 09 June 2007 - 03:56 PM.

  • 0

#6 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4098 posts
  • Version:GM6

Posted 12 June 2007 - 06:59 AM

i personally don't think anybody would need this kind of example...

for drawing multiple healthbars, you should use the healthbar code ( gml, not D&D) and just use variables...

<{POST_SNAPBACK}>

Well some people think otherwise. Remember, this is not only for multiple healthbars, but custom ones too.

This was an awsome example really good how you did the gml and the d&d together great tutorial only if all tutorials were like this! Very good 10/10 I'll definetly use this! Thanks! :whistle:

~XxSyThExX

<{POST_SNAPBACK}>

Thanks for the great feedback. 10/10 is a great score, thanks! ^_^ Are there any suggestions for new features or improvements? Maybe I'll add an option to change weapons?

Edited by stubbjax02, 06 December 2008 - 06:16 AM.

  • 0

#7 salmjak

salmjak

    GMC Member

  • New Member
  • 80 posts

Posted 12 June 2007 - 06:31 PM

Doesn't work for me :'( Do I have to put all the sprite changes in drawing event? Because my sprite doesn't change when I want it to when I use this :blink:
  • 0

#8 monomito

monomito

    GMC Member

  • New Member
  • 59 posts

Posted 14 June 2007 - 05:45 PM

nice I like it good work :)
  • 0

#9 trippledean96

trippledean96

    GMC Member

  • New Member
  • 7 posts

Posted 16 June 2007 - 10:56 PM

Wow this is great, i am sooo using this in my game!!!!
  • 0

#10 dRuNkEn ImMoRtAl

dRuNkEn ImMoRtAl

    GMC Member

  • New Member
  • 96 posts

Posted 15 July 2007 - 07:55 PM

amazing work!
More examples should be like this with the D&D and code.
  • 0

#11 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4098 posts
  • Version:GM6

Posted 22 July 2007 - 08:42 AM

Doesn't work for me :'( Do I have to put all the sprite changes in drawing event? Because my sprite doesn't change when I want it to when I use this :P

<{POST_SNAPBACK}>

Hmm... Try this:
draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,imag
e_yscale,image_angle,image_blend,image_alpha)
If your not registered, just use:
draw_sprite(sprite_index,image_index,x,y)

nice I like it good work :P

<{POST_SNAPBACK}>

Thanks.

Wow this is great, i am sooo using this in my game!!!!

<{POST_SNAPBACK}>

That's great news! Good for you. :D

amazing work!
More examples should be like this with the D&D and code.

<{POST_SNAPBACK}>

Yes I know. I should make some more stuff like this. :angry:

Edited by stubbjax02, 06 December 2008 - 06:17 AM.

  • 0

#12 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4098 posts
  • Version:GM6

Posted 30 July 2007 - 10:36 AM

Everyone, I have majourly updated the tutorial. :chikin It now includes...

// Shooting towards the mouse with inaccuracy
// Changing weapons
// Using alarms
// Using up ammo
// Drawing the amount of ammo
// Healthbar Backgrounds
// Actions for the code that I forgot to put in the old version


Buttons to change weapons...

1=Machinegun
2=Shotgun

Have fun! :(
  • 0

#13 Grievous

Grievous

    GMC Member

  • New Member
  • 1262 posts

Posted 30 July 2007 - 02:10 PM

lol. With the inaccuracy, shooting, ammo and such, this is looking more like my TDS example than a healthbar example. :(

Anyway, I suggest making the blood disappear after a while... other than that, nice work.
  • 0

#14 Glen

Glen

    GMC Member

  • GMC Member
  • 840 posts
  • Version:GM:Studio

Posted 25 August 2007 - 08:52 PM

I liked this... It was fun to mess around with...
  • 0

#15 Astrosapien

Astrosapien

    GMC Member

  • New Member
  • 473 posts

Posted 11 September 2007 - 11:20 AM

Excellent example. I'm trying to make a good RPG game right now, and my knowledge of GML is very limited, so this really helped me. Thanks!
  • 0

#16 Chibi Neko

Chibi Neko

    GMC Member

  • New Member
  • 157 posts

Posted 12 September 2007 - 02:20 PM

stubbjax02, thanks for supplying the example tutorial. This will certainly make many GM learners, such as myself, learn more about multiple health, and some of the wonderful effects that you have also shown in your tutorial.

Thanks again!
  • 0

#17 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4098 posts
  • Version:GM6

Posted 18 September 2007 - 09:14 PM

lol. With the inaccuracy, shooting, ammo and such, this is looking more like my TDS example than a healthbar example. ^_^

Anyway, I suggest making the blood disappear after a while... other than that, nice work.

<{POST_SNAPBACK}>


I was going to, but since this is example is mainly aimed at unregistered users, I couldn't make it fade away really. I guess I could use an alarm though. And yes it is a bit like your example but I had not even seen it before I made this example.

I liked this... It was fun to mess around with...

<{POST_SNAPBACK}>


I'm glad you liked it.

Excellent example. I'm trying to make a good RPG game right now, and my knowledge of GML is very limited, so this really helped me. Thanks!

<{POST_SNAPBACK}>


That's great Astrosapien! But if you have little knowledge of GM, and decide to start making an RPG, it is going to be hard. Seriously, I tried to make an RTS as soon as I got GM but it was a complete failure. After a year, it seems that I have now learnt enough, so now I know how to make one. But I haven't even tried an RPG before. So yeah, good luck with your RPG. :lol:

stubbjax02, thanks for supplying the example tutorial. This will certainly make many GM learners, such as myself, learn more about multiple health, and some of the wonderful effects that you have also shown in your tutorial.

Thanks again!

<{POST_SNAPBACK}>


Thank you Chibi Neko. I'm glad to see many new GM users learn from my tutorial. It really encourages me to make more because of all the nice feedback. ^_^
  • 0

#18 IcyWyvern

IcyWyvern

    GMC Member

  • New Member
  • 8 posts

Posted 20 September 2007 - 11:59 AM

WOAH! This is one of the BEST tutorials ever! Its basicly almost perfect, but maybe you could add in an example of a boss?

Wait... if you add in a boss, it'll basicly be a game, not a tutorial.

I managed to add in a raygun by editing the player and adding a raygun bullet in the sprites. Its simple to edit, which is really good for GM learners. Great job!
  • 0

#19 Rtyp06

Rtyp06

    GMC Member

  • GMC Member
  • 1608 posts
  • Version:GM:Studio

Posted 25 September 2007 - 02:13 AM

Excellent example. Unfortunately it's limited to static sprites due to placing the health bar in the draw event of the enemy object.
  • 0

#20 11clock

11clock

    Christian Pacifist

  • GMC Member
  • 1513 posts
  • Version:GM:Studio

Posted 08 January 2008 - 09:46 PM

Umm... Was it supposed to grow longer when the max hp is bigger? :P
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users