From 024dc5f09705b51656a817cdefcc880f382caf4f Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 7 Aug 2015 01:33:44 +0200 Subject: split&shoot --- test.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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() -- cgit v1.2.1