You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-2
Original file line number
Diff line number
Diff line change
@@ -43,13 +43,13 @@ In you game you have many commands, such as play sound, throw cake, etc. It can
43
43
44
44
**How to implement?**
45
45
46
-
* You have a base class called Command which has a method that a child can implement called Execute. In each child class, you put in the Execute method what will actually happen when you run (execute) that Command.
46
+
* You have a base class called Command which has a method that a child can implement called Execute. In each child class, you put in the Execute method what will actually happen when you run (execute) that command.
47
47
48
48
**When is it useful?**
49
49
50
50
* To make it easier to rebind keys. Example of this is available in the code section.
51
51
52
-
* To make it easier to make a replay system. When you play the game, you store in some list which button you pressed each update. When you want to replay what has happened, you just iterate through the list while running the game. Example of this is available in the code section.
52
+
* To make it easier to make a replay system. When you play the game, you store in some data strcuture which button you pressed each update. When you want to replay what has happened, you just iterate through each command while running the game. Example of this is available in the code section.
53
53
54
54
* To make it easier to make an undo and redo system. Is similar to the replay system, but in each command you also have a method called Undo() where you do the opposite of what the command is doing. Example of this is available in the code section.
55
55
@@ -132,6 +132,8 @@ In your game you have a game object. Now you want to duplicate that object to cr
132
132
133
133
## 5. Singleton
134
134
135
+
-
136
+
135
137
136
138
137
139
## 6. State
@@ -220,6 +222,9 @@ The update method will process one frame of behavior. Each object that needs it
220
222
221
223
## 10. Bytecode
222
224
225
+
-
226
+
227
+
223
228
224
229
## 11. Subclass Sandbox
225
230
@@ -325,6 +330,9 @@ When making your game you use many standardized methods to for example generate
0 commit comments