A fantasy roguelite game with spell fusion mechanics, built with Phaser 3. Features real user authentication, payment processing, cloud saves, and desktop packaging.
- 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
- 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
- Premium mage classes (Shadowweaver, Glaciomancer)
- Season Pass with exclusive spell skins
- Cosmetic spell skin packs
- Founder's Pack bundle
- Clone this repository
- Open
index.htmlin a modern web browser - Create an account or play as guest
- Start your run!
npm install
npm startnpm install -g vercel
vercelspellbound/
โโโ 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
For detailed setup instructions, see SETUP.md.
-
Create Supabase Project
- Sign up at supabase.com
- Run SQL schema from
js/systems/AuthSystem.js - Get your project URL and anon key
-
Create Paddle Account
- Sign up at paddle.com
- Create products for mages, skins, and season pass
- Get your client token and price IDs
-
Configure Credentials
- Edit
js/systems/AuthSystem.jswith Supabase credentials - Edit
js/systems/PaymentSystem.jswith Paddle credentials
- Edit
-
Test Locally
# Open index.html in browser, or: python -m http.server 8000 -
Build Desktop App
npm install npm run build:win # Windows npm run build:mac # macOS npm run build:linux # Linux
-
Deploy to Web
vercel --prod
- WASD - Move your mage
- Spells - Auto-cast at nearest enemy
- Mouse - Navigate menus
- Choose your mage and optional curses
- Clear floors of enemies
- Choose rewards (new spells, stat upgrades)
- Fuse spells to create powerful hybrids
- Defeat bosses every 5 floors
- Earn gold to unlock premium content
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
- Phaser 3.60 - HTML5 game framework
- Vanilla JavaScript (ES6+)
- No build tools required for game code
- Supabase - Authentication & PostgreSQL database
- Paddle - Payment processing
- Both loaded via CDN (no installation needed)
- Electron - Cross-platform desktop apps
- electron-builder - Creating installers
- Vercel - Serverless web hosting
- Zero-config deployment
# Just open index.html in your browser!
# Or use a local server:
python -m http.server 8000
# Then visit: http://localhost:8000npm install
npm startnpm 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 platformsAdd a new spell:
- Define it in
js/config.jsunderGAME_CONFIG.SPELLS - Implement logic in
js/systems/SpellSystem.js - Add fusion recipes in
FUSION_TABLE
Add a new mage:
- Add to
MAGE_CLASSESinjs/config.js - Create unlock logic in
js/scenes/MageSelectScene.js
Add a new scene:
- Create scene file in
js/scenes/ - Add to scene array in
js/main.js - Reference it in
index.html
Deploy to Vercel for instant global CDN distribution:
vercel --prodYour game will be live at: https://your-project.vercel.app
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!
- API keys in
AuthSystem.jsandPaymentSystem.jsare 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
MIT License - feel free to use this code for your own projects!
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
- Setup Issues: See SETUP.md
- Game Bugs: Check browser console for errors
- Supabase Help: Supabase Docs
- Paddle Help: Paddle Docs
- Electron Help: Electron Docs
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)
- Built with Phaser 3
- Fonts from Google Fonts
- Infrastructure powered by Supabase and Paddle
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! โจ