npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@omgod/tico

v1.0.5

Published

tico is a reusable high-performance 2D command-line game engine with example games

Readme

English | 简体中文

tico

tico 是一个面向 Node.js 的可复用终端 2D 游戏引擎。它保留了常见 2D 引擎的结构,但把渲染目标切换为终端 ASCII 帧。

概述

本仓库面向开源发布,npm 包名为 @omgod/tico,GitHub 仓库为 omegod/tico

特性

  • 场景驱动运行时
  • 固定步进主循环与插值支持
  • 统一的游戏时间服务,支持 after()every()nextFrame() 调度
  • 节点树与 Node2DSpriteNodeTextNodeTilemapNode
  • 支持相机的终端渲染
  • 输入处理与动作映射
  • 轻量资源、动画和物理层
  • 内置 HUDBannerModal UI 组件
  • 提供可直接运行的示例游戏

安装

npm install @omgod/tico

本仓库本地开发时执行:

npm install

快速开始

const { EngineApp, Scene, TextNode, SpriteNode, COLORS, Layer } = require('@omgod/tico');

class HelloScene extends Scene {
  constructor() {
    super('hello');

    this.title = new TextNode({
      x: 3,
      y: 2,
      text: 'tico',
      color: COLORS.brightCyan,
      bold: true,
      layer: Layer.HUD
    });

    this.ship = new SpriteNode({
      x: 10,
      y: 8,
      art: [' /\\ ', '<##>', ' \\/ '],
      color: COLORS.brightGreen,
      layer: Layer.PLAYER
    });

    this.root.addChild(this.title);
    this.root.addChild(this.ship);
  }

  onEnter(app) {
    app.engine.setState('running');
    this.direction = 1;
    app.time.every(120, () => {
      this.ship.x += this.direction;
      if (this.ship.x >= 24 || this.ship.x <= 10) {
        this.direction *= -1;
      }
    }, { owner: this });
  }
}

const app = new EngineApp({ width: 80, height: 32 });
app.addScene('hello', new HelloScene());
app.start('hello');

app.time 为场景提供可复用的调度器,会自动遵守引擎暂停 / 倍速规则,并在场景退出时清理归属于该场景的任务。

示例

| 游戏 | 说明 | 运行命令 | |------|------|----------| | 星际猎手 | 弹幕射击游戏,6种战机,Boss战斗 | npm run example:star-hunter | | 俄罗斯方块 | 经典方块游戏,使用 JSON 方块数据和调度器驱动的菜单 / 状态提示 | npm run example:tetris |

npm test

公共 API

包入口会转出 src/engine/index.js 中的公共 API。

  • 应用与主循环:EngineAppGameEngineGAME_STATEEngineTime
  • 场景与节点:SceneSceneManagerNode2DSpriteNodeTextNodeTilemapNode
  • 系统:EventBusEntityManagerEntityCollisionSystemPhysicsWorld
  • 输入:InputHandlerInputActionContextActionMapKeyMappinggetActionmatches
  • 渲染:RendererCOLORSLayerCamera2DScreenBuffer
  • 内容与 UI:ResourceManagerAnimationPlayerTweenEASINGHUDBannerModal

项目结构

docs/                   文档
example/                可运行的示例游戏
src/engine/
  animation/            补间与动画辅助
  app/                  EngineApp
  core/                 主循环、事件、实体
  input/                键盘输入与动作映射
  nodes/                场景树节点
  physics/              轻量物理与查询辅助
  rendering/            终端渲染器与帧缓冲
  resources/            资源缓存与加载
  scene/                Scene 与 SceneManager
  ui/                   终端 UI 组件
tests/                  引擎与示例测试

文档

许可证

MIT