naprawa pozycji + nowe rakiety

This commit is contained in:
2024-11-21 22:42:12 +01:00
parent 2bdfbb193c
commit 343b312227
10 changed files with 14 additions and 14 deletions

View File

@@ -5,7 +5,7 @@ Actor::Actor(int x, int y, std::string path) {
position.x = x;
position.y = y;
actorSprite.setOrigin(actorSprite.getLocalBounds().width / 2, actorSprite.getLocalBounds().height / 2); // wycentrowanie sprite
actorSprite.setPosition(x, y);
actorSprite.setPosition(float(x), float(y));
}
void Actor::loadTexture(std::string path) {
@@ -13,7 +13,7 @@ void Actor::loadTexture(std::string path) {
actorSprite.setTexture(actorTexture);
bulletTextureLeft.loadFromFile("../assets/img/bullet_left.png");
bulletTextureRight.loadFromFile("../assets/img/bullet_right.png");
bulletTextureRight.loadFromFile("../assets/img/Rocket_111.png");
}
sf::Sprite &Actor::getSprite() {
@@ -25,7 +25,7 @@ Position Actor::getPosition() {
}
void Actor::shoot() {
bullets.emplace_back(float(position.x) + actorSprite.getGlobalBounds().width / 2-62, position.y, bulletTextureLeft);
bullets.emplace_back(float(position.x) + actorSprite.getGlobalBounds().width / 2, position.y, bulletTextureLeft);
}
std::vector<Bullet> &Actor::getBullets() {