summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-24 03:36:45 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-24 03:36:45 +0200
commit65a4820a90799dfd52f64e95e1ac226953e2cbbc (patch)
tree18d79563f0ef3cc68239f9387d587cc9bead4706
parent6f6c61da00b020d51ffe092177a82489dbc2b2ad (diff)
autorejoin
-rw-r--r--main.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/main.py b/main.py
index c8cc341..d13c4ea 100644
--- a/main.py
+++ b/main.py
@@ -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