Skip to content

Commit 4e36e90

Browse files
committed
Add usings for slime class and ensure highlighting
Reference feedback MonoGame#56 AristurtleDev#56 (comment)
1 parent 3424016 commit 4e36e90

File tree

2 files changed

+13
-1
lines changed
  • articles/tutorials/building_2d_games/23_completing_the_game

2 files changed

+13
-1
lines changed

articles/tutorials/building_2d_games/23_completing_the_game/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,13 @@ Let's implement the input buffering technique we introduced in [Chapter 10](../1
291291

292292
### Implementing Input Buffering in the Slime Class
293293

294-
To add input buffering for the `Slime` class, we will begin by adding the necessary fields to store our input queue. In the *GameObjects* directory of the *DungeonSlime* project (your main game project), open the *Slime.cs* file and add the following fields after the `_sprite` field:
294+
For the `Slime` class, we will implement input buffering based on the example given using a `Queue<T>` in [Chapter 10](../10_handling_input/index.md#implementing-a-simple-input-buffer). In the `GameObject` folder of the `DungeonSlime` project (your main game project), open the `Slime.cs` file so we can make the changes.
295+
296+
First, update the using statements at the top of the `Slime` class so that we can use the `Queue<T>` type:
297+
298+
[!code-csharp[](./snippets/slime/usings.cs?highlight=3)]
299+
300+
Next, add the following fields to the `Slime` class after the `_sprite` field:
295301

296302
[!code-csharp[](./snippets/slime/fields.cs)]
297303

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using Microsoft.Xna.Framework;
5+
using MonoGameLibrary;
6+
using MonoGameLibrary.Graphics;

0 commit comments

Comments
 (0)