Malutki refactor
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
#include "../headers/Kamikadze.h"
|
#include "../headers/Kamikadze.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include "../headers/Bullet.h"
|
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
|
#include "../headers/RandomNumberGenerator.h"
|
||||||
|
|
||||||
Kamikadze::Kamikadze(int x, int y, const sf::Texture& texture) : Actor(x, y, texture) {
|
Kamikadze::Kamikadze(int x, int y, const sf::Texture& texture) : Actor(x, y, texture) {
|
||||||
actorSprite.setTexture(texture);
|
actorSprite.setTexture(texture);
|
||||||
hp = 3; // 3 punkty życia
|
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::shoot(){}
|
||||||
|
|
||||||
void Kamikadze::setRandomDirection() {
|
void Kamikadze::setRandomDirection() {
|
||||||
std::random_device rd;
|
int randomDirection = RandomNumberGenerator::getRandomNumber(0,3);
|
||||||
std::mt19937 gen(rd());
|
|
||||||
std::uniform_int_distribution<int> dist(0, 3);
|
|
||||||
|
|
||||||
int randomDirection = dist(gen);
|
|
||||||
|
|
||||||
// Zapobieganie wyjscia poza ekran
|
// Zapobieganie wyjscia poza ekran
|
||||||
switch (randomDirection) {
|
switch (randomDirection) {
|
||||||
|
|||||||
Reference in New Issue
Block a user