Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@javelin/ecs

Package Overview
Dependencies
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@javelin/ecs

A TypeScript/JavaScript Entity-Component System

  • 2.0.0-alpha.6
  • npm
  • Socket score

Version published
Weekly downloads
133
decreased by-57.78%
Maintainers
1
Weekly downloads
 
Created
Source

@javelin/ecs

Javelin is an implementation of ECS, a popular architecture for building games with dynamic entity behavior.

Join us on Discord!

Docs

Visit https://javelin.dev

Installation

npm i @javelin/ecs

Quick Start

import * as j from "@javelin/ecs"
// define entity data
let Pos = j.value({x: "number", y: "number"})
let Vel = j.value({x: "number", y: "number"})
// create an app
let app = j
  .app()
  // initialize entities (discrete game units)
  .addInitSystem(world => {
    let origin = {x: 0, y: 0}
    world.create(j.type(Pos, Vel), origin, {x: 0, y: -1})
  })
  // find entities by type
  .addSystem(world => {
    world.query(j.type(Pos, Vel)).each((entity, pos, vel) => {
      pos.x += vel.x
      pos.y += vel.y
    })
  })
  // call all registered systems
  .step()

Keywords

FAQs

Package last updated on 12 Apr 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc