MCPcopy Create free account
hub / github.com/ActiveState/code / floor

Function floor

recipes/Python/502255_Explosive_Embers/recipe-502255.py:115–120  ·  view source on GitHub ↗

Simulate a floor.

(ball)

Source from the content-addressed store, hash-verified

113 ball.vel.x -= force
114
115def floor(ball):
116 'Simulate a floor.'
117 floor_height = SCREEN_HEIGHT - FLOOR_SPACE - BALL_RADIUS
118 if ball.pos.y >= floor_height:
119 ball.pos.y = floor_height
120 ball.vel.y *= -1
121
122def gravity(ball):
123 'Simulate gravity.'

Callers 1

moveFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected