summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2015-08-07 01:33:44 +0200
committerFlorian Jung <flo@windfisch.org>2015-08-07 01:33:44 +0200
commit024dc5f09705b51656a817cdefcc880f382caf4f (patch)
tree3d7e1bb8550fd868b0bae580bf169c682a04b5be
parentc4958cc5c30c5c05972d7d12eb015cb07b2665c8 (diff)
split&shoot
-rw-r--r--test.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/test.py b/test.py
index d5fb740..04775b1 100644
--- a/test.py
+++ b/test.py
@@ -88,6 +88,8 @@ c.player.nick="Wyndfysch"
screen=pygame.display.set_mode((800,600))
i=0
+
+mb=pygame.mouse.get_pressed()
while True:
i=i+1
print(i)
@@ -113,7 +115,17 @@ while True:
mp=pygame.mouse.get_pos()
pygame.event.poll()
print(mp)
+
+ oldmb=mb
+ mb = pygame.mouse.get_pressed()
+
+
c.send_target(((mp[0]-400)*2)+c.player.center[0],(mp[1]-300)*2+c.player.center[1])
+ if mb[0] and not oldmb[0]:
+ c.send_split()
+ if mb[2] and not oldmb[2]:
+ c.send_shoot()
+
pygame.display.update()