Strafing
This commit is contained in:
@@ -16,6 +16,10 @@ namespace GameJamDungeon
|
||||
PlayerData PlayerData { get; }
|
||||
|
||||
public Vector3 GetGlobalInputVector();
|
||||
|
||||
public float GetLeftStrafeInputVector();
|
||||
|
||||
public float GetRightStrafeInputVector();
|
||||
}
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
@@ -139,8 +143,7 @@ namespace GameJamDungeon
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
var attackIsPressed = Input.IsActionJustPressed(GameInputs.Attack);
|
||||
if (attackIsPressed && !GameRepo.IsWithinDialogueSpace)
|
||||
if (Input.IsActionJustPressed(GameInputs.Attack))
|
||||
PlayerLogic.Input(new PlayerLogic.Input.Attack());
|
||||
}
|
||||
|
||||
@@ -176,7 +179,6 @@ namespace GameJamDungeon
|
||||
public Vector3 GetGlobalInputVector()
|
||||
{
|
||||
var rawInput = Input.GetVector(GameInputs.MoveLeft, GameInputs.MoveRight, GameInputs.MoveUp, GameInputs.MoveDown);
|
||||
|
||||
var input = new Vector3
|
||||
{
|
||||
X = rawInput.X,
|
||||
@@ -185,6 +187,18 @@ namespace GameJamDungeon
|
||||
return input with { Y = 0f };
|
||||
}
|
||||
|
||||
public float GetLeftStrafeInputVector()
|
||||
{
|
||||
var leftStrafe = Input.GetActionStrength(GameInputs.StrafeLeft);
|
||||
return leftStrafe;
|
||||
}
|
||||
|
||||
public float GetRightStrafeInputVector()
|
||||
{
|
||||
var rightStrafe = Input.GetActionStrength(GameInputs.StrafeRight);
|
||||
return rightStrafe;
|
||||
}
|
||||
|
||||
public void ThrowItem()
|
||||
{
|
||||
var itemScene = GD.Load<PackedScene>("res://src/items/throwable/ThrowableItem.tscn");
|
||||
|
||||
Reference in New Issue
Block a user