Skip to content

ehgzao/DungeonScoundrel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

393 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation


๐Ÿ“‹ Table of Contents


๐ŸŽฏ About

Dungeon Scoundrel is a progressive web app (PWA) roguelike deck-building card game where you navigate through treacherous dungeons using a standard deck of cards. Fight monsters, collect weapons, use potions, and unlock powerful relics to survive the depths!

๐ŸŽฒ Game Concept

  • ๐Ÿƒ Card-Based Combat: Use a deck of 50 cards (Monsters, Weapons, Potions, Specials)
  • โš”๏ธ Strategic Gameplay: Manage resources, build combos, and choose when to fight or flee
  • ๐Ÿ”ฎ Progressive Unlocks: Earn permanent upgrades across multiple runs
  • ๐Ÿ‘ฅ 6 Unique Classes: Each with distinct playstyles and abilities
  • ๐Ÿ† Achievement System: 50 achievements to unlock
  • ๐ŸŽต Dynamic Music: Procedural soundtrack with multiple themes
  • ๐Ÿ“ฑ Play Anywhere: Desktop, mobile, tablet - even offline!

โœจ Features

๐ŸŽฎ Core Gameplay

  • โœ… 4 Difficulty Levels: Easy, Normal, Hard, Endless
  • โœ… 50-Card Deck System: Monsters (โ™ โ™ฃ), Weapons (โ™ฆ), Potions (โ™ฅ), Specials (โœจ)
  • โœ… Boss Battles: Epic fights every 10 rooms
  • โœ… Combo System: Chain perfect kills for damage bonuses
  • โœ… Hold Mechanic: Strategic card management
  • โœ… Events & Shops: Random encounters with meaningful choices

๐ŸŽญ Classes (6 Total)

  • Scoundrel ๐ŸŽญ - Pure skill, no abilities (always unlocked)
  • Knight ๐Ÿ›ก๏ธ - Tank with Shield Bash and +5 HP
  • Rogue ๐Ÿ—ก๏ธ - Double hold slots, Shadow Strike
  • Dancer ๐Ÿ’ƒ - Healing specialist with extra luck
  • Berserker ๐Ÿ’ข - High risk/reward with Bloodlust
  • Priest ๐Ÿ“ฟ - Divine protection and Purification

๐Ÿ”“ Progression

  • 22 Permanent Unlocks: Start with bonuses each run
  • 53 Relics: Passive and active effects across 4 rarity tiers
  • 50 Achievements: Bronze, Silver, Gold, Platinum
  • Global Leaderboard: Firebase-powered rankings

๐ŸŽจ Polish & UX

  • ๐ŸŒ™ Dark Medieval Theme - Pixel-art inspired UI
  • ๐ŸŽต Dynamic Music System - 5 contextual tracks (menu, gameplay, boss, victory, defeat)
  • ๐ŸŽจ Visual Effects - Particles, screen shake, animations
  • โ™ฟ Accessibility - ARIA labels, keyboard navigation
  • ๐Ÿ“ฑ Mobile-Optimized - Touch controls, haptic feedback
  • ๐ŸŒ PWA Complete - Install as app, offline capable

๐Ÿ†• NEW: Mobile & PWA

Version 1.4.3 - Lighthouse Performance Update!

โœ… Progressive Web App (PWA)

  • Install as App: Add to home screen on any device
  • Offline Mode: Play without internet after first load
  • Service Worker: Smart caching of all assets (11.5MB)
  • Auto-Updates: Notifies when new version available
  • PWA Score: 100/100 on Lighthouse

๐Ÿ“ฑ Mobile Optimizations

  • Lazy Loading: Images load on-demand (-94% initial load)
  • Adaptive Performance: Detects device capabilities automatically
  • Reduced Animations: Optimized for low-end devices
  • Touch-Friendly: Long-press to hold, tap to play
  • Responsive Layout: Perfect on phones, tablets, desktops

๐Ÿ’พ Enhanced Storage

  • IndexedDB: Robust save system with backup/restore
  • LocalStorage Fallback: Works everywhere
  • Cloud Sync: Optional Firebase integration
  • Multiple Saves: Store progress safely

๐Ÿ“Š Performance Improvements

Metric Before After Improvement
Assets Size 9.5MB 550KB -94% ๐ŸŽ‰
Load Time ~5s ~2s -60% ๐Ÿš€
FPS (Mobile) 30 60 +100% โšก
PWA Score 60 100 +40 โœจ
Offline โŒ โœ… Working! ๐Ÿ’ฏ

See Mobile Roadmap for complete details.


๐ŸŽฎ How to Play

