Card Craft

A pygame application for a card game

OVERVIEW

About the project

CardCraft is a small Python application that I developed as part of my Software Engineering degree. For my application, the player is dealt a hand of five unique cards from the deck of the possible fifty-two that can be chosen. The game is against an AI opponent where the objective is simple, deal the highest card each round to win points and the overall game. Each card that the player chooses is removed from their hand of cards until no more cards are left, where a final winner is declared.

WHEN WAS THIS?

20th May, 2024

WHAT'D I DO?

Developed a pygame application and recorded a technical discussion.

Tools Used

BACKSTORY

The Problem

Design and develop a program for a straightforward card game.

The assignment brief states that a card game featuring a standard deck of 52 unique cards should be made, incorporating hands of cards and turn based rounds. Incorporation of an algorithmn was my way of tackling this challenge, as well as utilising pygame for its simplicity.

Design & Implementation

The program that got me an A- grade.

USER INPUT

Keyboard interaction

When developing CardCraft, ease of access and simplicity were at the forefront of the project. As a result, utilising the keyboard for interacting with the menu system when launching the application was an appealing choice and allowed the player to quickly interact.

VISUAL FEEDBACK

Chosen Cards

My application included playing against an AI player, which ensured that players could play regardless of whether they had someone to play with. As a result, ensuring that the card the AI had chosen was outlined clearly to the actual player was crucial for maintaining a positive playing experience. I achieved this by flashing the AI's chosen card at the top of the screen, giving the player visual feedback on why they lost or won a specific round.

POINTS SYSTEM

Turn Based Rounds

One core mechanic in CardCraft is the turn-based rounds and points system. The points system gives the player real-time feedback on who is winning and losing the game and automatically updates each round with the new values. This adds more tension to the game and maintains a consistent playing experience for the player.

Technical Discussion

Below is my technical discussion on the CardCraft application. It provides a code walkthrough as well as justifying the algorithm and data structure choices made.

REFLECTION

Project Learnings

1. Player Experience

When developing projects, big or small, this game taught me always to consider how the player interacts with your application and how best to improve and maintain a positive playing experience. Using keyboard interactions to prevent manually clicking buttons to navigate the menu was beneficial, and the design was consistent throughout the application to streamline the experience.

2. Visual Feedback

This project relied a lot on providing the player with regular visual feedback so they could understand what was happening right in the moment of the game; this was often showcased through the points system automatically updating each round as well as flashing the AI player card on screen so the player knew why they won/lost that round. This provided a valuable lesson in putting the player experience at the forefront.

3. Understanding Algorithms

This project required me to think carefully and research algorithms that would suit the project and how the turn-based rounds incorporate with the algorithm. Ensuring that calculations were correct and the algorithm performed as intended were vital learning points in ensuring the game worked as intended and awarded round points to the proper individual.