How jgefroh/core-light works
Main Components
• Bootstrap Layer
– main.js (entry point)
– game/title/start-game.js (Core initialization & system registration)
• Core Engine (core-js)
– Entity Manager (entity.js)
– Component Registry (component.js)
– System Scheduler (system.js)
– Tag Registry (tag.js)
– Core Loop (core.js)
• Generic Engine Systems (/game/engine)
– Rendering (canvas-renderer, webgl2-renderer, render-system)
– Input (input-system)
– Audio (audio-system)
– Collision (collision-system)
– Movement (movement-proposal & finalization systems)
– AI (ai-system)
– Lighting (light-system, shadow-system)
– Particles (particle-system)
– GUI (gui-system)
– Other subsystems: hitscan, attachments, timer, tracker
• Game Features (/game/features)
– AI feature implementations (goals, tactics, steps, state informer)
– Weapons (firing, reload, recoil, effects)
– FX (death-fx, impact-fx, footstep-fx)
– Map & Enemy generation
– Player control (movement, weapon, flashlight)
– Game logic (game-over, instructions, laser-aim, turn-towards-cursor)
• Configuration & Specifics (/game/specifics)
– Asset loader & manifest
– Collision/input configuration systems
– Debug systems
– Map warehouse
• Static Assets (/static/assets)
– Audio files
– Image/sprite data
• Utilities & Tracker
– Mouse-tracker component/system
Relationships & Data Flow
• main.js → start-game.js: instantiate Core, register engine & feature systems, load assets
• Core Loop (core-js) orchestrates:
– Each frame: run Input → AI → Movement → Collision → Gameplay Features → Rendering → Audio
• AssetLoaderSystem pulls from static/assets into in-memory resources used by renderer & audio-system
• Configuration systems run early to set up collision bounds, input mappings, and debug flags
• Feature systems subscribe to component/tag events provided by engine systems
Architectural Patterns
• ECS (Entity–Component–System) at heart
• Modular system registration (engine vs. feature vs. config vs. debug)
• Separation of concerns:
– Core engine is independent of game logic
– Feature implementations only add/remove components or react to tags
• Data-driven asset configuration
Technologies & Frameworks
• Pure JavaScript
• HTML5 Canvas & WebGL2 renderers
• Custom ECS framework (core-js)
• npm & webpack (webpack.config.js)