Malutki refactor
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user