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

Understanding Functions

Functions are integral to any program. Even in the programs you have been writing so far, you have used functions such as Print and Delay, and you have even written your own implicit main function. This section teaches you how to write your own functions that will make understanding and writing your program much easier and simpler.

Functions are small snippets of code that usually perform a single task. All programs consist of at least one function: main. Although main isn’t actually defined, it still exists within the program.

Every line of code written so far (with the exception of the ones in Chapter 1) has been written in the function main. This function is the starting point and ending point of every Blitz3D program. ...

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