diff options
author | Alex <alex@Tiresias.(none)> | 2008-07-07 21:24:53 (GMT) |
---|---|---|
committer | Alex <alex@Tiresias.(none)> | 2008-07-07 21:24:53 (GMT) |
commit | ea96074aa4f9b273b8dd57e66c83c69b5a1242c3 (patch) | |
tree | cbd8101ba4f6e5b516b3a69fae2df049b868b320 /activity.py | |
parent | f6bed1bd417c72145e65cd2acb45c865dfe1add1 (diff) |
Destroy tool now allows for drag+destroy
Diffstat (limited to 'activity.py')
-rw-r--r-- | activity.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/activity.py b/activity.py index 3714de8..68a2d8c 100644 --- a/activity.py +++ b/activity.py @@ -277,11 +277,10 @@ class DestroyTool(Tool): def handleEvents(self,event): #look for default events, and if none are handled then try the custom events if not super(DestroyTool,self).handleEvents(event): - if event.type == MOUSEBUTTONDOWN: - if event.button == 1: - tokill = world.get_bodies_at_pos(event.pos) - if tokill: - world.world.DestroyBody(tokill[0]) + if pygame.mouse.get_pressed()[0]: + tokill = world.get_bodies_at_pos(pygame.mouse.get_pos()) + if tokill: + world.world.DestroyBody(tokill[0]) # set up pygame pygame.init() size = (700,700) |