zx-kit 0.17.0 → 0.18.0

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.
@@ -1,5 +1,6 @@
1
1
  import type { Sprite } from './sprite.js';
2
2
  import type { TileMap } from './tilemap.js';
3
+ import type { Bitmap } from './renderer.js';
3
4
  /**
4
5
  * Axis-aligned bounding rectangle in game pixels.
5
6
  */
@@ -30,6 +31,16 @@ export declare function rectsOverlap(a: Rect, b: Rect): boolean;
30
31
  * if (spritesOverlap(player, coin)) collectCoin()
31
32
  */
32
33
  export declare function spritesOverlap(a: Sprite, b: Sprite): boolean;
34
+ /**
35
+ * Returns the bounding `Rect` for a {@link Bitmap} positioned at `(x, y)`.
36
+ * Works for any size — `16×16`, `16×24`, `32×32`, `96×128`, etc.
37
+ *
38
+ * @example
39
+ * const heroRect = bitmapRect(HERO_BITMAP, hero.x, hero.y)
40
+ * const enemyRect = bitmapRect(ENEMY_BITMAP, enemy.x, enemy.y)
41
+ * if (rectsOverlap(heroRect, enemyRect)) damage(hero)
42
+ */
43
+ export declare function bitmapRect(bitmap: Bitmap, x: number, y: number): Rect;
33
44
  /**
34
45
  * Returns `true` when the game pixel at `(px, py)` falls inside a solid tile.
35
46
  * Converts pixel coords to tile coords via integer division by `CELL`.
@@ -40,15 +51,45 @@ export declare function spritesOverlap(a: Sprite, b: Sprite): boolean;
40
51
  */
41
52
  export declare function isSolidAt(map: TileMap, px: number, py: number): boolean;
42
53
  /**
43
- * Resolves a proposed horizontal movement for a sprite against solid tiles.
44
- * Tests the leading edge of the sprite's bounding box at the target x position.
45
- * Returns the clamped x coordinate and collision flags.
54
+ * Generic horizontal sweep-resolver for any axis-aligned rectangle.
55
+ * Works correctly for sprites taller than `CELL` (e.g. 16×24 hero) the leading
56
+ * edge is checked across every tile row the rectangle spans, not just two corners.
46
57
  *
47
- * Call BEFORE `resolveY` so each axis is resolved independently.
58
+ * Returns the clamped x and collision flags. On collision, the rectangle is
59
+ * placed flush against the wall.
48
60
  *
49
- * @param sprite - Sprite being moved (uses current `sprite.y` for vertical extent)
50
- * @param map - Tile map to test solidity against
51
- * @param newX - Proposed new x position (after `moveSprite`)
61
+ * @example
62
+ * const rect = bitmapRect(HERO, hero.x, hero.y)
63
+ * const r = resolveRectX(rect, map, hero.x + dx)
64
+ * hero.x = r.x
65
+ * if (r.hitLeft || r.hitRight) hero.vx = 0
66
+ */
67
+ export declare function resolveRectX(rect: Rect, map: TileMap, newX: number): {
68
+ x: number;
69
+ hitLeft: boolean;
70
+ hitRight: boolean;
71
+ };
72
+ /**
73
+ * Generic vertical sweep-resolver for any axis-aligned rectangle.
74
+ * Works correctly for sprites wider than `CELL` — the leading edge is checked
75
+ * across every tile column the rectangle spans.
76
+ *
77
+ * @example
78
+ * const rect = bitmapRect(HERO, hero.x, hero.y)
79
+ * const r = resolveRectY(rect, map, hero.y + dy)
80
+ * hero.y = r.y
81
+ * if (r.hitBottom) { hero.vy = 0; onGround = true }
82
+ */
83
+ export declare function resolveRectY(rect: Rect, map: TileMap, newY: number): {
84
+ y: number;
85
+ hitTop: boolean;
86
+ hitBottom: boolean;
87
+ };
88
+ /**
89
+ * Resolves a proposed horizontal movement for an 8×8 sprite against solid tiles.
90
+ * Thin wrapper over {@link resolveRectX} preserved for backward compatibility.
91
+ *
92
+ * Call BEFORE `resolveY` so each axis is resolved independently.
52
93
  *
53
94
  * @example
54
95
  * moveSprite(player, dt)
@@ -62,22 +103,15 @@ export declare function resolveX(sprite: Sprite, map: TileMap, newX: number): {
62
103
  hitRight: boolean;
63
104
  };
64
105
  /**
65
- * Resolves a proposed vertical movement for a sprite against solid tiles.
66
- * Tests the leading edge of the sprite's bounding box at the target y position.
67
- * Returns the clamped y coordinate and collision flags.
106
+ * Resolves a proposed vertical movement for an 8×8 sprite against solid tiles.
107
+ * Thin wrapper over {@link resolveRectY} preserved for backward compatibility.
68
108
  *
69
109
  * Typical platformer pattern: `hitBottom` means the sprite landed on a floor.
70
- * Zero out `vy` on `hitBottom` and `hitTop` to prevent tunnelling.
71
- *
72
- * @param sprite - Sprite being moved (uses current `sprite.x` for horizontal extent)
73
- * @param map - Tile map to test solidity against
74
- * @param newY - Proposed new y position (after `moveSprite`)
75
110
  *
76
111
  * @example
77
112
  * const ry = resolveY(player, map, player.y)
78
113
  * player.y = ry.y
79
114
  * if (ry.hitBottom) { player.vy = 0; onGround = true }
80
- * if (ry.hitTop) { player.vy = 0 }
81
115
  */
