wiazkowiec strzela, gora dol

This commit is contained in:
2024-12-11 23:00:07 +01:00
parent b257837d18
commit c898aa0d81
8 changed files with 352 additions and 6 deletions

31
sources/Beam.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include "../headers/Beam.h"
Beam::Beam(float x, float y, float width, float height, const sf::Color& color)
: visible(false) {
beamShape.setPosition(x, y);
beamShape.setSize({width, height});
beamShape.setFillColor(color);
}
void Beam::update() {
// Wiązka może mieć logikę do czasu, jeśli potrzebne
}
void Beam::render(sf::RenderWindow& window) {
if (visible) {
window.draw(beamShape);
}
}
sf::FloatRect Beam::getBounds() const {
return beamShape.getGlobalBounds();
}
bool Beam::isVisible() const {
return visible;
}
void Beam::setVisible(bool visible) {
this->visible = visible;
}