Phaser is a client-side 2D game engine/framework distributed as a JavaScript library. In production it provides the runtime systems game developers assemble into browser games: scene lifecycle management, game-object factories and component mixins, display lists, input processing (pointer/touch/keyboard/gamepad), asset loading/caching, tweens, animation state machines, tilemap parsing/rendering, Arcade and Matter.js physics, audio, and a dual Canvas/WebGL rendering pipeline. The engine is event-driven: core, scene, camera, physics, loader, and sound subsystems communicate through named event constants, and game objects expose component-based behavior via mixed-in plain objects. Entry points include src/phaser.js (UMD bundle), src/phaser-esm.js (ESM), src/phaser-arcade-physics.js, and src/phaser-no-physics.js build variants; package.json exposes the main library and TypeScript declarations. Architecture is modular CommonJS with heavy JSDoc. The main data flow: developer configures Phaser.Game; Config boots core systems, SceneManager instantiates scenes and injects plugins; scenes create GameObjects through factory/creator registries; game objects are added to DisplayList/UpdateList; each frame TimeStep emits STEP, camera systems transform, renderers submit object batches to WebGL drawing contexts or Canvas contexts; loader uses XHR/fetch in browser to populate texture/audio/cache managers. Runtime dependency is minimal (eventemitter3); WebGL, Canvas, WebAudio, and device APIs are browser-native; Matter.js is vendored inside src/physics/matter-js. There is no data/research content; type definitions and constants are not analytical models. The codebase is large but well-modularized: many small single-purpose utility modules (math, geometry, color, arrays) are safely reusable outside Phaser. The most notable reusable pieces are polygon triangulation, the R-tree spatial index, and seeded RNG. Maintenance is active; however the repository carries legacy API vestiges (e.g. deprecated aliases, vendor-prefixed browser checks, mixed Jasmine/Vitest test conventions) and a renderer transition from older Canvas batching to the newer WebGL render-node pipeline, so technical drift is moderate despite recent commits.
ppy/osu-framework is a high-performance, cross-platform game framework written in C#, primarily designed to power the rhythm game osu! but offering general-purpose 2D game development capabilities. The codebase provides a comprehensive suite of subsystems including a hardware-accelerated rendering pipeline (OpenGL/Veldrid), a sophisticated input handling system (mouse, keyboard, touch, tablet, joystick, MIDI), an audio engine built on BASS and FFmpeg, a rich animation and layout system, and a full-featured UI toolkit with containers, text rendering, and interactive controls. It employs Roslyn source generators to eliminate runtime reflection for dependency injection and input dispatch. The architecture is modular, heavily test-driven (thousands of unit and visual tests), and supports Windows, macOS, Linux, iOS, and Android through platform-specific host implementations. Despite its strong engineering, the codebase shows signs of ongoing migration to SDL3, dual rendering backends, and reliance on unmanaged native libraries that require periodic updates.
ggez is a lightweight, cross-platform 2D game framework for Rust, inspired by LÖVE. It provides a comprehensive set of subsystems for graphics, audio, input, filesystem, and timer management, all accessible through a central `Context` object. The framework abstracts over `winit` for windowing and events, `wgpu` for GPU rendering, `rodio` for audio playback, and `gilrs` for gamepad support. The architecture is modular, using sub-contexts (e.g., `GraphicsContext`, `AudioContext`) that can be individually accessed via `Has`/`HasMut` traits, allowing for custom context composition. The graphics pipeline supports 2D and optional 3D rendering (behind a feature flag) with shaders, meshes, images, instanced drawing, and text rendering via `glyph_brush`. The filesystem uses a virtual filesystem (VFS) layer with physical directories and zip archives, and configuration is handled via TOML serialization. Key entry points include `ContextBuilder` for initialization, `EventHandler` trait for the game loop (with `update`, `draw`, and input callbacks), and the `event::run()` function to start the application. Data flows are event-driven: user input is collected by `winit` and forwarded to the event handler, while rendering commands are batched and submitted to the GPU each frame. The framework also includes built-in coroutines for asynchronous tasks without futures. The repository contains over 40 examples demonstrating all major features, from simple drawing to complex 3D scenes and shader effects. ggez is actively maintained with a stable API, though some parts (e.g., 3D support, coroutine implementation) are less mature. The codebase demonstrates good engineering practices: builder patterns, resource caching, buffer sub-allocation, and a clear separation of concerns. It is suitable for hobby game development, educational projects, and rapid prototyping. The heavy reliance on evolving crates like `wgpu` and `winit` introduces some technical drift, but the framework keeps pace with updates.