This repository has been archived on 2025-06-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
LotoStatek/sources/Beam.cpp
2025-01-05 18:20:19 +01:00

23 lines
596 B
C++

#include "../headers/Beam.h"
#include <iostream>
Beam::Beam(int x, int y, const sf::Texture& texture) {
beamSprite.setOrigin(beamSprite.getLocalBounds().width/2, beamSprite.getLocalBounds().height/2);
if (texture.getSize().x > 0 && texture.getSize().y > 0) {
beamSprite.setPosition(x, y);
} else {
std::cerr << "Błąd: Tekstura wiązki nie została poprawnie załadowana." << std::endl;
}
beamSprite.setTexture(texture);
}
sf::Sprite Beam::getSprite() {
return beamSprite;
}
void Beam::setRotation(float angle) {
beamSprite.setRotation(angle);
}