Skip to content

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

4 Commits

Folders and files

Repository files navigation

๐Ÿ”ฎ SPELLBOUND: Last Mage Standing

A fantasy roguelite game with spell fusion mechanics, built with Phaser 3. Features real user authentication, payment processing, cloud saves, and desktop packaging.

Version License Platform


โœจ Features

๐ŸŽฎ Gameplay

  • 4 Playable Mages - Each with unique abilities and starting spells
  • Spell Fusion System - Combine elements to create powerful hybrid spells
  • Roguelite Progression - Procedurally generated floors with increasing difficulty
  • Curse System - Optional difficulty modifiers for bonus gold rewards
  • Boss Battles - Epic encounters every 5 floors
  • Lore Collection - Discover the story through in-game scrolls

๐Ÿ” Infrastructure (NEW!)

  • User Authentication - Email/password signup and login via Supabase
  • Cloud Saves - Game progress synced across devices
  • Real Payments - Paddle integration for premium content purchases
  • Guest Mode - Play without account (local saves only)
  • Desktop App - Native Windows, macOS, and Linux builds with Electron
  • Web Deployment - One-command deployment to Vercel

๐Ÿ’ฐ Monetization

  • Premium mage classes (Shadowweaver, Glaciomancer)
  • Season Pass with exclusive spell skins
  • Cosmetic spell skin packs
  • Founder's Pack bundle

๐Ÿš€ Quick Start

Play in Browser

  1. Clone this repository
  2. Open index.html in a modern web browser
  3. Create an account or play as guest
  4. Start your run!

Run Desktop App

npm install
npm start

Deploy to Web

npm install -g vercel
vercel

๐Ÿ“ Project Structure

spellbound/
โ”œโ”€โ”€ index.html              # Game entry point
โ”œโ”€โ”€ js/
โ”‚   โ”œโ”€โ”€ main.js            # Phaser initialization
โ”‚   โ”œโ”€โ”€ config.js          # Game constants and configuration
โ”‚   โ”œโ”€โ”€ systems/           # Core game systems
โ”‚   โ”‚   โ”œโ”€โ”€ AuthSystem.js      # Supabase authentication
โ”‚   โ”‚   โ”œโ”€โ”€ PaymentSystem.js   # Paddle payment integration
โ”‚   โ”‚   โ”œโ”€โ”€ SaveSystem.js      # Cloud/local save management
โ”‚   โ”‚   โ”œโ”€โ”€ CurrencySystem.js  # Gold currency
โ”‚   โ”‚   โ”œโ”€โ”€ LoreSystem.js      # Lore collection
โ”‚   โ”‚   โ”œโ”€โ”€ SpellSystem.js     # Spell mechanics
โ”‚   โ”‚   โ””โ”€โ”€ EnemySystem.js     # Enemy AI
โ”‚   โ””โ”€โ”€ scenes/            # Phaser game scenes
โ”‚       โ”œโ”€โ”€ LoginScene.js      # Authentication UI
โ”‚       โ”œโ”€โ”€ MenuScene.js       # Main menu
โ”‚       โ”œโ”€โ”€ MageSelectScene.js # Character selection
โ”‚       โ”œโ”€โ”€ GameScene.js       # Core gameplay
โ”‚       โ”œโ”€โ”€ RewardScene.js     # Post-floor rewards
โ”‚       โ”œโ”€โ”€ DeathScene.js      # Game over screen
โ”‚       โ”œโ”€โ”€ GrimoireScene.js   # Lore viewer
โ”‚       โ””โ”€โ”€ ShopScene.js       # In-game store
โ”œโ”€โ”€ electron/              # Desktop app configuration
โ”‚   โ”œโ”€โ”€ main.js           # Electron main process
โ”‚   โ””โ”€โ”€ preload.js        # Security bridge script
โ”œโ”€โ”€ package.json          # Node.js dependencies & build scripts
โ”œโ”€โ”€ vercel.json          # Vercel deployment configuration
โ”œโ”€โ”€ config.example.js     # Template for API keys
โ”œโ”€โ”€ SETUP.md             # Detailed setup instructions
โ””โ”€โ”€ README.md            # This file

โš™๏ธ Setup & Configuration

For detailed setup instructions, see SETUP.md.

