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

Adding Text Variables

As you can see by the example in the last section, having text without some sort of variable just isn’t that effective. In that example, we have the word “Score,” but more importantly, what we don’t have is the actual score. This can be added by expanding our Text command. Think of the Text command as an equation; if you want to add something, just use the + sign.

Now we’ll continue on with the example we used in the last section, so if for some reason you thought it would be a good idea to skip that section and jump to here, think again. Go back and add the “Score” line to the demo13-06.bb program.

Before we add the code necessary to display the score on the screen, we have to determine how we are going to keep score in ...

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