From 85362a12ac5839e4e81a2a1543f9a34dd3abc239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Tue, 11 Sep 2018 08:39:30 +0200 Subject: [PATCH] Update --- demo2.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/demo2.cpp b/demo2.cpp index 84c8b03..c3badfd 100644 --- a/demo2.cpp +++ b/demo2.cpp @@ -8,7 +8,9 @@ */ #define FPS 60 -#define PLAYER_SPEED (UNITS_PER_SQUARE * 3) +#define HEAD_BOB_HEIGHT 200 +#define HEAD_BOB_STEP 20 +#define PLAYER_SPEED (5 * UNITS_PER_SQUARE) #include "general.hpp" @@ -809,10 +811,14 @@ void draw() c.maxSteps = 20; c.computeTextureCoords = 1; -player.mCamera.height += player.mHeadBob; -renderSimple(player.mCamera,floorHeightAt,textureAt,pixelFunc,c); -// render(player.mCamera,floorHeightAt,0,textureAt,pixelFunc,c); -player.mCamera.height -= player.mHeadBob; + player.mCamera.height += player.mHeadBob; + renderSimple(player.mCamera,floorHeightAt,textureAt,pixelFunc,c); + + /* this would achieve more or less the same (less shaky head bob), + for a cost of a few FPS: */ + // render(player.mCamera,floorHeightAt,0,textureAt,pixelFunc,c); + + player.mCamera.height -= player.mHeadBob; if (shotFired) {