Basic Rules

  1. ๐ŸŽฏ Objective: Clear all 50 cards without dying (HP โ‰ค 0)

  2. ๐Ÿƒ Actions Each Turn:

    • Enter Dungeon (Draw 4 cards) OR
    • Avoid Dungeon (Discard 3 cards from top)
    • โš ๏ธ Cannot avoid twice in a row (unless you have Four Leaf Clover)
  3. ๐Ÿƒ Card Types:

    • Monsters (โ™  Spades, โ™ฃ Clubs) - Enemies to fight
    • Weapons (โ™ฆ Diamonds) - Equip to deal damage
    • Potions (โ™ฅ Hearts) - Heal HP (1 per room limit)
    • Specials (โœจ) - Powerful one-time effects
  4. โš”๏ธ Combat:

    Damage Taken = Monster Value - Your Weapon Value
    
    • Perfect kill (no damage) = Build combo!
    • Taking damage = Reset combo to 0
    • No weapon = Take full monster damage
  5. ๐Ÿ”ฅ Combo System:

    • Chain perfect kills for bonus damage
    • 2x combo = +1 damage, 3x = +2 damage, etc.
    • Breaks when taking damage or equipping new weapon
    • Higher combos = Better score multiplier

Advanced Mechanics

  • Hold System: Save cards for later (Right-click or long-press on mobile)
  • Weapon Durability: Weapons break after X uses (varies by difficulty)
  • Boss Rooms: Every 10th room, face powerful multi-HP bosses
  • Events: Random encounters with risk/reward choices
  • Shop: Buy upgrades with gold (costs score penalty!)
  • Relics: Passive and active effects that stack

๐Ÿ‘ฅ Classes

Class Unlock Requirement Passive Ability Active Ability Playstyle
๐ŸŽญ Scoundrel Always unlocked None None Pure skill baseline
๐Ÿ›ก๏ธ Knight Win on Easy +5 HP, +1 Durability Shield Bash (3 CD) Tanky and consistent
๐Ÿ—ก๏ธ Rogue Win on Normal 2 Hold slots, +1 Gold/room Shadow Strike (4 CD) Flexible combos
๐Ÿ’ƒ Dancer Win on Hard Potions +3 HP, 2 uses/room, +15% events Healing Dance (5 CD) Sustain specialist
๐Ÿ’ข Berserker Hard + 5 bosses Bloodlust: +dmg at low HP Rage Strike (4 CD) High risk/reward
๐Ÿ“ฟ Priest 20 relics + 10 events + 5 wins 15% dodge, Potions +2 HP Purification (6 CD) Safe and strategic

๐Ÿ›  Technologies

Frontend

  • HTML5 - Semantic markup
  • CSS3 - Custom properties, animations, responsive design
  • Vanilla JavaScript ES6+ - Modular architecture, no frameworks
  • Web Audio API - Procedural sound effects and music

PWA & Performance

  • Service Workers - Workbox 7.0 for smart caching
  • IndexedDB - Robust client-side database
  • Lazy Loading - Progressive image loading
  • Adaptive Performance - Device-specific optimizations

Backend & Services

  • Firebase Firestore - Leaderboard and cloud saves
  • Firebase Auth - Anonymous authentication
  • EmailJS - Bug reporting system
  • Netlify - Hosting, CI/CD, CDN

Tools & Build

  • npm - Package management
  • Workbox CLI - Service Worker generation
  • Git - Version control
  • ESLint (recommended) - Code quality

๐Ÿš€ Getting Started

Prerequisites

  • Modern web browser (Chrome, Firefox, Safari, Edge)
  • Node.js 14+ (for development)
  • Internet connection (initial load only, then works offline!)

Quick Start

  1. Clone the repository

    git clone https://github.com/ehgzao/DungeonScoundrel.git
    cd DungeonScoundrel
  2. Install dependencies

    npm install
  3. Generate Service Worker

    npm run build:sw
  4. Run locally

    npm run dev
    # Opens at http://localhost:8080
  5. Play!

    • Desktop: Open in browser
    • Mobile: Add to home screen for app-like experience

Alternative: Static Server

# Python
python -m http.server 8080

# Node.js
npx serve public

# PHP
php -S localhost:8080 -t public

๐Ÿ’ป Development

Project Structure

