nivanov/cosplay
52.1
Adequate · 20 September 2026
38.8k
lines of production code
Scala
primary language
1
measurement over time
What this system is
Cosplay is a Scala-based ASCII game engine that provides a framework for building terminal-based games and interactive UIs. It features a comprehensive sprite system with declarative layout capabilities, extensive visual effects via shaders and particle emitters, and built-in examples including classic games like Pong, Snake, and Flappy Bird. The system supports rich media handling with audio-reactive effects, markup-based text styling, and a library of prefabricated ASCII assets.
Features
Add ASCII Macarena game
Users can now play the built-in ASCII Macarena game, where five stick figures dance to music and are controlled by pressing number keys 1–5 on the keyboard. The game includes a beat-synced title screen, background music, and an exit option via the 'Q' key.
modules/cosplay/src/main/scala/org/cosplay/games/macarena · high confidence
Added ASCII remake of Flappy Bird game
The Cosplay engine now includes a built-in ASCII remake of the classic 'Flappy Bird' game. This new feature adds a title scene with animated shaders and background audio, as well as the core gameplay scene, allowing users to launch and play the game via the provided entry point.
modules/cosplay/src/main/scala/org/cosplay/games/bird · high confidence
Added built-in game assets and documentation
The built-in games section now includes a shared color palette (CPColorPalette) that randomly selects from nine predefined color schemes for use across games, along with a README file providing an overview of the built-in games and links to documentation and support resources.
modules/cosplay/src/main/scala/org/cosplay/games · high confidence
Added classic ASCII Snake game
The Cosplay engine now includes a built-in classic Snake game, accessible via the \modules/cosplay/src/main/scala/org/cosplay/games/snake\ module. This addition introduces a complete gameplay experience featuring a title scene with animated shaders (star streaks, fade-in/out, and shimmer effects), a main play scene with score tracking, collision detection, and particle effects, and audio controls. Users can launch the game directly using Maven (\mvn -f modules/cosplay -P snake exec:java\) or SBT to play the retro-style ASCII game.
modules/cosplay/src/main/scala/org/cosplay/games/snake · high confidence
Added dialog example and support utilities
The \modules/cosplay/examples/dialog\ area now includes a runnable example (\CPDialogExample\) and a helper object (\CPDialogSupport\) that demonstrates built-in modal dialog functionality. The example initializes a scene that immediately presents a Yes/No confirmation, which can lead to a Login dialog (with username and password fields) or a final confirmation message, providing a concrete reference for integrating these UI components into games.
modules/cosplay/src/main/scala/org/cosplay/examples/dialog · high confidence
Added slide shader demo and updated shader example code
The shader examples directory now includes a new CPSlideShaderExample that demonstrates slide-in and slide-out shader effects using CPSlideInShader and CPSlideOutShader. The existing CPShaderExample has been updated to use the new CPArrayImage constructor syntax, modernized keyboard input handling (supporting both lowercase and uppercase 'Q' to exit), and replaced the static logo scene with a CPFadeShimmerLogoScene for the startup animation. A README.md file was also added to provide build and run instructions for these examples.
modules/cosplay/src/main/scala/org/cosplay/examples/shader · high confidence
Expanded library of prefabricated ASCII art images
The \modules/cosplay/src/main/scala/org/cosplay/prefabs/images\ package now includes a wide range of new prefabricated ASCII art images, such as an arrow, astronauts, a bed, cactus, calculator, capsule, car, cloud, crown, cubes, dolphin, flamingo, Game Boy, gingerbread man, grim reaper, ice cream, knife, lander, moons, mouse, and rocket. These new assets are available as \CPArrayImage\ objects for use within the game engine.
modules/cosplay/src/main/scala/org/cosplay/prefabs/images · high confidence
New UI framework sprites and layout example
Added several new sprite classes to support a basic UI framework: CPBubbleSprite for moving/fading image effects, CPCenteredImageSprite for automatic canvas centering, CPDynamicSprite as an abstract base for positionable sprites, CPLayoutSprite for declarative XY positioning of other sprites, CPListBoxSprite for selectable list views, CPSingletonSprite for one-time execution logic, CPSpacerSprite for layout spacing, and CPTitlePanelSprite for bordered panels with titles. Included a CPLayoutExample demonstrating the layout system and a CPListBoxExample showing file selection.
modules/cosplay/src/main/scala/org/cosplay · high confidence
New animated ASCII images and import fixes in the animation prefab library
The animation prefab library in the cosplay module now includes several new animated ASCII images: a bird, a curve, a cat logo, a runner, and a biking character. Existing animation prefabs (such as the cube, dancer, hand, macarena series, point man, somersault, and spinning globe) have been updated to use fully qualified imports for color and pixel utilities, and minor formatting and comment corrections (including a typo fix in the copyright notice and an updated archive link for the spinning globe) have been applied.
modules/cosplay/src/main/scala/org/cosplay/prefabs/images/ani · high confidence
New layout compiler for defining sprite positions
The layout subsystem now includes a new compiler (CPLayoutCompiler) and its underlying ANTLR grammar (CPLayout.g4) that allows users to define 2D sprite layouts using a declarative syntax. This compiler parses layout declarations specifying X and Y positioning relative to other sprites or fixed offsets, enabling more structured and maintainable UI arrangements within the game engine.
modules/cosplay/src/main/scala/org/cosplay/impl/layout · high confidence
New markup system, shader effects, and game scene additions
The engine introduces a new markup system (CPMarkup) allowing developers to define custom text styling with open/close tags and color skins, which is utilized in the new bird game scene (CPBirdGameScene) for displaying scores and UI elements. Additionally, new visual effects are available via the CPSparkleShader for frame-wide color sparkling and the CPStarStreakShader for creating parallax star streaks. The CPColor class has been enhanced with luma and delta calculations, while CPDim gains shortcut properties (w, h, wF, hF) and the engine core adds effect-based error handling (initEff) and various syntax sugar extensions.
repository · high confidence
New slide-in logo scene and enhanced fade-in logo scene with configurable timing
The CosPlay library now includes a new CPSlideShimmerLogoScene prefab that displays the logo with a slide-in and slide-out shader effect, allowing users to customize the slide direction and duration. The existing CPFadeShimmerLogoScene (renamed from CPLogoScene) has been updated to support configurable fade-in and fade-out durations, a customizable shimmer keyframe, and improved handling of space pixels during shader effects. Both scenes now center the logo dynamically on each frame to support adaptive terminal dimensions.
modules/cosplay/src/main/scala/org/cosplay/prefabs/scenes · high confidence
New visual effects: confetti particles and audio-reactive shaders
This update introduces several new visual capabilities to the engine. A new confetti particle system is available via CPConfettiEmitter and CPConfettiParticle, allowing developers to spawn colorful, fading particle effects. Additionally, a suite of new shaders has been added to the prefabs/shaders module: CPBeatShader provides audio-reactive brightness changes based on sound analysis; CPBorderShader creates shaded borders around objects or frames; CPFlashlightShader adds a circular lighting effect; CPRandomFadeInShader offers a fade-in effect using random characters; and CPSlideInShader/CPSlideOutShader enable directional slide transitions with configurable directions and balance functions. These new components expand the visual toolkit for creating dynamic and interactive game scenes.
modules/cosplay/src/main/scala/org/cosplay/prefabs/shaders · high confidence
Visual effects for Pong ball boosts and paddle returns
The Pong game now includes visual feedback for specific gameplay events through new shader implementations. A ball boost effect applies a random foreground color to the ball's pixels while active, and a paddle return effect briefly highlights the paddle area with a specific background color for 250 milliseconds after a hit.
modules/cosplay/src/main/scala/org/cosplay/games/pong/shaders · high confidence
Behavioural changes
6 commits (1 fix) modifying modules/cosplay/src/main/resources/images
A change to existing behaviour in modules/cosplay/src/main/resources/images — 6 commits (1 fix), 3 files.
modules/cosplay/src/main/resources/images · medium confidence · unverified
Animation example refactored with typed durations and modernized API usage
The animation example now uses explicit \.ms\ suffixes for animation and shader durations (e.g., \150.ms\ instead of \150\), ensuring type-safe time handling. The \CPArrayImage\ constructor is now called explicitly with \new\, and the \CPAnimationSprite\ is initialized using named parameters for clarity. Sound playback for the hop effect now uses \play()\ instead of \playOnce()\, and the background sound loop configuration has been updated. Additionally, the example now imports \CPFadeShimmerLogoScene\ instead of \CPLogoScene\, and the game info initialization is simplified.
modules/cosplay/src/main/scala/org/cosplay/examples/animation · high confidence
Camera example refactored to use named parameters and new scene/shader APIs
The camera example now uses named parameters for shader constructors (e.g., CPFadeInShader) and sprite creation, and switches from CPLogoScene to CPFadeShimmerLogoScene for the startup animation. Camera behavior is now configured via explicit focus tracking on the 'ufo' object with horizontal and vertical insets, replacing the previous override-based camera setup. The example also updates keyboard input handling to support both lowercase and uppercase 'Q' keys for exiting, and adopts Scala 3 syntax improvements such as the pixel creation operator and for-comprehension style changes.
modules/cosplay/src/main/scala/org/cosplay/examples/camera · high confidence
Canvas example updated to use named parameters and modern Scala syntax
The canvas example code has been refactored to improve readability and maintainability. Key changes include switching to named parameters for canvas drawing methods (e.g., \drawImage\, \drawString\, \fill\, \drawCircle\, \drawArtVector\, \drawRect\, \drawSimpleBorder\), replacing the \CPLogoScene\ with \CPFadeShimmerLogoScene\ for the startup animation, and updating the scene initialization to use \dim.?\ for dimension handling. The example also now uses \COLORS.rand\ instead of \CPRand.rand(COLORS)\ for random color selection and updates the keyboard sprite to handle both 'Q' and 'Up' keys for exiting. Additionally, the import statements have been standardized to use fully qualified names where appropriate, and the build instructions in the README have been updated to reflect the current project structure.
modules/cosplay/src/main/scala/org/cosplay/examples/canvas · high confidence
Fonts example updated to use new API and scene prefab
The fonts example now uses the updated CPGameInfo constructor with simplified parameters, adopts the new CPPixel syntax for background initialization, and utilizes the dim.w property for width calculations. The example also switches from the standard logo scene to the CPFadeShimmerLogoScene prefab and updates keyboard input handling to support both 'Q' and 'Up' keys for exiting the game.
modules/cosplay/src/main/scala/org/cosplay/examples/fonts · high confidence
GUI log interface refactoring and validation improvements
The GUI log component now uses a custom validation helper (!\>) to enforce non-null log categories with a specific error message, replacing the previous require check. The logging API signature has been updated to accept a Throwable instead of a generic Exception, and the initialization logic now delegates to CPUtils.initLaF(). Additionally, the UI action definitions have been refactored to use Scala 3's optional syntax (mkIcon(...).?) and simplified lambda bodies, improving code clarity without changing user-facing behavior.
modules/cosplay/src/main/scala/org/cosplay/impl/guilog · high confidence
Image examples updated with new assets, markup support, and API modernization
The image example modules have been refreshed to demonstrate expanded capabilities and adhere to updated engine APIs. The Image Carousel example now includes a significantly larger set of prefab images (such as CPCubesImage, CPAstronaut1Image, and CPBananaImage) and utilizes the new CPFadeShimmerLogoScene for the startup sequence. The Image Formats example introduces CPMarkup support, allowing for styled text rendering within CPArrayImage instances, and replaces the standard fade-in shader with CPRandomFadeInShader for more dynamic visual effects. Under the hood, these examples reflect broader engine changes: imports are now fully qualified (e.g., org.cosplay.prefabs.\*), dimension accessors have shifted from .width/.height to .w/.h, CPScene and CPGameInfo constructors now accept optional dimensions via the .? syntax, and CPArrayImage is instantiated with the 'new' keyword.
modules/cosplay/src/main/scala/org/cosplay/examples/image · high confidence
Logging configuration updated and Java Util Logging added
The application's logging setup has been modified to use a new environment variable, COSPLAY\_GAME\_ID, for determining log file paths instead of the previous COSPLAY\_GAME\_NAME. Additionally, the Log4j2 configuration now disables the shutdown hook and sets the status level to INFO, while a new Java Util Logging properties file has been introduced to configure console output.
modules/cosplay/src/main/resources · high confidence
Pong game restructured as a built-in title with enhanced visuals and audio controls
The Pong game has been moved from the examples directory into the built-in games module, introducing a dedicated title scene with a shimmering logo intro, sparkle and fade-in/out screen shaders, and background audio that can be toggled on or off using Ctrl+A. The gameplay scene now features platform-specific speed adjustments for Windows compatibility, distinct paddle shaders, and updated sound effects for bounces, misses, and win/loss states.
modules/cosplay/src/main/scala/org/cosplay/games/pong · high confidence
Refactored CPContainer API and added Mixpanel tracking
The CPContainer class now uses Set-based arguments for tag-based queries (removeForTags, getForTags, containsForTags, countForTags) instead of varargs, and the grab method is replaced by an apply method that raises an error on missing IDs. Additionally, CPUtils introduces Mixpanel analytics integration with a hardcoded token and environment variable control, adds a parallel execution helper (par), and implements new utility functions for splitting strings by newline and collections by predicate.
modules/cosplay/src/main/scala/org/cosplay/impl · high confidence
Refactored text input example with layout and styling updates
The text input example now uses a layout-driven approach for positioning UI elements, replacing manual coordinate calculations with a CPLayoutSprite. The login panel has been updated to use CPTitlePanelSprite with custom styling, and focus management is handled via CPSingletonSprite. Additionally, the code has been updated to use Scala 3 syntax features like the \?\ operator for Option handling and the \&&\ operator for pixel styling, while removing deprecated imports and label sprites in favor of inline CPLabelSprite instances.
modules/cosplay/src/main/scala/org/cosplay/examples/textinput · high confidence
Refactors terminal dimension handling and screen rendering logic
The JLine terminal implementation now enforces stricter validation when retrieving terminal window size, raising an error if dimensions cannot be obtained instead of silently defaulting to zero. The internal screen dimension reader has been refactored to update the current dimension state directly during initialization and polling, and the background pixel is now constructed using a concise syntax. Additionally, the rendering pipeline has been cleaned up by replacing explicit string appending with the \++=\ operator for buffer updates and simplifying the anonymous function syntax in the draw loop.
modules/cosplay/src/main/scala/org/cosplay/impl/jlineterm · medium confidence
Sound example refactored with updated UI components and API usage
The sound example has been updated to use the newer CPTitlePanelSprite instead of the generic CPPanelSprite, resulting in a styled title bar for the audio player interface. The code also adopts the new CPPixel syntax (e.g., '.'&&(C\_GRAY2, C\_GRAY1)) and simplifies the game info initialization. Additionally, the example now supports exiting via both 'Q' and 'Up+Q' key combinations, and the import structure has been adjusted to use wildcard imports for shaders and styled strings.
modules/cosplay/src/main/scala/org/cosplay/examples/sound · high confidence
Terminal emulator font validation and default font change
The emulator terminal now validates that the configured font name exists in the system, raising an error if an unknown font is specified. The default font has been changed from 'Courier New' to 'Monospaced' to improve cross-platform compatibility. Additionally, the logic for correcting font width offsets on macOS and Linux has been refined to use a more robust check based on character height.
modules/cosplay/src/main/scala/org/cosplay/impl/emuterm · high confidence
TileMapper example updated for Scala 3 syntax and API changes
The tile mapping example has been updated to align with the CosPlay engine's current API and Scala 3 conventions. Pixel construction now uses the \&&(color, bgColor)\ operator instead of the \CPPixel\ constructor, and \CPArrayImage\ instances are created using the \new\ keyword. The keyboard input handling has been refactored to accept the key codes as arguments to \CPKeyboardSprite\ rather than using a partial function. Additionally, dimension properties are accessed via \.w\ and \.h\ instead of \.width\ and \.height\, and the \CPGameInfo\ initialization has been simplified to use a single argument for the initial dimension.
modules/cosplay/src/main/scala/org/cosplay/examples/tilemapper · high confidence
Updated particle example to use modern CosPlay API and fade-in logo
The particle effect example has been updated to align with recent CosPlay API changes. The startup scene now uses CPFadeShimmerLogoScene instead of CPLogoScene, and the initial fade-in effect utilizes a duration in milliseconds (1500.ms) rather than raw frames. Input handling now supports both lowercase and uppercase 'Q' keys for exiting, and the help text labels have been standardized to uppercase (e.g., \[SPACE\], \[CTRL-L\]). Additionally, the code uses the new pixel syntax ('.'&&(C\_GRAY2, C\_GRAY1)) and simplified scene dimension initialization (dim.?).
modules/cosplay/src/main/scala/org/cosplay/examples/particle · high confidence
Video example now features background music and beat-reactive shaders
The video example in the CosPlay engine has been updated to include an auto-playing background music track (bg3.wav) and a beat shader that reacts to the audio. The scene initialization now starts the music and shader simultaneously with a fade-in effect, and the video sprite is configured to use this shader. Additionally, the example's resource path for the video footage has changed from 'video/tunnel.txt' to 'prefab/video/tunnel.txt', and the control key labels in the UI have been standardized to uppercase (e.g., SPACE, CTRL-L).
modules/cosplay/src/main/scala/org/cosplay/examples/video · high confidence
Test coverage
Added test coverage for core engine components; Added tests for CPLayoutCompiler; Added tests for CPUtils and updated CPTerminal test setup.
Dependencies
Dependency upgrades and new library integrations
The project has upgraded several core dependencies, including Scala 3 to 3.6, Log4j to 2.23.1, JUnit to 5.11.0, and FlatLaf to 3.2.5. New libraries have been added to the build, specifically Commons Text, Commons IO, Commons Collections, JNA, Mixpanel, AudioFile, and ANTLR4. Additionally, the build configuration now enables forking for terminal execution and updates the project version to 0.9.5.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 52.
Lenses
- Code Health 86
- Architecture 100
- Maturity 53
- Readiness 37
- Security 67
Changes since last survey
- 300 commits — 280 feature/other, 20 fixes
By area
- modules/cosplay — 162 commits
- (root) — 71 commits
- (repo) — 64 commits
- project/build.properties — 2 commits
- scaladoc/docroot.md — 1 commit
Notable commits
- fix: Added support for non-visible chars to CPAsciiTable + some bug fixes. 0.9.2 release.
- fix: Border draw improvements + misc. fixes.
- fix: Bug fixes.
- fix: Cleam up and warning fixes.
- fix: Doc fixes.
- fix: Docs & slide out shader fix.
- fix: Docs fix.
- fix: Docs fixes.
- fix: Docs fixes.
- fix: Fix for delayed actions.
- fix: Fix for title coordinates.
- fix: Fix message sending.
- fix: Fixes for README.
- fix: Header fixes.
- fix: Misc. fixes + JLine term improvements.
- fix: Quick fix.
- fix: Scaladoc version fix.
- fix: Slide out shader fixes.
- fix: WIP Audio magnitude fixed
- fix: WIP on delayed ops + fixes.
- …and 280 more
Architecture
- 0 containers · 1 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
nivanov/cosplay was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit f8462c28f249363e2b7bc432dbf755a93e01f943 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.