Make ceiling different
This commit is contained in:
parent
dbc8c41d05
commit
c1329c8cf8
1 changed files with 17 additions and 16 deletions
33
game.cpp
33
game.cpp
|
@ -86,11 +86,11 @@ const signed char levelFloor[] =
|
||||||
|
|
||||||
const signed char levelCeiling[] =
|
const signed char levelCeiling[] =
|
||||||
{
|
{
|
||||||
40,40,40,40,40,40,40,99,99,99,99,99,40,40,40,40,40,40,99,99,99,99,99,99,99,99,99,99,99,
|
40,40,40,40,40,40,40,99,99,99,99,36,40,40,40,40,40,36,99,99,99,99,99,99,99,99,99,99,99,
|
||||||
40,99,99,99,99,99,20,99,99,99,99,99,40,99,99,99,99,40,99,99,99,99,99,99,99,99,99,99,99,
|
40,99,99,99,99,99,20,99,99,99,99,36,40,99,99,99,99,36,99,99,99,99,99,99,99,99,99,99,99,
|
||||||
40,99,99,99,99,99,20,99,99,99,99,99,40,99,99,99,99,40,99,99,99,99,99,99,99,99,99,99,99,
|
40,99,99,99,99,99,20,99,99,99,99,36,40,99,99,99,99,36,99,99,99,99,99,99,99,99,99,99,99,
|
||||||
40,99,99,99,99,99,48,99,99,99,99,99,24,24,24,24,24,40,99,99,99,99,99,99,99,99,99,99,99,
|
40,99,99,99,99,99,48,99,99,99,99,36,24,24,24,24,24,36,99,99,99,99,99,99,99,99,99,99,99,
|
||||||
40,99,48,48,48,48,48,99,99,99,99,99,42,42,42,42,42,99,99,99,99,99,99,99,99,99,99,99,99,
|
40,99,48,48,48,48,47,99,99,99,99,36,36,36,36,36,36,36,99,99,99,99,99,99,99,99,99,99,99,
|
||||||
40,99,48,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,
|
40,99,48,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,
|
||||||
40,99,48,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,
|
40,99,48,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,
|
||||||
40,99,48,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,
|
40,99,48,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,
|
||||||
|
@ -517,11 +517,11 @@ public:
|
||||||
|
|
||||||
Character()
|
Character()
|
||||||
{
|
{
|
||||||
mCamera.position.x = 961;//UNITS_PER_SQUARE * 1;
|
mCamera.position.x = 27127;//UNITS_PER_SQUARE * 1;
|
||||||
mCamera.position.y = 7381;//UNITS_PER_SQUARE * 5;
|
mCamera.position.y = 1361;//UNITS_PER_SQUARE * 5;
|
||||||
mCamera.direction = -575;//200;
|
mCamera.direction = -3400;//200;
|
||||||
mCamera.fovAngle = UNITS_PER_SQUARE / 4;
|
mCamera.fovAngle = UNITS_PER_SQUARE / 4;
|
||||||
mCamera.height = UNITS_PER_SQUARE / 2;
|
mCamera.height = UNITS_PER_SQUARE * 2;
|
||||||
mCamera.resolution.x = 110 / SUBSAMPLE;
|
mCamera.resolution.x = 110 / SUBSAMPLE;
|
||||||
mCamera.resolution.y = 88;
|
mCamera.resolution.y = 88;
|
||||||
}
|
}
|
||||||
|
@ -563,10 +563,8 @@ inline void pixelFunc(PixelInfo pixel)
|
||||||
|
|
||||||
uint8_t c;
|
uint8_t c;
|
||||||
|
|
||||||
Unit depth = pixel.depth - UNITS_PER_SQUARE;
|
Unit depth = pixel.depth - UNITS_PER_SQUARE * 3;
|
||||||
|
depth = depth > 0 ? depth : 1;
|
||||||
if (depth < 0)
|
|
||||||
depth = 0;
|
|
||||||
|
|
||||||
int intensity = 7 - (depth * 7) / (UNITS_PER_SQUARE * 5);
|
int intensity = 7 - (depth * 7) / (UNITS_PER_SQUARE * 5);
|
||||||
|
|
||||||
|
@ -585,7 +583,10 @@ inline void pixelFunc(PixelInfo pixel)
|
||||||
c = addIntensity(c,intensity - 3);
|
c = addIntensity(c,intensity - 3);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
c = rgbToIndex(intensity/2,intensity,intensity/3);
|
c = pixel.isFloor ?
|
||||||
|
rgbToIndex(intensity/2,intensity,intensity/3) :
|
||||||
|
rgbToIndex(intensity,intensity/2,0);
|
||||||
|
|
||||||
|
|
||||||
uint8_t *buf = p.display.screenbuffer;
|
uint8_t *buf = p.display.screenbuffer;
|
||||||
|
|
||||||
|
@ -632,9 +633,9 @@ void draw()
|
||||||
|
|
||||||
p.display.setColor(rgbToIndex(7,7,3));
|
p.display.setColor(rgbToIndex(7,7,3));
|
||||||
p.display.setCursor(1,1);
|
p.display.setCursor(1,1);
|
||||||
p.display.print(divRoundDown(player.mCamera.position.x,UNITS_PER_SQUARE));
|
p.display.print(player.mCamera.position.x);
|
||||||
p.display.print(" ");
|
p.display.print(" ");
|
||||||
p.display.print(divRoundDown(player.mCamera.position.y,UNITS_PER_SQUARE));
|
p.display.print(player.mCamera.position.y);
|
||||||
p.display.print(" ");
|
p.display.print(" ");
|
||||||
p.display.print(player.mCamera.direction);
|
p.display.print(player.mCamera.direction);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue