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';
/**
* One board tile. `slot` is the fixed board cell this entity sits in (never
* changes); `tile` is which region of the video it currently SHOWS. Swapping
* two pieces swaps their `tile`s — the entities and their transforms stay put,
* only the sampled video region moves. Solved = every piece shows its own slot.
*/
export const PuzzlePiece = defineComponent('PuzzlePiece', {
slot: 0,
tile: 0,
});