Zero Game

How do you restart the room when your heath reaches zero in game maker 7?
When your heath reaches zero I want a message to display, the room to restart and 200 points to be deducted from the players score. I know how to do all this when the player collides with the enemy, but I don’t know how to do it when heath reaches zero. If you could tell me that would be great. Thanks
For the following you should create an object called ‘controller’. This object is used too set the score, lives, and many more things.
Also you can delete the script I gave you earlier with this one.
Note: They are in different objects.
Replace the numbers with whatever, I just used common ones.
________Step Event (controller)________
if health < 1 {
lives -= 1
score -= 200
show_message("TYPE YOUR MESSAGE HERE")
room_restart()
}
_______________
Replace the numbers with whatever. I just used common things
________Game Start Event (controller)________
score = 0
health = 100
lives = 3
_______________
If you want the game to go to a menu room or exit when the lives reaches zero (if you have lives) then add this to the step event of the controller. (After the } symbol, otherwise it will only be activated when the health is 0 (which might work, but it's better to add as a new 'if' statement). Also you'd need to make a room called 'menuroom' or change the script. If you want it to exit, replace the 'room=menuroom' with 'game_end()'
________Step Event (controller)________
if lives < 1 {
room=menuroom
}
_______________
PS. Could you upload your game to yoyogames so I could try it out?
You could just set it as a 'work in progress' and I'll search for it. (Also is your name the same on that as it is on this).
N64 F-Zero X – Mute City
|
|
NBX Proud Jack and Zero Vintage Lunch Box Carrying Case $29.99 Carry your stuff with Halloweentown style! Spooky and fun carrying case features Jack Skellington and Zero from The Nightmare Before Christmas! It’s a great way to travel with your Deadly Night Shade!Carry around your belongs with Halloweentown style, with this Nightmare Before Christmas Jack and Zero vintage carrying case! Featuring Jack Skellington and Zero from Tim Burton’s classic The Nightma… |
|
|
Nightmare Before Christmas Jack Skellington & Zero Puzzle Magnet Set $6.95 Imported from Japan, this collectible is new in its unopened package…. |
|
|
Nightmare Before Christmas Zero Resin Face Magnet … |
|
|
Mellon Collie & The Infinite Sadness $13.87 Two CD set in a ‘fat’ double jewel box. Slight scuffs on Disc One will not affect play. Two booklets…. |
|
|
1999 $3.99 CD > POPULAR MUSIC > ROCK… |
|
|
Disney’s Hercules: An Original Walt Disney Records Soundtrack $5.22 Small cut in UPC…. |
|
|
Zero Woman – Dangerous Game [VHS] $29.99 Japan’s deadliest hit woman is sent to shut down the mob-run black market in human organs and winds up the reluctant bodyguard to the government’s chief witness, the sneering mistress of the head man. The Zero Woman formula is closely followed: gratuitous nudity, soft-core sex scenes, and brutal violence abound. In the precredits kickoff, a mad doctor maniacally cackles while fondling the organs o… |
|
|
E-Flite Screwdriver, #00 Phillips $1.98 Screwdriver,#00 PhillipsE-FlitePart EFLA256… |
|
|
Zero – 18W x 13H – Peel and Stick Wall Decal by Wallmonkeys $30.99 WallMonkeys wall graphics are printed on the highest quality re-positionable, self-adhesive fabric paper. Each order is printed in-house and on-demand. WallMonkeys uses premium materials & state-of-the-art production technologies. Our white fabric material is superior to vinyl decals. You can literally see and feel the difference. Our wall graphics apply in minutes and won’t damage your paint or l… |
|
|
Goal Zero Luna .25-Watt Led Flexible Light $20.99 What’s in the Box: 1 x Luna LED USB Light…. |
Liked this article?
Subscribe to our RSS Feeds now!
No Comments to Zero Game so far.
Feel free to follow any responses to this entry through the RSS Feeds for comments. You can leave a response, or trackback from your own site. No one has commented so far, be the first one to comment!