GML scripts can be used to help debug a game. In this video we create a script to test the endgame scenario where a player has beaten the game.
- [Instructor] And now let's handle the alternative…end game scenario where you beat the game.…Open up the ball object,…and go to the green brick collision event, script.…Maximize the window and scroll all the way to the bottom.…First, every time a brick is destroyed,…we want to increase our hits variable.…Hits equals hits plus one.…And now, we can do an if check,…to see if hits is greater than or equal to total bricks.…And remember, total bricks is set to the number…of bricks in our room, in the creative in.…
And now, we can create our end game object…using instance create, zero, zero for the position…and obj underscore, end game for the name of the object.…Now after all of our bricks are destroyed,…the end game object will be created.…Let's save our changes and let's test it out.…I'll launch the ball,…and as you might have guessed,…it could take quite a while to destroy…all the bricks in the room.…To speed this up, let's add some debug text.…
Open the ball object again and add a new event.…This time, a key release I'm going to use digits zero.…
- 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.