Refactor of structs

Refactored Size and Position
Placed them in different .h files
This commit is contained in:
2024-12-04 14:47:50 +01:00
parent 7ecb90af1f
commit 72e2116dc7
9 changed files with 35 additions and 28 deletions

View File

@@ -14,8 +14,10 @@ int main()
sf::RenderWindow mainWindow(sf::VideoMode(600, 800), "LotoStatek");
mainWindow.setVerticalSyncEnabled(true);
mainWindow.setFramerateLimit(60);
sf::Image icon;
icon.loadFromFile("../assets/img/icon/ikonka.png");
mainWindow.setIcon(128, 128, icon.getPixelsPtr());
Plansza plansza(mainWindow.getSize().y, mainWindow.getSize().x);
@@ -40,10 +42,6 @@ int main()
while (mainWindow.isOpen()) {
mainWindow.clear();
// tło
background.update();
background.draw(mainWindow);
// Tu są handlowane eventy
sf::Event event{};
while (mainWindow.pollEvent(event)) {
@@ -51,6 +49,10 @@ int main()
mainWindow.close();
}
// tło
background.update();
background.draw(mainWindow);
// poruszanie się statkiem
if(sf::Keyboard::isKeyPressed(sf::Keyboard::A)) {
if(ship.getPosition().x > 50) {