Explosions

This commit is contained in:
MaddoScientisto 2024-06-09 11:45:22 +02:00
commit e1d6afa512
21 changed files with 323 additions and 24 deletions

View file

@ -53,16 +53,13 @@ public partial class PlayerMovement : CharacterBody2D
private void HandleShoot()
{
if (Input.IsActionJustPressed("shoot"))
{
//Debug.WriteLine("Shoot");
Bullet bullet = BulletScene.Instantiate<Bullet>();
Owner.AddChild(bullet);
bullet.Transform = Muzzle.GlobalTransform;
bullet.Position = this.Position;
bullet.SetDirection(this._facingDirection);
}
if (!Input.IsActionJustPressed("shoot")) return;
//Debug.WriteLine("Shoot");
var bullet = BulletScene.Instantiate<Bullet>();
Owner.AddChild(bullet);
bullet.Transform = Muzzle.GlobalTransform;
bullet.Position = this.Position;
bullet.SetDirection(this._facingDirection);
}
private void SetAnimation()