Isle-Slingers/js/levels/index.js
Relay dff5dd5b30 Clean release scrub: remove internal fleet references
Removes internal process references so the repo is presentable to an
outside audience: dropped the internal build-retrospective doc
(process log with internal terms, not useful to an outside reader),
and reworded remaining internal references in code comments and
module docs (agents.md cards, architecture.md, MODULES.md,
index.html, package.json) to generic descriptions of what changed
and when, with no behavior change -- full 47/47 suite re-run green
after the scrub, every edit verified comment/doc-only via diff.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 14:36:52 +00:00

44 lines
1.7 KiB
JavaScript

/* ISLE SLINGERS -- levels/index.js (module: levels -- aggregator / public API)
* Modularization pass. The original js/levels.js monolith is now:
* levels/helpers/ - block/enemy constructors + SLING anchor (shared scope L)
* levels/data/level-N.js - one level definition each (uses the shared scope)
* This aggregator loads the parts in order, builds the LEVELS array, and
* exposes the byte-identical public API: { LEVELS, SLING }.
*
* Load contract:
* browser - levels/helpers/index.js first, then data/level-1..5.js, then this file
* (parts arrive on globalThis.ISLE_LEVEL_PARTS in <script> order);
* node - this file requires the parts itself, in the same order.
*/
(function (root, factory) {
var api = factory();
if (typeof module !== 'undefined' && module.exports) module.exports = api;
else root.ISLE_LEVELS = api;
})(typeof globalThis !== 'undefined' ? globalThis : this, function () {
'use strict';
var L = {}; // the single shared levels scope
var parts;
if (typeof module !== 'undefined' && module.exports) {
parts = [
require('./helpers/index.js'),
require('./data/level-1.js'),
require('./data/level-2.js'),
require('./data/level-3.js'),
require('./data/level-4.js'),
require('./data/level-5.js')
];
} else {
parts = (typeof globalThis !== 'undefined' && globalThis.ISLE_LEVEL_PARTS) || [];
}
var LEVELS = [];
for (var i = 0; i < parts.length; i++) {
var part = parts[i](L);
if (part && part.id) LEVELS.push(part); // level data parts carry an `id`
}
if (!LEVELS.length) throw new Error('ISLE_LEVELS: no level parts loaded before the aggregator');
return { LEVELS: LEVELS, SLING: L.SLING };
});