Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tools.py
diff options
context:
space:
mode:
authorAlex <alex@Tiresias.(none)>2008-07-08 22:02:47 (GMT)
committer Alex <alex@Tiresias.(none)>2008-07-08 22:02:47 (GMT)
commit336cfa27876b0bd93bd34d68bc5d010b9171d812 (patch)
treeee7721176dba2fa3121156ef0fae4b85da3b6e36 /tools.py
parent40c895937c2dbbcd09ec98ae2a1cb532e0d3be38 (diff)
Added menu functionality
Diffstat (limited to 'tools.py')
-rw-r--r--tools.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools.py b/tools.py
index 65b27b6..7257dbd 100644
--- a/tools.py
+++ b/tools.py
@@ -13,8 +13,6 @@ class Tool(object):
self.name = "Tool"
def handleEvents(self,event):
# default event handling
- if event.type == MOUSEBUTTONDOWN:
- if self.game.menu.click(event.pos): return True
if event.type == QUIT or (event.type == KEYDOWN and event.key == K_ESCAPE):
# bye bye! Hope you had fun!
self.game.running = False
@@ -22,6 +20,9 @@ class Tool(object):
if event.key == K_SPACE:
#space pauses
self.game.world.run_physics = not self.game.world.run_physics
+ elif event.type == USEREVENT:
+ # for switching tools
+ self.game.setTool(event.action)
else:
# let the subclasses know that no events were handled yet
return False