🎮 Enterprise-Grade Mobile Game Development Framework
A comprehensive JavaScript game engine framework that unifies 2D and 3D game development with Laravel-inspired architecture. Built for mobile casual, hybrid casual, hyper casual, platformer, shooter, and puzzle games targeting Rollic/Voodoo quality standards.
|
|
Type | Description | Key Features |
---|---|---|
🎲 Mobile Casual | Touch-optimized gameplay | Responsive UI, haptic feedback |
⚡ Hybrid Casual | Progressive complexity | Retention hooks, analytics |
🏃 Hyper Casual | Ultra-lightweight | Instant playability, minimal bundle |
🏗️ Platformer | Physics-based games | Collision detection, movement helpers |
🔫 Shooter | High-performance action | Optimized rendering, input handling |
🧩 Puzzle | Logic-based games | State management, turn-based systems |
# Install the framework
npm install @gamebyte/framework
# Or with yarn
yarn add @gamebyte/framework
# Or with pnpm
pnpm add @gamebyte/framework
import { createGame, initializeFacades, RenderingMode } from '@gamebyte/framework';
// Create GameByte application with all features
const app = createGame();
// Initialize facades for static access
initializeFacades(app);
// Get canvas element
const canvas = document.getElementById('game-canvas') as HTMLCanvasElement;
// Initialize with 2D rendering
await app.initialize(canvas, RenderingMode.RENDERER_2D, {
width: 800,
height: 600,
backgroundColor: 0x1099bb
});
// Start the game loop
app.start();
import { create2DGame, initializeGame } from '@gamebyte/framework/2d';
import { add2DPhysics } from '@gamebyte/framework/physics2d';
// Create lightweight 2D game instance
const app = create2DGame();
// Optional: Add 2D physics if needed
add2DPhysics(app);
// Initialize 2D game
const canvas = document.getElementById('game-canvas') as HTMLCanvasElement;
await initializeGame(app, canvas, {
width: 800,
height: 600,
backgroundColor: 0x1099bb
});
app.start();
import { create3DGame, initializeGame } from '@gamebyte/framework/3d';
import { add3DPhysics } from '@gamebyte/framework/physics3d';
// Create lightweight 3D game instance
const app = create3DGame();
// Optional: Add 3D physics if needed
add3DPhysics(app);
// Initialize 3D game
const canvas = document.getElementById('game-canvas') as HTMLCanvasElement;
await initializeGame(app, canvas, {
width: 800,
height: 600
});
app.start();
import { Scene, Scenes } from '@gamebyte/framework';
class MainMenuScene implements Scene {
public readonly id = 'main-menu';
public readonly name = 'Main Menu';
public isActive = false;
async initialize(): Promise<void> {
// Initialize scene assets
}
activate(): void {
this.isActive = true;
}
deactivate(): void {
this.isActive = false;
}
update(deltaTime: number): void {
// Update scene logic
}
render(renderer: any): void {
// Render scene objects
}
destroy(): void {
// Clean up resources
}
}
// Register and switch scenes
const mainMenu = new MainMenuScene();
Scenes.add(mainMenu);
await Scenes.switchTo('main-menu');
The main application class that orchestrates the entire framework:
const app = GameByte.create();
// Register service providers
app.register(new CustomServiceProvider());
// Boot the application
await app.boot();
// Access services
const renderer = app.make('renderer');
Laravel-inspired dependency injection container:
// Bind services
app.bind('custom.service', () => new CustomService());
app.singleton('global.service', () => new GlobalService());
// Resolve services
const service = app.make('custom.service');
Modular service registration system:
import { AbstractServiceProvider } from '@gamebyte/framework';
export class CustomServiceProvider extends AbstractServiceProvider {
register(app: GameByte): void {
app.bind('custom.feature', () => new CustomFeature());
}
boot(app: GameByte): void {
// Bootstrap services after registration
}
}
Abstraction layer over Pixi.js and Three.js:
import { RendererFactory, RenderingMode } from '@gamebyte/framework';
// Create 2D renderer
const renderer2D = RendererFactory.create(RenderingMode.PIXI_2D);
// Create 3D renderer
const renderer3D = RendererFactory.create(RenderingMode.THREE_3D);
// Use facade for static access
import { Renderer } from '@gamebyte/framework';
Renderer.start();
Renderer.resize(1024, 768);
Comprehensive scene lifecycle management:
import { Scenes } from '@gamebyte/framework';
// Scene transitions with effects
await Scenes.switchTo('game', {
type: 'fade',
duration: 1000,
easing: (t) => t * t
});
npm-style plugin architecture:
import { Plugins } from '@gamebyte/framework';
// Register plugin
Plugins.register({
name: 'my-plugin',
version: '1.0.0',
provider: MyPluginProvider,
dependencies: ['core-plugin']
});
// Load plugins
await Plugins.loadAll();
Static access to framework services:
import { Renderer, Scenes, Plugins } from '@gamebyte/framework';
// Renderer facade
Renderer.start();
const stats = Renderer.getStats();
// Scenes facade
await Scenes.switchTo('game');
const currentScene = Scenes.getCurrentScene();
// Plugins facade
await Plugins.load('my-plugin');
const isLoaded = Plugins.isLoaded('my-plugin');
The framework is specifically designed for mobile game development with built-in optimizations:
import { PerformanceTier } from '@gamebyte/framework';
// Automatic performance detection and scaling
const tier = detectPerformanceTier();
adjustQualitySettings(tier);
- Mobile Casual - Touch-optimized UI and simple mechanics
- Hybrid Casual - Progressive complexity with retention hooks
- Hyper Casual - Ultra-lightweight with instant playability
- Platformer - Physics-based movement and collision detection
- Shooter - High-performance rendering and input handling
- Puzzle - Turn-based logic and state management
gamebyte-framework/
├── src/
│ ├── core/ # Core framework classes
│ │ ├── GameByte.ts # Main application class
│ │ ├── ServiceContainer.ts # Dependency injection
│ │ └── DefaultSceneManager.ts
│ ├── contracts/ # TypeScript interfaces
│ │ ├── ServiceProvider.ts
│ │ ├── Container.ts
│ │ ├── Renderer.ts
│ │ └── Scene.ts
│ ├── rendering/ # Rendering system
│ │ ├── PixiRenderer.ts # 2D renderer implementation
│ │ ├── ThreeRenderer.ts # 3D renderer implementation
│ │ └── RendererFactory.ts
│ ├── services/ # Core service providers
│ │ ├── RenderingServiceProvider.ts
│ │ ├── SceneServiceProvider.ts
│ │ └── PluginServiceProvider.ts
│ ├── plugins/ # Plugin system
│ │ └── PluginManager.ts
│ ├── facades/ # Static access facades
│ │ ├── Facade.ts
│ │ ├── Renderer.ts
│ │ ├── Scenes.ts
│ │ └── Plugins.ts
│ ├── types/ # TypeScript type definitions
│ └── index.ts # Main entry point
├── examples/ # Usage examples
│ ├── basic-usage.ts
│ └── index.html
├── dist/ # Compiled output
├── package.json
├── tsconfig.json
├── rollup.config.js
└── README.md
# Install dependencies
npm install
# Build the framework
npm run build
# Development mode with watch
npm run dev
# Run tests
npm run test
# Lint code
npm run lint
Experience the GameByte Framework with our comprehensive demo that showcases Laravel-inspired architecture patterns in action:
# Quick start - builds and serves the demo
npm run demo:serve
# Or manually build and serve
npm run demo:build
npx http-server demos/dist -p 9000 -o
Demo Features:
- ✅ Dependency Injection & IoC - Service container with automatic resolution
- ✅ Service Providers - Laravel-inspired service registration and lifecycle
- ✅ Facade Pattern - Clean static APIs (DemoScore, DemoGameState, DemoNotifications)
- ✅ Scene Management - Smooth transitions between splash, menu, and gameplay
- ✅ Event-Driven Architecture - Cross-service communication via events
- ✅ Mobile-First UI - Touch-optimized responsive design with haptic feedback
- ✅ Performance Monitoring - FPS tracking and automatic quality scaling
The demo runs at http://localhost:9000
and works on both desktop and mobile devices.
💡 Tip: The demo showcases enterprise patterns like dependency injection, service providers, and facades in action. Perfect for understanding the framework's architecture!
// Clean, abstracted 2D API - no Pixi.js references
import {
create2DGame,
initializeGame,
Renderer2D,
AssetManager2D
} from '@gamebyte/framework/2d';
import {
add2DPhysics,
PlatformerHelper,
PhysicsWorld2D
} from '@gamebyte/framework/physics2d';
const app = create2DGame();
add2DPhysics(app);
await initializeGame(app, canvas);
// Clean, abstracted 3D API - no Three.js references
import {
create3DGame,
initializeGame,
Renderer3D,
SpatialAudio
} from '@gamebyte/framework/3d';
import {
add3DPhysics,
ParticleSystem,
PhysicsWorld3D
} from '@gamebyte/framework/physics3d';
const app = create3DGame();
add3DPhysics(app);
await initializeGame(app, canvas);
Check the examples/
directory for:
- Basic framework setup
- Scene management examples
- Plugin development guide
- Mobile optimization techniques
- Performance monitoring setup
GameByte
- Main application classServiceContainer
- Dependency injection containerRendererFactory
- Renderer creation and managementPluginManager
- Plugin registration and lifecycle
RenderingMode
- Supported rendering modes (2D, 3D, Hybrid)PixiRenderer
- Pixi.js implementationThreeRenderer
- Three.js implementation
Scene
- Scene interfaceSceneManager
- Scene lifecycle managementSceneTransition
- Transition configuration
RenderingServiceProvider
- Rendering servicesSceneServiceProvider
- Scene management servicesPluginServiceProvider
- Plugin system services
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
MIT License - see LICENSE file for details.
- Asset management system
- Input handling system
- Audio system integration
- Physics engine integration
- UI component library
- Animation system
- Particle effects
- Mobile platform plugins (iOS/Android)
- Cloud save integration
- Analytics and telemetry
- A/B testing framework
We welcome contributions! Please see our Contributing Guide for details.
- 📖 Documentation
- 🎮 Interactive Demo
- 💬 Discord Community
- 🐦 Twitter Updates
- 📝 Blog & Tutorials
- 🎓 Video Courses
GameByte Framework is MIT licensed.
- Built on top of amazing libraries: Pixi.js, Three.js
- Inspired by Laravel Framework architecture patterns
Built with ❤️ for mobile game developers targeting Rollic/Voodoo quality standards.
⭐ Star us on GitHub — it motivates us a lot!