🏰

Castle-Wars

Completed 2023 • Object-Oriented Game Architecture with State Management

Castle-Wars is a complete turn-based card strategy game built with Python and Pygame. Players compete to build their castle to 100 points or destroy their opponent's castle through strategic card play. The game features comprehensive resource management (bricks, weapons, crystals, builders, soldiers, magic), multiple player types (Standard, Business, Devil), AI opponents with strategic decision-making, and a rich card system with various strategic options. Key features include turn-based gameplay, resource generation per turn, attack and defense mechanics, steal system, multiple game modes, visual feedback with time-of-day themes (Day, Night, Sunrise, Sunset), background music, menu system, and complete game flow management.

Game Development Python Development Software Engineering Object-Oriented Programming Algorithm Design Game Design

Overview

Castle-Wars is a complete turn-based card strategy game built with Python and Pygame. Players compete to build their castle to 100 points or destroy their opponent's castle through strategic card play. The game features comprehensive resource management (bricks, weapons, crystals, builders, soldiers, magic), multiple player types (Standard, Business, Devil), AI opponents with strategic decision-making, and a rich card system with various strategic options. Key features include turn-based gameplay, resource generation per turn, attack and defense mechanics, steal system, multiple game modes, visual feedback with time-of-day themes (Day, Night, Sunrise, Sunset), background music, menu system, and complete game flow management.

Key Features

✓

Turn-based card strategy gameplay

✓

Resource management system (bricks, weapons, crystals)

✓

Multiple player types (Standard, Business, Devil)

✓

AI opponent with strategic decision-making

✓

Card-based combat and building mechanics

✓

Win condition system (castle 100 or opponent 0)

✓

Time-of-day themes (Day, Night, Sunrise, Sunset)

✓

Background music with fade transitions

✓

Menu system and game flow management

✓

Visual feedback and animations

✓

Multiple game modes

✓

Per-turn resource generation

✓

Attack and defense mechanics

✓

Steal system for resource manipulation

✓

Complete game loop (menu, game, results)

Technical Highlights

⚡

Developed a complete turn-based card strategy game using Python and Pygame with comprehensive game mechanics

⚡

Implemented AI opponent with strategic decision-making algorithms including win/loss prediction and resource optimization

⚡

Created multiple player types (Standard, Business, Devil) with unique resource systems and card decks

⚡

Built resource management system with per-turn generation, resource limits, and strategic allocation

⚡

Designed card system with multiple card types (Bricks, Weapons, Crystals, Gold, Energy) and complex action mechanics

⚡

Implemented visual feedback system with time-of-day themes, tower states, animations, and resource displays

Challenges and Solutions

AI Decision Making

Created intelligent AI opponent with strategic card evaluation, win/loss prediction, and attack/defense prioritization algorithms

Resource Management

Balanced resource costs and benefits with careful card design, per-turn generation, and strategic resource allocation

Card System Complexity

Managed multiple card types and actions using class hierarchy, action-based system, and flexible card definitions

Multiple Player Types

Implemented different player mechanics using inheritance-based design, extended player classes, and mode-specific card decks

Technologies

Game Framework

Pygame

Programming Language

Python

Libraries

ctypes random time pygame.locals

Asset Management

PNG Images MP3 Audio TTF Fonts

Project Information

Status
Completed
Year
2023
Architecture
Object-Oriented Game Architecture with State Management
Category
Game Development