A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
import { defineComponent } from 'esengine';
/**
* A player-steered pawn. `player` is the owning connection id (0 = the host player) and is AUTHORITY-side only: provisioning matches pawns to
* players with it, and a ghost learns the same fact as `Replicated.owner`, which the spawn carries. `speed` comes from the `pawn` archetype on
* both ends, which is what lets client prediction run the same rule.
*/
export const Pawn = defineComponent('Pawn', {
player: 0,
speed: 340,
});