MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / getRandomVelocity

Function getRandomVelocity

src/gamesbyexample/pygame_games/squirrel.py:336–341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

334 return int(math.sin( (math.pi / float(bounceRate)) * currentBounce ) * bounceHeight)
335
336def getRandomVelocity():
337 speed = random.randint(SQUIRRELMINSPEED, SQUIRRELMAXSPEED)
338 if random.randint(0, 1) == 0:
339 return speed
340 else:
341 return -speed
342
343
344def getRandomOffCameraPos(camerax, cameray, objWidth, objHeight):

Callers 2

runGameFunction · 0.85
makeNewSquirrelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected