From 2cce226575dfada2345cb1eede8cfff2731f0aaa Mon Sep 17 00:00:00 2001 From: sam-astro <77079540+sam-astro@users.noreply.github.com> Date: Tue, 24 May 2022 21:40:58 -0400 Subject: [PATCH] Working on platformer --- examples/Platformer/script.zs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/Platformer/script.zs b/examples/Platformer/script.zs index 34cbbb6..4a1b5e2 100644 --- a/examples/Platformer/script.zs +++ b/examples/Platformer/script.zs @@ -41,7 +41,7 @@ func Start() global Sprite g_groundSprite = ZS.Graphics.Sprite("./square.png", groundPos, groundScale, 0) Vec2 instructionsPos = NVec2(centerOfScreen.x, centerOfScreen.y) - global Text g_instructionsText = ZS.Graphics.Text("Use Arrow Keys or WASD to Move, and Spacebar to Jump", "./arial.ttf", instructionsPos, 20, 0, 255, 255, 255) + global Text g_instructionsText = ZS.Graphics.Text("Use Arrow Keys or WASD to Move and Spacebar to Jump", "./arial.ttf", instructionsPos, 20, 0, 255, 255, 255) global Vec2 g_playerTargetPosition = playerPos @@ -92,7 +92,7 @@ func Update(deltaTime) { float newX = g_playerTargetPosition.x float stopSpeed = deltaTime * 7 float lerpedX = Lerp(oldX, newX, stopSpeed) - g_playerSprite.position = NVec2(lerpedX, newY) + g_playerSprite.position = NVec2(lerpedX, g_playerTargetPosition.y) // Finally draws all of the sprites