answersLogoWhite

0

I will explain how to make your own lives variable; granting you better control over them.

Create event:

lives_left = 3; //Replace 3 with the lives you start with.

health_left = 100; //Replace 100 with the health you start with.

health_max = 100; //Replace 100 with maximum health available.

lives_max = 3; //Replace this 3 the maximum amount of lives.

Step event:

if(lives_left < .1) { game_end(); /*Replace game_end(); with how your game ends*/ }

if(health_left < .1) { /*How you die goes here*/ }

if(health_left > health_max) { health_left = health_max }

if(lives_left > lives_max) { lives_left = lives_max; }

Whatever event makes you get hurt:

health_left -= .1; //Replace .1 with how much damage you take.

This works by simple math; if you have too many lives, you lose that extra life, to have the maximum amount. If you get hurt, it removes some of your health variable. If you have 0 health left, you lose a life. (Set health back to the maximum when you die though, or you'll infinitely die) If you have 0 lives left, the game ends.

This system allows for healing, by health_left += 20; /*Replace 20 with how much to heal*/, allows you to increase lives max, increase how many lives, and allows you to increase how much health you can have.

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin

Add your answer:

Earn +20 pts
Q: How do you make lives in game maker 8?
Write your answer...
Submit
Still have questions?
magnify glass
imp