castle-web-cli 0.4.48 → 0.4.49
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/kits/basic-2d/CLAUDE.md +1 -0
- package/package.json +1 -1
package/kits/basic-2d/CLAUDE.md
CHANGED
|
@@ -80,6 +80,7 @@ Rules: every actor needs a unique `id` (any string) and almost always a `Layout`
|
|
|
80
80
|
|
|
81
81
|
- **Layout** — `{ x, y, width, height, z?, rotation? }`. Every actor needs one. `z` orders draw (low first). `rotation` is degrees about the center.
|
|
82
82
|
- **Drawing** — `{ file: "drawings/foo.drawing", tint?: "#rrggbbaa" }`. Renders the pixel-art file scaled into the Layout box. `tint` multiplies; use white (`#ffffffff`) or omit for the original colors. For a solid-color rectangle, point `file` at `drawings/block.drawing` (an 8×8 white pixel sprite) and set `tint` to your color.
|
|
83
|
+
- **Don't distort pixel art.** Keep an actor's Layout aspect ratio close to its drawing's native aspect ratio, and don't scale a sprite way up — stretching a small sprite into a long/tall actor wrecks the pixels (a brick sprite stretched into a wall ruins the bricks). For long surfaces (walls, floors, platforms), make a drawing proportioned to the surface (or tile several actors) instead of stretching one. `block.drawing` is the exception — it's a flat solid fill, so any size/tint is fine.
|
|
83
84
|
- **Collider** — `{ kind: 'solid'|'pickup', width, height, offsetX?, offsetY?, debug? }`. Just a rect; the framework does NOT auto-resolve collisions for you. Use it as data:
|
|
84
85
|
|
|
85
86
|
```jsx
|