O'Reilly logo

DarkBASIC Pro Game Programming, Second Edition by Joshua R. Smith, Jonathan S. Harbour

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

Divide and Conquer

How about another example to give you a little more practice using parameters? I’ve written a program called RandomText that uses a custom function called PrintAt. This function prints a string on the screen at a specific location using parameters. Here’s the code listing for the RandomText program (shown in Figure 4.4). This program is using several commands you have not really learned yet, so just keep them in mind for now and we’ll cover them in a more formal basis in due time.

Figure 4.4. Output from the RandomText program.

DO color = RGB(RND(256), RND(256), RND(256)) INK color, 0 PrintAt(RND(640), ...

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