Skip to content
CAI
Software that uses CAICheck a score

regb/scala-game-library

69.3

Adequate · 20 September 2026

29.5k

lines of production code

Scala

with Kotlin

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is the SGL (Scala Game Library), a cross-platform game engine and UI framework written in Scala 3. It provides core infrastructure for 2D/3D game development, including spatial transforms, collision detection, and a scene graph for UI widgets, while supporting multiple rendering backends such as LWJGL, AWT, SDL2, and HTML5. The library enables building games for desktop, Android, and web platforms with integrated features for audio, input handling, analytics, and advertising.

How it got here

2016–2019 — Cross-platform architecture and backend expansion

12 changes.

The project underwent a major architectural overhaul, migrating to Bazel and Scala 3 while restructuring the core engine around a provider-based cake pattern. This period focused on expanding platform support by introducing new backends for desktop, HTML5, and Android, alongside adding comprehensive utility modules for analytics, ads, and metrics. Extensive unit testing was integrated to validate the new core components and ensure cross-platform compatibility.

2024–2026 — Multi-platform engine and build infrastructure

17 changes.

This period established the core SGL game engine with GameObject and Screen2D architectures, introducing comprehensive support for desktop, Android, HTML5, and Native platforms. It simultaneously built out a robust Bazel-based build system to manage these diverse backends and typed assets, while adding essential modules like scene2d UI, Tiled map rendering, and headless testing capabilities.

Features

Added Bazel build rule for Scala Native linking

A new Bazel build target has been introduced in the bazel/scalanative directory to handle Scala Native linking. This change adds a BUILD file defining a scala\_binary rule named 'linker' and a corresponding Scala source file (ScalaNativeLinker.scala) that implements the linking logic using Scala Native 3 tools. The linker accepts a classpath, main class, working directory, and output path to produce an executable binary, enabling the project to be built using Bazel with Scala 3 and Scala Native.

bazel/scalanative · high confidence

Android backend introduces safe area support and input handling

The Android backend now exposes safe area insets (left, top, right, bottom) through the window proxy, allowing applications to account for device-specific UI elements like notches and home indicators. Additionally, the new input listener handles multi-touch events and gestures, ensuring proper touch interaction on Android devices.

app · high confidence

Initial release of the Scala Game Library documentation website

The project now includes a dedicated documentation site built with Astro and Starlight. This site provides a marketing landing page, a structured documentation library covering core concepts, installation, graphics, audio, input, and platform targets, and a showcase of example applications. It also includes a migration guide detailing the shift from legacy resource paths to typed assets and updates to the GameObject spatial API.

website · high confidence

Introduce metrics library with counters, gauges, histograms, and rendering

Added a new metrics library in core/src/main/scala/sgl/util/metrics that provides Counter, IntGauge, FloatGauge, and Histogram types for tracking application performance. The library includes an InstrumentationProvider trait with DefaultInstrumentationProvider and NoInstrumentationProvider implementations, allowing metrics to be logged to the console or rendered on the canvas during a warmup period. This enables developers to easily instrument their code with performance metrics that can be visualized or logged without overhead when disabled.

core/src/main/scala/sgl/util/metrics · high confidence

Introduces a proxy layer for Android/Kotlin platform integration

A new set of proxy traits in the core library enables the Scala game engine to run on Android via Kotlin. This layer bridges platform-specific capabilities—including window management (with safe area support), audio, JSON parsing, logging, system resources, and application lifecycle—through a \PlatformProxy\ interface, allowing the core engine to remain platform-agnostic while delegating native operations to the Android host.

core/src/main/scala/sgl/proxy · high confidence

Introduces abstract AdsProvider interface with interstitial and rewarded ad support

The core ads module now defines a unified \AdsProvider\ trait that abstracts ad loading and display logic, specifically adding support for rewarded ads alongside existing interstitial ads. This interface standardizes how ads are preloaded and shown, allowing the application to inject different implementations (such as a \NoAdsProvider\ for ad-free builds) while ensuring consistent asynchronous behavior for ad events.

core/src/main/scala/sgl/ads · high confidence

Introduces core utility providers for asynchronous loading, JSON parsing, and tweening

This change adds foundational utility modules to the engine's core. It introduces a \Loader\ trait for asynchronous asset loading with support for combining multiple loaders and fallbacks, a \JsonProvider\ that standardizes JSON parsing across platforms by normalizing numeric types to avoid precision discrepancies between JVM and JavaScript, and a \TweeningEquations\ object providing various easing functions (linear, quad, cube, sine) for animation interpolation. Additionally, it includes a \Pool\ for object reuse to reduce garbage collection, a \RandomProvider\ with a default Java-based implementation, a \SchedulerProvider\ with a single-threaded scheduler for task management, and a draft \AssertionsProvider\ for debugging.

