diff options
author | Florian Jung <flo@windfisch.org> | 2015-08-07 01:33:44 +0200 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2015-08-07 01:33:44 +0200 |
commit | 024dc5f09705b51656a817cdefcc880f382caf4f (patch) | |
tree | 3d7e1bb8550fd868b0bae580bf169c682a04b5be /test.py | |
parent | c4958cc5c30c5c05972d7d12eb015cb07b2665c8 (diff) |
split&shoot
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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() |