Files
org_web/assets/scripts/pages/princess-lima-maps.js
gitea-actions 15b626ee0d
All checks were successful
Build Org Website / build (push) Successful in 38s
Rebuild Princess Lima maps around the new visual atlas
2026-07-30 12:48:17 +01:00

39 lines
1.0 KiB
JavaScript

(function (root) {
"use strict";
const Data = root.PrincessLimaData;
const REGION_FRAME = Object.freeze({
village: 0,
forest: 1,
ruins: 2,
mountain: 3,
camp: 4,
fortressExterior: 5,
fortressInterior: 6,
bossArena: 7,
chamber: 8
});
/*
* The generated atlas is the finished map artwork, not a texture reference.
* Keep it square and opaque. Collision is supplied separately by the region
* data so production rendering never paints debug geometry over the image.
*/
function render(scene, regionId) {
return scene.add.image(
Data.WIDTH / 2,
Data.HEIGHT / 2,
"lima-region-atlas",
REGION_FRAME[regionId]
)
.setDisplaySize(Data.WIDTH, Data.HEIGHT)
.setOrigin(0.5)
.setAlpha(1)
.setDepth(0);
}
const api = Object.freeze({ REGION_FRAME, render });
if (typeof module === "object" && module.exports) module.exports = api;
root.PrincessLimaMaps = api;
}(typeof globalThis !== "undefined" ? globalThis : this));