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

Game Programming for Teens, Third Edition

Book Description

Do you enjoy playing video games and want to learn how to create your own? Game Programming for Teens, Third Edition shows you how to design and develop a complete video game from start to finish, no prior programming knowledge required. You'll begin by learning the basics of BlitzMax, a simple cross-platform game programming language that can be used on Windows, Mac, or Linux operating systems. Once you understand how to write the programming code, you'll begin to incorporate all the graphical elements of games including varying colors, loading and displaying images, and creating scrolling backgrounds. Finally, you'll learn how to add sound and music, use keyboard input codes, and even integrate artificial intelligence. New skills are taught step-by-step, and each chapter builds upon the techniques you learned in the previous, so by the end of the book you'll have built your very own fully functioning video game. And the CD-ROM contains all the source code, art and sound files, and demo versions of BlitzMax and the other programs used in the book. So don't just play video games, build your own, with Game Programming for Teens, Third Edition!

Table of Contents

  1. Copyright
    1. Dedication
  2. Acknowledgments
  3. About the Author
  4. Introduction
    1. What’s in the Book?
    2. Who Are You?
    3. Who Am I?
    4. Conventions Used in This Book
    5. Let’s Get Ready to Rumble...
  5. I. The Basics of BASIC
    1. 1. Getting Started
      1. A Brief History of BASIC
        1. Installing BlitzMax
          1. Installing on Windows
          2. Installing on a Mac
          3. Understanding the IDE
        2. Windows and Panels
        3. Toolbars
        4. Menus
      2. The First Game: KONG
        1. Compiling the Code
      3. Summary
    2. 2. Getting to Know BASIC
      1. Hello, World!
      2. Variables
        1. Declaring Variables
        2. Using Variables
      3. Input
      4. Conditionals
        1. Truth and Falsehood
        2. If...Then
        3. If...Then...Else
        4. Select...Case
      5. Logical Operators
        1. The NOT Operator
      6. The Goto Command
      7. A Text-Based Guessing Game
      8. Summary
    3. 3. Loops, Functions, Arrays, and Types
      1. Understanding Loops
        1. For...Next
        2. While...Wend
        3. Repeat...Until
      2. Understanding Functions
        1. Scope Considerations
        2. When to Use Functions
      3. Understanding Arrays
        1. Multi-Dimensional Arrays
      4. Using Types
        1. Coordinate Systems
      5. Putting It All Together: Textanoid!
      6. Lists
      7. Summary
    4. 4. The Style Factor
      1. Developing Style
        1. White Space and Indentation
      2. Comments
        1. Pre-Program Comments
        2. Main Program Comments
        3. Function Comments
      3. Function and Variable Names
        1. Names
        2. Naming Format
      4. Summary
  6. II. Getting Graphical
    1. 5. Beginning Graphics
      1. Creating the Graphics Window
        1. Width and Height
        2. Color Depth
      2. Images
        1. LoadImage()
        2. DrawImage()
          1. Handle
          2. X and Y
          3. [Frame]
        3. TileImage()
        4. SetMaskColor()
      3. Colors
        1. RGB
        2. SetColor()
        3. Cls and SetClsColor()
      4. Summary
    2. 6. Page Flipping and Pixel Plotting
      1. Page Flipping
        1. Buffers
          1. Swapping Buffers
      2. Transformations
        1. Translating
        2. Scaling
          1. Proportion? What the Heck Is That?
          2. Scaling Shapes
          3. Scaling Rectangles
          4. Scaling Triangles
          5. Scaling Images
        3. Rotation
      3. Parallaxing
        1. TileImage
      4. Summary
    3. 7. Animation
      1. Using Bitmaps in Animation
        1. Making Bitmaps
        2. Displaying Movement
      2. Summary
    4. 8. Collision Detection
      1. Basic Collisions
      2. Bounding Circles
        1. Distance between Points
        2. Radii
      3. Bounding Boxes
      4. Image Collisions
      5. Summary
  7. III. Completing the Puzzle
    1. 9. Handling Input
      1. Handling the Keyboard
        1. KeyDown()
        2. KeyHit()
      2. Mapping the Mouse to the Screen
        1. What Was That? Handling Mouse Key Presses
          1. MouseDown()
          2. MouseHit()
        2. The Middle Mouse Wheel
      3. Summary
    2. 10. Sounds and Music
      1. Sound
        1. Loading Sounds
        2. Listen Closely—Playing Sounds
          1. SetChannelVolume
          2. SetChannelPan
      2. Music
        1. Channels and Music
        2. Messing with ’Da Channels
      3. Summary
    3. 11. Artificial Intelligence
      1. Random Numbers
        1. Creating a MilliSecs() Timer
      2. Chasing and Evading
        1. Chasing
        2. Evading
      3. Summary
    4. 12. The Final Frontier: Invaderz!!!
      1. Let’s Bust It: Planning the Game
      2. Constants, Functions, and Types in Invaderz!!!
      3. Playing Invaderz!!!
      4. Epilogue
  8. IV. Appendixes
    1. A. Scan Code Reference
    2. B. Useful Links
      1. Blitz Links
      2. General Game Programming Links
    3. C. What’s on the CD
      1. Source
      2. Art
      3. Sounds
      4. Programs