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
refactor(templates): the new-project templates live engine-side
esengine6e85424be598
diff --git a/build-tools/tasks/check-examples.js b/build-tools/tasks/check-examples.jsindex e7f7b6133..929dfa3f7 100644--- a/build-tools/tasks/check-examples.js+++ b/build-tools/tasks/check-examples.js@@ -12,8 +12,8 @@ import { fileURLToPath } from 'url';import * as logger from '../utils/logger.js';// Every project directory that ships to users: the examples plus the editor's-// bundled new-project templates (desktop/templates).-const PROJECT_ROOTS = ['examples', 'desktop/templates'];+// bundled new-project templates (templates/).+const PROJECT_ROOTS = ['examples', 'templates'];function discoverExamples(rootDir) {const out = [];diff --git a/build-tools/tasks/validate-documents.js b/build-tools/tasks/validate-documents.jsindex 213ad5135..39170fb51 100644--- a/build-tools/tasks/validate-documents.js+++ b/build-tools/tasks/validate-documents.js@@ -17,7 +17,7 @@ import { pathToFileURL } from 'url';import * as logger from '../utils/logger.js';// Every directory tree that ships authored documents to users.-const DOCUMENT_ROOTS = ['examples', 'sdk/src/ui/widgets/prefabs', 'desktop/templates'];+const DOCUMENT_ROOTS = ['examples', 'sdk/src/ui/widgets/prefabs', 'templates'];const SKIP_DIRS = new Set(['node_modules', '.esengine', 'dist', '.git']);const EXTENSIONS = ['.esprefab', '.esscene'];diff --git a/desktop/electron-builder.yml b/desktop/electron-builder.ymlindex 92181cce1..a77eae725 100644--- a/desktop/electron-builder.yml+++ b/desktop/electron-builder.yml@@ -86,7 +86,7 @@ extraResources:# exported (dist-playable/, dist-wechat/, dist-game/ … — `dist-<platform>`) sits# inside the example it came from, and `**/dist/**` never matched those names, so# local export output rode into the installer.- - from: templates+ - from: ../templatesto: templatesfilter:- "**/*"diff --git a/desktop/electron/launcher.ts b/desktop/electron/launcher.tsindex d3bad63a1..17b9b8dfd 100644--- a/desktop/electron/launcher.ts+++ b/desktop/electron/launcher.ts@@ -115,7 +115,7 @@ const templateRoots = (): Array<{ root: string; kind: TemplateEntry['kind'] }> ={ root: path.join(process.resourcesPath, 'examples'), kind: 'example' },]: [- { root: path.join(process.env.APP_ROOT ?? '', 'templates'), kind: 'starter' },+ { root: path.join(process.env.APP_ROOT ?? '', '..', 'templates'), kind: 'starter' },{ root: path.join(process.env.APP_ROOT ?? '', '..', 'examples'), kind: 'example' },];diff --git a/desktop/scripts/editor-checks/starter-3d.mjs b/desktop/scripts/editor-checks/starter-3d.mjsindex 442ce62f5..e5858d69e 100644--- a/desktop/scripts/editor-checks/starter-3d.mjs+++ b/desktop/scripts/editor-checks/starter-3d.mjs@@ -17,7 +17,7 @@import path from 'node:path';import { checker, DESKTOP } from '../lib/editorDriver.mjs';-const TEMPLATE = path.resolve(DESKTOP, 'templates', '3d-starter');+const TEMPLATE = path.resolve(DESKTOP, '..', 'templates', '3d-starter');export const name = 'starter-3d';export const describes = 'the 3D starter template stands up, and its key moves the character';diff --git a/templates/.gitignore b/templates/.gitignoredeleted file mode 100644index ac9813a3a..000000000--- a/templates/.gitignore+++ /dev/null@@ -1,19 +0,0 @@-# Dependencies-node_modules/--# Build output-build/-dist/--# Editor cache-.esengine/--# IDE-.vscode/-.idea/-*.swp-*.swo--# OS-.DS_Store-Thumbs.dbdiff --git a/desktop/templates/2d-platformer/.gitignore b/templates/2d-platformer/.gitignoresimilarity index 100%rename from desktop/templates/2d-platformer/.gitignorerename to templates/2d-platformer/.gitignorediff --git a/desktop/templates/2d-platformer/assets/prefabs/Coin.esprefab b/templates/2d-platformer/assets/prefabs/Coin.esprefabsimilarity index 100%rename from desktop/templates/2d-platformer/assets/prefabs/Coin.esprefabrename to templates/2d-platformer/assets/prefabs/Coin.esprefabdiff --git a/desktop/templates/2d-platformer/assets/prefabs/Coin.esprefab.meta b/templates/2d-platformer/assets/prefabs/Coin.esprefab.metasimilarity index 100%rename from desktop/templates/2d-platformer/assets/prefabs/Coin.esprefab.metarename to templates/2d-platformer/assets/prefabs/Coin.esprefab.metadiff --git a/desktop/templates/2d-platformer/assets/scenes/main.esscene b/templates/2d-platformer/assets/scenes/main.esscenesimilarity index 100%rename from desktop/templates/2d-platformer/assets/scenes/main.esscenerename to templates/2d-platformer/assets/scenes/main.esscenediff --git a/desktop/templates/2d-platformer/assets/scenes/main.esscene.meta b/templates/2d-platformer/assets/scenes/main.esscene.metasimilarity index 100%rename from desktop/templates/2d-platformer/assets/scenes/main.esscene.metarename to templates/2d-platformer/assets/scenes/main.esscene.metadiff --git a/desktop/templates/2d-platformer/assets/textures/block-guard.ktx2 b/templates/2d-platformer/assets/textures/block-guard.ktx2similarity index 100%rename from desktop/templates/2d-platformer/assets/textures/block-guard.ktx2rename to templates/2d-platformer/assets/textures/block-guard.ktx2diff --git a/desktop/templates/2d-platformer/assets/textures/block-guard.ktx2.meta b/templates/2d-platformer/assets/textures/block-guard.ktx2.metasimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/block-guard.ktx2.metarename to templates/2d-platformer/assets/textures/block-guard.ktx2.metadiff --git a/desktop/templates/2d-platformer/assets/textures/coin.png b/templates/2d-platformer/assets/textures/coin.pngsimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/coin.pngrename to templates/2d-platformer/assets/textures/coin.pngdiff --git a/desktop/templates/2d-platformer/assets/textures/coin.png.meta b/templates/2d-platformer/assets/textures/coin.png.metasimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/coin.png.metarename to templates/2d-platformer/assets/textures/coin.png.metadiff --git a/desktop/templates/2d-platformer/assets/textures/ground.png b/templates/2d-platformer/assets/textures/ground.pngsimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/ground.pngrename to templates/2d-platformer/assets/textures/ground.pngdiff --git a/desktop/templates/2d-platformer/assets/textures/ground.png.meta b/templates/2d-platformer/assets/textures/ground.png.metasimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/ground.png.metarename to templates/2d-platformer/assets/textures/ground.png.metadiff --git a/desktop/templates/2d-platformer/assets/textures/platform.png b/templates/2d-platformer/assets/textures/platform.pngsimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/platform.pngrename to templates/2d-platformer/assets/textures/platform.pngdiff --git a/desktop/templates/2d-platformer/assets/textures/platform.png.meta b/templates/2d-platformer/assets/textures/platform.png.metasimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/platform.png.metarename to templates/2d-platformer/assets/textures/platform.png.metadiff --git a/desktop/templates/2d-platformer/assets/textures/player.png b/templates/2d-platformer/assets/textures/player.pngsimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/player.pngrename to templates/2d-platformer/assets/textures/player.pngdiff --git a/desktop/templates/2d-platformer/assets/textures/player.png.meta b/templates/2d-platformer/assets/textures/player.png.metasimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/player.png.metarename to templates/2d-platformer/assets/textures/player.png.metadiff --git a/desktop/templates/2d-platformer/assets/textures/sky.png b/templates/2d-platformer/assets/textures/sky.pngsimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/sky.pngrename to templates/2d-platformer/assets/textures/sky.pngdiff --git a/desktop/templates/2d-platformer/assets/textures/sky.png.meta b/templates/2d-platformer/assets/textures/sky.png.metasimilarity index 100%rename from desktop/templates/2d-platformer/assets/textures/sky.png.metarename to templates/2d-platformer/assets/textures/sky.png.metadiff --git a/desktop/templates/2d-platformer/project.esproject b/templates/2d-platformer/project.esprojectsimilarity index 100%rename from desktop/templates/2d-platformer/project.esprojectrename to templates/2d-platformer/project.esprojectdiff --git a/desktop/templates/2d-platformer/src/components.ts b/templates/2d-platformer/src/components.tssimilarity index 100%rename from desktop/templates/2d-platformer/src/components.tsrename to templates/2d-platformer/src/components.tsdiff --git a/desktop/templates/2d-platformer/src/main.ts b/templates/2d-platformer/src/main.tssimilarity index 100%rename from desktop/templates/2d-platformer/src/main.tsrename to templates/2d-platformer/src/main.tsdiff --git a/desktop/templates/2d-platformer/src/systems/coin.ts b/templates/2d-platformer/src/systems/coin.tssimilarity index 100%rename from desktop/templates/2d-platformer/src/systems/coin.tsrename to templates/2d-platformer/src/systems/coin.tsdiff --git a/desktop/templates/2d-platformer/src/systems/player.ts b/templates/2d-platformer/src/systems/player.tssimilarity index 100%rename from desktop/templates/2d-platformer/src/systems/player.tsrename to templates/2d-platformer/src/systems/player.tsdiff --git a/desktop/templates/2d-platformer/src/systems/score.ts b/templates/2d-platformer/src/systems/score.tssimilarity index 100%rename from desktop/templates/2d-platformer/src/systems/score.tsrename to templates/2d-platformer/src/systems/score.tsdiff --git a/desktop/templates/2d-platformer/tsconfig.json b/templates/2d-platformer/tsconfig.jsonsimilarity index 100%rename from desktop/templates/2d-platformer/tsconfig.jsonrename to templates/2d-platformer/tsconfig.jsondiff --git a/desktop/templates/3d-starter/assets/scenes/main.esscene b/templates/3d-starter/assets/scenes/main.esscenesimilarity index 100%rename from desktop/templates/3d-starter/assets/scenes/main.esscenerename to templates/3d-starter/assets/scenes/main.esscenediff --git a/desktop/templates/3d-starter/assets/scenes/main.esscene.meta b/templates/3d-starter/assets/scenes/main.esscene.metasimilarity index 100%rename from desktop/templates/3d-starter/assets/scenes/main.esscene.metarename to templates/3d-starter/assets/scenes/main.esscene.metadiff --git a/desktop/templates/3d-starter/project.esproject b/templates/3d-starter/project.esprojectsimilarity index 100%rename from desktop/templates/3d-starter/project.esprojectrename to templates/3d-starter/project.esprojectdiff --git a/desktop/templates/3d-starter/src/components.ts b/templates/3d-starter/src/components.tssimilarity index 100%rename from desktop/templates/3d-starter/src/components.tsrename to templates/3d-starter/src/components.tsdiff --git a/desktop/templates/3d-starter/src/main.ts b/templates/3d-starter/src/main.tssimilarity index 100%rename from desktop/templates/3d-starter/src/main.tsrename to templates/3d-starter/src/main.tsdiff --git a/desktop/templates/3d-starter/src/systems/camera.ts b/templates/3d-starter/src/systems/camera.tssimilarity index 100%rename from desktop/templates/3d-starter/src/systems/camera.tsrename to templates/3d-starter/src/systems/camera.tsdiff --git a/desktop/templates/3d-starter/src/systems/walk.ts b/templates/3d-starter/src/systems/walk.tssimilarity index 100%rename from desktop/templates/3d-starter/src/systems/walk.tsrename to templates/3d-starter/src/systems/walk.tsdiff --git a/desktop/templates/3d-starter/tsconfig.json b/templates/3d-starter/tsconfig.jsonsimilarity index 100%rename from desktop/templates/3d-starter/tsconfig.jsonrename to templates/3d-starter/tsconfig.jsondiff --git a/desktop/templates/blank/assets/scenes/main.esscene b/templates/blank/assets/scenes/main.esscenesimilarity index 100%rename from desktop/templates/blank/assets/scenes/main.esscenerename to templates/blank/assets/scenes/main.esscenediff --git a/desktop/templates/blank/assets/scenes/main.esscene.meta b/templates/blank/assets/scenes/main.esscene.metasimilarity index 100%rename from desktop/templates/blank/assets/scenes/main.esscene.metarename to templates/blank/assets/scenes/main.esscene.metadiff --git a/desktop/templates/blank/project.esproject b/templates/blank/project.esprojectsimilarity index 100%rename from desktop/templates/blank/project.esprojectrename to templates/blank/project.esprojectdiff --git a/desktop/templates/blank/src/components.ts b/templates/blank/src/components.tssimilarity index 100%rename from desktop/templates/blank/src/components.tsrename to templates/blank/src/components.tsdiff --git a/desktop/templates/blank/src/main.ts b/templates/blank/src/main.tssimilarity index 100%rename from desktop/templates/blank/src/main.tsrename to templates/blank/src/main.tsdiff --git a/desktop/templates/blank/tsconfig.json b/templates/blank/tsconfig.jsonsimilarity index 100%rename from desktop/templates/blank/tsconfig.jsonrename to templates/blank/tsconfig.jsondiff --git a/templates/package.json b/templates/package.jsondeleted file mode 100644index df3d4d2da..000000000--- a/templates/package.json+++ /dev/null@@ -1,17 +0,0 @@-{- "name": "{{PROJECT_NAME}}",- "version": "1.0.0",- "type": "module",- "scripts": {- "build": "npx esbuild src/main.ts --bundle --format=esm --outfile=build/js/main.js --sourcemap",- "dev": "npx esbuild src/main.ts --bundle --format=esm --outfile=build/js/main.js --sourcemap --watch",- "typecheck": "npx tsc --noEmit"- },- "dependencies": {- "esengine": "file:{{SDK_PATH}}"- },- "devDependencies": {- "esbuild": "^0.20.0",- "typescript": "^5.0.0"- }-}diff --git a/desktop/templates/pixel-rpg/assets/animations/walk-down.esanim b/templates/pixel-rpg/assets/animations/walk-down.esanimsimilarity index 100%rename from desktop/templates/pixel-rpg/assets/animations/walk-down.esanimrename to templates/pixel-rpg/assets/animations/walk-down.esanimdiff --git a/desktop/templates/pixel-rpg/assets/animations/walk-down.esanim.meta b/templates/pixel-rpg/assets/animations/walk-down.esanim.metasimilarity index 100%rename from desktop/templates/pixel-rpg/assets/animations/walk-down.esanim.metarename to templates/pixel-rpg/assets/animations/walk-down.esanim.metadiff --git a/desktop/templates/pixel-rpg/assets/animations/walk-left.esanim b/templates/pixel-rpg/assets/animations/walk-left.esanimsimilarity index 100%rename from desktop/templates/pixel-rpg/assets/animations/walk-left.esanimrename to templates/pixel-rpg/assets/animations/walk-left.esanimdiff --git a/desktop/templates/pixel-rpg/assets/animations/walk-left.esanim.meta b/templates/pixel-rpg/assets/animations/walk-left.esanim.metasimilarity index 100%rename from desktop/templates/pixel-rpg/assets/animations/walk-left.esanim.metarename to templates/pixel-rpg/assets/animations/walk-left.esanim.metadiff --git a/desktop/templates/pixel-rpg/assets/animations/walk-right.esanim b/templates/pixel-rpg/assets/animations/walk-right.esanimsimilarity index 100%rename from desktop/templates/pixel-rpg/assets/animations/walk-right.esanimrename to templates/pixel-rpg/assets/animations/walk-right.esanimdiff --git a/desktop/templates/pixel-rpg/assets/animations/walk-right.esanim.meta b/templates/pixel-rpg/assets/animations/walk-right.esanim.metasimilarity index 100%rename from desktop/templates/pixel-rpg/assets/animations/walk-right.esanim.metarename to templates/pixel-rpg/assets/animations/walk-right.esanim.metadiff --git a/desktop/templates/pixel-rpg/assets/animations/walk-up.esanim b/templates/pixel-rpg/assets/animations/walk-up.esanimsimilarity index 100%rename from desktop/templates/pixel-rpg/assets/animations/walk-up.esanimrename to templates/pixel-rpg/assets/animations/walk-up.esanimdiff --git a/desktop/templates/pixel-rpg/assets/animations/walk-up.esanim.meta b/templates/pixel-rpg/assets/animations/walk-up.esanim.metasimilarity index 100%rename from desktop/templates/pixel-rpg/assets/animations/walk-up.esanim.metarename to templates/pixel-rpg/assets/animations/walk-up.esanim.metadiff --git a/desktop/templates/pixel-rpg/assets/scenes/main.esscene b/templates/pixel-rpg/assets/scenes/main.esscenesimilarity index 100%rename from desktop/templates/pixel-rpg/assets/scenes/main.esscenerename to templates/pixel-rpg/assets/scenes/main.esscenediff --git a/desktop/templates/pixel-rpg/assets/scenes/main.esscene.meta b/templates/pixel-rpg/assets/scenes/main.esscene.metasimilarity index 100%rename from desktop/templates/pixel-rpg/assets/scenes/main.esscene.metarename to templates/pixel-rpg/assets/scenes/main.esscene.metadiff --git a/desktop/templates/pixel-rpg/assets/textures/hero.png b/templates/pixel-rpg/assets/textures/hero.pngsimilarity index 100%rename from desktop/templates/pixel-rpg/assets/textures/hero.pngrename to templates/pixel-rpg/assets/textures/hero.pngdiff --git a/desktop/templates/pixel-rpg/assets/textures/hero.png.meta b/templates/pixel-rpg/assets/textures/hero.png.metasimilarity index 100%rename from desktop/templates/pixel-rpg/assets/textures/hero.png.metarename to templates/pixel-rpg/assets/textures/hero.png.metadiff --git a/desktop/templates/pixel-rpg/assets/textures/tiles.png b/templates/pixel-rpg/assets/textures/tiles.pngsimilarity index 100%rename from desktop/templates/pixel-rpg/assets/textures/tiles.pngrename to templates/pixel-rpg/assets/textures/tiles.pngdiff --git a/desktop/templates/pixel-rpg/assets/textures/tiles.png.meta b/templates/pixel-rpg/assets/textures/tiles.png.metasimilarity index 100%rename from desktop/templates/pixel-rpg/assets/textures/tiles.png.metarename to templates/pixel-rpg/assets/textures/tiles.png.metadiff --git a/desktop/templates/pixel-rpg/assets/tilesets/world.estileset b/templates/pixel-rpg/assets/tilesets/world.estilesetsimilarity index 100%rename from desktop/templates/pixel-rpg/assets/tilesets/world.estilesetrename to templates/pixel-rpg/assets/tilesets/world.estilesetdiff --git a/desktop/templates/pixel-rpg/assets/tilesets/world.estileset.meta b/templates/pixel-rpg/assets/tilesets/world.estileset.metasimilarity index 100%rename from desktop/templates/pixel-rpg/assets/tilesets/world.estileset.metarename to templates/pixel-rpg/assets/tilesets/world.estileset.metadiff --git a/desktop/templates/pixel-rpg/project.esproject b/templates/pixel-rpg/project.esprojectsimilarity index 100%rename from desktop/templates/pixel-rpg/project.esprojectrename to templates/pixel-rpg/project.esprojectdiff --git a/desktop/templates/pixel-rpg/src/components.ts b/templates/pixel-rpg/src/components.tssimilarity index 100%rename from desktop/templates/pixel-rpg/src/components.tsrename to templates/pixel-rpg/src/components.tsdiff --git a/desktop/templates/pixel-rpg/src/main.ts b/templates/pixel-rpg/src/main.tssimilarity index 100%rename from desktop/templates/pixel-rpg/src/main.tsrename to templates/pixel-rpg/src/main.tsdiff --git a/desktop/templates/pixel-rpg/src/systems/follow.ts b/templates/pixel-rpg/src/systems/follow.tssimilarity index 100%rename from desktop/templates/pixel-rpg/src/systems/follow.tsrename to templates/pixel-rpg/src/systems/follow.tsdiff --git a/desktop/templates/pixel-rpg/src/systems/move.ts b/templates/pixel-rpg/src/systems/move.tssimilarity index 100%rename from desktop/templates/pixel-rpg/src/systems/move.tsrename to templates/pixel-rpg/src/systems/move.tsdiff --git a/desktop/templates/pixel-rpg/src/systems/talk.ts b/templates/pixel-rpg/src/systems/talk.tssimilarity index 100%rename from desktop/templates/pixel-rpg/src/systems/talk.tsrename to templates/pixel-rpg/src/systems/talk.tsdiff --git a/desktop/templates/pixel-rpg/tsconfig.json b/templates/pixel-rpg/tsconfig.jsonsimilarity index 100%rename from desktop/templates/pixel-rpg/tsconfig.jsonrename to templates/pixel-rpg/tsconfig.jsondiff --git a/desktop/templates/playable-ad/assets/scenes/main.esscene b/templates/playable-ad/assets/scenes/main.esscenesimilarity index 100%rename from desktop/templates/playable-ad/assets/scenes/main.esscenerename to templates/playable-ad/assets/scenes/main.esscenediff --git a/desktop/templates/playable-ad/assets/scenes/main.esscene.meta b/templates/playable-ad/assets/scenes/main.esscene.metasimilarity index 100%rename from desktop/templates/playable-ad/assets/scenes/main.esscene.metarename to templates/playable-ad/assets/scenes/main.esscene.metadiff --git a/desktop/templates/playable-ad/project.esproject b/templates/playable-ad/project.esprojectsimilarity index 100%rename from desktop/templates/playable-ad/project.esprojectrename to templates/playable-ad/project.esprojectdiff --git a/desktop/templates/playable-ad/src/components.ts b/templates/playable-ad/src/components.tssimilarity index 100%rename from desktop/templates/playable-ad/src/components.tsrename to templates/playable-ad/src/components.tsdiff --git a/desktop/templates/playable-ad/src/main.ts b/templates/playable-ad/src/main.tssimilarity index 100%rename from desktop/templates/playable-ad/src/main.tsrename to templates/playable-ad/src/main.tsdiff --git a/desktop/templates/playable-ad/tsconfig.json b/templates/playable-ad/tsconfig.jsonsimilarity index 100%rename from desktop/templates/playable-ad/tsconfig.jsonrename to templates/playable-ad/tsconfig.jsondiff --git a/templates/src/main.ts b/templates/src/main.tsdeleted file mode 100644index bdaa513d1..000000000--- a/templates/src/main.ts+++ /dev/null@@ -1,98 +0,0 @@-/**- * ESEngine Project Entry Point- *- * This file is the main entry point for your game logic.- * Press F5 in the editor to run, or use Web Preview for browser testing.- */-import {- type ESEngineModule,- App,- createWebApp,- defineSystem,- Schedule,- Commands,- Transform,- Sprite,- Camera,- Canvas,- Res,- Time,- Query,- Mut,- type Entity-} from 'esengine';--// =============================================================================-// Main Entry Point-// =============================================================================--export async function main(Module: ESEngineModule): Promise<void> {- console.log('ESEngine starting...');-- // Create the app with WASM module (handles renderer init + render loop)- const app = createWebApp(Module);-- // Add startup system - runs once at beginning- app.addSystemToSchedule(Schedule.Startup, defineSystem(- [Commands()],- (cmds) => {- console.log('Startup: Creating entities...');-- // Create camera- const camera = cmds.spawn()- .insert(Camera, {- projectionType: 1, // Orthographic- fov: 60,- orthoSize: 400,- nearPlane: 0.1,- farPlane: 1000,- aspectRatio: 1,- isActive: true,- priority: 0- })- .insert(Transform, {- position: { x: 0, y: 0, z: 10 },- rotation: { w: 1, x: 0, y: 0, z: 0 },- scale: { x: 1, y: 1, z: 1 }- })- .id();-- // Create a test sprite- const sprite = cmds.spawn()- .insert(Sprite, {- texture: 0,- color: { r: 1, g: 0.5, b: 0.2, a: 1 },- size: { x: 100, y: 100 },- uvOffset: { x: 0, y: 0 },- uvScale: { x: 1, y: 1 },- layer: 0,- flipX: false,- flipY: false- })- .insert(Transform, {- position: { x: 0, y: 0, z: 0 },- rotation: { w: 1, x: 0, y: 0, z: 0 },- scale: { x: 1, y: 1, z: 1 }- })- .id();-- console.log(`Created camera: ${camera}, sprite: ${sprite}`);- }- ));-- // Add update system - runs every frame- app.addSystemToSchedule(Schedule.Update, defineSystem(- [Res(Time), Query(Transform, Sprite)],- (time, query) => {- for (const [entity, transform, sprite] of query) {- // Move the sprite in a circle- transform.position.x = Math.sin(time.elapsed) * 100;- transform.position.y = Math.cos(time.elapsed) * 100;- }- }- ));-- // Start the game loop- console.log('Starting game loop...');- app.run();-}diff --git a/desktop/templates/top-down/assets/scenes/main.esscene b/templates/top-down/assets/scenes/main.esscenesimilarity index 100%rename from desktop/templates/top-down/assets/scenes/main.esscenerename to templates/top-down/assets/scenes/main.esscenediff --git a/desktop/templates/top-down/assets/scenes/main.esscene.meta b/templates/top-down/assets/scenes/main.esscene.metasimilarity index 100%rename from desktop/templates/top-down/assets/scenes/main.esscene.metarename to templates/top-down/assets/scenes/main.esscene.metadiff --git a/desktop/templates/top-down/assets/textures/player.png b/templates/top-down/assets/textures/player.pngsimilarity index 100%rename from desktop/templates/top-down/assets/textures/player.pngrename to templates/top-down/assets/textures/player.pngdiff --git a/desktop/templates/top-down/assets/textures/player.png.meta b/templates/top-down/assets/textures/player.png.metasimilarity index 100%rename from desktop/templates/top-down/assets/textures/player.png.metarename to templates/top-down/assets/textures/player.png.metadiff --git a/desktop/templates/top-down/project.esproject b/templates/top-down/project.esprojectsimilarity index 100%rename from desktop/templates/top-down/project.esprojectrename to templates/top-down/project.esprojectdiff --git a/desktop/templates/top-down/src/components.ts b/templates/top-down/src/components.tssimilarity index 100%rename from desktop/templates/top-down/src/components.tsrename to templates/top-down/src/components.tsdiff --git a/desktop/templates/top-down/src/main.ts b/templates/top-down/src/main.tssimilarity index 100%rename from desktop/templates/top-down/src/main.tsrename to templates/top-down/src/main.tsdiff --git a/desktop/templates/top-down/src/systems/follow.ts b/templates/top-down/src/systems/follow.tssimilarity index 100%rename from desktop/templates/top-down/src/systems/follow.tsrename to templates/top-down/src/systems/follow.tsdiff --git a/desktop/templates/top-down/src/systems/move.ts b/templates/top-down/src/systems/move.tssimilarity index 100%rename from desktop/templates/top-down/src/systems/move.tsrename to templates/top-down/src/systems/move.tsdiff --git a/desktop/templates/top-down/tsconfig.json b/templates/top-down/tsconfig.jsonsimilarity index 100%rename from desktop/templates/top-down/tsconfig.jsonrename to templates/top-down/tsconfig.jsondiff --git a/templates/tsconfig.json b/templates/tsconfig.jsondeleted file mode 100644index 84d188ba9..000000000--- a/templates/tsconfig.json+++ /dev/null@@ -1,15 +0,0 @@-{- "compilerOptions": {- "target": "ES2020",- "module": "ESNext",- "lib": ["ES2020", "DOM"],- "moduleResolution": "node",- "strict": true,- "esModuleInterop": true,- "skipLibCheck": true,- "forceConsistentCasingInFileNames": true,- "noEmit": true- },- "include": ["src/**/*.ts"],- "exclude": ["node_modules", "build"]-}diff --git a/desktop/templates/ui-game/assets/scenes/main.esscene b/templates/ui-game/assets/scenes/main.esscenesimilarity index 100%rename from desktop/templates/ui-game/assets/scenes/main.esscenerename to templates/ui-game/assets/scenes/main.esscenediff --git a/desktop/templates/ui-game/assets/scenes/main.esscene.meta b/templates/ui-game/assets/scenes/main.esscene.metasimilarity index 100%rename from desktop/templates/ui-game/assets/scenes/main.esscene.metarename to templates/ui-game/assets/scenes/main.esscene.metadiff --git a/desktop/templates/ui-game/project.esproject b/templates/ui-game/project.esprojectsimilarity index 100%rename from desktop/templates/ui-game/project.esprojectrename to templates/ui-game/project.esprojectdiff --git a/desktop/templates/ui-game/src/components.ts b/templates/ui-game/src/components.tssimilarity index 100%rename from desktop/templates/ui-game/src/components.tsrename to templates/ui-game/src/components.tsdiff --git a/desktop/templates/ui-game/src/main.ts b/templates/ui-game/src/main.tssimilarity index 100%rename from desktop/templates/ui-game/src/main.tsrename to templates/ui-game/src/main.tsdiff --git a/desktop/templates/ui-game/src/systems/hud.ts b/templates/ui-game/src/systems/hud.tssimilarity index 100%rename from desktop/templates/ui-game/src/systems/hud.tsrename to templates/ui-game/src/systems/hud.tsdiff --git a/desktop/templates/ui-game/src/systems/round.ts b/templates/ui-game/src/systems/round.tssimilarity index 100%rename from desktop/templates/ui-game/src/systems/round.tsrename to templates/ui-game/src/systems/round.tsdiff --git a/desktop/templates/ui-game/tsconfig.json b/templates/ui-game/tsconfig.jsonsimilarity index 100%rename from desktop/templates/ui-game/tsconfig.jsonrename to templates/ui-game/tsconfig.jsondiff --git a/templates/web/index.html b/templates/web/index.htmldeleted file mode 100644index 636164a6e..000000000--- a/templates/web/index.html+++ /dev/null@@ -1,83 +0,0 @@-<!DOCTYPE html>-<html lang="en">-<head>- <meta charset="UTF-8">- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">- <title>{{PROJECT_NAME}}</title>- <style>- * { margin: 0; padding: 0; box-sizing: border-box; }- html, body {- width: 100%;- height: 100%;- overflow: hidden;- background-color: #1a1a1a;- }- #canvas {- display: block;- width: 100%;- height: 100%;- touch-action: none;- }- #loading {- position: absolute;- top: 50%;- left: 50%;- transform: translate(-50%, -50%);- color: #fff;- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;- font-size: 16px;- text-align: center;- }- #loading.hidden { display: none; }- .spinner {- width: 40px;- height: 40px;- margin: 0 auto 16px;- border: 3px solid #333;- border-top-color: #3b82f6;- border-radius: 50%;- animation: spin 1s linear infinite;- }- @keyframes spin { to { transform: rotate(360deg); } }- </style>-</head>-<body>- <div id="loading">- <div class="spinner"></div>- <div>Loading...</div>- </div>- <canvas id="canvas"></canvas>-- <script type="module">- const v = Date.now();- const { default: ESEngineModule } = await import(`./esengine.js?v=${v}`);- const { main } = await import(`./scripts/main.js?v=${v}`);-- function resizeCanvas() {- const canvas = document.getElementById('canvas');- const dpr = window.devicePixelRatio || 1;- canvas.width = window.innerWidth * dpr;- canvas.height = window.innerHeight * dpr;- }- window.addEventListener('resize', resizeCanvas);- resizeCanvas();-- ESEngineModule({- canvas: document.getElementById('canvas'),- print: (text) => console.log(text),- printErr: (text) => console.error(text)- }).then(async (Module) => {- console.log('ESEngine loaded');- document.getElementById('loading').classList.add('hidden');- await main(Module);- }).catch((err) => {- if (err === 'unwind' || (err.message && err.message.includes('unwind'))) {- console.log('App running');- return;- }- console.error('Failed:', err);- document.getElementById('loading').innerHTML = '<div style="color:#f87171">Error: ' + err.message + '</div>';- });- </script>-</body>-</html>diff --git a/desktop/templates/wechat-minigame/assets/scenes/main.esscene b/templates/wechat-minigame/assets/scenes/main.esscenesimilarity index 100%rename from desktop/templates/wechat-minigame/assets/scenes/main.esscenerename to templates/wechat-minigame/assets/scenes/main.esscenediff --git a/desktop/templates/wechat-minigame/assets/scenes/main.esscene.meta b/templates/wechat-minigame/assets/scenes/main.esscene.metasimilarity index 100%rename from desktop/templates/wechat-minigame/assets/scenes/main.esscene.metarename to templates/wechat-minigame/assets/scenes/main.esscene.metadiff --git a/desktop/templates/wechat-minigame/project.esproject b/templates/wechat-minigame/project.esprojectsimilarity index 100%rename from desktop/templates/wechat-minigame/project.esprojectrename to templates/wechat-minigame/project.esprojectdiff --git a/desktop/templates/wechat-minigame/src/components.ts b/templates/wechat-minigame/src/components.tssimilarity index 100%rename from desktop/templates/wechat-minigame/src/components.tsrename to templates/wechat-minigame/src/components.tsdiff --git a/desktop/templates/wechat-minigame/src/main.ts b/templates/wechat-minigame/src/main.tssimilarity index 100%rename from desktop/templates/wechat-minigame/src/main.tsrename to templates/wechat-minigame/src/main.tsdiff --git a/desktop/templates/wechat-minigame/tsconfig.json b/templates/wechat-minigame/tsconfig.jsonsimilarity index 100%rename from desktop/templates/wechat-minigame/tsconfig.jsonrename to templates/wechat-minigame/tsconfig.json