O'Reilly logo

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

DarkBASIC Programming for the Absolute Beginner

Book Description

Looking for an inexpensive way to learn the fundamentals of game programming? Look no further! DarkBASIC Programming for the Absolute Beginner will provide you with a fun, gentle learning curve for learning DarkBASIC-- no prior programming experience required! DarkBASIC is an inexpensive programming language that supports the development of desktop applications, but is especially useful for game creation. DarkBASIC Programming for the Absolute Beginner will touch on all aspects of DarkBASIC's capabilities, but emphasis is placed on using it in game development. A different programming concept is taught in every chapter walking you through the creation of a simple game to illustrate the concept. This "learn by doing" approach not only provides a sense of accomplishment, but it's also a fun way to learn. By the end of the book, you'll have a fundamental understanding of programming in DarkBASIC and an excellent foundation of knowledge for future forays into the exciting worlds of game development and computer programming.

Table of Contents

  1. Copyright
  2. Acknowledgments
  3. About the Author
  4. Introduction
  5. Introducing DarkBASIC Professional
    1. Introducing DarkBASIC Professional
      1. Project Preview: The Dark Jokes Game
      2. A Quick Overview of DarkBASIC Professional
      3. DarkBASIC Versus DarkBASIC Professional
      4. Setting Up DarkBASIC Professional
      5. A Quick DarkBASIC Demonstration
      6. A Few Basic Scripting Commands
      7. Other Game Building Tools Provided by the Game Creators
      8. Other DarkBASIC Resources
      9. DarkBASIC Professional’s Architecture
      10. Summary
    2. Getting Comfortable with the DarkBASIC Professional Integrated Development Environment
      1. Project Preview: The Fortune Teller Game
      2. Mastering the DarkBASIC Professional IDE
      3. Creating New Projects
      4. Alternate Integrated Development Environments
      5. Text, Color, and Graphics
      6. Back to the Fortune Teller Game
      7. Summary
  6. Learning How to Write DarkBASIC Applications
    1. Working with Data Types, Variables, and Arrays
      1. Project Preview: The Number Guessing Game
      2. Storing And Manipulating Data
      3. Working With Variables
      4. Storing Data That Never Changes
      5. Embedding Data in Your Code File
      6. Storing and Retrieving Collections of Data
      7. Increasing the Size of an Array
      8. Inserting an Element into the Middle of an Array
      9. Deleting an Array Element
      10. Creating User-Defined Data Types
      11. Back to the Number Guessing Game
      12. Summary
    2. Implementing Conditional Logic
      1. Project Preview: The Rock, Paper, Scissors Game
      2. Developing Games That Can Adapt Their Execution
      3. Working With Different Relational Operators
      4. Doing A Little Math
      5. Streamlining Code Using Comparison Operations
      6. Back to the Rock, Paper, Scissors Game
      7. Summary
    3. Repeating Statement Execution Using Loops
      1. Project Preview: The Slot Machine Game
      2. Leveraging the Power of Loops
      3. Guarding Against Endless Loops
      4. Exiting Loops
      5. Back to the Slot Machine Game
      6. Summary
    4. Organizing Code Logic Using Functions
      1. Project Preview: The Tic, Tac, Toe Game
      2. Improving Code Structure with Functions
      3. Defining a Function
      4. Prematurely Terminating Functions
      5. Validating Data Passed to Functions
      6. Building a Function Library
      7. Back to the Tic, Tac, Toe Game
      8. Summary
  7. Advanced Topics
    1. Working with Graphics and Sound
      1. Project Preview: The Pong Game
      2. A Few Quick Words About Graphics Programming and Animation
      3. Drawing Your Own Graphics
      4. Working with Bitmap Files
      5. Working with Bitmap Images
      6. Deleting Bitmap Images
      7. Working with Special Effects Commands
      8. Controlling Game Play with Loops
      9. Detecting Collisions
      10. Making Some Noise
      11. Back to the Pong Game
      12. Summary
    2. Generating Animation Using Sprites
      1. Project Preview: The Bricks Game
      2. A Few Words About 2D Programming
      3. Creating and Working With Sprites
      4. Setting Up Sprite Animation
      5. Determining When Sprites Collide
      6. A Few Additional Commands for Working With Sprites
      7. Back to the Bricks Game
      8. Summary
    3. Working with Input Devices
      1. Project Preview: Part Two of the Bricks Game
      2. Collecting Player Input
      3. Collecting Keyboard Input
      4. Interacting with the Mouse
      5. Using Joystick Input
      6. Back to the Bricks Game
      7. Summary
    4. Finding and Fixing Application Errors
      1. Project Preview: The 3D Fortune Teller Game
      2. Understanding and Dealing with Errors
      3. Understanding Different Types of Errors
      4. Keeping a Watchful Eye on Program Execution
      5. Back to the 3D Fortune Teller Game
      6. Summary
  8. Appendices
    1. What’s on the Companion Website?
      1. DarkBASIC Application Source Code
    2. What Next?
      1. Locating DarkBASIC Resources Online
      2. Alternative DarkBASIC IDEs
      3. DirectX Resources
      4. Other DarkBASIC Resources
      5. Recommended Reading
  9. Glossary