Skip to content

Commit 21800f8

Browse files
committed
(Fix)Removed < > from xref links and set unordered list to ordered list
1 parent a8398de commit 21800f8

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ $$(radius_{circle1} + radius_{circle2})^2 > a^2 + b^2$$
5858

5959
It is easy to confuse the direction of the inequality sign. As a quick mental test, think of how the math works when the origin of two circles are at the same position, i.e., when the *squared distance* is zero.
6060

61-
To calculate the squared distance between two points, MonoGame provides the [**Vector2.DistanceSquared**](<xref:Microsoft.Xna.Framework.Vector2.DistanceSquared(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)>) method:
61+
To calculate the squared distance between two points, MonoGame provides the [**Vector2.DistanceSquared**](xref:Microsoft.Xna.Framework.Vector2.DistanceSquared(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)) method:
6262

6363
[!code-csharp[](./snippets/vector2_distance.cs)]
6464

6565
> [!TIP]
66-
> MonoGame also provides a distance calculation method with [**Vector2.Distance**](<xref:Microsoft.Xna.Framework.Vector2.Distance(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)>) which returns the distance by providing the square root of the distance squared. So why not use this instead?
66+
> MonoGame also provides a distance calculation method with [**Vector2.Distance**](xref:Microsoft.Xna.Framework.Vector2.Distance(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)) which returns the distance by providing the square root of the distance squared. So why not use this instead?
6767
>
6868
> Square root operations are more computationally complex for a CPU. So instead of getting the normal distance, which would require the square root operation, it is more efficient for the cpu to multiply the sum of the radii by itself to get the squared sum and use that for comparison instead.
6969
@@ -93,7 +93,7 @@ To determine if two rectangles overlap using AABB collision detection, there are
9393

9494
If even a single one of these conditions is false, then the rectangles are not overlapping and thus not colliding.
9595

96-
MonoGame provides the [**Rectangle.Intersects**](<xref:Microsoft.Xna.Framework.Rectangle.Intersects(Microsoft.Xna.Framework.Rectangle)>) method which will perform an AABB collision check for us:
96+
MonoGame provides the [**Rectangle.Intersects**](xref:Microsoft.Xna.Framework.Rectangle.Intersects(Microsoft.Xna.Framework.Rectangle)) method which will perform an AABB collision check for us:
9797

9898
[!code-csharp[](./snippets/rectangle_intersects.cs)]
9999

@@ -144,7 +144,7 @@ For example:
144144

145145
[!code-csharp[](./snippets/blocking_example.cs)]
146146

147-
Sometimes, instead of preventing an object from moving onto another object, we want to ensure an object remains contained within a certain bounding area. MonoGame also provides the [**Rectangle.Contains**](<xref:Microsoft.Xna.Framework.Rectangle.Contains(Microsoft.Xna.Framework.Rectangle)>) method that we can use to determine this. [**Rectangle.Contains**](<xref:Microsoft.Xna.Framework.Rectangle.Contains(Microsoft.Xna.Framework.Rectangle)>) can check if any of the following are completely contained within the bounds of the rectangle;
147+
Sometimes, instead of preventing an object from moving onto another object, we want to ensure an object remains contained within a certain bounding area. MonoGame also provides the [**Rectangle.Contains**](xref:Microsoft.Xna.Framework.Rectangle.Contains(Microsoft.Xna.Framework.Rectangle)) method that we can use to determine this. [**Rectangle.Contains**](xref:Microsoft.Xna.Framework.Rectangle.Contains(Microsoft.Xna.Framework.Rectangle)) can check if any of the following are completely contained within the bounds of the rectangle;
148148

149149
- [**Point**](xref:Microsoft.Xna.Framework.Point)
150150
- [**Rectangle**](xref:Microsoft.Xna.Framework.Rectangle)
@@ -174,7 +174,7 @@ For example:
174174

175175
#### Bounce Collision Response
176176

177-
For games that need objects to bounce off each other (like the ball in a Pong game), we need to calculate how their velocity should change after the collision. MonoGame provides the [**Vector2.Reflect**](<xref:Microsoft.Xna.Framework.Vector2.Reflect(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)>) method to handle this calculation for us. The method needs two pieces of information:
177+
For games that need objects to bounce off each other (like the ball in a Pong game), we need to calculate how their velocity should change after the collision. MonoGame provides the [**Vector2.Reflect**](xref:Microsoft.Xna.Framework.Vector2.Reflect(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)) method to handle this calculation for us. The method needs two pieces of information:
178178