Quick Setup Summary

  1. Create Supabase Project

    • Sign up at supabase.com
    • Run SQL schema from js/systems/AuthSystem.js
    • Get your project URL and anon key
  2. Create Paddle Account

    • Sign up at paddle.com
    • Create products for mages, skins, and season pass
    • Get your client token and price IDs
  3. Configure Credentials

    • Edit js/systems/AuthSystem.js with Supabase credentials
    • Edit js/systems/PaymentSystem.js with Paddle credentials
  4. Test Locally

    # Open index.html in browser, or:
    python -m http.server 8000
  5. Build Desktop App

    npm install
    npm run build:win    # Windows
    npm run build:mac    # macOS
    npm run build:linux  # Linux
  6. Deploy to Web

    vercel --prod

๐ŸŽฎ How to Play

Controls

  • WASD - Move your mage
  • Spells - Auto-cast at nearest enemy
  • Mouse - Navigate menus

Gameplay Loop

  1. Choose your mage and optional curses
  2. Clear floors of enemies
  3. Choose rewards (new spells, stat upgrades)
  4. Fuse spells to create powerful hybrids
  5. Defeat bosses every 5 floors
  6. Earn gold to unlock premium content

Spell Fusion

Combine two base element spells to create fusion spells:

  • ๐Ÿ”ฅ Fire + โ„๏ธ Ice = Frostfire Nova
  • โšก Lightning + ๐ŸŒ‘ Shadow = Void Storm
  • ๐Ÿ”ฅ Fire + โšก Lightning = Plasma Burst
  • โ„๏ธ Ice + ๐ŸŒ‘ Shadow = Phantom Blizzard

๐Ÿ› ๏ธ Technology Stack

Game Engine

  • Phaser 3.60 - HTML5 game framework
  • Vanilla JavaScript (ES6+)
  • No build tools required for game code

Backend Services

  • Supabase - Authentication & PostgreSQL database
  • Paddle - Payment processing
  • Both loaded via CDN (no installation needed)

Desktop Packaging

  • Electron - Cross-platform desktop apps
  • electron-builder - Creating installers

Deployment

  • Vercel - Serverless web hosting
  • Zero-config deployment

๐Ÿ’ป Development

Browser Development

# Just open index.html in your browser!
# Or use a local server:
python -m http.server 8000
# Then visit: http://localhost:8000

Desktop Development

npm install
npm start

Build Commands

npm run start         # Run Electron app
npm run build:win     # Build Windows installer
npm run build:mac     # Build macOS app
npm run build:linux   # Build Linux AppImage
npm run build:all     # Build for all platforms

Adding New Features

Add a new spell:

  1. Define it in js/config.js under GAME_CONFIG.SPELLS
  2. Implement logic in js/systems/SpellSystem.js
  3. Add fusion recipes in FUSION_TABLE

Add a new mage:

  1. Add to MAGE_CLASSES in js/config.js
  2. Create unlock logic in js/scenes/MageSelectScene.js

Add a new scene:

  1. Create scene file in js/scenes/
  2. Add to scene array in js/main.js
  3. Reference it in index.html

๐Ÿ“ฆ Distribution

Web Version

Deploy to Vercel for instant global CDN distribution:

vercel --prod

Your game will be live at: https://your-project.vercel.app

Desktop Version

Built installers are in the dist/ folder:

  • Windows: dist/Spellbound Setup 1.0.0.exe
  • macOS: dist/Spellbound-1.0.0.dmg
  • Linux: dist/Spellbound-1.0.0.AppImage

Distribute these files to your players!


๐Ÿ”’ Security Notes

  • API keys in AuthSystem.js and PaymentSystem.js are public keys - safe to expose in client-side code
  • Private keys (database secrets, webhook secrets) should NEVER be in client code
  • Supabase Row Level Security (RLS) protects user data
  • Paddle handles all payment security (PCI compliant)
  • Always verify Paddle webhooks with signature verification

๐Ÿ“ License

MIT License - feel free to use this code for your own projects!


๐Ÿค Contributing

This is a complete game template. Feel free to:

  • Fork and modify for your own game
  • Use the infrastructure code in your projects
  • Submit issues if you find bugs
  • Share improvements

๐Ÿ“ž Support


๐ŸŽฏ Roadmap

Potential future enhancements:

  • Multiplayer co-op mode
  • Daily challenges
  • Leaderboards
  • More mage classes
  • New biomes/environments
  • Achievements system
  • Social features (friend system)
  • Modding support
  • Mobile version (iOS/Android)

๐Ÿ™ Credits


๐Ÿ”ฎ Start Your Journey

Ready to begin? Follow the SETUP.md guide to get everything configured, then start your descent into the Tower of Shadows!

May your spells be powerful and your runs be long! โœจ

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages