Malutki refactor

This commit is contained in:
2024-12-12 22:22:01 +01:00
parent f1dc19e795
commit 87399213b3

View File

@@ -1,10 +1,10 @@
#include "../headers/Kamikadze.h"
#include <iostream>
#include "../headers/Bullet.h"
#include <random>
#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<int> dist(0, 3);
int randomDirection = dist(gen);
int randomDirection = RandomNumberGenerator::getRandomNumber(0,3);
// Zapobieganie wyjscia poza ekran
switch (randomDirection) {