summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-24 18:06:30 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-24 18:06:30 +0200
commit58b0b9da0241ff8623581b2cb837eaf34b8f165d (patch)
tree84be13623a791cf142bcfa15207baa077d4c5c44
parentec5409a1f1467895af7ebed239bcabb7f3dd2a0c (diff)
UI: change behaviour of S key, allow split+W always
-rw-r--r--README2
-rw-r--r--gui.py14
2 files changed, 8 insertions, 8 deletions
diff --git a/README b/README
index 57da257..d609439 100644
--- a/README
+++ b/README
@@ -7,5 +7,5 @@ move mouse = move
left click, space = split
right click, w = eject some mass
r = respawn
-s = lock input. cycles through: user lock -> user and bot lock -> bot lock -> no lock
+s = lock input. toggle between "user controls" and "bot controls". hold shift for "nobody controls"
esc = quit
diff --git a/gui.py b/gui.py
index 68aa48e..19fffbb 100644
--- a/gui.py
+++ b/gui.py
@@ -273,10 +273,10 @@ def draw_frame():
pygame.display.quit()
if event.type == KEYDOWN:
if event.key == K_s:
- if not input and bot_input:
+ if event.mod & KMOD_SHIFT and (input or bot_input):
input = False
bot_input = False
- elif not input and not bot_input:
+ elif not input and bot_input:
input = True
bot_input = False
else:
@@ -291,11 +291,11 @@ def draw_frame():
marker[event.button-1] = win_to_world_pt(event.pos, c.player.center)
marker_updated[event.button-1] = True
print("set marker "+str(event.button-1)+" to "+str(event.pos))
+ if event.type == KEYDOWN:
+ if event.key == K_w:
+ c.send_shoot()
+ if event.key == K_SPACE:
+ c.send_split()
if input:
- if event.type == KEYDOWN:
- if event.key == K_w:
- c.send_shoot()
- if event.key == K_SPACE:
- c.send_split()
if event.type == MOUSEMOTION:
c.send_target(*win_to_world_pt(event.pos, c.player.center))