def __init__(self, game: Game): GameObject.__init__(self, Box(0, 0, 54, 19), game=game) # self.addObjectHandler() playerBox = Box(0, 0, 26, 12) self.playerHand: Hand = Hand(playerBox, STATE.playerCards, "Player") dealerBox = Box(28, 0, 26, 12) self.dealerHand: Hand = Hand(dealerBox, STATE.dealerCards, "Dealer") self.controls: Controls = Controls()
def __init__(self, box: Box, cardList: List[CardData], player: str): GameObject.__init__(self, box) self.cardList: List[CardData] = cardList self.player: TextLine = TextLine(Box(0, 0, self.w, 1), player, (255, 255, 255), (60, 15, 90), justify="C") self.cardTotal: TextLine = TextLine(Box(0, 1, self.w, 1), "", (255, 255, 255), (60, 15, 90), justify="C") self.cardObjects: List[CardDisplay] = [] for y in range(3, self.h): textBox = Box(2, y, self.w - 2, 1) self.cardObjects.append(CardDisplay(textBox))
def __init__(self, box: Box): GameObject.__init__(self, box) self.name: TextLine = TextLine(Box(2, 0, box.w - 2, 1), "", (255, 255, 255), (60, 15, 90), justify="C") self.suitColor: Tuple[int] = (0, 0, 0)
def __init__(self): GameObject.__init__(self, Box(0, 14, 54, 5)) self.hint: TextBox = TextBox( Box(0, 0, self.w, 2), "Try to get closer to 21 than the\ndealer without going over!", (255, 255, 255), (60, 15, 90), justify="C") self.controlHint: TextLine = TextLine( Box(0, 3, self.w, 1), "Press (RETURN) to hit and (SPACE) to stay.", (255, 255, 255), (60, 15, 90), justify="C") self.navHint: TextLine = TextLine( Box(0, 4, self.w, 1), "Press (TAB) to return to main menu.", (255, 255, 255), (60, 15, 90), justify="C")
def __init__(self, game: Game): TextLine.__init__( self, Box(20, 8, 12, 1), "Quit", (255, 255, 255), (0, 0, 0), justify="C", isSelectable=True, game=game, selectionHandler=Selection_Fill(defaultColor=(60, 15, 90)) ) self.game: Game = Game
def __init__(self): GameObject.__init__(self, Box(0, 0, 54, 19)) self.addObjectHandler() self.exitable = False