Skip to content

feat(examples): collide a Tiled polyline and sweep the action3d camera - #2734

Open
houko wants to merge 1 commit into
mainfrom
feat/issue-1490-example-polyline-camera-spring-arm
Open

houko wants to merge 1 commit into
mainfrom
feat/issue-1490-example-polyline-camera-spring-arm

Conversation

@houko

@houko houko commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Cave Run's Tiled level now carries a hidden collision object layer with a polyline ramp out of the first lava pit, which the game builds into static terrain with tilemap.ObjectLayer.PhysicsBodies inside a physics.World that the player moves through, so the player walks on the ramp while tile collision behaves as before; its test drops a body on the ramp's landing, where both tile layers are empty above the lava, and checks it rests there with full hearts. The action3d orbit camera now sweeps a physics3d sphere along its arm instead of casting a ray, so a wall corner beside the center line pulls the camera in instead of clipping the lens; its test puts a pillar corner 0.05 m off the arm where a ray misses and checks the camera stays the probe's radius from it. Cave Run's immersive system bars were already delivered by #2387, so this PR covers the other two acceptance items plus docs, the level generator, a changelog fragment and an agent note; the template copy under internal/gamecli/_templates/projects/action3d matches its module.

Related issue

Fixes #1490

Verification

  • gofmt -l . produces no output
  • go tool nsgo test ./... passes from the repository root — not run; the affected packages pass: ./examples/caverun (27 tests), ./template/action3d/template (32), ./internal/gamecli/_templates/projects/action3d (32), and ./internal/gamecli -run TestTemplatesMatchTemplateModules
  • go tool nsgo check -target macos,windows,linux,android,web passes from the repository root — not run; go tool nsgo check passes for the three affected packages
  • go tool nsgo check -target ios,ios_simulator passes (if on macOS with Xcode) — not run
  • bun run build passes (for docs/ or website/ changes)
  • Both docs/en/ and docs/zh/ updated (when applicable)

Screenshots

None: Cave Run's new collision layer is hidden by design and changes no art, and the action3d camera change only differs in a wall corner, which the new test checks numerically.

Cave Run's level gains a hidden collision object layer with a polyline ramp out of the first lava pit, and the game moves the player through a physics.World so tilemap.ObjectLayer.PhysicsBodies shapes collide as static terrain. A test drops a body on the ramp's landing and checks it rests there with full hearts.

The action3d orbit camera now sweeps a physics3d sphere along its arm instead of casting a ray, so a wall corner beside the center line pulls the camera in instead of clipping the lens. A test places a corner a ray misses and checks the camera keeps the probe's radius from it.

The level generator writes the new layer; docs/en, docs/zh, the example and template READMEs, a changelog fragment and an agent note record both changes.
@github-actions github-actions Bot added enhancement New feature or request documentation Improvements or additions to documentation pkg/internal area/examples area/template area/agents size/M labels Dec 1, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Examples: Cave Run keeps the system bars, and no example shows a Tiled polyline as terrain or a 3D camera spring arm

1 participant