Dodano wiecej progow %

This commit is contained in:
2025-01-16 23:08:03 +01:00
parent 3c0cd4b950
commit 696714cf9a
7 changed files with 13 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@@ -120,7 +120,7 @@ private:
sf::Texture movingSpeedDebuffTexture; sf::Texture movingSpeedDebuffTexture;
sf::Texture firerateDebuffTexture; sf::Texture firerateDebuffTexture;
sf::Texture bulletSpeedDebuffTexture; sf::Texture bulletSpeedDebuffTexture;
sf::Texture ultimateIndicatorTextures[6]; sf::Texture ultimateIndicatorTextures[11];
// Tablice // Tablice
std::vector<Enemy> enemies; std::vector<Enemy> enemies;

View File

@@ -80,26 +80,32 @@ Plansza::Plansza(unsigned int windowHeight, unsigned int windowWidth, sf::Render
} }
void Plansza::loadUltimateIndicators() { void Plansza::loadUltimateIndicators() {
const std::string texturePaths[6] = { const std::string texturePaths[11] = {
"../assets/img/ultimate/ultimate_0.png", "../assets/img/ultimate/ultimate_0.png",
"../assets/img/ultimate/ultimate_10.png",
"../assets/img/ultimate/ultimate_20.png", "../assets/img/ultimate/ultimate_20.png",
"../assets/img/ultimate/ultimate_30.png",
"../assets/img/ultimate/ultimate_40.png", "../assets/img/ultimate/ultimate_40.png",
"../assets/img/ultimate/ultimate_50.png",
"../assets/img/ultimate/ultimate_60.png", "../assets/img/ultimate/ultimate_60.png",
"../assets/img/ultimate/ultimate_70.png",
"../assets/img/ultimate/ultimate_80.png", "../assets/img/ultimate/ultimate_80.png",
"../assets/img/ultimate/ultimate_90.png",
"../assets/img/ultimate/ultimate_100.png" "../assets/img/ultimate/ultimate_100.png"
}; };
for (int i = 0; i < 6; ++i) { for (int i = 0; i < 11; ++i) {
if (!ultimateIndicatorTextures[i].loadFromFile(texturePaths[i])) { if (!ultimateIndicatorTextures[i].loadFromFile(texturePaths[i])) {
std::cerr << "Failed to load ultimate indicator texture: " << texturePaths[i] << std::endl; std::cerr << "Failed to load ultimate indicator texture: " << texturePaths[i] << std::endl;
exit(-1); exit(-1);
} }
sf::Sprite sprite; sf::Sprite sprite;
sprite.setTexture(ultimateIndicatorTextures[i]); sprite.setTexture(ultimateIndicatorTextures[i]);
sprite.setPosition(10, window->getSize().y - 60); // Lewy dolny róg sprite.setPosition(10, window->getSize().y - 60);
sprite.setScale(0.7f, 0.7f); // Skalowanie sprite.setScale(0.5f, 0.5f);
ultimateIndicators.push_back(sprite); ultimateIndicators.push_back(sprite);
} }
} }
// TODO: Refactor tej metody bo rozrosła się za bardzo już // TODO: Refactor tej metody bo rozrosła się za bardzo już
@@ -136,8 +142,8 @@ void Plansza::update() {
ship->ultimate_shoot(); ship->ultimate_shoot();
} }
int indicatorIndex = ultimateCounter / 40; int indicatorIndex = ultimateCounter / 20;
indicatorIndex = std::min(indicatorIndex, 5); // Zapobiegaj przekroczeniu zakresu indicatorIndex = std::min(indicatorIndex, 10); // Zapobiegaj przekroczeniu zakresu
window->draw(ultimateIndicators[indicatorIndex]); window->draw(ultimateIndicators[indicatorIndex]);
// TODO: Przenieść obiekt dźwięku wewnątrz klasy Bullet // TODO: Przenieść obiekt dźwięku wewnątrz klasy Bullet