core/src/main/scala/sgl/util · high confidence

New 2D/3D game engine and screen-based UI framework

This release introduces the core infrastructure for the SGL game engine, including a new GameObject engine with systems for 2D/3D spatial transforms, collision detection (circle, AABB, polygon SAT), and updatable components, alongside a Screen2D engine providing a game loop, state management, and UI components like buttons and dialogs. It also adds example applications for board, menu, and platformer games across AWT, Native, and HTML5 backends, establishing the foundational architecture for building games with this library.

(repo-wide) · high confidence

New Bazel build rules and templates for SGL game projects

This change introduces a complete set of Bazel build infrastructure for the SGL game library, including \sgl\_assets\_provider\ and typed asset rules (images, text, audio, fonts, drawables) in \assets.bzl\, and platform-specific entrypoint generators for Desktop (AWT, LWJGL, Native) and HTML5 in \desktop.bzl\, \lwjgl.bzl\, \native.bzl\, and \html5.bzl\. These rules generate Scala main classes from templates (e.g., \DesktopAWTMain.scala.template\) that configure frame dimensions, save components, and platform-specific behaviors like HTML5 keyboard/touch handling. A headless Java image processing tool (\ImageAssetTool\) is also added to support asset resizing and extrusion during the build.

bazel/sgl · high confidence

New Bazel rules and server for building and serving Scala.js applications

This change introduces a new build infrastructure for Scala.js applications within the Bazel workspace. It adds a custom \scalajs\_html\_template\ rule that generates HTML files by substituting Scala.js output paths into a template, and a \run\_server\ helper that creates a Go-based HTTP server. This server copies the generated HTML, JavaScript, and static assets into a temporary directory and serves them on port 8080 (configurable via the PORT environment variable), automatically cleaning up the temporary directory upon shutdown. The implementation includes a Scala-based linker (\ScalaJsLinker.scala\) to produce ES modules and a Go server (\server.go\) to handle asset serving.

bazel/scalajs · high confidence

New Bazel-based Android build system with Kotlin backend and typed assets

This change introduces a new Bazel build infrastructure for Android applications, replacing the previous setup. It generates a complete Gradle project structure using Kotlin (Kotlin 2.1.21, Android Gradle Plugin 8.13.0) and targets Android API 37. The system supports typed asset packaging (drawables, text, audio, etc.) with automatic density-aware resource generation, configurable system bar modes (immersive, edge-to-edge), and optional integrations for Firebase, AdMob, and Play Games. It also enables R8 code shrinking and resource shrinking in release builds, with specific ProGuard rules to preserve drawable resources loaded via reflection.

bazel/sgl/android · high confidence

New GameObject and Screen2D engine examples and build targets

This change introduces build definitions and example applications for the new \sgl-gameobject\ and \sgl-screen2d\ engines. For the GameObject engine, it adds an Asteroids example (with desktop LWJGL, HTML5, and native SDL2 targets) and a Solar System example (with desktop LWJGL, HTML5, and native SDL2 targets), alongside a headless integration test suite that validates canvas drawing, input handling, and movement in a headless OpenGL environment. For the Screen2D engine, it adds a Board example (desktop AWT and HTML5), a Menu example (desktop AWT, HTML5, and native), and a Platformer example (desktop AWT and native) featuring Tiled map support and asset handling.

engines · high confidence

New Snake game example with safe-area support

Added a new Snake game example in \examples/snake\ that demonstrates cross-platform capabilities (JVM desktop, native desktop, HTML5, and Android) using the SGL framework. The implementation includes a \Wiring\ object for platform abstraction and an \AbstractApp\ that renders the game within the window's safe area, displaying a specific message if the safe area is too small for gameplay. Build configurations are provided via Bazel targets (\sgl\_desktop\_awt\_app\, \sgl\_desktop\_native\_app\, \sgl\_html5\_app\, \sgl\_android\_app\) to facilitate running the game on various targets.

examples/snake · high confidence

New Tiled map rendering extension with multi-density support

The \extensions/tiled\ module now provides a complete solution for rendering Tiled maps, including a JSON parser (\TmxJsonParser\) for TMX files, a density-aware resolver (\TiledMapResolvedDensity\) that scales all map coordinates and tilesets to match the target screen DPI, and a renderer (\TiledMapRenderer\) that draws tile layers, image layers, and object layers with support for animations and opacity.

