Design Patterns for Game Programming
4.6 (501 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
5,506 students enrolled

Design Patterns for Game Programming

An exploration of robust modularised code building for games with Unity 2019 and C#.
4.6 (501 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
5,506 students enrolled
Last updated 12/2019
Current price: $15.99 Original price: $19.99 Discount: 20% off
30-Day Money-Back Guarantee
This course includes
  • 9 hours on-demand video
  • 1 article
  • 27 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • How to create robust, reusable modularised code for use in games programming.
  • How to implement repeatable solutions to address common game programming problems.
Course content
Expand all 37 lectures 09:00:17
+ Introduction
3 lectures 05:41

This lecture gives you an overview of the content of the course and the concepts you will learn about.

Preview 03:50

H3D has a bustling online student community.  Here's how to get involved.

Join the H3D Student Community


Here's some answers to frequently asked questions about working with Unity that I get asked across all my courses.

Unity Version

This course was originally created using Unity 2019.1 but to use the ECS in Section 03 you will need to upgrade to 2019.2.0.a9 or above to be able to use the Hybrid Renderer Preview 9-0.01 and Entities Preview 29-0.0.12 needed for  that section.

Standard FAQ's

Frequently Asked Questions
+ The Command Pattern
4 lectures 01:02:12

In this lecture we look at the command design pattern and start building an abstract class to encompass it's simple functionality.

Preview 18:06

In this lecture we will finish creating the initial version of a command class and use it to control the animations of two animated characters.

Commands Part 2

In this video we will extend the command pattern by adding replay and undo functionality.

Commands Part 3

In this video we complete the undo facility to generate animations that run backwards when they are taken away from the replay list.

Commands Part 4
+ The Flyweight Pattern
7 lectures 01:58:51

In this lecture we will begin with a small experiment that illustrates the importance and workings of the flyweight design pattern.

Investigating Memory

In this lecture we will walk through the process of making a scriptable object and adding them to an existing project to store data about game objects.

Preview 19:58

In this section tutorial on examining scriptable objects you will learn how to grab the data added to a prefab from them and display it on the screen.

Scriptable Objects Part 2

In this lecture we will a Perlin landscape from cube prefabs readying for a comparison with Unity's ECS System.

Unity's ECS Part 1

In this lecture we will begin putting together the game objects and components that will become entities in an ECS.

Unity's ECS Part 2

This lectures completes our brief look at how ECS conforms to the Flyweight design pattern and compares performance between using GameObjects versus Entities.

Unity's ECS Part 3

In this lecture we will optimise the performance of the ECS with a little rendering trick and then take a drive around the scene with the camera.

A little ECS Optimisation Extra
+ The Observer Pattern
5 lectures 01:16:58

In this lecture the observer pattern will be introduced and a project setup to apply it.

Preview 12:38

In this lecture we will complete the egg spawner and create the base classes for Events and Event Listeners.

Observers Part 2

In this lecture we will begin using the events and listeners to pass messages as well as extend this to have items appear on the radar.

Observers Part 3

In this video we will add in other objects to appear on the radar as well as work at taking them away.

Observers Part 4

In this video we will complete the process to take items away from the radar system as well as perform a challenge to display popup text on the screen.

Observers Part 5
+ The Prototype Pattern
3 lectures 54:22

In this lecture we will start to examine the prototype pattern.  Most game engines automatically take care of this functionality themselves, though we will try our best to illustrate the old way of doing things.

The Prototype Pattern

In this video you will learn how to turn your procedurally created cube into a cloneable object.

Cloning a Game Object

In this lecture you will learn how to create a dynamic game object that you can save into your assets folder as a prefab.

Dynamic Prefab Creation
+ The Singleton Pattern
2 lectures 36:59

In this video you will be introduced to the singleton pattern and we will start working on a project to put it to good use.

The Singleton
Using a Singleton
+ The State Pattern
6 lectures 01:33:13

This lecture introduces the state design pattern and starts setting up a project for building a finite state machine for a patrolling and attacking NPC.

Preview 14:22

In this lecture we will create the state base class and build an idle state that inherits from it.

Creating and Using a State Class

In this lecture we will add in the patrolling state and set the npc to walk around a set route.

Patrolling the Perimeter

In this lecture we start writing the pursue and attack states to add to the NPCs behaviour.

Chasing the Player Part 1

In this video we will complete the code for getting the NPC to pursue and attack the player.

Chasing the Player Part 2

In this video you will be given a challenge to add a new state to the NPCs behaviour.

State Challenge
+ The Object Pool
4 lectures 01:08:48

In this lecture we will cover object pooling and start building a classic game scenario in which pooling is critical for memory management and performance.

Setting Up the Project

In this lecture we will add the code for an object pool to take care of the asteroid and bullet spawning.

Adding in an Object Pool

In this video we will extend the object pool to make it expandable.

Extending the Object Pool
Blowing Up the Ship
+ And...
3 lectures 23:13

In this lecture we will examine some of the most powerful game programming design patterns that you use everyday without realising.

More Patterns

Some final worlds from Penny

Final Words

You've finished this course....  what now?

Where to now??
  • Be able to program in C#.
  • Have used the Unity Game Engine at a Basic Level.

Want to create code that is robust, optimized and reusable? Then you need to learn about programmming design patterns.

Game Programming Design Patterns are templates for building modularised code that are generally a repeatable solution to a commonly occurring mechanic applied in computer games. They are general solutions that aren’t tied to a particular problem, making them reusable. One such pattern is object pooling. Whether a game needs an onslaught of constantly spawning zombies or bullets fired from a gun or asteroids to pummel the player’s spaceship, an object pool is a group of classes that can be reused, exactly as they are, across not only these scenarios but a plethora of others whenever game objects need a spawn manager.

In this course, Penny will take you through the top 12 game programming design patterns with C# and the Unity Game Engine using her internationally acclaimed Holistic teaching style and expertise from over 25 years teaching, researching and writing about games. Throughout the course you will follow along with hands-on workshops designed to teach you these core programming concepts that will take your games to the next level.

Learn how to program and work with patterns such as:

  • commands

  • flyweight

  • observer

  • prototype

  • singleton

  • states

  • object pools

  • game loops

  • updates

  • components

  • ...and more.

Contents and Overview

The course begins with a brief introduction and then you are straight into hands-on exercises, working through each of the design patterns as listed above. There are a variety of scenarios you will work on in both 2D and 3D from an asteroid shooter, to a radar object finding system to a programmable prototype prefab system. All starter files and Unity assets (including models and scenes) are provided for you. All you need to bring is a copy of Unity 2019.

If you want to become a knowledgeable and skilled game developer, then this course is for you.

What students are saying about Penny's courses:

  • Excellent course!! I am already in game development industry and there is one quote here from the course that says it all "Whenever you are not able to solve complex problem, its the right time to get back to the BASICS".

  • She is the best teacher ever in this platform

  • I do like Penny de Byl's courses and way of teaching, they are much more specific than your average "master Unity" kind of courses and usually you don't learn just the engine, but also how things work behind the scenes (albeit briefly, at least it gives you an idea if you want to investigate more on your own). She's really amazing!

Who this course is for:
  • Game programmers who want to better their understanding of programming constructs to improve their code.
  • Beginners learning game coding who want to get off on the right foot.