diff options
author | Florian Jung <flo@windfisch.org> | 2015-08-24 03:36:45 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-08-24 03:36:45 +0200 |
commit | 65a4820a90799dfd52f64e95e1ac226953e2cbbc (patch) | |
tree | 18d79563f0ef3cc68239f9387d587cc9bead4706 | |
parent | 6f6c61da00b020d51ffe092177a82489dbc2b2ad (diff) |
autorejoin
-rw-r--r-- | main.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -48,6 +48,8 @@ gui.set_client(c) # initialize strategy strategy = Strategy(c) +autorespawn_counter = 60 + # main loop while True: c.on_message() @@ -63,3 +65,10 @@ while True: stats.log_pos(c.player.center) stats.log_mass(c.player.total_mass) gui.update() + + if not c.player.is_alive: + if autorespawn_counter == 0: + c.send_respawn() + autorespawn_counter = 60 + else: + autorespawn_counter-=1 |