Add turning and elevator sounds

This commit is contained in:
2021-04-18 22:35:49 +02:00
parent cc3df2e2a5
commit 3d9ca3d590
4 changed files with 68 additions and 8 deletions
+16 -8
View File
@@ -106,21 +106,29 @@ namespace EvilSatellites.Screens
{
move.X = _player.Acceleration.X;
}
if (Input.IsPressed(Keys.Left))
if (Input.IsJustPressed(Keys.Left))
{
_player.RotateY(0.05f);
_player.StartTurning(-1, gameTime);
}
if (Input.IsPressed(Keys.Right))
if (Input.IsJustPressed(Keys.Right))
{
_player.RotateY(-0.05f);
_player.StartTurning(1, gameTime);
}
if (Input.IsPressed(Keys.Up))
if (Input.IsJustReleased(Keys.Left) || Input.IsJustReleased(Keys.Right))
{
_player.RotateX(0.05f);
_player.StopTurning();
}
if (Input.IsPressed(Keys.Down))
if (Input.IsJustPressed(Keys.Up))
{
_player.RotateX(-0.05f);
_player.StartElevating(-1, gameTime);
}
if (Input.IsJustPressed(Keys.Down))
{
_player.StartElevating(1, gameTime);
}
if (Input.IsJustReleased(Keys.Up) || Input.IsJustReleased(Keys.Down))
{
_player.StopElevating();
}
_player.Accelerate(move);
if (Input.IsJustPressed(Keys.Space))