camera controller

This commit is contained in:
Hunter 2023-05-27 13:36:40 -04:00
parent a1f8e26d9a
commit 83e312894b
5 changed files with 15 additions and 9 deletions

View file

@ -25,8 +25,8 @@ void PDestroyTexture(PhoenixTexture *texture) {
void PRenderTexture(PhoenixTexture *texture, int x, int y) {
SDL_Rect dstRect{};
dstRect.x = x;
dstRect.y = y;
dstRect.x = x - state.camera.x;
dstRect.y = y - state.camera.y;
dstRect.w = TEXTURE_WIDTH;
dstRect.h = TEXTURE_HEIGHT;