Jump to content


Photo

how to add 2 health bars in 2 sides


  • Please log in to reply
8 replies to this topic

#1 roshan119

roshan119

    GMC Member

  • New Member
  • 11 posts

Posted 10 October 2011 - 01:00 PM

hello developers i have a doubt how to add 2 health bars in a 2 sides
i am cearing a fighting game in game maker 8 it want to be assign to 1 for player 1 for enimi in the top right and top left corner

pleas help me
  • 0

#2 PWL

PWL

    The non-pixel-artist

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

Posted 10 October 2011 - 01:09 PM

You have to create two variables e.g. global.health1 and global.health2, then make a healthbar-sprite with images 0-100 with increasing health. Then you can go something like this:
draw_sprite(spr_healthbar,global.health1,x,y);
draw_sprite(spr_healthbar,global.health2,x,y);

Edited by PWL, 10 October 2011 - 01:10 PM.

  • 0

#3 Logfan200

Logfan200

    GMC Member

  • GMC Member
  • 177 posts
  • Version:GM5

Posted 10 October 2011 - 01:12 PM

PWL: Why don't just use draw_healthbar?

draw_healthbar(x,y,x2,y2,hp,c_green,c_green,c_red,0,1,1);
Then just make another one, but change the variable and x/y positions.
  • 0

#4 roshan119

roshan119

    GMC Member

  • New Member
  • 11 posts

Posted 10 October 2011 - 01:35 PM

You have to create two variables e.g. global.health1 and global.health2, then make a healthbar-sprite with images 0-100 with increasing health. Then you can go something like this:

draw_sprite(spr_healthbar,global.health1,x,y);
draw_sprite(spr_healthbar,global.health2,x,y);


dear pleas help i am new to game maker ware can i create those variables
  • 0

#5 Logfan200

Logfan200

    GMC Member

  • GMC Member
  • 177 posts
  • Version:GM5

Posted 10 October 2011 - 01:37 PM


You have to create two variables e.g. global.health1 and global.health2, then make a healthbar-sprite with images 0-100 with increasing health. Then you can go something like this:

draw_sprite(spr_healthbar,global.health1,x,y);
draw_sprite(spr_healthbar,global.health2,x,y);


dear pleas help i am new to game maker ware can i create those variables

Uhm, you don't know how variables work? How the hell are you supposed to create an fighting game? Protip: Learn variables before doing ANYTHING.
  • 0

#6 roshan119

roshan119

    GMC Member

  • New Member
  • 11 posts

Posted 10 October 2011 - 01:41 PM

PWL: Why don't just use draw_healthbar?

draw_healthbar(x,y,x2,y2,hp,c_green,c_green,c_red,0,1,1);
Then just make another one, but change the variable and x/y positions.


pleas tell me step by step i created basic one like this

creat an object
under that i create draw event and i put draw helth bar x1=16 y1=16 x2=160 y2=32

after that to my player i set
that helth to -3

and i put that helth object in to a room but iwant that hekth bar in right side but it is in left side


pleas help me
  • 0

#7 roshan119

roshan119

    GMC Member

  • New Member
  • 11 posts

Posted 10 October 2011 - 01:43 PM



You have to create two variables e.g. global.health1 and global.health2, then make a healthbar-sprite with images 0-100 with increasing health. Then you can go something like this:

draw_sprite(spr_healthbar,global.health1,x,y);
draw_sprite(spr_healthbar,global.health2,x,y);


dear pleas help i am new to game maker ware can i create those variables

Uhm, you don't know how variables work? How the hell are you supposed to create an fighting game? Protip: Learn variables before doing ANYTHING.



hmm iknow the variable (i am a software engineering undergraduate) but i am new to this game maker thats y
  • 0

#8 Logfan200

Logfan200

    GMC Member

  • GMC Member
  • 177 posts
  • Version:GM5

Posted 10 October 2011 - 01:46 PM




You have to create two variables e.g. global.health1 and global.health2, then make a healthbar-sprite with images 0-100 with increasing health. Then you can go something like this:

draw_sprite(spr_healthbar,global.health1,x,y);
draw_sprite(spr_healthbar,global.health2,x,y);


dear pleas help i am new to game maker ware can i create those variables

Uhm, you don't know how variables work? How the hell are you supposed to create an fighting game? Protip: Learn variables before doing ANYTHING.



hmm iknow the variable (i am a software engineering undergraduate) but i am new to this game maker thats y

And you've got an F in English? Can't understand **** you sayin'.
  • 0

#9 roshan119

roshan119

    GMC Member

  • New Member
  • 11 posts

Posted 10 October 2011 - 01:47 PM

pleas tell me step by step i created basic one like this

creat an object
under that i create draw event and i put draw helth bar x1=16 y1=16 x2=160 y2=32

after that to my player i set
that helth to -3

and i put that helth object in to a room but iwant that hekth bar in right side but it is in left side


pleas help me
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users