Skip to content

Commit

Permalink
Correct 5_adding_basic_code.md (#69)
Browse files Browse the repository at this point in the history
cast `PlayerIndex.One` as int so it compiles. Also correct differences between example code in block and explanation.
  • Loading branch information
BE-Code authored Sep 29, 2024
1 parent 56e6932 commit a965348
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions articles/getting_started/5_adding_basic_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Find the `Update` method in the Game1.cs class file and add:
```csharp
if(Joystick.LastConnectedIndex == 0)
{
JoystickState jstate = Joystick.GetState(PlayerIndex.One);
JoystickState jstate = Joystick.GetState((int) PlayerIndex.One);

float updatedBallSpeed = ballSpeed * (float)gameTime.ElapsedGameTime.TotalSeconds;

Expand Down Expand Up @@ -202,10 +202,10 @@ If there is no controller, the code inside the if statement will be skipped over
### Get the current state of Joystick 1

```csharp
JoystickState jstate = Joystick.GetState(0);
JoystickState jstate = Joystick.GetState((int) PlayerIndex.One);
```

This code fetches the current first joystick state `Joystick.GetState(0)` and stores it into a variable called `jstate`.
This code fetches the current first joystick state `Joystick.GetState((int) PlayerIndex.One)` and stores it into a variable called `jstate`.

### CHeck the current value of "Axis" 2

Expand Down

0 comments on commit a965348

Please sign in to comment.