Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Game Development Patterns and Best Practices

You're reading from   Game Development Patterns and Best Practices Better games, less hassle

Arrow left icon
Product type Paperback
Published in Apr 2017
Publisher Packt
ISBN-13 9781787127838
Length 394 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
John P. Doran John P. Doran
Author Profile Icon John P. Doran
John P. Doran
Matt Casanova Matt Casanova
Author Profile Icon Matt Casanova
Matt Casanova
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Introduction to Design Patterns FREE CHAPTER 2. One Instance to Rule Them All - Singletons 3. Creating Flexibility with the Component Object Model 4. Artificial Intelligence Using the State Pattern 5. Decoupling Code via the Factory Method Pattern 6. Creating Objects with the Prototype Pattern 7. Improving Performance with Object Pools 8. Controlling the UI via the Command Pattern 9. Decoupling Gameplay via the Observer Pattern 10. Sharing Objects with the Flyweight Pattern 11. Understanding Graphics and Animation 12. Best Practices

What this book covers

Chapter 1, Introduction to Design Patterns, introduces the concept of design patterns and how they can benefit our projects. We also dive into learning about the advantages of compartmentalizing our code and set up a sample project that we can use to build upon in the book.

Chapter 2, One Instance to Rule Them All – Singletons, discusses the well-known singleton pattern, explaining common arguments for and against having a single instance that’s accessible globally within our game.

Chapter 3, Creating Flexibility with the Component Object Model, explores how to create a large amount of different game object types while minimizing code duplication.

Chapter 4, Artificial Intelligence Using the State Pattern, shows the usage of states to allow a game object to change its behavior and functionality due to different stimuli in your game. We discuss and apply how we can use this concept in both player behavior and artificial intelligence.

Chapter 5, Decoupling Code via the Factory Method Pattern, explains how we separate our specific game objects from our game engine.  This will allow us to reuse all or at least part of our game engine for future games.

Chapter 6, Creating Objects with the Prototype Pattern, covers another way to reduce dependencies within our game engine.  We learn how to create objects through their base classes.  In addition, we cover how to read object data from a file.

Chapter 7, Improving Performance with Object Pools, covers a way to improve memory costs in our games by reusing objects that we’ve created dynamically by making use of a manager to control what is and isn’t being used at the moment.

Chapter 8, Controlling the UI via the Command Pattern, discusses how to create reusable actions that can be utilized for UI button clicks or input devices such as keyboard or controller.

Chapter 9, Decoupling Gameplay via the Observer Pattern, explains multiple ways that classes can communicate and share data without using global variables. 

Chapter 10, Sharing Objects with the Flyweight Pattern, discusses how we can design our objects to be as lightweight as possible by separating data that can and can't be shared. We use this knowledge to create a particle system which produces smaller objects developed to simulate things like fire, explosions, and smoke.

Chapter 11, Understanding Graphics and Animation, provides a low-level explanation of how graphics and rendering work so that you are better able to implement it in your game.

Chapter 12, Best Practices, covers a number of topics that will improve your code and game projects in the future, touching on things like how to improve your code quality, use the const keyword correctly, how iteration is a great way to improve game and code design, and when you should consider adding scripting to your game.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image