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
2024-12-11 23:00:07 +01:00

32 lines
644 B
C++

#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;
}