179179
1. The incoming vector (the direction the object is moving in before the collision).
180180
2. The normal vector (the direction perpendicular to the surface).
@@ -318,15 +318,15 @@ The key changes made here are:
318318
2. The field `_batVelocity` was added to track the velocity of the bat.
319319
3. The `AssignRandomBatVelocity()` method was added which calculates a random x and y velocity for the bat to move at when called.
320320
4. In [**Initialize**](xref:Microsoft.Xna.Framework.Game.Initialize), the initial position of the bat is set and `AssignRandomVelocity` is called to assign the initial velocity for the bat.
321-
5. In [**Update**](<xref:Microsoft.Xna.Framework.Game.Update(Microsoft.Xna.Framework.GameTime)>), collision detection and response logic was added to perform the following in order:
321+
5. In [**Update**](xref:Microsoft.Xna.Framework.Game.Update(Microsoft.Xna.Framework.GameTime)), collision detection and response logic was added to perform the following in order:
322322
1. A [**Rectangle**](xref:Microsoft.Xna.Framework.Rectangle) bound is created to represent the bounds of the screen.
323323
2. A `Circle` bound is created to represent the bounds of the slime.
324324
3. Distance based checks are performed to ensure that the slime cannot move outside of the screen, the resolution of which is to perform a blocking response.
325325
4. A new position for the bat is calculated based on the current velocity of the bat.
326326
5. A `Circle` bound is created to represent the bounds of the bat.
327327
6. Distance based checks are performed to ensure the bat cannot move outside of the screen, the resolution of which is to perform a bounce response.
328328
7. A collision check is made to determine if the slime and bat are colliding (bat "eating" the slime). If so, the bat is assigned a new random position within the screen and assigned a new random velocity.
329-
6. In [**Draw**](<xref:Microsoft.Xna.Framework.Game.Draw(Microsoft.Xna.Framework.GameTime)>), the bat is now drawn using the `_batPosition` value.
329+
6. In [**Draw**](xref:Microsoft.Xna.Framework.Game.Draw(Microsoft.Xna.Framework.GameTime)), the bat is now drawn using the `_batPosition` value.
330330

331331
Running the game now
332332

@@ -389,10 +389,10 @@ In the next chapter, we will explore using tilesets and tilemaps to create tile
389389
Two circles are colliding if the distance between their centers is less than the sum of their radii. If the distance is greater, they are separate. If the distance equals the sum of radii, they are just touching at one point.
390390
:::
391391

392-
4. When implementing bounce collision response, what two pieces of information does [**Vector2.Reflect**](<xref:Microsoft.Xna.Framework.Vector2.Reflect(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)>) need?
392+
4. When implementing bounce collision response, what two pieces of information does [**Vector2.Reflect**](xref:Microsoft.Xna.Framework.Vector2.Reflect(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)) need?
393393

394394
::: question-answer
395-
[**Vector2.Reflect**](<xref:Microsoft.Xna.Framework.Vector2.Reflect(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)>) needs:
395+
[**Vector2.Reflect**](xref:Microsoft.Xna.Framework.Vector2.Reflect(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2)) needs:
396396

397397
1. The incoming vector (direction the object is moving).
398398
2. The normal vector (direction perpendicular to the surface being hit).

articles/tutorials/building_2d_games/17_scenes/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The key changes here are:
115115
116116
## Updating the Game
117117

118-
With the scene architecture in place, we’re now ready to update the game by breaking it into separate scenes. We will create two scenes; a title scene and a gameplay scene. First, however, we need to add an additional SpriteFont Description that will be used during the title scene to display the title of the game. Open the *Content.mgcb* content project file in the MGCB Editor and perform the following:
118+
With the scene architecture in place, we are now ready to update the game by breaking it into separate scenes. We will create two scenes; a title scene and a gameplay scene. First, however, we need to add an additional SpriteFont Description that will be used during the title scene to display the title of the game. Open the *Content.mgcb* content project file in the MGCB Editor and perform the following:
119119

120120
1. Right-click the `fonts` folder and choose `Add > New Item...`.
121121
2. Select `SpriteFont Description (.spritefont)` from the options.

articles/tutorials/building_2d_games/22_snake_game_mechanics/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ This update method:
269269
2. Calls `HandleInput` to check for player input.
270270
3. Increments the movement timer by the amount of time that has elapsed between the game's update cycles.
271271
4. Performs a check to see if the movement timer has accumulated more time than the threshold to perform a movement cycle update. If it has then:
272-
- The movement timer is reduced by the threshold time.
273-
- The `Move` method is called to perform a movement cycle update.
272+
1. The movement timer is reduced by the threshold time.
273+
2. The `Move` method is called to perform a movement cycle update.
274274
5. Finally, the movement progress amount is calculated by dividing the number of seconds accumulated for the movement timer by the number of seconds for the threshold.  This gives us a normalized value between 0.0 and 1.0 that we can use for visual interpolation for fluid movement.
275275

276276
> [!TIP]

0 commit comments

Comments
 (0)