comparison gamelib/gameboard.py @ 189:37af9e5dd292

Use tool with left button, cancel tool with right button.
author Jeremy Thurgood <firxen@gmail.com>
date Fri, 04 Sep 2009 18:00:59 +0000
parents f06010d34cd3
children 3c80f49d7d74
comparison
equal deleted inserted replaced
188:1281196ccafd 189:37af9e5dd292
244 if pos.x >= width or pos.y >= height: 244 if pos.x >= width or pos.y >= height:
245 return False 245 return False
246 return True 246 return True
247 247
248 def use_tool(self, e): 248 def use_tool(self, e):
249 if e.button == 3: # Right button
250 self.selected_tool = None
251 self.reset_cursor()
252 elif e.button != 1: # Left button
253 return
249 if self.selected_tool == constants.TOOL_SELL_CHICKEN: 254 if self.selected_tool == constants.TOOL_SELL_CHICKEN:
250 self.sell_chicken(self.tv.screen_to_tile(e.pos)) 255 self.sell_chicken(self.tv.screen_to_tile(e.pos))
251 elif self.selected_tool == constants.TOOL_SELL_EGG: 256 elif self.selected_tool == constants.TOOL_SELL_EGG:
252 pass 257 pass
253 elif self.selected_tool == constants.TOOL_PLACE_ANIMALS: 258 elif self.selected_tool == constants.TOOL_PLACE_ANIMALS: