A lightweight, gesture-first 2D game engine for creating interactive demos and playable ads
Built-in tap, swipe, drag, and long-press recognition. Perfect for mobile games and interactive ads.
Powerful tweening system with 30+ easing functions. Make everything feel responsive and polished.
Zero dependencies, ~15KB minified + gzipped. Tree-shakeable ES modules for minimal bundle size.
Full type safety and IntelliSense support. Written in TypeScript from the ground up.
Dynamically load any Google Font. Beautiful typography with zero configuration.
Built-in position and overlap detection. Perfect for match-3 games and interactive elements.
import { Game, Scene, Sprite } from '@mode-7/zap'; // Create a game const game = new Game({ width: 800, height: 600, backgroundColor: '#0f3460' }); // Create a scene const scene = new Scene(); // Create an interactive card const card = new Sprite({ x: 400, y: 300, width: 100, height: 140, color: '#e94560', interactive: true, }); // Add tap interaction card.on('tap', () => { card.tween( { rotation: Math.PI, scaleX: 1.2, scaleY: 1.2 }, { duration: 300, easing: 'easeOutBack' } ); }); // Add to scene and start scene.add(card); game.setScene(scene); game.start();
Minified + Gzipped
Dependencies
Easing Functions
TypeScript