From: Stefano Rivera Date: Fri, 16 May 2014 18:12:30 +0000 (+0200) Subject: Play sounds when moving around the board X-Git-Tag: 0.1~203 X-Git-Url: https://git.ctpug.org.za/?a=commitdiff_plain;h=85d70adb07711749c5775c3f249d04f462bf97e0;p=naja.git Play sounds when moving around the board --- diff --git a/naja/widgets/board.py b/naja/widgets/board.py index f9bb80c..b168c6b 100644 --- a/naja/widgets/board.py +++ b/naja/widgets/board.py @@ -5,6 +5,7 @@ import pygame.locals as pgl from naja.constants import BOARD_SIZE, TILE_SIZE, KEYS, ACT from naja.events import finish_event +from naja.sound import sound from naja.widgets.base import Widget from naja.widgets.tile import TileWidget @@ -43,6 +44,7 @@ class BoardWidget(Widget): self.card_pos = card_pos self.info.set_position(self.card_pos) self.legal = self.card_pos in self.state.player.legal_moves() + sound.play_sound('zoop.ogg', volume=0.05) def change_pos(self, offset): tpos = (offset[0] + self.card_pos[0], offset[1] + self.card_pos[1]) @@ -83,5 +85,6 @@ class BoardWidget(Widget): if self.state.player.set_position(self.card_pos): self.state.gameboard.change_mode(ACT) self.info.set_position(self.card_pos) + sound.play_sound('chirp.ogg', volume=0.5) return finish_event() return super(BoardWidget, self).handle_event(ev)