GameMaker has a built-in variable named lives. We use lives to know when the player has lost the game and then we display "GAME OVER" text.
- [Instructor] Our final feature to code…is the end game scenarios.…So either, you can beat the game or you can lose.…We'll create a new object by right-clicking…the Objects folder, Create Object,…and we'll give it a name of obj_endGame,…and we'll add the only event we need.…Add Event, Draw, Draw GUI.…And we'll create a new script for this.…We'll maximize the window,…then we'll give it a 3 slash comment…of Game over text.…
And because we're drawing text,…let's set the font, draw_set_font,…and once more, let's just re-use our existing font,…fnt_score.…We don't need to set a color yet…but let's set the alignment, draw_set_halign,…and again we use the constant, fa_center.…The color will be dependent on if you beat the game…or if you've lost.…We use an if statement for that.…if (lives > 0),…lives is a built in variable…we're going to use to track…how many more balls the player has.…
So if lives is greater than 0,…then you must have beat the game.…So we'll set the color to blue.…And then we can draw the text with draw_text.…
- Creating a new GameMaker project
- Creating sprites
- Importing existing images
- Adding collisions
- Playing sounds
- Designing game levels
- Creating start and game over screens
- Exporting the game
Skill Level Beginner
iOS Game Development with Swift 3 and SpriteKitwith Todd Perkins2h 52m Intermediate
1. Getting Started
2. The Game Pieces
3. The Gameplay
4. The Game Cycle
5. Finishing a Project
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.