| 1 | if (golf == 0 && falling == 0) |
| 2 | { |
| 3 | y = yprevious; |
| 4 | x = xprevious; |
| 5 | if (speed <= 0.06) |
| 6 | speed = 0; |
| 7 | else |
| 8 | speed -= 0.05; |
| 9 | if (other.bbox_right < bbox_left) |
| 10 | { |
| 11 | x += 2; |
| 12 | hspeed = -hspeed; |
| 13 | } |
| 14 | if (other.bbox_left > bbox_right) |
| 15 | { |
| 16 | x -= 2; |
| 17 | hspeed = -hspeed; |
| 18 | } |
| 19 | if (other.bbox_top > bbox_bottom) |
| 20 | { |
| 21 | y -= 2; |
| 22 | vspeed = -vspeed; |
| 23 | } |
| 24 | if (other.bbox_bottom < bbox_top) |
| 25 | { |
| 26 | y += 2; |
| 27 | vspeed = -vspeed; |
| 28 | } |
| 29 | golf = 1; |
| 30 | } |