Add multiple hits

This commit is contained in:
Miloslav Číž 2018-08-31 19:12:47 +02:00
parent 3fbd9f23cb
commit 0ed24fdcd2

View file

@ -16,7 +16,7 @@ public:
int16_t getHeight(int16_t x, int16_t y) int16_t getHeight(int16_t x, int16_t y)
{ {
if (x > 12 || y > 12) if (x > 12 || y > 12)
return x * y; return max(x,y) - 10;
return (x < 0 || y < 0 || x > 9 || y > 9) ? 1 : 0; return (x < 0 || y < 0 || x > 9 || y > 9) ? 1 : 0;
} }
@ -59,7 +59,7 @@ void draw()
{ {
RayConstraints c; RayConstraints c;
c.maxHits = 1; c.maxHits = 3;
c.maxSteps = 32; c.maxSteps = 32;
render(player.mCamera,heightFunc,pixelFunc,c); render(player.mCamera,heightFunc,pixelFunc,c);