Isle-Slingers/js/physics/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

72 lines
2.6 KiB
JavaScript

/* ISLE SLINGERS -- physics/index.js (module: physics -- aggregator / public API)
* Modularization pass. This is the THIN AGGREGATOR for the physics
* module. The original js/core.js monolith is now split into submodules
* (physics/constants, -/state, -/aim, -/abilities, -/damage, -/step,
* -/collision, -/rules, -/camera); each installs its units into ONE shared
* scope `P`, preserving the monolith's single-closure semantics exactly.
*
* Load contract:
* browser -- every physics/<unit>/index.js <script> must load BEFORE this
* file (it reads the ordered parts off globalThis.ISLE_PHYSICS_PARTS);
* node -- this file requires the submodules in dependency order itself.
*
* Public API (ISLE_CORE) is key-for-key identical to the pre-modularization
* core.js return object -- same 20 keys, same values. No DOM, deterministic.
*/
(function (root, factory) {
var api = factory();
if (typeof module !== 'undefined' && module.exports) module.exports = api;
else root.ISLE_CORE = api;
})(typeof globalThis !== 'undefined' ? globalThis : this, function () {
'use strict';
var P = {}; // the single shared physics scope (== the old monolith closure)
var parts;
if (typeof module !== 'undefined' && module.exports) {
// Node: load submodules in dependency order (constants first, camera last)
parts = [
require('./constants/index.js'),
require('./state/index.js'),
require('./aim/index.js'),
require('./abilities/index.js'),
require('./damage/index.js'),
require('./step/index.js'),
require('./collision/index.js'),
require('./topple/index.js'),
require('./rules/index.js'),
require('./camera/index.js')
];
} else {
// browser: submodules already pushed their installers, in <script> order
parts = (typeof globalThis !== 'undefined' && globalThis.ISLE_PHYSICS_PARTS) || [];
}
for (var i = 0; i < parts.length; i++) parts[i](P);
// ------------------------------------------------------------------ API
// (kept key-for-key identical to the pre-S-2 core.js public surface)
return {
WORLD: P.WORLD,
VIEW: P.VIEW,
MATERIALS: P.MATERIALS,
BIRD_TYPES: P.BIRD_TYPES,
ENEMY_TYPES: P.ENEMY_TYPES,
GRAVITY: P.GRAVITY,
MAX_PULL: P.MAX_PULL,
MIN_PULL: P.MIN_PULL,
LAUNCH_POWER: P.LAUNCH_POWER,
BIRD_BONUS: P.BIRD_BONUS,
createGame: P.createGame,
activeBird: P.activeBird,
aimVector: P.aimVector,
trajectory: P.trajectory,
launch: P.launch,
triggerAbility: P.triggerAbility,
step: P.step,
starsFor: P.starsFor,
birdsRemaining: P.birdsRemaining,
AIR_DRAG: P.AIR_DRAG
};
});