Join the Discord: [ Ссылка ]
In this episode I explain what the Command Pattern is and how you can use it. Before I explain what the Command Pattern is I explain what a design pattern is and reference the Gang of Four's original book, Design Patterns. After that, I explain that the Command Pattern is simply a wrapper around executing commands. I then illustrate how this can be used in conjunction with a Command History object to create an undo/redo system, record gameplay sessions, and create instant replays. I describe in detail how you might code this, then I show an actual example that I use in my code to implement undo/redo system.
The Command Pattern: [ Ссылка ]
Gang of Four Book: [ Ссылка ]
Command Code Example: [ Ссылка ]
Command History Code Example: [ Ссылка ]
0:00 Intro
0:31 What is a Programming Pattern?
1:39 What is the Command Pattern?
13:39 What does the Code Look Like?
---------------------------------------------------------------------
Website: [ Ссылка ]
Github: [ Ссылка ]
Here are some books I recommend if you want to learn about game engine development more thoroughly. I do not profit off any of these sales, these are just some books that have helped me out :)
My Recommended Game Engine Books:
Game Engine Architecture: [ Ссылка ]
Game Physics Cookbook (Read this before the next physics book): [ Ссылка ]
Game Physics (Ian Millington): [ Ссылка ]
Game Programming Patterns (Free): [ Ссылка ]
My Recommended Beginning Game Programming Books:
JavaScript Game Design: [ Ссылка ]
My Recommended Java Books:
Data Structures/Algorithms: [ Ссылка ]
LWJGL (Free, but I haven't read this thoroughly): [ Ссылка ]
Outro Music: [ Ссылка ]
![](https://i.ytimg.com/vi/vqRHjhaECv4/maxresdefault.jpg)