extensions/tiled · high confidence

New desktop and HTML5 backends for the Scala game library

This release introduces new platform backends for the library, adding support for desktop applications via AWT and LWJGL, as well as for web deployment via HTML5/Scala.js. The AWT backend provides canvas rendering, input handling, and font support using Java AWT, while the LWJGL backend adds OpenGL rendering and OpenAL audio capabilities. The HTML5 backend implements canvas graphics, input, and system services using the browser's DOM and Web APIs, including asset loading from server or asset packs. These new backends expand the library's reach to desktop and web platforms alongside existing ones.

repository · high confidence

New desktop backend implementations for JVM and Native platforms

This change introduces new backend implementations for desktop environments, organizing them under a dedicated \backends/\ directory. For the JVM, it adds a shared \desktop-jvm-shared\ module providing core system services (resource loading, timing, process exit), LWJGL-based windowing and OpenGL rendering, Java Sound audio, Lift-based JSON parsing, and terminal logging. It also includes a screenshot capture feature for desktop examples, controllable via the \SGL\_SCREENSHOT\_PATH\ environment variable or \sgl.screenshot.path\ system property, along with a file-based save system. For Native platforms, it adds Scala Native bindings for OpenGL (\gl\ package) and SDL2 (\sdl2\ package) to support headless or native desktop execution.

(repo-wide) · high confidence

New headless OpenGL backend and portable font generation tooling

Users can now run the engine without a display server using the new headless OpenGL backend, which uses a surfaceless EGL pbuffer to render in software (e.g., llvmpipe) and exposes a Controller object for enqueuing input events from any thread. The backend includes frame capture support via LwjglFrameCapture and thread-safe dispatch via LwjglRenderThreadDispatcher. Additionally, a new font-atlas-generator tool in tools/ produces and verifies checked-in portable Noto Sans glyph atlases and metrics for use by the engine.

backends/headless-opengl, backends/lwjgl-shared, tools · high confidence

New hello-canvas example demonstrating text layout and multi-backend support

This change introduces a new example application in examples/hello-canvas that showcases the engine's canvas and text layout capabilities. The App.scala file demonstrates wrapped text rendering that preserves blank lines, aligns rows, and shrinks to fit a defined box, alongside basic 2D graphics, audio, and input handling. The accompanying BUILD file configures the example for multiple backends, including desktop (AWT, LWJGL, native) and HTML5 (standard and OpenGL), allowing users to run the demo across different platforms.

examples/hello-canvas · high confidence

New platform backend implementations for Android, HTML5/Cordova, and JVM

This change introduces new backend implementations for Android, HTML5/Cordova, and JVM platforms. On Android, it adds optional modules for Google AdMob ads, Firebase Analytics, and Google Play Games Services, allowing games to opt into these features without bundling their SDKs by default. For HTML5/Cordova, it provides audio providers using the native-audio plugin (replacing the previous media plugin as the default for CordovaApp) and Firebase Analytics integrations. On the JVM side, it adds a Future-based Loader and a ThreadPool-based Scheduler to handle asynchronous loading and task execution.

(repo-wide) · high confidence

New scene2d module with scene graph, actions, and UI widgets

The \modules/scene2d\ module introduces a hierarchical scene graph for organizing renderable objects and handling input routing, primarily targeting game UIs like menus and HUDs. It includes an action system (\Action\, \SequenceAction\, \ParallelAction\, \TemporalAction\) for stateful behavior updates on scene elements. The module provides a set of UI widgets including \Popup\, \Dialog\, \DialogPopup\, and \ScrollPane\ for scrollable content, along with a \SceneComponent\ trait to aggregate these features. Input processing is handled by the \SceneGraph\, which dispatches mouse and touch events to nodes based on hit testing and coordinate transformation.

modules/scene2d · high confidence

Architecture

Add Bazel build definitions for desktop and headless backends

The backends directory now includes Bazel BUILD files for the desktop (AWT, LWJGL, native), headless OpenGL, HTML5, and shared JVM modules, enabling these components to be built and tested via Bazel. The headless OpenGL backend is restricted to Linux, while the LWJGL-based backends include platform-specific native library dependencies for Linux, Windows, and macOS. Additionally, the Android Kotlin backend is now managed with Gradle 8.13.

backends · high confidence

Behavioural changes

Android backend adds system text sharing and safe area support

The Android backend now allows users to share text from the game via the system share sheet, and supports safe area insets to ensure content remains visible on devices with notches or system bars. Additionally, the back button handling has been modernized to use the latest Android APIs, and the audio system now properly pauses and resumes music during app lifecycle changes.

