From ea96074aa4f9b273b8dd57e66c83c69b5a1242c3 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 07 Jul 2008 21:24:53 +0000 Subject: Destroy tool now allows for drag+destroy --- (limited to 'activity.py') 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) -- cgit v0.9.1