Bullet, shooting & camera shake

This commit is contained in:
2024-08-08 12:13:53 +08:00
parent 6fa2c8411f
commit 0f9192a5f8
10 changed files with 216 additions and 20 deletions

View File

@ -5,6 +5,7 @@ namespace AceField.Scripts.Logic;
public partial class PlayerInput : MultiplayerSynchronizer
{
[Export] public bool IsDashing;
[Export] public bool IsShooting;
[Export] public Vector2 MovementDirection;
@ -21,12 +22,18 @@ public partial class PlayerInput : MultiplayerSynchronizer
private void Dash()
=> IsDashing = true;
[Rpc(CallLocal = true)]
private void Shoot()
=> IsShooting = true;
public override void _Process(double delta)
{
MovementDirection = Input.GetVector("move_left", "move_right", "move_up", "move_down");
if (Input.IsActionJustPressed("move_dash"))
Rpc(nameof(Dash));
if (Input.IsActionJustPressed("shoot"))
Rpc(nameof(Shoot));
}
public override void _Input(InputEvent evt)