Game Maker Studio: How to Create Lives & Healthbar for Player & Boss.

Channel:
Subscribers:
268
Published on ● Video Link: https://www.youtube.com/watch?v=dr1nML_9-O8



Duration: 13:49
172 views
0


Visit my anime and game site: http://mcanime1.wixsite.com/mcanime

GMX File: https://goo.gl/SYvCQp

Note: Game Maker will only allow you to create one Lives and one Health bar, if you try to make more, when you hit the player or the boss using weapon, while having two Health bars for both characters or have two Lives you will both lose health, because relative is checked, if you don't check relative, then you will not lose Lives or Health. Got to make sure to use two different health's for characters.

Bosshp:

Events:

Step

Actions:

If health is smaller than 1

Start of a block

Set the health to 0

Else

End the game or you can create a room for End the Game.

End of a block

Events:

Game Start

Actions:

Set the health to 100

Events:

Draw GUI

Actions:

Draw the health bar

x1: view_xview+2800

y1: view_yview+170

x2: view_xview+2540

y2: view_yview+70

Back color: Red

Bar color: Yellow


Playerlives:

Events:

Create

Actions:

Set lives relative to 5

Events:

No More Lives

Actions: End the game or set a room up for end game

Events:

Draw GUI

Actions:

Draw the lives as image

x: 170

y: 100

Note: May need to adjust x and y numbers when dealing with PC or Android to get hearts or your image in the correct location on screen; also resize image of hearts or whatever image you are going to use for the health. Resize in Photoshop or a different program, if you try to resize in Game Maker, it will resize, but on screen it will not look smaller or bigger, it will be the same size.

Note: Also leave space around heart image or your image you use, this will determine the spacing around heart image for each heart image or your image your using. You don't want them overlapping one another, so leave some space around image.

Boss:

Events:

Playerweapon collison

Actions:

Change instance into from bosstopper to hittopperboss
perform event: yes

Set the health relative to -25

Destory the instance: Other

Events:

Create

Actions:

Set Alarm 0 to room_speed*3

Events:

Alarm 0

Actions:

Set Alarm 0 to room_speed*3

Change instance from boss to boss fire, perform event: yes

Player:

Events:

bossweapon collision

Actions:

Change instance into from playertopper to playerhittopper
perform event: yes

Set lives relative to -1

Destroy the instance: Other

Events:

Left Pressed

Change player to playerfire, perform event: yes

Blocker:

Be sure its not visible and make sure its checked as solid




Other Videos By MC Designs


2018-06-09Game Maker Studio: How to Create Enemy Health Bars above their heads.
2018-05-27Game Maker Studio: How to Deactivate & Reactivate Keyboard Key’s after getting Hit.
2018-05-20Game Maker Studio: How to Move to the Next Room after Collecting Certain Amount of Coins.
2018-04-07Game Maker Studio: How to Create Boss Movements with Custom Health bar.
2018-03-24Game Maker Studio: How to Create Enemy Hit Points.
2018-03-18Game Maker Studio: How to go from Day to Night, Night & Day.
2018-02-25Game Maker Studio: How to Create Random Objects.
2018-02-04Game Maker Studio: How to Create Special Effects.
2018-01-21Game Maker Studio: How to Make you’re File Image Icons Larger on Screen.
2018-01-13Game Maker Studio: How to Create a Mini Map.
2018-01-08Game Maker Studio: How to Create Lives & Healthbar for Player & Boss.
2017-12-09Game Maker Studio: How to select a player & continue background sound.
2017-12-01Game Maker Studio: How to Swim in Water, show Bubbles & Splashes.
2017-11-26Game Maker Studio: How to Stack & Use Objects in you’re game.
2017-11-23Game Maker Studio: How to Create Checkpoints in you’re game.
2017-11-19Game Maker Studio: How to Create Random Objects, Instances & Timing Objects Out.
2017-11-18Game Maker Studio: How to Animate an Object, using a Path, Alarms, & Images.
2017-10-31Game Maker Studio: Create a Custom Mouse Pointer & Gun Target Shooter. Plus, Collect Ammo & Score.
2017-09-26Game Maker Studio: How to Create a Path & Fire Weapon in all Directions.
2017-09-24Game Maker Studio: How to Create Alarms for you're Objects.
2017-09-16Game Maker Studio: How to Make Something Happen, Later in the Game.



Tags:
android
device
pc
computer
windows
healthbar
lives
boss
player
fight
battle
move
game
maker
stuido
play
shoot
fire
weapon
destroy
how
learn
teach
create
health
bar
relative
characters
lose
check
alarm