Simulate a floor.
(ball)
| 113 | ball.vel.x -= force |
| 114 | |
| 115 | def 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 | |
| 122 | def gravity(ball): |
| 123 | 'Simulate gravity.' |