Naprawiono białe kwadraty i zmieniono tło
This commit is contained in:
@@ -10,6 +10,8 @@ Actor::Actor(int x, int y, std::string path) {
|
||||
void Actor::loadTexture(std::string path) {
|
||||
actorTexture.loadFromFile(path);
|
||||
actorSprite.setTexture(actorTexture);
|
||||
|
||||
bulletTexture.loadFromFile("../assets/img/bullet.png");
|
||||
}
|
||||
|
||||
sf::Sprite &Actor::getSprite() {
|
||||
@@ -35,10 +37,9 @@ Position Actor::getPosition() {
|
||||
}
|
||||
|
||||
void Actor::shoot() {
|
||||
bullets.emplace_back(position.x + actorSprite.getGlobalBounds().width / 2-62, position.y);
|
||||
bullets.emplace_back(float(position.x) + actorSprite.getGlobalBounds().width / 2-62, position.y, bulletTexture);
|
||||
}
|
||||
|
||||
std::vector<Bullet> &Actor::getBullets() {
|
||||
return bullets;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user