Skip to content

Metal Slug demo: tileset art, parallax, camera shake, debug overlay - #30

Merged
diego3 merged 8 commits into
mainfrom
claude/metalslug-jump-and-background
Jul 30, 2026
Merged

Metal Slug demo: tileset art, parallax, camera shake, debug overlay#30
diego3 merged 8 commits into
mainfrom
claude/metalslug-jump-and-background

Conversation

@diego3

@diego3 diego3 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Split spawn/AABB helpers out of world_scene.go and refreshed docs
  • Added ADR-012 (cost estimate for a config-selectable render/engine backend)
  • Added ParallaxLayer component and used it for level1's background
  • Added process-manager-based camera shake, plus architecture sequence diagrams
  • Reskinned level1's ground, platforms and crates with real tileset art
  • Added a debug stats overlay (events/frame via Bus.TakeEventCount, OS/GL version, RSS) behind the existing F3 toggle, and ADR-013 (image generation agent options)
  • Added the Sci-Fi sideview asset pack used by metalslug_demo

Test plan

  • go build ./...
  • go test ./...
  • Manual golden-path check in the running game (movement, shooting, jumping, F3 overlay)

🤖 Generated with Claude Code

diego3 and others added 8 commits July 29, 2026 22:36
…compiled binary

WorldScene had grown past the file-size guideline after absorbing spawn/hit-detection
logic; move spawnEntity, updateProjectiles, and the AABB/payload helpers into a new
spawn.go so world_scene.go stays focused on Setup/Update/Draw.

CLAUDE.md and README.md still described the pre-frameengine/ package layout and an
already-resolved scene-registration FIXME; update both to match the current structure.

Also stop tracking the accidentally-committed `goengine` build binary.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Scopes out what it would actually take to benchmark Go/Ebiten against a
native rendering backend (raylib or OpenGL) or a full C++ rewrite, sized
against the current codebase's line counts and coupling to *ebiten.Image.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replaces level1.yaml's flat-color bg_stripe_0..11 placeholder with a real
two-layer parallax background (sky + mountains) using the SideviewSciFi
sci-fi asset pack. ParallaxLayer is drawn directly to screen -- outside the
level-sized world buffer everything else scrolls through -- so each layer
can move at its own fraction of the camera's scroll (sky fixed, mountains
drifting slowly) and tile to cover the viewport regardless of the source
art's small native size.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rams

Camera shake: Camera gains ShakeX/ShakeY, driven by a new CameraShake
process (frameengine/view/camera/shake.go) attached to a per-scene
process.Manager. Triggered by scripts via engine.emit("ShakeCamera",
{...}); sphere_timer.py now fires it alongside its existing explosion
SpawnEntity call, covering both the falling-sphere hazard and enemy_bomber's
lobbed bomb for free. Multiple concurrent shakes add rather than overwrite,
since WorldScene zeroes Shake{X,Y} once per frame before running processes.

Also adds docs/diagrams/: six PlantUML sequence diagrams (plus rendered
PNGs) walking a new dev from engine boot through the frame loop down to
concrete gameplay flows (shooting, the bomber/explosion/shake chain,
physics contacts driving jump state).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replaces the flat-color Block placeholders on ground/crate_1..3/platform_1..4
with sprites cropped from sci-fi-environment-tileset.png -- the same sheet
bg_mountains already draws from, for a consistent canyon palette. Adds
Sprite.RepeatWidth (world-space horizontal tiling, no camera math needed,
unlike ParallaxLayer.Repeat) so the ground and platform-top art -- small
repeating strips -- can tile to each object's width instead of stretching.

physics_body on every reskinned object now carries its width/height
explicitly: PhysicsSystem previously sized these from the sibling Block
component, which no longer exists, and would otherwise silently default to
64x64. Values are copied from the old Block entries, so collision behavior
is unchanged (verified via the boot-time physics body size log).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Extends the F3 debug overlay with an event-bus throughput counter
(Bus.TakeEventCount), OS/GL version info, and process memory stats
(POSIX-only, with a fallback for other platforms), so perf issues can
be diagnosed without external tooling. Also records ADR-013 on image
generation agent options and adds the Sci-Fi sideview asset pack used
by metalslug_demo.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@diego3
diego3 merged commit 4f3cb0d into main Jul 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant