Random class not included in Animated Application?

I wanted to quickly make a small game with my son. We used latest version of Projucer 6.07 and created a new “Animated Application” project.

But I am totally shocked to see that the global Random function is NOT included!

That surely has to be an oversight, as I fail to see how you can make a game without random numbers.

Well, the Random class is defined in the juce_core, so it should be really available in every project.

Did you by chance look for Random instead of juce::Random?
The new projects don’t import the full juce namespace any more to be safer to combine with other codes.

1 Like

I figured it out, for my new game project I explicitly have to prepend “juce::” to get functions like “Random” and “Colours”.

It just completely took me by surprise, as in my synthesizer I don’t have to prepend “juce::”.

Why it that and how to overcome?

You can overcome this with using juce; but (as I understand) it’s bad practice to have using in too wide a scope (as it was before).

1 Like

Thanks for that clarification.

Thanks.