This commit is contained in:
Marco 2025-06-18 18:09:30 +02:00
commit 341f76d885
17 changed files with 156 additions and 55 deletions

View file

@ -53,10 +53,12 @@ public partial class IsoMovementModule : ModuleBase<PlayerState, CharacterBody3D
if (rightStickInput.Length() > 0.1f) // If the right stick is moved
{
PlayerStorage.FacingDirection = rightStickInput;
PlayerStorage.AimingDirection = rightStickInput;
}
else if (movementInput != Vector2.Zero) // Fall back to movement direction
{
PlayerStorage.FacingDirection = movementInput;
PlayerStorage.AimingDirection = rightStickInput;
}
// }

View file

@ -52,8 +52,10 @@ public partial class PlayerWeaponModule3D : ModuleBase<PlayerState, CharacterBod
return;
}
if (!InputProvider.GetShootPressed()) return;
WeaponProvider.Shoot(Storage.AimingDirection);
if (InputProvider.GetShootPressed())
{
WeaponProvider.Shoot(Storage.AimingDirection);
}
}
private void HandleWeaponSwitch()

View file

@ -221,9 +221,12 @@ public partial class PlayerWeaponProvider3D : Node
if (maybeExistingWeapon is not null) return maybeExistingWeapon;
var weapon = WeaponTemplate.Instantiate<Weapon3D>();
this.AddChild(weapon);
_parent.AddChild(weapon);
weapon.GlobalPosition = _parent.GlobalPosition;
//this.CreateSibling<Weapon>(WeaponTemplate);
weapon.WeaponData = startingItem.WeaponData;
weapon.WeaponData = startingItem.WeaponData3D;
weapon.Sprite.Texture = startingItem.InventorySprite;