𝗟𝗶𝗺𝗻 𝗘𝗻𝗴𝗶𝗻𝗲: 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗲 𝗔𝗣𝗜 𝗥𝗲𝗳𝗲𝗿𝗲𝗻𝗰𝗲
Build games faster with the Limn Engine API. This guide covers the core classes and methods you need to start developing.
Core Classes
• Display (L1): The engine heart. It manages the canvas, game loop, input, and camera. • Component (L1): Every visible object. It handles position, size, physics, and collisions. • Camera (L2): Controls the viewport. Use it to follow players, shake the screen, or zoom. • Move (L1): A helper for physics, particles, and movement logic. • State (L1): Read-only tools to query object properties. • TileMap (L2): System for grid-based levels and maps. • Tctxt (L1): Rich text with background support and alignment. • Sound (L1): Handles single audio files. • SoundManager (L4): Manages multiple sounds and global volume. • ParticleSystem (L3): Creates bursts, smoke, and continuous effects. • Sprite (L2): Manages spritesheet animations.
Quick Implementation
Start the engine: const display = new Display(); display.perform(); display.start(800, 600);
Add a player: const player = new Component(40, 40, "blue", 100, 100); player.physics = true; player.gravity = 0.4; display.add(player);
Movement and Physics
Use the move helper to simplify your code:
- move.bound(player): Keeps objects inside the canvas.
- move.pointTo(id, x, y): Rotates an object to face a target.
- move.project(id, speed, angle, gravity): Creates projectile motion.
- move.accelerate(id, ax, ay): Adds smooth movement.
Camera Control
Keep the action in view with these methods:
- display.camera.follow(target, true): Smoothly tracks an object.
- display.camera.shake(x, y): Adds screen shake for impact.
- display.camera.setZoom(amount): Changes the view scale.
Visual Effects
Enhance your game with particles:
- move.particles.explosion(ps, x, y, count): Creates a burst.
- move.particles.smoke(ps, x, y): Creates a smoke puff.
- move.particles.magic(ps, x, y): Creates colorful rotating effects.
Source: https://dev.to/kehinde_owolabi_e2e54567a/limn-engine-complete-api-reference-1acj