create-dreamer-app 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-dreamer-app",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "The scaffolding application for using Disco Dreamer.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -273,6 +273,8 @@ Rectangle bounds use their top-left corner; circle bounds use their center. `pos
273
273
 
274
274
  Call these each frame with the body's public `key`. The handler receives the other body's public key once per reported body pair per frame.
275
275
 
276
+ - `gameCollision` calls `handler(otherKey: string, otherLayer: string)`, passing the other body's public key and layer. The layer is always defined for a physical collision.
277
+ - `gameHit` calls `handler(otherKey: string)`, passing only the other body's public key.
276
278
  - Physical collisions require both bodies to include each other's `layer` in `collidesWith`.
277
279
  - Hits are directional: only the observing body's `hitsWith` needs to include the other body's layer.
278
280
  - Hits alone do not separate bodies or change their velocities.
@@ -280,8 +282,8 @@ Call these each frame with the body's public `key`. The handler receives the oth
280
282
 
281
283
  ```tsx
282
284
  function PhysicsExample() {
283
- gameCollision("ball", (otherKey) => {
284
- if (otherKey === "floor") console.log("Ball contacted floor");
285
+ gameCollision("ball", (otherKey, otherLayer) => {
286
+ if (otherLayer === "world") console.log("Ball contacted world body:", otherKey);
285
287
  });
286
288
 
287
289
  return (
@@ -22,6 +22,6 @@
22
22
  "vite": "^8.3.2"
23
23
  },
24
24
  "dependencies": {
25
- "discodreamer": "^1.0.4"
25
+ "discodreamer": "^1.0.5"
26
26
  }
27
27
  }