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

Chapter 4. Program Logic: Branching Statements, Functions, and Algorithms

Regardless of programming language or computer system, there is a point where logic commands reach a roadblock and the program cannot grow any larger without being broken into smaller parts. When the main procedure needs to do something specific, such as check the position of the mouse pointer on the screen, it is better to jump to another part of the program that specifically handles mouse input than to write the mouse code directly in the main procedure’s source code. That way other parts of the program can use the mouse, and you don’t have to rewrite the mouse commands every time.

This chapter will teach you how to break up a program into smaller parts, called subroutines ...

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