This commit is contained in:
2026-03-22 20:23:27 +01:00
parent fa4a2b9924
commit 0c0e7c41af
6 changed files with 16 additions and 7 deletions

View File

@@ -15,6 +15,9 @@ namespace Game::AGame {
int w, h;
SDL_GetWindowSizeInPixels(Window::Window::getSDLWindowBackend(), &w, &h);
mTransform.scaleX = 8.f;
mTransform.scaleY = 8.f;
mTransform.x -= mTex->getWidth() * mTransform.adjustedScaleX() / 2.f;
mTransform.y -= mTex->getHeight() * mTransform.adjustedScaleY() / 2.f;
@@ -30,10 +33,10 @@ namespace Game::AGame {
//Object::Camera::getInstance().move(1.f, 0.f);
// Simple movement
if (Input::isKeyPressed(SDL_SCANCODE_W)) mTransform.y -= mSpeed * deltaTime;
if (Input::isKeyPressed(SDL_SCANCODE_S)) mTransform.y += mSpeed * deltaTime;
if (Input::isKeyPressed(SDL_SCANCODE_A)) mTransform.x -= mSpeed * deltaTime;
if (Input::isKeyPressed(SDL_SCANCODE_D)) mTransform.x += mSpeed * deltaTime;
if (Input::isKeyPressed(SDL_SCANCODE_W)) { mTransform.y -= mSpeed * deltaTime; }
if (Input::isKeyPressed(SDL_SCANCODE_S)) { mTransform.y += mSpeed * deltaTime; }
if (Input::isKeyPressed(SDL_SCANCODE_A)) { mTransform.x -= mSpeed * deltaTime; mIsFlipped = false; }
if (Input::isKeyPressed(SDL_SCANCODE_D)) { mTransform.x += mSpeed * deltaTime; mIsFlipped = true; }
mSpeed = Input::isKeyPressed(SDL_SCANCODE_LSHIFT) ? 400.f : 200.f;
}
}