Skip to content

Commit f2c570c

Browse files
committed
Code block not indented in numbered list
1 parent dab58f0 commit f2c570c

File tree

1 file changed

+22
-22
lines changed
  • articles/tutorials/building_2d_games/11_collision_detection

1 file changed

+22
-22
lines changed

articles/tutorials/building_2d_games/11_collision_detection/index.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -660,28 +660,28 @@ Open the *Game1.cs* file and perform the following:
660660
661661
3. Finally, after creating the bounding rectangle for the circle, add the following to perform a distance based collision check:
662662
663-
```cs
664-
// Use distance based checks to determine if the slime is within the
665-
// bounds of the game screen, and if it's outside that screen edge,
666-
// move it back inside.
667-
if(slimeBounds.Left < screenBounds.Left)
668-
{
669-
_slimePosition.X = screenBounds.Left;
670-
}
671-
else if(slimeBounds.Right > screenBounds.Right)
672-
{
673-
_slimePosition.X = screenBounds.Right - _slime.Width;
674-
}
675-
676-
if(slimeBounds.Top < screenBounds.Top)
677-
{
678-
_slimePosition.Y = screenBounds.Top;
679-
}
680-
else if(slimeBounds.Bottom > screenBounds.Bottom)
681-
{
682-
_slimePosition.Y = screenBounds.Bottom - _slime.Height;
683-
}
684-
```
663+
```cs
664+
// Use distance based checks to determine if the slime is within the
665+
// bounds of the game screen, and if it's outside that screen edge,
666+
// move it back inside.
667+
if(slimeBounds.Left < screenBounds.Left)
668+
{
669+
_slimePosition.X = screenBounds.Left;
670+
}
671+
else if(slimeBounds.Right > screenBounds.Right)
672+
{
673+
_slimePosition.X = screenBounds.Right - _slime.Width;
674+
}
675+
676+
if(slimeBounds.Top < screenBounds.Top)
677+
{
678+
_slimePosition.Y = screenBounds.Top;
679+
}
680+
else if(slimeBounds.Bottom > screenBounds.Bottom)
681+
{
682+
_slimePosition.Y = screenBounds.Bottom - _slime.Height;
683+
}
684+
```
685685
686686
Running the game now, try moving the slime outside the edges of the game window. You'll see that it's now being prevented from doing so:
687687

0 commit comments

Comments
 (0)