O'Reilly logo

3D Game Programming for Teens, Second Edition by Eric Grebler, Maneesh Sethi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Ending the Game

For the game to end, all of the gallery items need to be destroyed (in other words, the score has to equal 35) or the time elapsed will need to equal zero. Whenever one of those two conditions is met, a graphic will appear allowing the user to exit the game or start over. If he elects to start over, we need to have the program jump back to the beginning. We’ll accomplish this by using a Goto command. Remember that with Goto commands we need to create a bookmark so the computer knows where to jump to. In this case, we’ll create a bookmark at the beginning of the program. Add the following bookmark in bold to the game code:

;Creating a bookmark
      .start ;Setting the graphics for the program Graphics3D 1024,768 SetBuffer BackBuffer() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required