Workey! :3 (also added a suprise tool that wil help us later)

main
Johannes Hendrik Gerard van der Weide 2023-10-12 11:52:13 +02:00
parent 67d5830da5
commit 59560ced66
3 changed files with 9 additions and 4 deletions

BIN
Assets/blobcat_hertog.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@ -13,4 +13,9 @@ class Game
private:
sf::RenderWindow mWindow;
sf::CircleShape mPlayer;
bool mIsMovingUp{false};
bool mIsMovingDown{false};
bool mIsMovingLeft{false};
bool mIsMovingRight{false};
};

View File

@ -67,13 +67,13 @@ void Game::update(sf::Time deltaTime)
{
sf::Vector2f movement(0.f, 0.f);
if (mIsMovingUp)
movement.y -= 1.f;
movement.y -= 100.f;
if (mIsMovingDown)
movement.y += 1.f;
movement.y += 100.f;
if (mIsMovingLeft)
movement.x -= 1.f;
movement.x -= 100.f;
if (mIsMovingRight)
movement.x += 1.f;
movement.x += 100.f;
mPlayer.move(movement * deltaTime.asSeconds());
}