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) {