39 lines
1.0 KiB
JavaScript
Executable File
39 lines
1.0 KiB
JavaScript
Executable File
(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));
|