Class
Acceleration2D
View sourceExtendsVector2
Represents an entity’s linear acceleration in 2D as an ECS component.
A new component starts at (0, 0). Use it with Velocity2D and
Position2D.
Examples
import { Query, World } from '@wimaengine/ecs'
import { Acceleration2D } from '@wimaengine/movable'
const world = new World()
world.spawn([new Acceleration2D(0, -9.8)])
new Query(world, [Acceleration2D]).each(([acceleration]) => {
acceleration.x += 2
})Constructor
View source
Methods
staticcopy(source: Acceleration2D, target?: Acceleration2D): Acceleration2D
View sourcestaticclone(target: Acceleration2D): Acceleration2D
View sourceCreates a new Acceleration2D with the same coordinates as another one.
