PacktLib: SDL Game Development

SDL Game Development

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Getting Started with SDL

Why use SDL?

Setting up SDL in Visual C++ Express 2010

Hello SDL

What makes up a game

The Game class

Summary

Drawing in SDL

Basic SDL drawing

Source and destination rectangles

Installing SDL_image

Tying it into the framework

Summary

Working with Game Objects

Using inheritance

Implementing polymorphism

Using abstract base classes

Should we always use inheritance?

Putting it all together

Summary

Exploring Movement and Input Handling

Setting up game objects for movement

Creating fixed frames per second

Input handling

Summary

Handling Game States

A simple way for switching states

Implementing finite state machines

Implementing menu states

Summary

Data-driven Design

Loading XML files

Implementing Object Factories

Fitting the factory into the framework

Parsing states from an XML file

Loading the menu state from an XML file

Loading other states from an XML file

Summary

Creating and Displaying Tile Maps

What is a tile map?

Getting familiar with the Tiled application

Parsing and drawing a tile map

Scrolling a tile map

Parsing object layers

Summary

Creating Alien Attack

Using the SDL_mixer extension for sound

Setting up the basic game objects

Handling bullets

Dealing with collisions

Possible improvements

Summary

Creating Conan the Caveman

Setting up the basic game objects

Possible additions

Summary

Index