Update all state for each game tick.
(session, window, state)
| 716 | |
| 717 | |
| 718 | def update_state(session, window, state): |
| 719 | """Update all state for each game tick.""" |
| 720 | |
| 721 | num_enemies = state["num_enemies"] = check_win(session, state) |
| 722 | if num_enemies == 0: |
| 723 | win(session, window, state) |
| 724 | elif check_lose(session, state): |
| 725 | lose(session, window, state) |
| 726 | else: |
| 727 | # update the tick counter. |
| 728 | state["tick"] += 1 |
| 729 | move_player(session, window, state) |
| 730 | move_missile(session, window, state) |
| 731 | move_army(session, window, state) |
| 732 | move_saucer(session, window, state) |
| 733 | update_splat(session, window, state) |
| 734 | |
| 735 | |
| 736 | def start(session, window, state, continue_=False): |
no test coverage detected