Add transformer mode: car unfolds into a shell-firing mech#2
Open
Makio64 wants to merge 5 commits intomrdoob:masterfrom
Open
Add transformer mode: car unfolds into a shell-firing mech#2Makio64 wants to merge 5 commits intomrdoob:masterfrom
Makio64 wants to merge 5 commits intomrdoob:masterfrom
Conversation
- Press Space (or gamepad A) to throw a bouncy turtle shell projectile that ricochets off walls and knocks trucks into a spin - Convert the three static NPC trucks into kinematic waypoint-following racers looping around the outer track - Shell hit spins target ~22 rad/s for 2.2 s with vertical hop and tilt wobble; ricochet also stuns the player - Hit burst effect: expanding yellow ring plus pooled gold stars with gravity Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Press T (or gamepad B) to run a staged choreography: anticipation dip, body liftoff with overshoot, spine extrude, chest swing, head slide-up, visor flicker open, shoulder cannons unfold, final pose snap - Physics body swaps to KINEMATIC during transform so the vehicle freezes in place; reverse transform restores DYNAMIC - In robot mode A/D rotates the torso turret, W/S tilts cannon pitch, Space rapid-fires shells from alternating cannon tips at 0.12 s cooldown (max 12 active) - Each shot recoils the cannon, pulses the red eye visor, and heats the muzzle tip toward orange glow - Transform FX: staged shockwave rings, steam puffs, cyan electric arcs, yellow screen flash, camera shake, and Mario-Kart-style star burst on the final pose - Procedural mech built from shared chrome / dark panel / yellow / blue-core / red-emissive materials to keep draw calls low Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Shells now carry a power multiplier; robot cannons fire at power=1.4 for ~30% longer stun, stronger spin, and a knockback that shoves the hit target along the shell's travel direction
- Targets on impact: NPCs slide in the impact direction with decaying velocity (kinematic body + mesh kept in sync); the player gets a linear-velocity impulse plus a small vertical lift
- Shell.onContact passes an impact vector { dirX, dirZ, power } built from the shell's current velocity so hits from any angle push correctly
- Recolor the mech primary body to the truck yellow with darker yellow trim so the robot reads as a transformed version of the player's vehicle
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Turret yaw rate: 2.5 → 5.0 rad/s for snappier aiming - Max concurrent robot-mode shells: 12 → 24 so a sustained barrage stays uninterrupted Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Zero turretYaw / turretPitch at the start of each forward transform so the tower always deploys pointing the same direction as the car, instead of remembering the last aim. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #1 (turtle shell / NPC racing). While #1 is open the diff shows both features; it will narrow automatically once #1 merges.
Summary
The transformation
Staged choreography driven off a single progress value (0.9 s forward, 0.7 s reverse):
Robot mode
MotionType.KINEMATIC, pinned at entry position, zero velocity.vehicle.stun()is a no-op during transform/transformer mode — robot is bullet-proof against its own ricochet.File changes
getCannonTransform(side)helper.transformflag (KeyT + gamepad button 1).Test plan
python3 -m http.server 8000), open http://localhost:8000/.🤖 Generated with Claude Code