Programming 2D scrolling games
From GPWiki
The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server. However, the GPWiki forums are still active! Come say hello. Programming 2D Scrolling Games by Krylar's Kreations
"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! Complete Table of Contents PART 1: PUREBASIC BASICS CHAPTER 1: WELCOME TO PUREBASIC 1. What is PureBasic and who is this Book for? 2. Why Learn PureBasic? 3. What Will I Need to Run PureBasic? 4. The Major Sections of this Book 5. Conventions Used in this Book 6. What's on the CD? CHAPTER 2: FUNDAMENTALS OF PROGRAMMING 1. What is a Program? 2. Object Code 3. Bits and Bytes 4. Screen Resolutions and Bit-Depth 5. Speed Impact of Higher Resolutions and Bit-Depths 6. DirectX, Peripheral Cards and Drivers 7. Creative and Technical Design Documents 8. Good Coding Style and Commenting 9. A Place to Work CHAPTER 3: GETTING STARTED WITH PUREBASIC 1. The PureBasic IDE Main Screen 2. What Every PureBasic Program Must Contain 3. The PureBasic Debugger 4. The Good Old "Hello, World!" Program CHAPTER 4: THE BASICS OF PUREBASIC 1. Variables, What are they? 2. Defining Variables 3. Commenting Your Code 4. Simple Arithmetic 5. Cartesian Coordinates CHAPTER 5: PROGRAM CONTROL STATEMENTS 1. If…Then…Else…EndIf 2. Nested IF Statements 3. ElseIf Statement 4. And and Or Statements 5. The SELECT Statement 6. Loop Basics 7. For…Next Loops 8. While…Wend Loops 9. Repeat…Until/Forever CHAPTER 6: UNDERSTANDING/USING ARRAYS 1. What Arrays Look Like 2. Initializing an Array (the DIM command) 3. Multidimensional Arrays 4. Re-dimensioning Arrays 5. Loading Data Values into an Array 6. Variable Length Data Statements CHAPTER 7: UNDERSTANDING/USING STRUCTURES 1. Arrays of Structures 2. Arrays within Structures 3. Array of Types 4. Basic Structure Lists 5. Advanced Structure Operations – Extending Structures 6. Advanced Structure Operations – Pointers 7. Other Structure Commands CHAPTER 8: WORKING WITH MEMORY 1. Creating and Freeing Memory Buffers 2. Poke and Peek 3. Resizing Allocated Memory 4. Copying Memory Buffers 5. Comparing Memory 6. String-Specific Commands CHAPTER 9: PROCEDURES AND LIBRARIES 1. Declaring a Procedure 2. Passing Arguments and Returning Results 3. Including Files 4. Libraries CHAPTER 10: WORKING WITH FILES 1. Creating a File 2. Writing to a File 3. Reading from a File 4. Moving Around Inside of Files 5. A Quick Binary Example 6. Miscellaneous File Commands PART 2: PB GAME TOOLS CHAPTER 11: COLORS AND DRAWING PRIMITIVES 1. Getting and Setting Colors 2. Dealing with Pixels 3. Drawing Lines 4. Rectangles 5. Circles and Ellipses CHAPTER 12: WORKING WITH SPRITES 1. Basic Loading and Displaying of Sprites 2. Rotating an Image to Make Multiple Frames 3. Grabbing Images from Memory 4. Writing Directly to a Sprite CHAPTER 13: HANDLING ANIMATION 1. Page Flip Animation 2. Animating Images 3. Animation Timing CHAPTER 14: COLLISION DETECTION 1. Bounding Box Collisions 2. Pixel-Perfect Collision Detection CHAPTER 15: HANDLING INPUT 1. Using the Keyboard 2. Using the Mouse 3. Displaying a Custom Mouse Cursor 4. Using the Joystick CHAPTER 16: SOUNDS AND MUSIC 1. Loading Sounds 2. Manipulating Sounds 3. Multiple Sounds Playing Simultaneously 4. Loading Sounds into Memory 5. Overlaying Multiple Sounds 6. Playing Music 7. Music Modules CHAPTER 17: TIMERS 1. Frames per Second (FPS) Tracking 2. The Rolling Timer 3. Locking in at Real Time PART 3: MIGZ CALLO: LASER BLAZER CHAPTER 18: GAME DESIGN 1. Background Story 2. Game Features 3. Art Asset List 4. Sound Asset List 5. Music Asset List 6. Map Asset List 7. Technical List CHAPTER 19: Z-ORDERING 1. What is Z-Ordering? 2. Why Use Z-Ordering? 3. How to Implement Z-Ordering CHAPTER 20: LOADING MAP FILES 1. Loading Tiles 2. Text-Based Map File Format 3. Loading Map Dimensions 4. Loading the Map Data 5. Binary-Based Map Files 6. Loading Binary Maps 7. Saving Binary Maps 8. Showing a Loaded Map CHAPTER 21: MOVING SPRITES ON SCROLLING MAPS 1. Player hits a wall 2. Screen and World Coordinates 3. Scrolling a Map (Theory) 4. Edge-Independent Scrolling 5. Scrolling Code 6. More on Coordinate Systems 7. Screen Vs. World 8. Robots, HealthPaks, and Lasers…oh my! CHAPTER 22: SIMPLE AI 1. Robots Doing Stuff 2. Robots Firing 3. Migz Gets Bored 4. Migz Falls Asleep CHAPTER 23: PUTTING IT ALL TOGETHER 1. The main loop 2. Making a level for Migz 3. Placing robots and healthpaks 4. Code for starting a level 5. Conclusion |


