WIP - ultimate

This commit is contained in:
2025-01-16 20:16:08 +01:00
parent 0834460e82
commit 622e814d1c
4 changed files with 49 additions and 2 deletions

View File

@@ -2,6 +2,7 @@
#include <iostream>
#include "../headers/Plansza.h"
#include "../headers/RandomNumberGenerator.h"
#include <SFML/Graphics.hpp>
Plansza::Plansza(unsigned int windowHeight, unsigned int windowWidth, sf::RenderWindow *mainWindow, ships selectedShip)
: background("../assets/img/background/background.png", 2.0f) {
@@ -1098,4 +1099,30 @@ void Plansza::check_Meteor_collisions() {
}
ships Plansza::selectedShip = none;
unsigned int Plansza::score = 0;
unsigned int Plansza::score = 0;
void Plansza::handleUltimate() {
sf::Clock ultimateClock;
ultimateClock.restart();
if(ship->getUltimateStatus()) {
sf::RectangleShape ultimateShape(sf::Vector2f(600,800));
ultimateShape.setFillColor(sf::Color(255,255,255));
meteors.clear();
// hearts.clear();
// powerUps.clear();
debuffs.clear();
enemies.clear();
AEnemies.clear();
BEnemies.clear();
KEnemies.clear();
WEnemies.clear();
if(ultimateClock.getElapsedTime().asSeconds() < 1) {
window->draw(ultimateShape);
} else {
ship->setUltimateStatus(false);
}
}
}

View File

@@ -58,6 +58,10 @@ void Player::alternate_shoot() {
}
}
void Player::ultimate_shoot() {
ultimateShootActive = true;
}
void Player::update() {
// Wyłącz nieśmiertelność po określonym czasie
if (isImmortal && immortalityClock.getElapsedTime().asSeconds() >= immortalityDuration) {
@@ -129,3 +133,11 @@ void Player::setBulletSpeed(float speed) {
Player* Player::player_ = nullptr;
bool Player::getUltimateStatus() {
return ultimateShootActive;
}
void Player::setUltimateStatus(bool status) {
ultimateShootActive = status;
}