mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Scriptable bullet emitter
This commit is contained in:
parent
d62538a382
commit
4261009c33
17 changed files with 251 additions and 74 deletions
|
|
@ -16,23 +16,28 @@ public partial class MovementPattern : AttackPattern
|
|||
|
||||
private Tween tween;
|
||||
private bool isComplete = false;
|
||||
|
||||
public override void Start(Boss boss)
|
||||
|
||||
protected IScriptHost Boss;
|
||||
|
||||
public override void Start(Node2D parent)
|
||||
{
|
||||
if (parent is not IScriptHost boss)
|
||||
return;
|
||||
|
||||
Boss = boss;
|
||||
tween = boss.CreateTween();
|
||||
tween = parent.CreateTween();
|
||||
isComplete = false;
|
||||
|
||||
Vector2 targetPosition = (Boss?.HomePosition ?? boss.GlobalPosition) + this.relativeTargetPosition;
|
||||
Vector2 targetPosition = (Boss?.HomePosition ?? parent.GlobalPosition) + this.relativeTargetPosition;
|
||||
|
||||
tween.TweenProperty(Boss, "position", targetPosition, moveDuration)
|
||||
tween.TweenProperty(Parent, "position", targetPosition, moveDuration)
|
||||
.SetTrans(transitionType)
|
||||
.SetEase(easeType)
|
||||
.Finished += () => isComplete = true;
|
||||
|
||||
if (shootingPattern != null && !WaitForCompletion)
|
||||
{
|
||||
shootingPattern.Start(boss);
|
||||
shootingPattern.Start(Parent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue