Explaining Asteroids Movement code
- by Moaz ELdeen
I'm writing an Asteroids Atari clone, and I want to figure out how the AI for the asteroids is done.
I have came across that piece of code, but I can't get what it does 100%
if ((float)rand()/(float)RAND_MAX < 0.5) {
m_Pos.x = -app::getWindowWidth() / 2;
if ((float)rand()/(float)RAND_MAX < 0.5)
m_Pos.x =…