def getRandomVelocity(): speed = random.randint(SQUIRRELMINSPEED, SQUIRRELMAXSPEED) if random.randint(0, 1) == 0: return speed else: return -speed
getRandomVelocity() function is used to randomly determine how fast an enemy squirrel will move. The range of this velocity is set in the
SQUIRRELMAXSPEED constants, but on top of that, the speed is either negative (indicating the squirrel goes to the left or up) or positive (indicating the squirrel goes to the right or down). There is a fifty-fifty chance for the random speed to be positive or negative.