Public API

Headless systems, optional adapters.

Import every public type from src/index.js during development or from release/littleenvironment.min.js in a browser.

AreaExportsPurpose
EventsEnvironmentEventBus, EnvironmentEventsStable listener registration and canonical lifecycle names.
TimeCalendarEngine, CelestialClockContinuous normalised time, 24-hour conversion, solar and lunar vectors, seasons, years, and persistence.
LightingAmbientColorGradient, LightSource, LightingCompositorCyclic palette evaluation, deterministic harmonic flicker, viewport culling, and opt-in Canvas compositing.
WeatherClimateMatrix, PrecipitationParticle, WeatherSystemBiome-weighted weather selection, interpolated climate values, and particles recycled within active bounds.
SurvivalHeatSource, ThermodynamicModel, SurvivalVitalManagerRadiant heat, conduction, vital depletion, stamina recovery, submersion, and threshold conditions.
CombatModifierType, StatModifier, Attribute, DamagePayload, CombatResolverDirty-cached modifier values, criticals, armour or elemental mitigation, shields, true damage, and receipts.
EffectsStackPolicy, StatusEffect, StatusEffectManagerRefresh, intensity, duration, and independent effects with drift-free ticks and targeted dispels.
ProgressionExperienceCurve, CharacterProgressionExponential or polynomial requirements, level ceilings, overflow rollover, stat growth, and perk points.
PersistenceSchemaMigrator, EnvironmentSerialiserVersioned compact JSON and contiguous forward migrations.

Typical integration

import { CelestialClock, WeatherSystem } from './release/littleenvironment.min.js';

const clock = new CelestialClock({ dayDurationSeconds: 900 });
const weather = new WeatherSystem();

export function update(deltaSeconds, cameraBounds) {
  clock.update(deltaSeconds);
  return weather.update(deltaSeconds, cameraBounds).climate;
}