Zmiana sposobu tworzenia gracza.

Użyto singleton pattern.
Zmieniono konstruktor klasy Plansza
This commit is contained in:
2024-12-13 13:36:41 +01:00
parent 3f4a937257
commit 8b4b25747e
7 changed files with 139 additions and 142 deletions

View File

@@ -10,14 +10,6 @@ Actor::Actor(int x, int y, const sf::Texture& texture) {
actorSprite.setPosition(float(x), float(y));
}
void Actor::loadTexture(std::string path) {
actorTexture.loadFromFile(path);
actorSprite.setTexture(actorTexture);
bulletTextureLeft.loadFromFile("../assets/img/bullets/bullet_pink.png");
bulletTextureRight.loadFromFile("../assets/img/rockets/Rocket_111.png");
}
sf::Sprite &Actor::getSprite() {
if (!actorSprite.getTexture()) {
std::cerr << "actorSprite has no texture set!" << std::endl;