2 Widget that holds the game tiles.
5 from naja.constants import BOARD_SIZE, TILE_SIZE
6 from naja.widgets.base import Widget
7 from naja.widgets.tile import TileWidget
10 class BoardWidget(Widget):
12 Widget which holds all the tiles that make up the gameboard.
14 def __init__(self, pos, tiles=None):
15 super(BoardWidget, self).__init__(pos, BOARD_SIZE)
16 # FIXME: Placeholder logic
20 tile_pos = (pos[0] + x * TILE_SIZE[0],
21 pos[1] + y * TILE_SIZE[1])
22 self._tiles.append(TileWidget(tile_pos, None))
25 for tile in self._tiles:
27 self.size = BOARD_SIZE
29 def draw(self, surface):
30 for tile in self._tiles: