summaryrefslogtreecommitdiff
path: root/gui.py
diff options
context:
space:
mode:
authorSpitfireX <timm.weber@me.com>2015-08-11 05:49:33 +0200
committerSpitfireX <timm.weber@me.com>2015-08-11 05:49:33 +0200
commit5b5db451134901077a57c1c5bf73fe3a70ed1fee (patch)
tree37aa46498dfd02688c62cf28bb27baa48d474961 /gui.py
parentbb709bd6ae7245d681ad2d401ba72e7ba96281f6 (diff)
Changed input locking controls
instead of two separate toggles S now cycles through the different lock combinations.
Diffstat (limited to 'gui.py')
-rw-r--r--gui.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/gui.py b/gui.py
index 8e3fb84..fdc587b 100644
--- a/gui.py
+++ b/gui.py
@@ -221,7 +221,7 @@ def draw_frame():
for cell in c.player.own_cells:
total_mass += cell.mass
- pygame.display.set_caption("Agar.io: " + str(c.player.nick) + " - " + str(int(total_mass)) + " Total Mass - " + str(int(clock.get_fps())) + (" FPS - INPUT LOCKED" if not input else " FPS") + (" - BOT INPUT LOCKED" if not bot_input else ""))
+ pygame.display.set_caption("Agar.io: " + str(c.player.nick) + " - " + str(int(total_mass)) + " Total Mass - " + str(int(clock.get_fps())) + (" FPS - USER INPUT LOCKED" if not input else " FPS") + (" - BOT INPUT LOCKED" if not bot_input else ""))
events = pygame.event.get()
for event in events:
@@ -234,9 +234,18 @@ def draw_frame():
pygame.display.quit()
if event.type == KEYDOWN:
if event.key == K_s:
- input = not input
- if event.key == K_b:
- bot_input = not bot_input
+ if not input and bot_input:
+ input = False
+ bot_input = False
+ elif not input and not bot_input:
+ input = True
+ bot_input = False
+ elif input and not bot_input:
+ input = True
+ bot_input = True
+ else:
+ input = False
+ bot_input = True
if event.key == K_ESCAPE:
pygame.quit()
if event.key == K_r: