Fix sprites
This commit is contained in:
parent
6ad2165a40
commit
d24bf31d6e
1 changed files with 17 additions and 9 deletions
16
game.cpp
16
game.cpp
|
@ -421,9 +421,9 @@ public:
|
|||
|
||||
Character()
|
||||
{
|
||||
mCamera.position.x = UNITS_PER_SQUARE * 1;
|
||||
mCamera.position.y = UNITS_PER_SQUARE * 5;
|
||||
mCamera.direction = 200;
|
||||
mCamera.position.x = 2468;//UNITS_PER_SQUARE * 1;
|
||||
mCamera.position.y = 6736;//UNITS_PER_SQUARE * 5;
|
||||
mCamera.direction = -100;//200;
|
||||
mCamera.fovAngle = UNITS_PER_SQUARE / 4;
|
||||
mCamera.height = UNITS_PER_SQUARE / 2;
|
||||
mCamera.resolution.x = 110 / SUBSAMPLE;
|
||||
|
@ -495,7 +495,15 @@ v.y = 7 * UNITS_PER_SQUARE;
|
|||
PixelInfo pos = mapToScreen(v,UNITS_PER_SQUARE / 4,player.mCamera);
|
||||
|
||||
if (pos.depth > 0)
|
||||
drawSprite(sprite,pos.position.x,pos.position.y,perspectiveScale(32,pos.depth));
|
||||
drawSprite(sprite,pos.position.x * SUBSAMPLE,pos.position.y,perspectiveScale(32,pos.depth));
|
||||
|
||||
p.display.setColor(rgbToIndex(7,7,3));
|
||||
p.display.setCursor(1,1);
|
||||
p.display.print(player.mCamera.position.x);
|
||||
p.display.print(" ");
|
||||
p.display.print(player.mCamera.position.y);
|
||||
p.display.print(" ");
|
||||
p.display.print(player.mCamera.direction);
|
||||
}
|
||||
|
||||
int main()
|
||||
|
|
Loading…
Reference in a new issue