litecanvas 0.67.2 → 0.67.3

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,14 +1,15 @@
1
1
  {
2
2
  "name": "litecanvas",
3
- "version": "0.67.2",
3
+ "version": "0.67.3",
4
4
  "description": "Lightweight HTML5 canvas engine suitable for small games and animations.",
5
5
  "license": "MIT",
6
6
  "author": "Luiz Bills <luizbills@pm.me>",
7
7
  "contributors": [],
8
8
  "devDependencies": {
9
+ "@swc/core": "^1.7.26",
9
10
  "ava": "^6.1.3",
10
11
  "esbuild": "^0.24.0",
11
- "@swc/core": "^1.7.26"
12
+ "prettier": "^3.3.3"
12
13
  },
13
14
  "homepage": "https://litecanvas.github.io/about.html",
14
15
  "repository": {
@@ -27,7 +28,7 @@
27
28
  "dev": "esbuild src/web.js --bundle --watch --outfile=dist/dist.js --servedir=.",
28
29
  "build": "node script/build.js",
29
30
  "gzip-size": "gzip -9 -c dist/dist.min.js | wc -c | xargs printf \" Gzip size: %s bytes\n\"",
30
- "format": "npx prettier -w src/* samples/* types/*",
31
+ "format": "prettier -w src/* samples/* types/* script/* types/*",
31
32
  "prepare": "npm run build && npm run gzip-size",
32
33
  "prepublishOnly": "npm test"
33
34
  },
package/src/zzfx.js CHANGED
@@ -80,12 +80,12 @@ export const zzfx = (
80
80
  (a < e
81
81
  ? a / e
82
82
  : a < e + m
83
- ? 1 - ((a - e) / m) * (1 - w)
84
- : a < e + m + r
85
- ? w
86
- : a < h - c
87
- ? ((h - a - c) / t) * w
88
- : 0)),
83
+ ? 1 - ((a - e) / m) * (1 - w)
84
+ : a < e + m + r
85
+ ? w
86
+ : a < h - c
87
+ ? ((h - a - c) / t) * w
88
+ : 0)),
89
89
  (f = c
90
90
  ? f / 2 +
91
91
  (c > a
package/types/index.d.ts CHANGED
@@ -205,6 +205,14 @@ declare global {
205
205
  * @returns the random number
206
206
  */
207
207
  function randi(min?: number, max?: number): number
208
+ /**
209
+ * If a value is passed, initializes the random number generator with an explicit seed value.
210
+ * Otherwise, returns the current seed state.
211
+ *
212
+ * @param [value]
213
+ * @returns the seed state
214
+ */
215
+ function seed(value?: number): number
208
216
 
209
217
  /** BASIC GRAPHICS API */
210
218
  /**
package/types/types.d.ts CHANGED
@@ -194,6 +194,14 @@ type LitecanvasInstance = {
194
194
  * @returns the random number
195
195
  */
196
196
  randi(min?: number, max?: number): number
197
+ /**
198
+ * If a value is passed, initializes the random number generator with an explicit seed value.
199
+ * Otherwise, returns the current seed state.
200
+ *
201
+ * @param [value]
202
+ * @returns the seed state
203
+ */
204
+ seed(value?: number): number
197
205
 
198
206
  /** BASIC GRAPHICS API */
199
207
  /**