You are previewing DarkBASIC Pro Game Programming, Second Edition.
O'Reilly logo
DarkBASIC Pro Game Programming, Second Edition

Book Description

Learn to write 2D and 3D games without any programming experience by harnessing the advanced 2D/3D graphics features of DarkBasic Professional. This easy-to-use language handles the entire game engine for you, so you are free to focus on designing and playing your own games. Written for beginners with no programming experience, DarkBASIC Pro Game Programming, Second Edition is a welcome change of pace from traditional game programming books. You won't need to spend time figuring out how the game engine works, but only what the game is supposed to do. You will be able to create self-contained executable games with the graphics and sound files stored inside the exe file. No DarkBasic runtime library is needed: compiled programs are self-contained and require only that DirectX is installed. Finally, a book for complete beginners who want to learn to write games!

Table of Contents

  1. Copyright
  2. Foreword
  3. Acknowledgments
  4. About the Authors
  5. Introduction
  6. The Basics of Computer Programming
    1. Introduction to Computer Programming with DarkBASIC Professional
      1. DarkBASIC Professional
      2. Features of the DarkBASIC Language
      3. Summary
    2. Programming Basics: Variables, Data Types, and Scope
      1. Short Course on Programming
      2. Video Game Basics
      3. Writing Some DarkBASIC Code
      4. Understanding Variables
      5. Summary
    3. More Variables: Strings and User-Defined Types
      1. Programming Strings
      2. User-Defined Data Types
      3. Summary
    4. Program Logic: Branching Statements, Functions, and Algorithms
      1. Introduction to Program Logic
      2. Branching Statements: Decisions, Decisions
      3. Dividing and Conquering with Functions
      4. Divide and Conquer
      5. Advanced Logic Programming: Algorithms
      6. Summary
    5. Repetition: Looping Statements, Data Sequences, and Arrays
      1. Understanding Looping Statements
      2. Using Looping Statements
      3. Introduction to Data Sequences and Arrays
      4. Data Sequences
      5. Arrays
      6. Summary
    6. Number Crunching: Math Operators and Commands
      1. Mathematical Operators
      2. Relational Operators
      3. Basic Math Commands
      4. Random Numbers
      5. Reading the Date and Time
      6. Higher Math Commands
      7. Summary
    7. Reading and Writing Data: File Input/Output Commands
      1. Introduction to File Input/Output
      2. Basic File Commands
      3. Using the Clipboard
      4. Summary
  7. 2D Game Programming
    1. Introduction to 2D Graphics: Basic Vector Drawing Commands
      1. Graphics in Abundance!
      2. System and Video Card Commands
      3. Display Mode Commands
      4. Basic Graphics Programming
      5. Summary
    2. Bitmapped Graphics: Bitmaps and Images
      1. Introduction to Bitmaps
      2. Creating and Loading Bitmaps
      3. Bitmap Information Commands
      4. The BitmapInfo Program
      5. Special Effects Commands
      6. ImageShuffle: A Complete Bitmap-Based Game
      7. Summary
    3. 2D Actors: Basic Sprite Commands
      1. Introduction to Sprites
      2. Creating and Loading Sprites
      3. Drawing and Moving Sprites
      4. The All-Powerful Game Loop
      5. Starting Work on Darkanoid (Your First Complete Game Project)
      6. Summary
    4. 2D Acting: Sprite Animation
      1. Animated Sprites
      2. Creating and Editing Sprites Using Pro Motion
      3. Manipulating Sprites: Rotation and Scaling
      4. Darkanoid: The Continuing Saga
      5. Summary
    5. 2D Game Physics: Sprite Collision Testing
      1. Detecting Sprite Collisions
      2. Darkanoid Revisited
      3. Summary
    6. Getting Input: Keyboard, Mouse, and Joystick Commands
      1. Introduction to User Input
      2. Keyboard Commands
      3. Mouse Commands
      4. Joystick Commands
      5. Defining Control Devices
      6. Force Feedback
      7. Summary
    7. Game Audio: Sound Effects and Music
      1. Sound Effects
      2. Playing Sound Files
      3. Music
      4. Enhancing Darkanoid
      5. Summary
    8. 2D Game Worlds: Level Editing and Tile-Based Scrolling
      1. Introduction to Scrolling
      2. A Limited View of the World
      3. Scrolling the Screen
      4. Tile-Based Backgrounds
      5. Backgrounds and Scenery
      6. Creating Backgrounds from Tiles
      7. Creating a Tile Map
      8. Tile-Based Scrolling
      9. Dynamic Tile-Based Scrolling
      10. The DynamicScroller Program
      11. The DynamicScroller Source Code
      12. Summary
    9. Advanced Sprite Programming: Alpha Channel Transparency and Angular Motion
      1. Alpha Channel Transparency
      2. Angular Motion
      3. Summary
    10. Playing Intro Movies and Cut-Scenes
      1. Introduction to Movies
      2. Loading and Playing Movie Files
      3. Changing the Position and Size of a Movie
      4. Movie Trailers
      5. Summary
  8. 3D Game Programming
    1. Fundamentals of 3D Graphics Programming
      1. Introduction to 3D Graphics
      2. Basic 3D Graphics Commands
      3. Summary
    2. Lights, Camera, Action: 3D Lighting and Camera Control
      1. Lighting the Scene
      2. Controlling the Camera
      3. Creating New Cameras
      4. Adjusting the Camera’s Position
      5. Summary
    3. 3D Actors: Loading and Rendering 3D Models
      1. Learning about 3D Models
      2. Testing 3D Animation
      3. Summary
    4. Landscaping: Building 3D Terrain Using Matrices
      1. Using Bumpy Terrain
      2. Following the Contour
      3. Summary
    5. Multiplayer LAN and Internet Programming
      1. Introduction to Multiplayer Games
      2. Packet Transport
      3. Establishing a Network Connection
      4. Passing the Data
      5. Additional Multiplayer Commands
      6. Memory Blocks
      7. Summary
    6. Battle Checkers
      1. Getting to Know Battle Checkers
      2. Building the Game’s Source Code
      3. Summary
      4. Epilogue
  9. Appendices
    1. ASCII Chart
    2. Recommended Books and Websites
      1. Game Development and Programming
      2. News, Reviews, and Download Sites
      3. Engines
      4. Independent Game Developers
      5. Industry
      6. Computer Humor
      7. Noteworthy Books
      8. Game Resources
      9. Development Tools