A CardHandSprite is a hand of x amount of cards.
import pygame
from CardSprite import CardSprite# Contructs CardHandSprite object
hand = CardHandSprite()
# Constructs a deck of 52 cards
deck = DeckSprite()
# Shuffles the deck of cards
deck.shuffle()
# Adds five cards to the CardHandSprite object
for i in range(5):
hand.addCard(deck)
# Centers the CardHandSprite on the screen
hand.centerOnScreen(SCREEN_WIDTH, SCREEN_HEIGHT)
# Draws the CardHandSprite object to the screen
hand.draw(screen)| Name | Data Type | Description |
|---|---|---|
_hand |
CardSprite[] | hand of CardSprites |
_numFaceUp |
int | keeps track of how many cards are flipped |