mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 14:45:55 +00:00
Mapping
This commit is contained in:
parent
ba2f6a97fc
commit
efd6283487
15 changed files with 177 additions and 35 deletions
|
|
@ -11,6 +11,8 @@ public partial class Boss : Enemy, IActivable
|
|||
[Export] public string BossName { get; private set; }
|
||||
[Export] private Array<BossPhase> Phases;
|
||||
[Export] private PackedScene BossHudPrefab;
|
||||
[Export] public Vector2 BossPhaseAnimationStartingPosition = new Vector2(180, 10);
|
||||
|
||||
private int currentPhaseIndex = 0;
|
||||
|
||||
private bool _started = false;
|
||||
|
|
@ -27,9 +29,6 @@ public partial class Boss : Enemy, IActivable
|
|||
[Export]
|
||||
public Vector2 CameraOffset = Vector2.Zero;
|
||||
|
||||
// [Export]
|
||||
// private PackedScene _bossPhaseAnimationPrefab;
|
||||
|
||||
private TextureRect _animationTextureRect;
|
||||
|
||||
[Export]
|
||||
|
|
@ -74,20 +73,12 @@ public partial class Boss : Enemy, IActivable
|
|||
|
||||
_bossHud.CallDeferred("add_child", _animationTextureRect);
|
||||
|
||||
//canvas.AddChild(animationTextureRect);
|
||||
|
||||
_animationTextureRect.Position = new Vector2(180, 10);
|
||||
_animationTextureRect.Position = BossPhaseAnimationStartingPosition;
|
||||
|
||||
_animationTextureRect.Visible = false;
|
||||
|
||||
//var animation = _bossPhaseAnimationPrefab.Instantiate<BossPhaseAnimation>();
|
||||
|
||||
// _gameManager.AddChild(animation);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void _Process(double delta)
|
||||
|
|
@ -105,6 +96,18 @@ public partial class Boss : Enemy, IActivable
|
|||
StartPhase(CurrentPhase);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Explode()
|
||||
{
|
||||
if (_bossHud is not null)
|
||||
{
|
||||
_bossHud.QueueFree();
|
||||
}
|
||||
|
||||
_gameManager.CameraTargetPlayer();
|
||||
|
||||
base.Explode();
|
||||
}
|
||||
|
||||
private void StartPhase(BossPhase phase)
|
||||
{
|
||||
|
|
@ -150,6 +153,7 @@ public partial class Boss : Enemy, IActivable
|
|||
private async Task PlayAnimation()
|
||||
{
|
||||
_animationTextureRect.Modulate = new Color(_animationTextureRect.Modulate.R, _animationTextureRect.Modulate.G, _animationTextureRect.Modulate.B, 0f);
|
||||
_animationTextureRect.Position = BossPhaseAnimationStartingPosition;
|
||||
_animationTextureRect.Visible = true;
|
||||
|
||||
var tween = GetTree().CreateTween();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue