Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How I Cleaned Up Limn Engine's Global Variables (and Fixed Two Bugs Along the Way)

说明与用途

将 Limn Engine 的全局变量迁移到单一命名空间 TCJSgameVariable,消除了冲突,修复了重启后地图破坏的错误,并解决了非默认场景中粒子不可见的问题。

问题

Limn Engine used six global variables that caused collisions with game scripts, leading to rendering failures and hidden bugs.

结果

The refactor eliminated global variable collisions, fixed tile corruption after restarts, and resolved invisible particles on non‑default scenes, making the engine safer for community games.

工作流

  • Create TCJSgameVariable object and move globals into it
  • Update all internal references to use TCJSgameVariable properties
  • Fix TileMap constructor to avoid mutating caller’s map array
  • Correct ParticleSystem to add particles to the correct scene
  • Simplify sound system by removing broken clone-on-overlap path

证据

Six globals, all sitting directly in the window's scope. Any script loaded on the same page could read them, overwrite them, or shadow them by accident.

来源

We created TCJSgameVariable as the home for every internal engine value.

来源

Fix a bug in TileMap that corrupted the level data after restart.

来源

  • 记录日期: 2026-10-03T05:41:00.510Z