Brought over our player input code from GML into a PlayerInput.cs class.

This commit is contained in:
J. M. Ellis
2024-05-24 20:21:01 -07:00
parent b92de57435
commit 9ccb35f2ad
3 changed files with 126 additions and 20 deletions
+7 -2
View File
@@ -23,7 +23,8 @@ namespace LunaLightXMG
// Test player input and movement with abstracted player class
private Player player;
// Player input
private PlayerInput playerInput;
// Native retro scale
private int retroWidth = 320;
private int retroHeight = 180;
@@ -40,6 +41,7 @@ namespace LunaLightXMG
// Test player input and movement with abstracted player class
player = new Player();
playerInput = new PlayerInput();
}
private void OnClientSizeChanged(object sender, EventArgs eventArgs)
@@ -59,6 +61,8 @@ namespace LunaLightXMG
graphics.PreferredBackBufferHeight = 1080;
graphics.ApplyChanges();
playerInput.HasControl = true; // Do we need this here?
base.Initialize();
CalculateRenderDestination();
}
@@ -96,7 +100,8 @@ namespace LunaLightXMG
Exit();
// Test player input and movement with abstracted player class
player.Update(gameTime);
playerInput.Update();
player.Update(gameTime, playerInput);
base.Update(gameTime);
}