82
116
  export declare function resolveY(sprite: Sprite, map: TileMap, newY: number): {
83
117
  y: number;
@@ -1 +1 @@
1
- {"version":3,"file":"collision.d.ts","sourceRoot":"","sources":["../src/collision.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C;;GAEG;AACH,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAKtD;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAEvE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,MAAM,GACX;IAA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E,EAAE,MAAM,GAAG,OAAO,CAEvE;AAwBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,MAAM,GACX;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAuBpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,MAAM,GACX;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAuBpD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,MAAM,GACX;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CAEpD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,QAAQ,CACtB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,MAAM,GACX;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAEpD"}
package/dist/collision.js CHANGED
@@ -29,6 +29,18 @@ export function rectsOverlap(a, b) {
29
29
  export function spritesOverlap(a, b) {
30
30
  return rectsOverlap(spriteRect(a), spriteRect(b));
31
31
  }
32
+ /**
33
+ * Returns the bounding `Rect` for a {@link Bitmap} positioned at `(x, y)`.
34
+ * Works for any size — `16×16`, `16×24`, `32×32`, `96×128`, etc.
35
+ *
36
+ * @example
37
+ * const heroRect = bitmapRect(HERO_BITMAP, hero.x, hero.y)
38
+ * const enemyRect = bitmapRect(ENEMY_BITMAP, enemy.x, enemy.y)
39
+ * if (rectsOverlap(heroRect, enemyRect)) damage(hero)
40
+ */
41
+ export function bitmapRect(bitmap, x, y) {
42
+ return { x, y, w: bitmap.width, h: bitmap.height };
43
+ }
32
44
  /**
33
45
  * Returns `true` when the game pixel at `(px, py)` falls inside a solid tile.
34
46
  * Converts pixel coords to tile coords via integer division by `CELL`.
@@ -40,88 +52,125 @@ export function spritesOverlap(a, b) {
40
52
  export function isSolidAt(map, px, py) {
41
53
  return map.isSolid(Math.floor(px / CELL), Math.floor(py / CELL));
42
54
  }
55
+ // ─── Generic rect-based collision (works for any sprite size) ────────────────
56
+ function _solidAlongVerticalEdge(map, edgeX, y0, y1) {
57
+ // Check every tile row the edge from y0..y1 crosses (handles tall sprites > CELL).
58
+ const tileTop = Math.floor(y0 / CELL);
59
+ const tileBot = Math.floor(y1 / CELL);
60
+ for (let ty = tileTop; ty <= tileBot; ty++) {
61
+ if (isSolidAt(map, edgeX, ty * CELL))
62
+ return true;
63
+ }
64
+ return false;
65
+ }
66
+ function _solidAlongHorizontalEdge(map, edgeY, x0, x1) {
67
+ // Check every tile column the edge from x0..x1 crosses (handles wide sprites > CELL).
68
+ const tileLeft = Math.floor(x0 / CELL);
69
+ const tileRight = Math.floor(x1 / CELL);
70
+ for (let tx = tileLeft; tx <= tileRight; tx++) {
71
+ if (isSolidAt(map, tx * CELL, edgeY))
72
+ return true;
73
+ }
74
+ return false;
75
+ }
43
76
  /**
44
- * Resolves a proposed horizontal movement for a sprite against solid tiles.
45
- * Tests the leading edge of the sprite's bounding box at the target x position.
46
- * Returns the clamped x coordinate and collision flags.
77
+ * Generic horizontal sweep-resolver for any axis-aligned rectangle.
78
+ * Works correctly for sprites taller than `CELL` (e.g. 16×24 hero) the leading
79
+ * edge is checked across every tile row the rectangle spans, not just two corners.
47
80
  *
48
- * Call BEFORE `resolveY` so each axis is resolved independently.
49
- *
50
- * @param sprite - Sprite being moved (uses current `sprite.y` for vertical extent)
51
- * @param map - Tile map to test solidity against
52
- * @param newX - Proposed new x position (after `moveSprite`)
81
+ * Returns the clamped x and collision flags. On collision, the rectangle is
82
+ * placed flush against the wall.
53
83
  *
54
84
  * @example
55
- * moveSprite(player, dt)
56
- * const rx = resolveX(player, map, player.x)
57
- * player.x = rx.x
58
- * if (rx.hitLeft || rx.hitRight) player.vx = 0
85
+ * const rect = bitmapRect(HERO, hero.x, hero.y)
86
+ * const r = resolveRectX(rect, map, hero.x + dx)
87
+ * hero.x = r.x
88
+ * if (r.hitLeft || r.hitRight) hero.vx = 0
59
89
  */
60
- export function resolveX(sprite, map, newX) {
61
- const y0 = sprite.y;
62
- const y1 = sprite.y + CELL - 1;
90
+ export function resolveRectX(rect, map, newX) {
91
+ const y0 = rect.y;
92
+ const y1 = rect.y + rect.h - 1;
63
93
  let x = newX;
64
94
  let hitLeft = false;
65
95
  let hitRight = false;
66
- if (newX < sprite.x) {
67
- // Moving left check left edge
68
- if (isSolidAt(map, newX, y0) || isSolidAt(map, newX, y1)) {
69
- // Clamp to in-bounds before computing tile column (avoids negative col from OOB overshoot)
96
+ if (newX < rect.x) {
97
+ if (_solidAlongVerticalEdge(map, newX, y0, y1)) {
70
98
  const safeX = Math.max(0, newX);
71
99
  x = (Math.floor(safeX / CELL) + 1) * CELL;
72
100
  hitLeft = true;
73
101
  }
74
102
  }
75
- else if (newX > sprite.x) {
76
- // Moving right check right edge
77
- if (isSolidAt(map, newX + CELL - 1, y0) || isSolidAt(map, newX + CELL - 1, y1)) {
78
- const safeEdge = Math.min(map.cols * CELL - 1, newX + CELL - 1);
79
- x = Math.floor(safeEdge / CELL) * CELL - CELL;
103
+ else if (newX > rect.x) {
104
+ const rightEdge = newX + rect.w - 1;
105
+ if (_solidAlongVerticalEdge(map, rightEdge, y0, y1)) {
106
+ const safeEdge = Math.min(map.cols * CELL - 1, rightEdge);
107
+ x = Math.floor(safeEdge / CELL) * CELL - rect.w;
80
108
  hitRight = true;
81
109
  }
82
110
  }
83
111
  return { x, hitLeft, hitRight };
84
112
  }
85
113
  /**
86
- * Resolves a proposed vertical movement for a sprite against solid tiles.
87
- * Tests the leading edge of the sprite's bounding box at the target y position.
88
- * Returns the clamped y coordinate and collision flags.
89
- *
90
- * Typical platformer pattern: `hitBottom` means the sprite landed on a floor.
91
- * Zero out `vy` on `hitBottom` and `hitTop` to prevent tunnelling.
92
- *
93
- * @param sprite - Sprite being moved (uses current `sprite.x` for horizontal extent)
94
- * @param map - Tile map to test solidity against
95
- * @param newY - Proposed new y position (after `moveSprite`)
114
+ * Generic vertical sweep-resolver for any axis-aligned rectangle.
115
+ * Works correctly for sprites wider than `CELL` the leading edge is checked
116
+ * across every tile column the rectangle spans.
96
117
  *
97
118
  * @example
98
- * const ry = resolveY(player, map, player.y)
99
- * player.y = ry.y
100
- * if (ry.hitBottom) { player.vy = 0; onGround = true }
101
- * if (ry.hitTop) { player.vy = 0 }
119
+ * const rect = bitmapRect(HERO, hero.x, hero.y)
120
+ * const r = resolveRectY(rect, map, hero.y + dy)
121
+ * hero.y = r.y
122
+ * if (r.hitBottom) { hero.vy = 0; onGround = true }
102
123
  */
103
- export function resolveY(sprite, map, newY) {
104
- const x0 = sprite.x;
105
- const x1 = sprite.x + CELL - 1;
124
+ export function resolveRectY(rect, map, newY) {
125
+ const x0 = rect.x;
126
+ const x1 = rect.x + rect.w - 1;
106
127
  let y = newY;
107
128
  let hitTop = false;
108
129
  let hitBottom = false;
109
- if (newY < sprite.y) {
110
- // Moving up check top edge
111
- if (isSolidAt(map, x0, newY) || isSolidAt(map, x1, newY)) {
130
+ if (newY < rect.y) {
131
+ if (_solidAlongHorizontalEdge(map, newY, x0, x1)) {
112
132
  const safeY = Math.max(0, newY);
113
133
  y = (Math.floor(safeY / CELL) + 1) * CELL;
114
134
  hitTop = true;
115
135
  }
116
136
  }
117
- else if (newY > sprite.y) {
118
- // Moving down check bottom edge
119
- if (isSolidAt(map, x0, newY + CELL - 1) || isSolidAt(map, x1, newY + CELL - 1)) {
120
- const safeEdge = Math.min(map.rows * CELL - 1, newY + CELL - 1);
121
- y = Math.floor(safeEdge / CELL) * CELL - CELL;
137
+ else if (newY > rect.y) {
138
+ const bottomEdge = newY + rect.h - 1;
139
+ if (_solidAlongHorizontalEdge(map, bottomEdge, x0, x1)) {
140
+ const safeEdge = Math.min(map.rows * CELL - 1, bottomEdge);
141
+ y = Math.floor(safeEdge / CELL) * CELL - rect.h;
122
142
  hitBottom = true;
123
143
  }
124
144
  }
125
145
  return { y, hitTop, hitBottom };
126
146
  }
147
+ /**
148
+ * Resolves a proposed horizontal movement for an 8×8 sprite against solid tiles.
149
+ * Thin wrapper over {@link resolveRectX} preserved for backward compatibility.
150
+ *
151
+ * Call BEFORE `resolveY` so each axis is resolved independently.
152
+ *
153
+ * @example
154
+ * moveSprite(player, dt)
155
+ * const rx = resolveX(player, map, player.x)
156
+ * player.x = rx.x
157
+ * if (rx.hitLeft || rx.hitRight) player.vx = 0
158
+ */
159
+ export function resolveX(sprite, map, newX) {
160
+ return resolveRectX(spriteRect(sprite), map, newX);
161
+ }
162
+ /**
163
+ * Resolves a proposed vertical movement for an 8×8 sprite against solid tiles.
164
+ * Thin wrapper over {@link resolveRectY} preserved for backward compatibility.
165
+ *
166
+ * Typical platformer pattern: `hitBottom` means the sprite landed on a floor.
167
+ *
168
+ * @example
169
+ * const ry = resolveY(player, map, player.y)
170
+ * player.y = ry.y
171
+ * if (ry.hitBottom) { player.vy = 0; onGround = true }
172
+ */
173
+ export function resolveY(sprite, map, newY) {
174
+ return resolveRectY(spriteRect(sprite), map, newY);
175
+ }
127
176
  //# sourceMappingURL=collision.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collision.js","sourceRoot":"","sources":["../src/collision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAcnC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc;IACvC,OAAO,EAAE,CAAC,EAAE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E,IAAI,CAAC,CAAA;AACpD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,QAAQ,CACtB,MAAc,EACd,GAAY,EACZ,IAAY;IAEZ,OAAO,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;AACpD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zx-kit",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/zrebec/zx-kit.git"