DungeonScoundrel/
โ”œโ”€โ”€ public/                    # Production files (served)
โ”‚   โ”œโ”€โ”€ index.html            # Main game file
โ”‚   โ”œโ”€โ”€ assets/               # Images, icons
โ”‚   โ”‚   โ”œโ”€โ”€ images/           # Avatars, backgrounds (WebP optimized)
โ”‚   โ”‚   โ””โ”€โ”€ icons/            # Favicons
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ js/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ modules/      # Game modules (state, shop, relics, events)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ systems/      # Game systems (achievements, stats, music)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ utils/        # Utilities (helpers, mobile-optimization, offline-storage)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ data/         # Game data (relics, shop items)
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ core/         # Core systems (Firebase, audio, errors)
โ”‚   โ”‚   โ”œโ”€โ”€ css/              # Stylesheets
โ”‚   โ”‚   โ””โ”€โ”€ config/           # Firebase configuration
โ”‚   โ”œโ”€โ”€ sw.js                 # Service Worker (generated)
โ”‚   โ””โ”€โ”€ site.webmanifest      # PWA manifest
โ”œโ”€โ”€ docs/                      # Project documentation
โ”‚   โ”œโ”€โ”€ guides/               # Roadmaps and planning
โ”‚   โ”œโ”€โ”€ architecture/         # Technical structure
โ”‚   โ”œโ”€โ”€ releases/             # Changelog and releases
โ”‚   โ”œโ”€โ”€ security/             # Security audits
โ”‚   โ”œโ”€โ”€ development/          # Dev process
โ”‚   โ”œโ”€โ”€ mobile/               # Mobile implementation
โ”‚   โ””โ”€โ”€ merge-history/        # Archived merge docs
โ”œโ”€โ”€ scripts/                   # Build and deploy scripts
โ”œโ”€โ”€ package.json              # npm configuration
โ”œโ”€โ”€ workbox-config.js         # Service Worker config
โ”œโ”€โ”€ SECURITY.md               # Security policy (245 lines)
โ”œโ”€โ”€ README.md                 # This file
โ””โ”€โ”€ LICENSE                   # MIT License

npm Scripts

npm run dev          # Start local development server
npm run build:sw     # Generate Service Worker
npm run deploy       # Deploy to Netlify (production)

Development Workflow

  1. Create a feature branch

    git checkout -b feature/your-feature-name
  2. Make changes

    • Code in public/ directory
    • Test in multiple browsers
    • Check mobile responsiveness
  3. Test thoroughly

    • All difficulty levels
    • All classes and abilities
    • Mobile/desktop compatibility
    • Offline functionality
    • Achievement unlocking
  4. Commit with meaningful messages

    git commit -m "feat: Add Lucky Horseshoe relic"
  5. Push and create PR

    git push origin feature/your-feature-name

Code Style Guide

  • JavaScript: ES6+, const over let, descriptive names
  • HTML: Semantic markup, ARIA labels
  • CSS: BEM naming, CSS custom properties
  • Comments: JSDoc for functions, explain complex logic
  • Modules: One responsibility per file, clear exports

๐Ÿ“Š Performance

Current Metrics (v1.4.3)

Desktop

  • Load Time: < 2s (4G connection)
  • FPS: 60fps constant
  • Lighthouse Score: 95/100
    • Performance: 92
    • Accessibility: 98
    • Best Practices: 95
    • SEO: 97
    • PWA: 100 โญ

Mobile

  • Load Time: ~2s (4G), instant after cache
  • FPS: 60fps on mid-range devices
  • Battery: Optimized (reduced animations on low-end)
  • Data Usage: 550KB initial, 0KB after cache

Offline

  • โœ… 100% functional after first load
  • โœ… Service Worker caches 49 files (11.5MB)
  • โœ… All game features work offline
  • โœ… Leaderboard syncs when online

Optimization Techniques

  • Lazy Loading: Images load on-demand
  • WebP Format: 94% smaller than JPEG
  • Code Splitting: Modular architecture
  • Adaptive Performance: Device detection
  • Smart Caching: Workbox strategies
  • Reduced Animations: Mobile/low-end optimization

See Mobile Progress Report for detailed metrics.


๐Ÿ”’ Security

We take security seriously. Please review our Security Policy for:

  • Supported Versions: Which versions receive security updates
  • Reporting Vulnerabilities: How to report security issues privately
  • Response Timeline: What to expect when reporting
  • Security Features: Built-in protections
  • Hall of Fame: Contributors who helped secure the game

Quick Security Tips

  • โœ… HTTPS-only (enforced by Netlify)
  • โœ… Content Security Policy headers
  • โœ… Firebase security rules
  • โœ… Input sanitization
  • โœ… No sensitive data in localStorage
  • โœ… Anonymous authentication only

Found a vulnerability? Please report it privately via GitHub Security Advisories.


๐Ÿค Contributing

