mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Player movement and camera
This commit is contained in:
parent
ed656f00bb
commit
a324f2e347
43 changed files with 1777 additions and 316 deletions
|
|
@ -35,11 +35,16 @@ public partial class SimpleMovementPattern : AttackPattern
|
|||
Boss = boss;
|
||||
tween = Parent.CreateTween();
|
||||
isComplete = false;
|
||||
|
||||
if (parent is not Node2D parent2d)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Vector2 targetPosition = (Boss?.HomePosition ?? Parent.GlobalPosition) + pattern.relativeTargetPosition;
|
||||
Vector2 targetPosition = (Boss?.HomePosition ?? parent2d.GlobalPosition) + pattern.relativeTargetPosition;
|
||||
|
||||
boss.ChangeSpriteDirection(-(Parent.GlobalPosition - targetPosition));
|
||||
tween.TweenProperty(Parent, "global_position", targetPosition, pattern.moveDuration)
|
||||
boss.ChangeSpriteDirection(-(parent2d.GlobalPosition - targetPosition));
|
||||
tween.TweenProperty(parent2d, "global_position", targetPosition, pattern.moveDuration)
|
||||
.SetTrans(pattern.transitionType)
|
||||
.SetEase(pattern.easeType)
|
||||
.Finished += () =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue