A Blackjack roguelike RPG with survival horror and absurd surrealism.
Card Fifty-Two is a blackjack roguelike where blackjack is your weapon. Fight corrupted AI enemies in a glitching casino by playing blackjack hands—each hand you win damages the enemy, each hand you lose costs you chips (your health).
Built in C using:
- Archimedes: SDL2 game framework
- Daedalus: C data structures library
Core Twist: You always have all 52 cards. Instead of building a deck, you upgrade cards with tags that grant special powers (SHARP cards boost damage, VAMPIRIC cards heal you, LUCKY cards boost crit chance).
- GCC (C11 support)
- SDL2, SDL2_image, SDL2_ttf, SDL2_mixer
- Archimedes and Daedalus libraries installed
- make
# Build the game
make
# Build and run
make run
# Debug build
make debug
# Run tests
make test
# Verify architecture compliance
make verify# Build for web (requires Emscripten SDK)
make web
# Serve locally at http://localhost:8000
make serveSee Makefile for all available targets.
Tech Stack: C11, SDL2, Archimedes framework, Daedalus data structures
Project Structure:
card-fifty-two/
├── src/ # ~10,500 lines of modular C code
│ ├── scenes/ # UI sections and components
│ ├── loaders/ # DUF file parsers (enemies, events, trinkets)
│ ├── terminal/ # Debug command system
│ └── trinkets/ # Class-specific trinket implementations
├── include/ # Header files
├── data/ # DUF data files (enemies, events, affixes, trinkets)
├── resources/ # Textures, audio, fonts
├── test/ # Unit test suite
└── Makefile
Constitutional Patterns:
- No raw
malloc—usedString_t,dArray_t,dTable_tfrom Daedalus - Value semantics (tables store data by value, not pointers)
- Fitness functions enforce architectural rules (
make verify) - Data-driven design with DUF format files
Key Files:
- src/main.c - Entry point, initialization
- src/game.c - Core game state machine
- include/structs.h - Core data structures
- Makefile - Build system with native + web targets
See comprehensive design documentation:
- GAME_DESIGN_SUMMARY.md - Complete game systems reference
- GAME_DESIGN_BUILD_OPPORTUNITIES.md - Class system, trinkets, progression
Key Systems:
- Combat: Blackjack hands are attacks (win = damage enemy, lose = lose chips)
- Card Tags: Permanent upgrades (CURSED, VAMPIRIC, LUCKY, BRUTAL, DOUBLED)
- Trinkets: Equipment with passive effects + random affixes (27 unique trinkets)
- Classes: 3 playable classes with unique abilities and sanity thresholds
- Events: Slay the Spire-style narrative encounters with unlockable choices
- Status Effects: Enemy debuffs that manipulate betting and resources
- Place Bet (10-100 chips) - higher bet = more damage if you win
- Play Blackjack - hit, stand, double down against dealer AI
- Deal Damage - winning hands damage the enemy (based on bet amount)
- Repeat until enemy HP reaches 0 or you run out of chips
- Chips: Your health AND betting currency (lose if you hit 0)
- Sanity: Mental stability (affects betting options and class abilities)
- Degenerate: Risk/reward gambler (rewards hitting on 15+, scales with aggressive play)
- Dealer: Control specialist (see enemy's face-down card at low sanity, mulligan mechanic)
- Detective: Pattern recognition (deals damage based on pairs in play)
- CURSED: Deal 10 damage to enemy when drawn
- VAMPIRIC: Deal 5 damage + heal 5 chips when drawn
- LUCKY: +10% crit chance while in any hand
- BRUTAL: +10% damage while in any hand
- Win combat → choose card to upgrade with tag
- Encounter events → make narrative choices (gain chips, sanity, tags, trinkets)
- Defeat bosses → unlock class trinket upgrades (planned)
- Collect trinkets → equipment with passive effects + random stat affixes