UNPKG

lingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

32 lines 1.19 kB
import createInternalSystem from "./utils/createInternalSystem"; export const flySystem = createInternalSystem("flySystem", { data: {}, update: (manager, { downSet }) => { if (downSet.has("Meta") || downSet.has("Control")) return; const speed = downSet.has("Shift") ? 50 : 10; if (downSet.has("w")) manager.translateZ(-speed); else if (downSet.has("s")) manager.translateZ(speed); if (downSet.has("a") || downSet.has("ArrowLeft")) manager.moveRight(-speed); else if (downSet.has("d") || downSet.has("ArrowRight")) manager.moveRight(speed); if (downSet.has("w") || downSet.has("s") || downSet.has("a") || downSet.has("d")) { const worldPos = manager.getWorldPosition(); manager.innerZ = 0; manager.placeAt(worldPos); } if (downSet.has("Meta") || downSet.has("Control")) return; if (downSet.has("ArrowDown")) manager.y -= speed; else if (downSet.has("ArrowUp")) manager.y += speed; } }); //# sourceMappingURL=flySystem.js.map