From 3ec47117fa49dfdc492dff500c782ccd49556c1d Mon Sep 17 00:00:00 2001 From: Bradley English <43590516+BE-Code@users.noreply.github.com> Date: Fri, 27 Sep 2024 23:17:36 -0400 Subject: [PATCH] Correct 5_adding_basic_code.md cast `PlayerIndex.One` as int so it compiles. Also correct differences between example code in block and explanation. --- articles/getting_started/5_adding_basic_code.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/articles/getting_started/5_adding_basic_code.md b/articles/getting_started/5_adding_basic_code.md index acc3d93..32f416f 100644 --- a/articles/getting_started/5_adding_basic_code.md +++ b/articles/getting_started/5_adding_basic_code.md @@ -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; @@ -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