backends/android-kotlin · high confidence

Core engine architecture refactored with new provider traits and input system

The core engine has been restructured around a cake-pattern architecture, introducing new base traits for application lifecycle (Application), audio (AudioProvider), and OpenGL rendering (OpenGLProvider). A new unified InputProcessor system replaces previous input handling, featuring a CombinedInputProcessor for chaining handlers and a PointerInputProcessor mixin to abstract mouse and touch events for cross-platform compatibility. Additionally, a FrameCaptureProvider has been added to support capturing rendered frames, and a portable font atlas (PortableFontData) is now included for text rendering.

core/src/main/scala/sgl · high confidence

Introduction of configurable analytics providers

The analytics module now supports pluggable implementations via new provider traits. LoggedAnalyticsProvider logs all analytics events (such as level changes, purchases, and achievements) to the application logger for debugging purposes, while NoAnalyticsProvider provides a lightweight, no-op implementation that ignores all events, useful for release builds on platforms without analytics frameworks.

core/src/main/scala/sgl/analytics · high confidence

Test coverage

Added unit tests for core engine components; Added unit tests for metrics components; Added unit tests for utility components.

Dependencies

Migrated build system to Bazel 9 with Scala 3 and cross-platform support

The project has replaced its previous build configuration with a Bazel-based system (version 9.1.1), enabling cross-compilation for Desktop JVM, Android, iOS (via web), and Scala Native. This change introduces Scala 3.3.8 as the primary language version and integrates key dependencies including rules\_scala 7.2.6, protobuf 33.4, and LWJGL 3.3.6 for graphics and audio. The new setup includes a \.bazelrc\ for worker strategy and proto toolchain resolution, a \MODULE.bazel\ for dependency management, and a \.buildifier.json\ for linting, providing a unified, reproducible build environment for all supported platforms.

(repo-wide) · high confidence

New Android Kotlin backend and website dependency updates

This change introduces a new Android Kotlin backend module (\backends/android-kotlin\) that provides Gradle build configurations for SGL's Android integration, including submodules for Firebase analytics, AdMob ads, and Google Play Games services. The build is configured to compile against Android SDK 37 with a minimum SDK of 26, using Kotlin 2.1.21 and AGP 8.13.0, and relies on Bazel-built core JARs. Additionally, the website's \package.json\ is updated to use Astro 7.2.9 and TypeScript 5.9.3.

(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 69.

Lenses

  • Code Health 88
  • Architecture 100
  • Maturity 66
  • Readiness 57
  • Security 95
  • Domain Modelling 100

Changes since last survey

  • 300 commits — 266 feature/other, 34 fixes

By area

  • core/src — 117 commits
  • (root) — 46 commits
  • desktop-awt/src — 24 commits
  • android/core — 21 commits
  • bazel/sgl — 13 commits
  • html5/src — 12 commits
  • examples/hello — 11 commits
  • android/build.sbt — 7 commits
  • examples/platformer — 5 commits
  • android/firebase — 4 commits
  • .github/workflows — 3 commits
  • android/admob — 3 commits
  • android/google-ads — 3 commits
  • android/src — 3 commits
  • bazel/scalajs — 3 commits
  • html5/cordova — 3 commits
  • android-kotlin/app — 2 commits
  • android/project — 2 commits
  • desktop-native/src — 2 commits
  • examples/menu — 2 commits

Notable commits

  • fix: Fix a bug introduced by refactoring of Resources
  • fix: Fix the AdsProvider for GoogleAds on Android.
  • fix: catch a bug with width of awt canvas when scaling
  • fix: clean up bugs
  • fix: document how to address a bug in openjdk
  • fix: finally fix back button on Android
  • fix: fix a bug in mapping source image to destination in awt
  • fix: fix a bug introduced in android with logicalPpi
  • fix: fix a bug with loader combine and document/test it
  • fix: fix a null pointer initialization with the button themes
  • fix: fix a state issue in the android music player
  • fix: fix and document the volume
  • fix: fix and test cases of joining resource path
  • fix: fix android bug with multi dpi resource refactoring
  • fix: fix bug when no tile layers
  • fix: fix ci
  • fix: fix font rendering
  • fix: fix hello project
  • fix: fix hello world
  • fix: fix html5 bug with missing slash in resource path
  • …and 280 more

Architecture

  • 0 containers · 4 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

regb/scala-game-library 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 39591f6c6d65828fd48ba0d327143f10bc6c3d50 — 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.