"""
import pygame.locals as pgl
-from naja.constants import BOARD_SIZE, TILE_SIZE, KEYS, EXAMINE, ACT
+from naja.constants import BOARD_SIZE, TILE_SIZE, KEYS, ACT
from naja.events import finish_event
from naja.widgets.base import Widget
if ev.key in KEYS.UP:
if self.change_pos((0, -1)):
return finish_event()
- if ev.key in KEYS.DOWN:
+ elif ev.key in KEYS.DOWN:
if self.change_pos((0, +1)):
return finish_event()
- if ev.key in KEYS.LEFT:
+ elif ev.key in KEYS.LEFT:
if self.change_pos((-1, 0)):
return finish_event()
- if ev.key in KEYS.RIGHT:
+ elif ev.key in KEYS.RIGHT:
if self.change_pos((+1, 0)):
return finish_event()
- if (ev.key in KEYS.SELECT and
- self.state.player.set_position(self.card_pos)):
- self.state.gameboard.change_mode(ACT)
- self.info.set_position(self.card_pos)
- return finish_event()
+ elif ev.key in KEYS.SELECT:
+ if self.state.player.set_position(self.card_pos):
+ self.state.gameboard.change_mode(ACT)
+ self.info.set_position(self.card_pos)
+ return finish_event()
return super(BoardWidget, self).handle_event(ev)