@dumindalk/blueprint
v1.0.0
Published
Minimal game development blueprint with Phaser 3, TypeScript, and Webpack 5
Downloads
5
Maintainers
Readme
Game Development Blueprint
A minimal, maintainable game development setup with Phaser 3, TypeScript, and Webpack 5.
Features
- One core codebase for gameplay, UI, and assets
- Thin platform adapters (web → FBIG → Android → iOS)
- Small, fast builds with predictable releases
- Minimal toolchain you can maintain solo
Tech Stack
- Engine: Phaser 3 (stable)
- Language: TypeScript
- Bundler: Webpack 5
- Package Manager: pnpm (or npm)
- Lint/Format: ESLint (typescript-eslint), Prettier
- Art/Audio: TexturePacker (atlases), Aseprite (sprites), Audacity + ffmpeg (audio)
Project Structure
/project
/src
/core # game scenes, logic, UI, assets indices
/scenes
/systems
/ui
GameConfig.ts
/platform # thin adapters
/web
/fbig
/android
/ios
/boot # entry bootstraps per target (no game logic)
main.web.ts
main.fb.ts
main.android.ts
main.ios.ts
/services # interfaces + implementations per platform
ads/
iap/
storage/
analytics/
social/
/assets
/images
/audio
/atlases
/fonts
/config
webpack.web.js
webpack.fbig.js
webpack.android.js
webpack.ios.js
paths.json # centralize dist/out paths
env.example # documented keys
/tests
/e2e
smoke.spec.ts # load → show main menu → start level
/build # output (gitignored)
/scripts # tiny node scripts for packaging/zip/sign
.editorconfig
.eslintrc
.prettierrc
README.mdQuick Start
Option 1: Use as NPM Package (Recommended)
# Install the blueprint CLI globally
npm install -g @dumindalk/blueprint
# Create a new game project
bs-play create my-awesome-game --platforms web,android --type puzzle
# Navigate to your project
cd my-awesome-game
# Install dependencies
npm install
# Start development
npm run dev:webOption 2: Use as Template Repository
Install dependencies:
pnpm install # or npm installStart development server for specific platform:
pnpm dev:web # Web platform (port 8080) pnpm dev:fbig # Facebook Instant Games platform (port 8081) pnpm dev:android # Android platform (port 8082) pnpm dev:ios # iOS platform (port 8083)Build for production:
pnpm build:web pnpm build:fbig pnpm build:android pnpm build:ios pnpm build:all # Build all platforms
Scripts
pnpm dev:web- Start web development serverpnpm dev:fbig- Start Facebook Instant Games development serverpnpm dev:android- Start Android development serverpnpm dev:ios- Start iOS development serverpnpm build:web- Build web for productionpnpm build:fbig- Build Facebook Instant Games for productionpnpm build:android- Build Android for productionpnpm build:ios- Build iOS for productionpnpm build:all- Build all platformspnpm lint- Run ESLintpnpm lint:fix- Fix ESLint issuespnpm format- Format code with Prettierpnpm clean- Clean build directorypnpm test:e2e- Run end-to-end testspnpm package:web- Package web buildpnpm package:fbig- Package Facebook Instant Games buildpnpm package:android- Package Android buildpnpm package:ios- Package iOS build
Platform Adapters
The blueprint includes thin platform adapters that abstract platform-specific functionality:
- Web: Standard web APIs, localStorage, Web Audio API
- FBIG: Facebook Instant Games APIs, Facebook Analytics
- Android: Android native APIs, SharedPreferences, Firebase
- iOS: iOS native APIs, UserDefaults, Firebase
Services
Each platform implements the same service interfaces:
- Storage: Platform-appropriate storage (localStorage, AsyncStorage, etc.)
- Analytics: Event tracking and user analytics
- Ads: Banner, interstitial, and rewarded ads
- Social: Sharing and social login
- Input: Touch and keyboard input handling
- Audio: Sound and music playback
- Graphics: Screen management and orientation
Development Guidelines
- Use camelCase for functions and variables
- Use SCREAMING_SNAKE_CASE for constants
- Use PascalCase for classes, enums and typedefs
- Keep platform adapters thin - no game logic
- Place reusable logic in the core directory
- Use the service interfaces for platform abstraction
