Zaimplementowane menu i wybieranie skinów statku
This commit is contained in:
@@ -3,14 +3,24 @@
|
||||
#include "../headers/Plansza.h"
|
||||
#include "../headers/RandomNumberGenerator.h"
|
||||
|
||||
Plansza::Plansza(unsigned int windowHeight, unsigned int windowWidth, sf::RenderWindow *mainWindow)
|
||||
Plansza::Plansza(unsigned int windowHeight, unsigned int windowWidth, sf::RenderWindow *mainWindow, ships selectedShip)
|
||||
: background("../assets/img/background/background.png", 2.0f) {
|
||||
window = mainWindow;
|
||||
size.height = static_cast<int>(windowHeight);
|
||||
size.width = static_cast<int>(windowWidth);
|
||||
|
||||
Plansza::selectedShip = selectedShip;
|
||||
|
||||
try {
|
||||
playerTexture.loadFromFile("../assets/ship/Dreadnought-Base.png");
|
||||
if(selectedShip == nova) {
|
||||
playerTexture.loadFromFile("../assets/ship/nova.png");
|
||||
} else if(selectedShip == pulsar) {
|
||||
playerTexture.loadFromFile("../assets/ship/pulsar.png");
|
||||
} else if(selectedShip == zenith) {
|
||||
playerTexture.loadFromFile("../assets/ship/zenith.png");
|
||||
} else {
|
||||
playerTexture.loadFromFile("../assets/ship/Dreadnought-Base.png");
|
||||
}
|
||||
meteorTexture1.loadFromFile("../assets/img/meteors/meteor-1.png");
|
||||
meteorTexture2.loadFromFile("../assets/img/meteors/meteor-2.png");
|
||||
// Ładowanie tekstur wrogów
|
||||
@@ -803,4 +813,6 @@ void Plansza::update_score() {
|
||||
text.setFillColor(sf::Color::White);
|
||||
text.setPosition(25, 25);
|
||||
window->draw(text);
|
||||
}
|
||||
}
|
||||
|
||||
ships Plansza::selectedShip = none;
|
||||
Reference in New Issue
Block a user