|
|
@ -24,8 +24,7 @@ void Game::update(float dTime) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Game::tryCreateWall() { |
|
|
|
void Game::tryCreateWall() { |
|
|
|
int val = rand() % 1000; |
|
|
|
if (Game::Random(0, 1000) > 990){ |
|
|
|
if (val > 990){ |
|
|
|
|
|
|
|
walls.emplace_back(); |
|
|
|
walls.emplace_back(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -47,3 +46,10 @@ Game::Game() { |
|
|
|
GameQueue * Game::eventQueue = new GameQueue; |
|
|
|
GameQueue * Game::eventQueue = new GameQueue; |
|
|
|
Game * Game::instance = nullptr; |
|
|
|
Game * Game::instance = nullptr; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double Game::Random(double low, double high) { |
|
|
|
|
|
|
|
std::random_device device; |
|
|
|
|
|
|
|
std::mt19937 gen(device()); |
|
|
|
|
|
|
|
auto dist = std::uniform_real_distribution<double>(low, high); |
|
|
|
|
|
|
|
return dist(gen); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|