diff --git a/sources/Kamikadze.cpp b/sources/Kamikadze.cpp index e18927c..5067acd 100644 --- a/sources/Kamikadze.cpp +++ b/sources/Kamikadze.cpp @@ -1,10 +1,10 @@ #include "../headers/Kamikadze.h" #include - -#include "../headers/Bullet.h" #include +#include "../headers/RandomNumberGenerator.h" + Kamikadze::Kamikadze(int x, int y, const sf::Texture& texture) : Actor(x, y, texture) { actorSprite.setTexture(texture); hp = 3; // 3 punkty życia @@ -14,11 +14,7 @@ Kamikadze::Kamikadze(int x, int y, const sf::Texture& texture) : Actor(x, y, tex void Kamikadze::shoot(){} void Kamikadze::setRandomDirection() { - std::random_device rd; - std::mt19937 gen(rd()); - std::uniform_int_distribution dist(0, 3); - - int randomDirection = dist(gen); + int randomDirection = RandomNumberGenerator::getRandomNumber(0,3); // Zapobieganie wyjscia poza ekran switch (randomDirection) {