()
| 48 | |
| 49 | |
| 50 | def outside_window(): |
| 51 | left_wall = -t.window_width()/2 |
| 52 | right_Wall = t.window_width()/2 |
| 53 | top_wall = t.window_height()/2 |
| 54 | bottom_wall = -t.window_height()/2 |
| 55 | (x,y) = caterpillar.pos() |
| 56 | outside = x < left_wall or x > right_Wall or y > top_wall or y < bottom_wall |
| 57 | return outside |
| 58 | |
| 59 | def game_over(): |
| 60 | caterpillar.color('yellow') |