@zakkster/lite-tools 2.0.5 → 2.0.7
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/LiteEngine.d.ts +6 -6
- package/LiteEngine.js +7 -7
- package/README.md +2 -2
- package/package.json +1 -1
package/LiteEngine.d.ts
CHANGED
|
@@ -110,9 +110,9 @@ export { Vec2 } from '@zakkster/lite-vec';
|
|
|
110
110
|
export { Seek, Flee, Wander, Arrive, Pursuit, Evade, PathFollow, Separation, Alignment, Cohesion, Flock } from '@zakkster/lite-steer';
|
|
111
111
|
|
|
112
112
|
// Game layer
|
|
113
|
-
export {
|
|
113
|
+
export { BitmapFont } from '@zakkster/lite-bmfont';
|
|
114
114
|
export { InputPoller } from '@zakkster/lite-gamepad';
|
|
115
|
-
export {
|
|
115
|
+
export { CinematicCamera } from '@zakkster/lite-camera';
|
|
116
116
|
export { SpatialHash } from '@zakkster/lite-spatial';
|
|
117
117
|
export { testPolygonPolygon, translatePoly, rotatePoly } from '@zakkster/lite-sat';
|
|
118
118
|
export { PathFinder } from '@zakkster/lite-path';
|
|
@@ -145,8 +145,8 @@ import type {Viewport} from 'lite-viewport';
|
|
|
145
145
|
import type {FSM} from 'lite-states';
|
|
146
146
|
import type {FPSMeter} from 'lite-fps-meter';
|
|
147
147
|
import type {PointerTracker} from 'lite-pointer-tracker';
|
|
148
|
-
import type {
|
|
149
|
-
import type {
|
|
148
|
+
import type {BitmapFont} from '@zakkster/lite-bmfont';
|
|
149
|
+
import type {CinematicCamera} from '@zakkster/lite-camera';
|
|
150
150
|
import type {SpatialHash} from '@zakkster/lite-spatial';
|
|
151
151
|
import type {EmberEngine} from '@zakkster/lite-embers';
|
|
152
152
|
import type {SmokeEngine} from '@zakkster/lite-smoke';
|
|
@@ -328,7 +328,7 @@ export interface RetroArcadeTextResult extends Destroyable {
|
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
export interface ProceduralWorldResult extends Destroyable {
|
|
331
|
-
cam:
|
|
331
|
+
cam: CinematicCamera;
|
|
332
332
|
render(dt: number): void;
|
|
333
333
|
moveTo(x: number, y: number): void;
|
|
334
334
|
reseed(s?: number): void;
|
|
@@ -375,7 +375,7 @@ export interface TimelineShowcaseResult extends Destroyable {
|
|
|
375
375
|
export interface SparkImpactResult extends Destroyable {
|
|
376
376
|
sparks: SparkEngine;
|
|
377
377
|
fireworks: FireworksEngine;
|
|
378
|
-
cam:
|
|
378
|
+
cam: CinematicCamera;
|
|
379
379
|
explodeAt(x: number, y: number): void;
|
|
380
380
|
update(dt: number): void;
|
|
381
381
|
}
|
package/LiteEngine.js
CHANGED
|
@@ -111,9 +111,9 @@ export {
|
|
|
111
111
|
}from '@zakkster/lite-steer';
|
|
112
112
|
|
|
113
113
|
// Game layer
|
|
114
|
-
export {
|
|
114
|
+
export {BitmapFont} from '@zakkster/lite-bmfont';
|
|
115
115
|
export {InputPoller} from '@zakkster/lite-gamepad';
|
|
116
|
-
export {
|
|
116
|
+
export {CinematicCamera} from '@zakkster/lite-camera';
|
|
117
117
|
export {SpatialHash} from '@zakkster/lite-spatial';
|
|
118
118
|
export {testPolygonPolygon, translatePoly, rotatePoly} from '@zakkster/lite-sat';
|
|
119
119
|
export {PathFinder} from '@zakkster/lite-path';
|
|
@@ -170,9 +170,9 @@ import {confetti as confettiFn} from '@zakkster/lite-confetti';
|
|
|
170
170
|
import {liteId} from '@zakkster/lite-id';
|
|
171
171
|
import {Vec2} from '@zakkster/lite-vec';
|
|
172
172
|
import {Flock, Wander, Separation, Alignment, Cohesion} from '@zakkster/lite-steer';
|
|
173
|
-
import {
|
|
173
|
+
import {BitmapFont} from '@zakkster/lite-bmfont';
|
|
174
174
|
import {InputPoller} from '@zakkster/lite-gamepad';
|
|
175
|
-
import {
|
|
175
|
+
import {CinematicCamera} from '@zakkster/lite-camera';
|
|
176
176
|
import {SpatialHash} from '@zakkster/lite-spatial';
|
|
177
177
|
import {PathFinder} from '@zakkster/lite-path';
|
|
178
178
|
import {WFC} from '@zakkster/lite-wfc';
|
|
@@ -967,7 +967,7 @@ export const Recipes = {
|
|
|
967
967
|
retroArcadeText(ctx, fontImage, fontData, options = {}) {
|
|
968
968
|
const {seed = Date.now(), maxNumbers = 30} = options;
|
|
969
969
|
const rng = new Random(seed);
|
|
970
|
-
const font = new
|
|
970
|
+
const font = new BitmapFont(fontImage, fontData);
|
|
971
971
|
const numbers = [];
|
|
972
972
|
let score = 0;
|
|
973
973
|
|
|
@@ -1016,7 +1016,7 @@ export const Recipes = {
|
|
|
1016
1016
|
const ctx = canvas.getContext('2d');
|
|
1017
1017
|
const rng = new Random(seed);
|
|
1018
1018
|
seedNoise(seed);
|
|
1019
|
-
const cam = new
|
|
1019
|
+
const cam = new CinematicCamera({smoothing: 0.08, deadzone: 40});
|
|
1020
1020
|
const gradient = new Gradient([
|
|
1021
1021
|
{l: 0.2, c: 0.15, h: 220}, // deep water
|
|
1022
1022
|
{l: 0.4, c: 0.2, h: 200}, // shallow
|
|
@@ -1384,7 +1384,7 @@ export const Recipes = {
|
|
|
1384
1384
|
const ctx = canvas.getContext('2d');
|
|
1385
1385
|
const sparks = new SparkEngine(maxSparks);
|
|
1386
1386
|
const fireworks = new FireworksEngine(maxFireworks);
|
|
1387
|
-
const cam = new
|
|
1387
|
+
const cam = new CinematicCamera({smoothing: 0.05});
|
|
1388
1388
|
let w = canvas.width, h = canvas.height;
|
|
1389
1389
|
|
|
1390
1390
|
function explodeAt(x, y) {
|
package/README.md
CHANGED
|
@@ -418,7 +418,7 @@ hud.update(dt);
|
|
|
418
418
|
console.log(hud.getScore()); // cumulative
|
|
419
419
|
```
|
|
420
420
|
|
|
421
|
-
**Composes:** `
|
|
421
|
+
**Composes:** `BitmapFont` + `easeOutCubic` + `easeInOutCubic` + `liteId()` + `Random`
|
|
422
422
|
|
|
423
423
|
</details>
|
|
424
424
|
|
|
@@ -442,7 +442,7 @@ world.render(dt);
|
|
|
442
442
|
world.reseed(9999);
|
|
443
443
|
```
|
|
444
444
|
|
|
445
|
-
**Composes:** `Noise.fbm2()` + `Gradient.at()` + `
|
|
445
|
+
**Composes:** `Noise.fbm2()` + `Gradient.at()` + `CinematicCamera` (deadzone + smoothing) + `toCssOklch()`
|
|
446
446
|
|
|
447
447
|
</details>
|
|
448
448
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zakkster/lite-tools",
|
|
3
3
|
"author": "Zahary Shinikchiev <shinikchiev@yahoo.com>",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.7",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "The standard library for high-performance web presentation — 45+ micro-libraries, 24 recipes, zero-GC, deterministic, tree-shakeable.",
|
|
7
7
|
"type": "module",
|