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