WIP
This commit is contained in:
@@ -19,27 +19,29 @@ bunx serve workshop/steps/11-capstone
|
||||
```
|
||||
|
||||
Arrow keys move the pink box. Run it into the border, the ledge, the pillar, the
|
||||
bar. Push diagonally into a wall and watch it **slide** along instead of sticking.
|
||||
That sliding is your step-09 `dot`-product projection. The fact that it stops
|
||||
*at* the wall instead of tunneling through, even at speed, is your step-07 swept
|
||||
detection. The clean corners are your step-10 loop running twice in one frame.
|
||||
bar. Push diagonally into a wall and watch it **slide** along instead of
|
||||
sticking. That sliding is your step-09 `dot`-product projection. The fact that
|
||||
it stops _at_ the wall instead of tunneling through, even at speed, is your
|
||||
step-07 swept detection. The clean corners are your step-10 loop running twice
|
||||
in one frame.
|
||||
|
||||
## Make it yours (optional)
|
||||
|
||||
- Open `game.js`. The top half is your kernel — read it and confirm it matches
|
||||
what you wrote. Swap in your own `moveAndSlide` from step 10 and check it feels
|
||||
identical (it will).
|
||||
what you wrote. Swap in your own `moveAndSlide` from step 10 and check it
|
||||
feels identical (it will).
|
||||
- Add a wall to the `walls` array. Change `SPEED`. Make the player bigger.
|
||||
- Try **deleting the `EPSILON` backoff** (`Math.max(0, nearest.time - EPSILON)`
|
||||
→ `nearest.time`) and push into a wall. Watch it stick and jitter. Then put it
|
||||
back. Now you've *felt* why that line exists in your real engine.
|
||||
back. Now you've _felt_ why that line exists in your real engine.
|
||||
|
||||
## You're back
|
||||
|
||||
That's the whole climb: pairs of numbers → sweeping a point → sweeping a box via
|
||||
Minkowski → detecting the hit → stopping and sliding → the full loop → a thing you
|
||||
can play. Every rung is a function that exists, by name, inside your real
|
||||
Minkowski → detecting the hit → stopping and sliding → the full loop → a thing
|
||||
you can play. Every rung is a function that exists, by name, inside your real
|
||||
`engine/system/physics.ts`.
|
||||
|
||||
Now go open the real `sweptAABB` with fresh eyes. You know exactly what every line
|
||||
is *supposed* to do — so the two lines that don't should stand out. Happy hunting.
|
||||
Now go open the real `sweptAABB` with fresh eyes. You know exactly what every
|
||||
line is _supposed_ to do — so the two lines that don't should stand out. Happy
|
||||
hunting.
|
||||
|
||||
Reference in New Issue
Block a user