Spottedcat
Lightweight cross-platform 2D/3D game engine for Rust.
Spottedcat is small, fast, and a little wild—named after the rusty-spotted cat and built for desktop, Web/WASM, iOS, Android, and AI-assisted game creation.
The Example Checks workflow compiles the desktop examples in scripts/check_examples.sh, including the default, utils, model-3d, effects, and gltf feature combinations.
Why Spottedcat?
- Small core API: build around
Spot,Context,Image,Text,Model, andrun. - 2D and 3D: draw images, text, custom shaders, primitives, GLTF models, billboards, instanced models, and foggy 3D scenes.
- Cross-platform: target desktop, Web/WASM, iOS, and Android from one Rust codebase.
- AI-friendly: stable lifecycle, focused examples, and a dedicated guide make it easier for AI tools to generate runnable game prototypes.
- Practical by default: start with zero default features for lean 2D apps; enable 3D, effects, GLTF, image helpers, or sensors only when needed.
Links
- Documentation: rustyspottedcat.dev
- API reference: docs.rs/spottedcat
- Crate: crates.io/crates/spottedcat
- AI generation guide: AI_GAME_GENERATION_GUIDE.md
Install
Minimal 2D core:
[]
= "1.0.2"
Common feature set for richer projects:
[]
= { = "1.0.2", = ["model-3d", "utils", "gltf", "effects", "sensors"] }
Feature guide:
| Feature | Use when you need |
|---|---|
model-3d |
3D models, primitives, billboards, cameras, and model shaders |
effects |
3D effects such as fog |
utils |
PNG/JPEG/WebP helper loading and async image loading |
gltf |
GLTF model loading; also enables model-3d and utils |
sensors |
Motion and step APIs on supported mobile platforms |
Minimal app
Spottedcat apps are ordinary Rust types that implement Spot:
use ;
use Duration;
Run an example:
AI-assisted creation
Spottedcat is intentionally easy for AI coding tools to read and extend:
- the game loop is explicit:
initialize,update,draw,remove - examples are small enough to use as generation anchors
- the 1.0 API gives AI tools a stable surface to target
If you use Codex or another AI coding tool, a good prompt shape is:
Use Spottedcat 1.0 to make a tiny playable 2D dodge game.
Start from one Spot scene, read keyboard input, draw simple images,
show score text, and keep the code close to the existing examples.
See AI_GAME_GENERATION_GUIDE.md for LLM-oriented API guidance.
Install the Codex skill in a game project
Install the Spot CLI once:
Then run this command from the root of any game project that uses Spottedcat:
It installs spot-game-builder into the current project's
.agents/skills/spot-game-builder directory. To target another project, run:
Examples
Useful starting points:
| Goal | Example |
|---|---|
| Input and HUD | examples/input_example.rs |
| Image loading | examples/rgb_image.rs, examples/async_loading_example.rs |
| Text rendering | examples/centered_text_test.rs |
| Audio | examples/audio_test.rs |
| 2D shaders | examples/image_shader_template.rs |
| 3D world | examples/fog_world.rs |
| GLTF models | examples/gltf_loader.rs, examples/animated_gltf.rs |
| Instancing | examples/instancing_test.rs |
| WASM demos | examples/wasm/ |
| Mobile wrappers | examples/ios/, examples/android/ |
For a guided mini-game, see the Flappy Cat guide on rustyspottedcat.dev.
Core concepts
Spot
Spot is the application or scene lifecycle:
initializeloads assets and creates state.updateruns fixed-step gameplay logic.drawrenders the current frame.resumedandsuspendedhandle platform lifecycle when needed.removecleans up scene-specific state.
Keep gameplay mutation in update and rendering in draw. Use interpolation when fixed updates and display refresh do not line up.
Rendering
Imagehandles 2D textures, render targets, sub-images, layers, transforms, clipping, and custom 2D shaders.Texthandles font-backed text rendering, wrapping, color, and stroke.Modelhandles 3D primitives, GLTF content, billboards, instancing, lighting, fog, and custom model shaders whenmodel-3dis enabled.
Platform support
Declared support:
- Desktop: Windows, macOS, Linux
- Web: WASM builds
- iOS: UIKit integration and native sensor access
- Android: Android GameActivity integration and native sensor access
Generated platform outputs such as target/, .gradle/, pkg/, .xcframework/, and IDE caches are intentionally excluded from version control.
Stability
Spottedcat 1.0 treats the main user-facing surfaces as stable:
ContextSpotImageTextModelWindowConfigrun
Minor and patch releases should preserve public API compatibility wherever possible. Pin an exact crate version if you need fully reproducible builds.
Name
The name comes from the rusty-spotted cat (Prionailurus rubiginosus): tiny, quick, and a little wild. It also nods to Rust, the language behind the engine.
License
Licensed under either of:
- Apache License, Version 2.0
- MIT License
at your option.