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

A Text-Based Guessing Game

Now, let’s put together all of what you learned in this chapter and create your first guessing game! Basically, the users enter a number, and you will tell them if they are too high or too low. You will allow the users to guess until they figure it out. In order to make this game work, you will be using a loop in this game. If you cannot understand what the loop’s function is, it is explained in the next chapter.

First you need to create an initialization section. It will look something like this.

;demo02-11.bb - Try to guess the number Print "Welcome to the Guessing Game!" AppTitle "Guessing Game!" ;Seed the random generator...don't worry, it will be explained later SeedRnd MilliSecs() ;Pick a number between 1 and ...

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