We love contributions! Whether it's code, art, music, or documentation - all help is welcome.

Quick Start for Contributors

  1. Fork the repository
  2. Clone your fork
  3. Create a feature branch
  4. Make your changes
  5. Test thoroughly
  6. Commit with clear messages
  7. Push to your fork
  8. Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.

Areas We Need Help

  • ๐ŸŽจ UI/UX Design: Visual improvements, animations
  • ๐ŸŽต Music & Sound: Additional tracks, SFX variations
  • ๐ŸŒ Localization: Translate to other languages
  • ๐Ÿ› Bug Fixes: Check open issues
  • โšก Performance: Optimize code and assets
  • ๐Ÿ“š Documentation: Tutorials, guides, API docs
  • ๐ŸŽฎ Game Design: New relics, classes, mechanics
  • ๐Ÿงช Testing: QA on different devices

๐Ÿ“š Documentation

Main Docs

Mobile & PWA

Development

Total Documentation: 4100+ lines across 11 files


๐Ÿ—บ๏ธ Roadmap

โœ… Version 1.4.3 (Current - COMPLETE)

  • โœ… Mobile PWA implementation (Phase 1)
  • โœ… Service Worker and offline mode
  • โœ… IndexedDB for robust saves
  • โœ… Performance optimizations (60 FPS mobile, -60% load time)
  • โœ… Cloud saves working
  • โœ… Security audit and improvements

๐Ÿ”„ Version 1.5.0 (Next - Planned)

  • โณ Additional language support
  • โณ Advanced tutorial for experienced players
  • โณ Tutorial replay option in menu
  • โณ Touch-friendly UI improvements
  • โณ Mobile tooltips (tap instead of hover)

๐Ÿ“ฑ Version 2.0 (Future - Q1 2026)

  • Native mobile apps (Capacitor)
  • iOS App Store release
  • Google Play Store release
  • In-App Purchases (remove ads, starter packs)
  • Push notifications (daily rewards)
  • Native features (Game Center, Google Play Games)

๐ŸŽฎ Version 2.5 (Future - Q2 2026)

  • Multiplayer mode (async PvP)
  • Daily challenges with leaderboard
  • Seasonal events
  • New class: Mage ๐Ÿง™
  • More relics (70 total)
  • Card crafting system

๐Ÿ”ง Version 3.0 (Long-term Vision)

  • Mod support (custom cards, relics)
  • Level editor (community dungeons)
  • Steam release (desktop app)
  • Achievements via Steam/Epic
  • Cloud save sync across platforms
  • Localization (10+ languages)

See Mobile Roadmap for detailed Phase 2 planning.


๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License - Copyright (c) 2025 ehgzao

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

[Full license text in LICENSE file]

๐Ÿ™ Acknowledgments

Inspiration

  • Balatro - UI/UX design and visual polish
  • Slay the Spire - Roguelike deck-building mechanics
  • Inscryption - Card game innovation and atmosphere

Assets

  • Google Fonts - Cinzel, Cinzel Decorative, MedievalSharp
  • AI-Generated Art - Class avatars and background (via Midjourney)
  • Custom Pixel Art - UI elements and icons

Technologies

  • Firebase - Backend as a Service
  • Netlify - Hosting and CI/CD
  • EmailJS - Email integration
  • Workbox - PWA toolkit by Google
  • Web Audio API - Procedural audio synthesis

Community

  • All contributors and playtesters
  • The roguelike community on Reddit
  • Open source maintainers
  • Early access players who provided feedback

๐Ÿ“ž Contact & Support

Play & Connect

Developer

Resources


๐ŸŽฏ Quick Links

Resource Description
๐ŸŽฎ Play Game Start playing now (PWA, works offline!)
๐Ÿ“ฑ Mobile Guide Complete mobile implementation roadmap
๐Ÿ›ก๏ธ Security Report vulnerabilities, security policy
๐Ÿ› Report Bug Found a bug? Let us know
โœจ Request Feature Have an idea? Share it
๐Ÿ“– Documentation Read all docs (organized by category)
๐Ÿค Contributing Join the development
๐Ÿ“œ License MIT License details

Made with โค๏ธ by ehgzao

โญ Star this repo if you enjoy the game! โญ

Star on GitHub Fork on GitHub

๐ŸŽฎ Play Now | ๐Ÿ“ฑ Mobile Roadmap | ๐Ÿ›ก๏ธ Security | ๐Ÿ› Report Issue

Version 1.4.3 | PWA Score: 100/100 | Offline Ready | Lighthouse Optimized


Dungeon Scoundrel is a free, open-source game. No ads, no tracking, no microtransactions.