mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:45:33 +00:00
Move player to the middle of the elevator
This commit is contained in:
parent
95837b75fe
commit
0f431b5343
2 changed files with 12 additions and 1 deletions
|
|
@ -662,7 +662,7 @@ position = Vector2(124, 338)
|
|||
script = ExtResource("12_8to53")
|
||||
|
||||
[node name="PlayerStartPosition" type="Marker2D" parent="."]
|
||||
position = Vector2(640, 56)
|
||||
position = Vector2(238, 188)
|
||||
|
||||
[node name="AlarmManager" type="Node2D" parent="."]
|
||||
process_mode = 1
|
||||
|
|
|
|||
|
|
@ -64,6 +64,8 @@ public abstract partial class ElevatorMovementState : BaseState<ElevatorState, E
|
|||
// Grab player if in range
|
||||
CatchPlayer();
|
||||
|
||||
_ = MovePlayerToCenter();
|
||||
|
||||
//Ascend
|
||||
_ = PlayAnimation();
|
||||
}
|
||||
|
|
@ -78,4 +80,13 @@ public abstract partial class ElevatorMovementState : BaseState<ElevatorState, E
|
|||
|
||||
StateMachine.SetState(EndState);
|
||||
}
|
||||
|
||||
private async Task MovePlayerToCenter()
|
||||
{
|
||||
var tween = GTweenSequenceBuilder.New()
|
||||
.Append(PlayerBody.TweenPosition(this.Position, 0.2f))
|
||||
.Build();
|
||||
|
||||
await tween.PlayAsync(CancellationToken.None);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue