
Procedural Content Generation for C++ Game Development
By :

Before we do anything we're going to need to set the game seed. Without it we'll get the same results each time our game is run. As we've learned, this simply requires us to make a call to the std::srand()
function passing a random parameter to be used as the seed. We'll use the current system time as our seed, it's random enough for our purposes.
Where we make the call to the std::srand()
function is arbitrary so long as it's called before any call to the std::rand()
function. The file main.cpp
contains the function main()
, the entry point of the application. It's here that our game object is created and the main game loop entered, so we'll make our call to the std::srand()
function here.
Our updated main()
function should now look like this:
// Entry point of the application. int main() { // Set a random seed. std:: srand(static_cast<unsigned int>(time(nullptr))); // Create the main game object. Game game...
Change the font size
Change margin width
Change background colour