Continued work on tilemaps/debug

This commit is contained in:
2022-04-08 18:19:27 -04:00
parent 2331110c71
commit bc4262d552
5 changed files with 48 additions and 14 deletions

View File

@ -91,11 +91,17 @@ public:
void update() override
{
if (Game::gsm->currentState == GameStateManager::ST_COREGAME){
for (int i=0;i<destRects.size()-1;i++){
if (Game::camera.x >= 352)
destRects[i].x = destRects[i].x - Game::camera.x*0.01f;
if (Game::camera.y >= 432)
destRects[i].y = destRects[i].y - Game::camera.y*0.01f;
if (Game::pVel.x > 0)
destRects[i].x = destRects[i].x - Game::pVel.x;
if (Game::pVel.y > 0)
destRects[i].y = destRects[i].y - Game::pVel.y;
if (Game::pVel.x < 0)
destRects[i].x = destRects[i].x - Game::pVel.x;
if (Game::pVel.y < 0)
destRects[i].y = destRects[i].y - Game::pVel.y;
}
}
}