hhmm
This commit is contained in:
parent
434f07cc4e
commit
16074232aa
40 changed files with 1509 additions and 732 deletions
17
js/main.js
17
js/main.js
|
|
@ -1,4 +1,20 @@
|
|||
"use strict";
|
||||
|
||||
function ensureWorldBootstrap() {
|
||||
let currentWorld = globalThis.world;
|
||||
if (currentWorld?.update) return currentWorld;
|
||||
try {
|
||||
currentWorld = new World();
|
||||
if (typeof window !== "undefined") window.world = currentWorld;
|
||||
if (typeof globalThis !== "undefined") globalThis.world = currentWorld;
|
||||
return currentWorld;
|
||||
} catch (error) {
|
||||
if (typeof window !== "undefined") window.__worldInitError = error?.stack || String(error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
let world = ensureWorldBootstrap();
|
||||
let last = nowSec();
|
||||
let statsTimer = 0;
|
||||
let fpsTimer = 0;
|
||||
|
|
@ -114,6 +130,7 @@ loadImages(null, (done, total) => {
|
|||
setLoadingProgress("\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u69cb\u7bc9\u4e2d", 0.72);
|
||||
applyFieldLayout("garden");
|
||||
world.reset(null, "garden");
|
||||
window.bindGroundUI?.(world);
|
||||
selectTool("observe");
|
||||
setLoadingProgress("\u8868\u793a\u3092\u521d\u671f\u5316\u4e2d", 0.84);
|
||||
renderLog(world.logs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue