mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Shooting
This commit is contained in:
parent
1229613def
commit
341f76d885
17 changed files with 156 additions and 55 deletions
|
|
@ -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;
|
||||
}
|
||||
// }
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue