This commit is contained in:
Miloslav Číž 2018-09-11 08:39:30 +02:00
parent 72fc074af1
commit 85362a12ac

View file

@ -8,7 +8,9 @@
*/ */
#define FPS 60 #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" #include "general.hpp"
@ -809,10 +811,14 @@ void draw()
c.maxSteps = 20; c.maxSteps = 20;
c.computeTextureCoords = 1; c.computeTextureCoords = 1;
player.mCamera.height += player.mHeadBob; player.mCamera.height += player.mHeadBob;
renderSimple(player.mCamera,floorHeightAt,textureAt,pixelFunc,c); renderSimple(player.mCamera,floorHeightAt,textureAt,pixelFunc,c);
// render(player.mCamera,floorHeightAt,0,textureAt,pixelFunc,c);
player.mCamera.height -= player.mHeadBob; /* 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) if (shotFired)
{ {