summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'main.py')
-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