Skip to content

Latest commit

 

History

History
91 lines (56 loc) · 1.93 KB

File metadata and controls

91 lines (56 loc) · 1.93 KB

CardHandSprite

A CardHandSprite is a hand of x amount of cards.

Screenshots

CardHandSprite_5_Cards

Imports
import pygame
from CardSprite import CardSprite
Usage
# 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)
Instance Variables
Name Data Type Description
_hand CardSprite[] hand of CardSprites
_numFaceUp int keeps track of how many cards are flipped
Methods

back