Examples
import { World } from '@wimaengine/ecs'
import { createRawMovable2D } from '@wimaengine/movable'
const world = new World()
world.spawn(createRawMovable2D(2, 0, 0.1))Function
createRawMovable2D(x?: number, y?: number, a?: number): [Velocity2D, Rotation2D, Acceleration2D, Torque2D]Creates an ordered 2D motion-only component bundle.
The returned tuple contains Velocity2D, Rotation2D,
Acceleration2D, and Torque2D in insertion order. The
supplied x and y values initialize velocity, a initializes angular
motion in radians, and acceleration and torque start at zero. Use
createMovable2D when the entity also needs the standard 2D
transform components.
import { World } from '@wimaengine/ecs'
import { createRawMovable2D } from '@wimaengine/movable'
const world = new World()
world.spawn(createRawMovable2D(2, 0, 0.1))