Hello, I've been having a minor issue with a game I'm writing in Codeblocks using SDL. My problem is, srand(). I seed it to time like so in the main function:
And functions utilising rand() in main() do have true randomness.
However, when I call rand() from an external file (for instance, a class called Rain in the file rain.h which automatically sets its x to a random position), I get the same seed each time, a.k.a, the rain always falls in the exact same pattern. I assume this is because the random seed is not passed between files, but I have no idea how to enable it.