game-svelte
Svelte game framework — Game component shell with lifecycle, loop, and renderer integration
1 2 3 4 5 6 7 8 9 10 11
<script>
import { Game } from '@sbx/game-svelte';
import { arcadePreset } from '@sbx/game-preset-arcade';
function onReady(engine) {
console.log('Game started:', engine.fps, 'fps');
}
</script>
<Game config={{ width: 800, height: 600 }}
preset={arcadePreset} onready={onReady} />About
Top-level Svelte component that bootstraps a game instance. Manages the game lifecycle (init → running → paused → stopped), connects the PixiJS renderer, input manager, and game loop into a unified component with reactive Svelte 5 props for configuration and state observation.
Public API
| Name | Kind | Signature |
|---|---|---|
| Game | type | Game.svelte — config, preset, onready, onupdate |
Dependencies
Imports (2)
Rendering engine — PixiJS-based game renderer with grid, backgrounds, and visual effects
Input manager — unified keyboard, mouse, and touch input handling for games
Related Packages
Rendering engine — PixiJS-based game renderer with grid, backgrounds, and visual effects
Input manager — unified keyboard, mouse, and touch input handling for games
Arcade game preset — preconfigured runtime with score, lives, levels, and collision
PixiJS vendor wrapper — tree-shakeable PixiJS adapter with type-safe API subset