From 5520e91336daa4a2f33c4caee508cabdf34fdb2c Mon Sep 17 00:00:00 2001 From: Renge Date: Sun, 17 Apr 2022 20:23:54 -0400 Subject: [PATCH] feat: update player position --- src/shattered_sword/Scenes/GameLevel.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/shattered_sword/Scenes/GameLevel.ts b/src/shattered_sword/Scenes/GameLevel.ts index c368348..53a1d3f 100644 --- a/src/shattered_sword/Scenes/GameLevel.ts +++ b/src/shattered_sword/Scenes/GameLevel.ts @@ -262,6 +262,11 @@ export default class GameLevel extends Scene { const baseViewportSize = this.viewport.getHalfSize().scaled(2); //check position of player this.playerFalloff(viewportCenter, baseViewportSize); + + // Update player safe position + if (this.player.onGround) { + this.playerSpawn = this.player.position.clone(); + } //TODO - this is for testing if(InputWrapper.isSpawnJustPressed()){