summaryrefslogtreecommitdiff
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
parentbb709bd6ae7245d681ad2d401ba72e7ba96281f6 (diff)
Changed input locking controls
instead of two separate toggles S now cycles through the different lock combinations.
-rw-r--r--README3
-rw-r--r--gui.py17
2 files changed, 14 insertions, 6 deletions
diff --git a/README b/README
index ffad25c..57da257 100644
--- a/README
+++ b/README
@@ -7,6 +7,5 @@ move mouse = move
left click, space = split
right click, w = eject some mass
r = respawn
-s = lock input
-b = lock bot input
+s = lock input. cycles through: user lock -> user and bot lock -> bot lock -> no lock
esc = quit
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: