Refactor of structs
Refactored Size and Position Placed them in different .h files
This commit is contained in:
10
main.cpp
10
main.cpp
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user