"Programming 2D Scrolling Games" is a comprehensive guide to creating 2D scrolling games with PureBasic development language. An accompanying CD contains a demo version of PureBasic, as well as all the example programs referenced througout the book, which can be loaded directly into the PureBasic IDE, and compiled and run with ease.
Aimed at beginners and advanced users alike, "Programming 2D Scrolling Games" starts with the roots of game development, and continues to explore the ins-and-outs of the PureBasic development language, and even takes you through the entire development process of a futuristic side-scroller!
Topics covered in-depth
- Program Control Statements
- Understanding and Using Arrays
- Understanding and Using Data Types
- Functions and Libraries
- File Manipulation
- Graphics and Sprites
- Animation Techniques
- Collision Detection
- Input Handling
- Sound and Music
- Timers
- Z-Ordering
- Game Design
- 2D Map Scrolling
- Simple AI
- ...and more!
The book's 23 chapters conclude with the creation of a complete 2D Scrolling game!
Screen Shots
- Art created by Ric "Putty" Lumb
- Music created by Future Developments (FD)
Complete Table of Contents
PART 1: PUREBASIC BASICS
CHAPTER 1: WELCOME TO PUREBASIC
- What is PureBasic and who is this Book for?
- Why Learn PureBasic?
- What Will I Need to Run PureBasic?
- The Major Sections of this Book
- Conventions Used in this Book
- What's on the CD?
CHAPTER 2: FUNDAMENTALS OF PROGRAMMING
- What is a Program?
- Object Code
- Bits and Bytes
- Screen Resolutions and Bit-Depth
- Speed Impact of Higher Resolutions and Bit-Depths
- DirectX, Peripheral Cards and Drivers
- Creative and Technical Design Documents
- Good Coding Style and Commenting
- A Place to Work
CHAPTER 3: GETTING STARTED WITH PUREBASIC
- The PureBasic IDE Main Screen
- What Every PureBasic Program Must Contain
- The PureBasic Debugger
- The Good Old "Hello, World!" Program
CHAPTER 4: THE BASICS OF PUREBASIC
- Variables, What are they?
- Defining Variables
- Commenting Your Code
- Simple Arithmetic
- Cartesian Coordinates
CHAPTER 5: PROGRAM CONTROL STATEMENTS
- If…Then…Else…EndIf
- Nested IF Statements
- ElseIf Statement
- And and Or Statements
- The SELECT Statement
- Loop Basics
- For…Next Loops
- While…Wend Loops
- Repeat…Until/Forever
CHAPTER 6: UNDERSTANDING/USING ARRAYS
- What Arrays Look Like
- Initializing an Array (the DIM command)
- Multidimensional Arrays
- Re-dimensioning Arrays
- Loading Data Values into an Array
- Variable Length Data Statements
CHAPTER 7: UNDERSTANDING/USING STRUCTURES
- Arrays of Structures
- Arrays within Structures
- Array of Types
- Basic Structure Lists
- Advanced Structure Operations – Extending Structures
- Advanced Structure Operations – Pointers
- Other Structure Commands
CHAPTER 8: WORKING WITH MEMORY
- Creating and Freeing Memory Buffers
- Poke and Peek
- Resizing Allocated Memory
- Copying Memory Buffers
- Comparing Memory
- String-Specific Commands
CHAPTER 9: PROCEDURES AND LIBRARIES
- Declaring a Procedure
- Passing Arguments and Returning Results
- Including Files
- Libraries
CHAPTER 10: WORKING WITH FILES
- Creating a File
- Writing to a File
- Reading from a File
- Moving Around Inside of Files
- A Quick Binary Example
- Miscellaneous File Commands
PART 2: PB GAME TOOLS
CHAPTER 11: COLORS AND DRAWING PRIMITIVES
- Getting and Setting Colors
- Dealing with Pixels
- Drawing Lines
- Rectangles
- Circles and Ellipses
CHAPTER 12: WORKING WITH SPRITES
- Basic Loading and Displaying of Sprites
- Rotating an Image to Make Multiple Frames
- Grabbing Images from Memory
- Writing Directly to a Sprite
CHAPTER 13: HANDLING ANIMATION
- Page Flip Animation
- Animating Images
- Animation Timing
CHAPTER 14: COLLISION DETECTION
- Bounding Box Collisions
- Pixel-Perfect Collision Detection
CHAPTER 15: HANDLING INPUT
- Using the Keyboard
- Using the Mouse
- Displaying a Custom Mouse Cursor
- Using the Joystick
CHAPTER 16: SOUNDS AND MUSIC
- Loading Sounds
- Manipulating Sounds
- Multiple Sounds Playing Simultaneously
- Loading Sounds into Memory
- Overlaying Multiple Sounds
- Playing Music
- Music Modules
CHAPTER 17: TIMERS
- Frames per Second (FPS) Tracking
- The Rolling Timer
- Locking in at Real Time
PART 3: MIGZ CALLO: LASER BLAZER
CHAPTER 18: GAME DESIGN
- Background Story
- Game Features
- Art Asset List
- Sound Asset List
- Music Asset List
- Map Asset List
- Technical List
CHAPTER 19: Z-ORDERING
- What is Z-Ordering?
- Why Use Z-Ordering?
- How to Implement Z-Ordering
CHAPTER 20: LOADING MAP FILES
- Loading Tiles
- Text-Based Map File Format
- Loading Map Dimensions
- Loading the Map Data
- Binary-Based Map Files
- Loading Binary Maps
- Saving Binary Maps
- Showing a Loaded Map
CHAPTER 21: MOVING SPRITES ON SCROLLING MAPS
- Player hits a wall
- Screen and World Coordinates
- Scrolling a Map (Theory)
- Edge-Independent Scrolling
- Scrolling Code
- More on Coordinate Systems
- Screen Vs. World
- Robots, HealthPaks, and Lasers…oh my!
CHAPTER 22: SIMPLE AI
- Robots Doing Stuff
- Robots Firing
- Migz Gets Bored
- Migz Falls Asleep
CHAPTER 23: PUTTING IT ALL TOGETHER
- The main loop
- Making a level for Migz
- Placing robots and healthpaks
- Code for starting a level
- Conclusion
© 2001-2010 John P. Logsdon. All rights reserved.