What Ubie wanted to say is that ...
you always need to verify that the count of an object is less than what you wanted , here , ubie did set the max count to 10 via a variable ( MaxEnemies ) and did compare it to the number of redsquares in the game
He didn't stop spawning them until the number of the redsquares reached
10
P.S: The expression to find the number of said objects is
*Insert-Object-Name-Here*.count
Cheers