def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM + 5 * l.XS, l.YM + 4 * l.YS) for i, j in ( (1, 0), (2, 0), (3, 0), (4, 1.5), (3, 3), (2, 3), (1, 3), (0, 1.5), ): x, y = l.XM + i * l.XS, l.YM + j * l.YS stack = RK_RowStack(x, y, self, dir=1, mod=13, max_move=0) s.rows.append(stack) stack.CARD_YOFFSET = 0 x, y = l.XM + 1.5 * l.XS, l.YM + 1.5 * l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=2) l.createText(s.talon, 'nw') l.createRoundText(self.s.talon, 'nn') x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'ne') l.defaultStackGroups()
def createGame(self): l, s = Layout(self), self.s self.setSize(l.XM+5*l.XS, l.YM+4*l.YS) for i, j in ((1, 0), (2, 0), (3, 0), (4, 1.5), (3, 3), (2, 3), (1, 3), (0, 1.5), ): x, y = l.XM+i*l.XS, l.YM+j*l.YS stack = RK_RowStack(x, y, self, dir=1, mod=13, max_move=0) s.rows.append(stack) stack.CARD_YOFFSET = 0 x, y = l.XM+1.5*l.XS, l.YM+1.5*l.YS s.talon = WasteTalonStack(x, y, self, max_rounds=2) l.createText(s.talon, 'nw') l.createRoundText(self.s.talon, 'nn') x += l.XS s.waste = WasteStack(x, y, self) l.createText(s.waste, 'ne') l.defaultStackGroups()
def createGame(self, rows=8): # create layout l, s = Layout(self), self.s # set size self.setSize(l.XM + (rows+2)*l.XS, l.YM + 5*l.YS) # playcards = 4*l.YS // l.YOFFSET xoffset, yoffset = [], [] for i in range(playcards): xoffset.append(0) yoffset.append(l.YOFFSET) for i in range(104-playcards): xoffset.append(l.XOFFSET) yoffset.append(0) # create stacks x, y = l.XM, l.YM for i in range(rows): stack = RK_RowStack(x, y, self) stack.CARD_XOFFSET = xoffset stack.CARD_YOFFSET = yoffset s.rows.append(stack) x += l.XS x, y = l.XM + rows*l.XS, l.YM for suit in range(4): for i in range(2): s.foundations.append(RK_FoundationStack(x+i*l.XS, y, self, suit=suit)) y += l.YS self.setRegion(self.s.foundations, (x - l.CW // 2, -999, 999999, y), priority=1) x, y = self.width-3*l.XS//2, self.height-l.YS s.talon = InitialDealTalonStack(x, y, self) # define stack-groups l.defaultStackGroups()