This commit is contained in:
2023-09-11 17:42:11 -07:00
parent ba9c1e320e
commit 4d8fbda71b
21 changed files with 123 additions and 67 deletions

View File

@@ -8,6 +8,7 @@ public partial class CapricornControls : Character
public override void _Ready()
{
base._Ready();
Position = OwnerPlayer.SpawnPoint.Position;
_sprite = GetNode<AnimatedSprite3D>("Pivot/Sprite");
}
@@ -88,7 +89,8 @@ public partial class CapricornControls : Character
await ToSignal(GetTree().CreateTimer(1.0f), "timeout");
var projectile = _fireProjectile.Instantiate<Node3D>();
projectile.Position = Position;
GetParent().AddChild(projectile);
if (GetParent() != null)
GetParent().AddChild(projectile);
CanShoot = true;
IsShooting = false;
}
@@ -100,7 +102,8 @@ public partial class CapricornControls : Character
await ToSignal(GetTree().CreateTimer(1.0f), "timeout");
var projectile = _altFireProjectile.Instantiate<Node3D>();
projectile.Position = Position;
GetParent().AddChild(projectile);
if (GetParent() != null)
GetParent().AddChild(projectile);
CanShoot = true;
IsShooting = false;
}
@@ -130,7 +133,6 @@ public partial class CapricornControls : Character
public new void OnHit(Node3D node)
{
if (this != null)
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, OwnerPlayer);
_gameManager.CallDeferred(GameManager.MethodName.RemoveCharacter, OwnerPlayer);
}
}