Zmiana sposobu tworzenia gracza.
Użyto singleton pattern. Zmieniono konstruktor klasy Plansza
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user