jugar-web
WASM browser integration for the Jugar game engine.
This crate provides the web platform layer that bridges Jugar to browsers. All game logic runs in Rust/WASM with ABSOLUTE ZERO JavaScript computation.
Architecture
┌─────────────────────────────────────────────────────────────┐
│ Browser (JavaScript) │
│ - Event listeners (keyboard, mouse, touch) │
│ - requestAnimationFrame loop │
│ - Canvas2D rendering (drawing only) │
└─────────────────────────┬────────────────────────────────────┘
│ JSON Events ↓ ↑ JSON Commands
┌─────────────────────────┴────────────────────────────────────┐
│ WebPlatform (Rust/WASM) │
│ - Input translation (browser events → InputState) │
│ - Game logic (Pong, etc.) │
│ - Render command generation (Canvas2DCommand) │
│ - Time management (DOMHighResTimeStamp → seconds) │
└──────────────────────────────────────────────────────────────┘
Usage
// JavaScript (minimal event forwarding + Canvas2D execution)
import init from './jugar_web.js';
const platform = ;
const events = ;
document.;