Book Image

SDL Game Development

By : Shaun Mitchell
5 (1)
Book Image

SDL Game Development

5 (1)
By: Shaun Mitchell

Overview of this book

SDL 2.0 is the latest release of the popular Simple DirectMedia Layer API, which is designed to make life easier for C++ developers, allowing you simple low-level access to various multiplatform audio, graphics, and input devices.SDL Game Development guides you through creating your first 2D game using SDL and C++. It takes a clear and practical approach to SDL game development, ensuring that the focus remains on creating awesome games.Starting with the installation and setup of SDL, you will quickly become familiar with useful SDL features, covering sprites, state management, and OOP, leading to a reusable framework that is extendable for your own games. SDL Game Development culminates in the development of two exciting action games that utilize the created framework along with tips to improve the framework.
Table of Contents (16 chapters)
SDL Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Possible improvements


Alien Attack is a pretty robust game at the moment; we highly recommend looking through the source code and becoming familiar with every aspect of it. Once you have a good understanding of most of the areas of the game, it is a lot easier to see where certain areas could be enhanced. Here are some ideas that could be added to improve the game:

  • Bullets could be created at the start of a level and stored in an object pool; so rather than creating and deleting bullets all the time they can be pulled from and put back into the object pool. The main advantage of this approach is that the creation and destruction of objects can be quite expensive when it comes to performance. Eliminating this while the game is running could give a real performance boost.

  • Collision detection could be optimized further, possibly through the addition of a Quadtree to stop unnecessary collision checks.

  • The source code has a few areas that use string comparisons to check types. This can be a bit...