@webvoxel/plugin-wasdcontrols
TypeScript icon, indicating that this package has built-in type declarations

0.0.2-a20 • Public • Published

@webvoxel/plugin-wasdcontrols

WASD controls for WebVoxel

Usage

Without pointer locking

import { Game, World } from '@webvoxel/core';
import { WASDControlsPlugin} from '@webvoxel/plugin-wasdcontrols';

const wasd = new WASDControlsPlugin();

const game = new Game({
    plugins: [
        wasd,
    ],
    initialWorld: new World(),
});

game.start();

With pointer locking

import { Game, World } from '@webvoxel/core';
import { WASDControlsPlugin} from '@webvoxel/plugin-wasdcontrols';

const wasd = new WASDControlsPlugin();

const game = new Game({
    plugins: [
        wasd,
    ],
    initialWorld: new World(),
});

game.start();

game.renderer.domElement.addEventListener('click', () => wasd.controls.lock());

Readme

Keywords

none

Package Sidebar

Install

npm i @webvoxel/plugin-wasdcontrols

Weekly Downloads

4

Version

0.0.2-a20

License

MIT

Unpacked Size

620 kB

Total Files

20

Last publish

Collaborators

  • railrunner16