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

The DynamicScroller Source Code

The DynamicScroller program only has a few key functions that you will need to understand in order to adapt the code to your own tile-based game. I will explain every part of the program in the following pages. First, let’s start with the global variables and constants used by the program. This section of code is very important because it defines all of the settings of the scroller. This code might need to be made more reusable by moving some of these globals into parameters for the various scroller support functions. At this point, clarity is more important than efficiency and code reuse. You will want to modify the TILEWIDTH and TILEHEIGHT constants if you change the size of your tiles (they are currently 32×32). ...

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