Falling rose petal effect
This commit is contained in:
@@ -15,12 +15,17 @@ public partial class Character : CharacterBody3D
|
||||
|
||||
public bool CanShoot { get; protected set; }
|
||||
|
||||
public bool CanShootAlt { get; protected set; }
|
||||
|
||||
protected GameManager _gameManager;
|
||||
|
||||
private bool isPaused;
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
Position = OwnerPlayer.SpawnPoint.Position;
|
||||
CanShoot = true;
|
||||
CanShootAlt = true;
|
||||
_gameManager = GetTree().Root.GetNode<GameManager>("Main/GameManager");
|
||||
}
|
||||
|
||||
@@ -35,14 +40,14 @@ public partial class Character : CharacterBody3D
|
||||
MoveAndSlide();
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (Input.IsActionJustPressed("exit"))
|
||||
GetTree().Quit();
|
||||
|
||||
if (Input.IsActionJustPressed(OwnerPlayer.PlayerInput.Fire()) && CanShoot)
|
||||
Fire();
|
||||
if (Input.IsActionJustPressed(OwnerPlayer.PlayerInput.AltFire()) && CanShoot)
|
||||
if (Input.IsActionJustPressed(OwnerPlayer.PlayerInput.AltFire()) && CanShootAlt)
|
||||
AltFire();
|
||||
}
|
||||
|
||||
@@ -94,9 +99,9 @@ public partial class Character : CharacterBody3D
|
||||
if (proj.HasRotation)
|
||||
proj.Rotation = GetNode<Node3D>("Pivot").Rotation;
|
||||
}
|
||||
CanShoot = false;
|
||||
CanShootAlt = false;
|
||||
await ToSignal(GetTree().CreateTimer(projectiles.First().Cooldown), "timeout");
|
||||
CanShoot = true;
|
||||
CanShootAlt = true;
|
||||
}
|
||||
|
||||
public void OnHit(Node3D node)
|
||||
|
||||
Reference in New Issue
Block a user