New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

minimojs

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minimojs

MinimoJS v1 — ultra-minimal, flat, deterministic 2D web game engine. Emoji-only sprites, rAF loop, TypeScript-first, LLM-friendly.

latest
npmnpm
Version
1.0.0-alpha.17
Version published
Maintainers
1
Created
Source

MinimoJS v1

Ultra-minimal, deterministic 2D web game engine for browser games.

MinimoJS focuses on a flat API, direct game-loop control, and fast iteration for small games and agent-generated prototypes.

This README is intentionally high-level. It explains what the project is and how to use it quickly, without listing the full API surface.

What MinimoJS Is

  • ESM-only TypeScript-first engine
  • Single Game entry point
  • Emoji-based sprite rendering
  • rAF-driven loop (timers/animations/updates)
  • Responsive auto-centered canvas

Core Conventions

  • Time arguments are milliseconds (ms)
  • Rotation uses degrees
  • Runtime update delta (dt) is seconds
  • Coordinate system is center-based world space
  • Positive Y goes downward
  • For new mobile-first games, prefer a portrait canvas of 720x1280

What It Intentionally Avoids

  • Heavy scene-manager/ECS architecture
  • Heavy physics engine features
  • Image spritesheets and asset pipelines
  • Nested subsystem APIs
  • setTimeout / setInterval game loops

Install

npm install minimojs

Quick Start

import { DrawSprite, Game, Sprite, type IScene } from "minimojs";

const game = new Game(720, 1280);
game.gravityY = 980;

class MeterSprite extends DrawSprite {
  public value = 0.5;

  constructor(x: number, y: number) {
    super(160, 28, x, y);
  }

  redraw(ctx: CanvasRenderingContext2D) {
    ctx.fillStyle = "#1a2236";
    ctx.fillRect(0, 0, this.width, this.height);
    ctx.fillStyle = "#7ce7ff";
    ctx.fillRect(0, 0, this.width * this.value, this.height);
  }
}

class DemoScene implements IScene {
  private player: Sprite | null = null;
  private meter: MeterSprite | null = null;

  onCreate() {
    this.player = game.add(new Sprite("🐢", 360, 640, 48));
    this.player.gravityScale = 1;
    this.meter = game.add(new MeterSprite(360, 80));
    this.meter.ignoreScroll = true;
  }

  onUpdate(dt: number) {
    if (!this.player) return;

    if (game.isKeyDown("ArrowLeft")) this.player.vx = -200;
    else if (game.isKeyDown("ArrowRight")) this.player.vx = 200;
    else this.player.vx = 0;

    if (game.isKeyPressed(" ")) this.player.vy = -600;
    if (this.meter) this.meter.value = Math.abs(this.player.vx) / 200;
    game.drawText("MinimoJS", 10, 10, 16);
  }
}

game.start(new DemoScene());

Note: drawText() uses "Press Start 2P", monospace. Load the font in your HTML if you want pixel-font styling.

Examples

  • examples/chickens-eggs-basket/
  • examples/run-dino-run/
  • examples/space-invader/
  • examples/super-minimo-bros/
  • examples/scale-shift/
  • examples/background-desert/
  • examples/scene-lab/
  • examples/image-sprite-sad-plush/
  • examples/draw-sprite/
  • examples/pseudo-3d-racer/
  • examples/animations/

Run locally from the minimojs directory:

npx serve .

Full API Reference

For complete API details, use source/docs generated from types:

  • dist/minimo.d.ts
  • src/minimo.ts (JSDoc)

Development

npm run build
npm run clean
npm run rebuild
npm run pack:check

License

MIT

Keywords

game

FAQs

Package last updated on 03 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts