Post by 54877380 on Mar 22, 2008 1:27:33 GMT -5
I'll just go through how you can put a health bar, score and imaged lives on your game, with Game Maker.
First we make an object and call it objControler. Then make it visible but not solid and have no sprite. Add event create and place set score and make it 0. Then place set lives
and make it 3, or what ever you want. Then place set health
and make it 100, or what ever you want. Then place score caption and make it
show score: don't show
score caption: score:
show lives: don't show
lives caption: lives:
show health: don't show
health caption: health:
Now we have finished the event create
Next we add event no more lives, and in it we put show highscore. You can customise it in any way, it won't matter. Then we place end game or restart game, your choice.
Thats all we put in the event no more lives
Next we add event no more health, and in it we put set health and make it your max health, 100%. Then we place set lives and make it 1 and tick the relative box down the bottom (so you will lose a life when you health is gone, if it's not ticked you will go strait to -1 lives). Thats all of the event no more health.
Last but not least we add the event draw, this will let us see the health, lives and score on the game screen. So in the event we add set font and set it to one of your fonts. Then set colour and choose the colour of your font. Then add draw score and add the location and caption of the score
e.g.
x:180
y:440
caption: score:
Then add draw health and choose the location of your health bar, back colour and colour
e.g.
x1:12
y1:449
x2:138
y2:459
back colour: none
bar colour: green to red
Then add draw lives and choose the location and sprite of your lives
e.g.
x:16
y:410
image: sprHealth
Thats all of the event draw, and thats all I have for you.
First we make an object and call it objControler. Then make it visible but not solid and have no sprite. Add event create and place set score and make it 0. Then place set lives
and make it 3, or what ever you want. Then place set health
and make it 100, or what ever you want. Then place score caption and make it
show score: don't show
score caption: score:
show lives: don't show
lives caption: lives:
show health: don't show
health caption: health:
Now we have finished the event create
Next we add event no more lives, and in it we put show highscore. You can customise it in any way, it won't matter. Then we place end game or restart game, your choice.
Thats all we put in the event no more lives
Next we add event no more health, and in it we put set health and make it your max health, 100%. Then we place set lives and make it 1 and tick the relative box down the bottom (so you will lose a life when you health is gone, if it's not ticked you will go strait to -1 lives). Thats all of the event no more health.
Last but not least we add the event draw, this will let us see the health, lives and score on the game screen. So in the event we add set font and set it to one of your fonts. Then set colour and choose the colour of your font. Then add draw score and add the location and caption of the score
e.g.
x:180
y:440
caption: score:
Then add draw health and choose the location of your health bar, back colour and colour
e.g.
x1:12
y1:449
x2:138
y2:459
back colour: none
bar colour: green to red
Then add draw lives and choose the location and sprite of your lives
e.g.
x:16
y:410
image: sprHealth
Thats all of the event draw, and thats all I have for you.