kaplay 3001.0.1 → 3001.0.5
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/CHANGELOG.md +121 -35
- package/README.md +7 -6
- package/dist/declaration/assets/asset.d.ts +2 -0
- package/dist/declaration/assets/asset.d.ts.map +1 -1
- package/dist/declaration/assets/sprite.d.ts +1 -1
- package/dist/declaration/audio/playMusic.d.ts.map +1 -1
- package/dist/declaration/audio/volume.d.ts +2 -0
- package/dist/declaration/audio/volume.d.ts.map +1 -1
- package/dist/declaration/components/level/index.d.ts +5 -5
- package/dist/declaration/components/level/tile.d.ts +1 -0
- package/dist/declaration/components/level/tile.d.ts.map +1 -1
- package/dist/declaration/components/misc/animate.d.ts +14 -3
- package/dist/declaration/components/misc/animate.d.ts.map +1 -1
- package/dist/declaration/components/misc/textInput.d.ts +4 -0
- package/dist/declaration/components/misc/textInput.d.ts.map +1 -1
- package/dist/declaration/components/misc/timer.d.ts +10 -3
- package/dist/declaration/components/misc/timer.d.ts.map +1 -1
- package/dist/declaration/components/physics/area.d.ts.map +1 -1
- package/dist/declaration/components/physics/body.d.ts +4 -2
- package/dist/declaration/components/physics/body.d.ts.map +1 -1
- package/dist/declaration/components/physics/effectors.d.ts.map +1 -1
- package/dist/declaration/constants.d.ts +1 -0
- package/dist/declaration/constants.d.ts.map +1 -1
- package/dist/declaration/game/camera.d.ts +12 -4
- package/dist/declaration/game/camera.d.ts.map +1 -1
- package/dist/declaration/game/events/eventMap.d.ts +9 -1
- package/dist/declaration/game/events/eventMap.d.ts.map +1 -1
- package/dist/declaration/game/events/events.d.ts +6 -0
- package/dist/declaration/game/events/events.d.ts.map +1 -1
- package/dist/declaration/game/game.d.ts +6 -0
- package/dist/declaration/game/game.d.ts.map +1 -1
- package/dist/declaration/game/layers.d.ts +4 -1
- package/dist/declaration/game/layers.d.ts.map +1 -1
- package/dist/declaration/game/level.d.ts.map +1 -1
- package/dist/declaration/game/make.d.ts.map +1 -1
- package/dist/declaration/gfx/draw/drawDebug.d.ts.map +1 -1
- package/dist/declaration/gfx/draw/drawTexture.d.ts.map +1 -1
- package/dist/declaration/gfx/formatText.d.ts +1 -1
- package/dist/declaration/gfx/formatText.d.ts.map +1 -1
- package/dist/declaration/gfx/gfx.d.ts.map +1 -1
- package/dist/declaration/global.d.ts +20 -0
- package/dist/declaration/kaplay.d.ts.map +1 -1
- package/dist/declaration/math/math.d.ts +44 -0
- package/dist/declaration/math/math.d.ts.map +1 -1
- package/dist/declaration/types.d.ts +1687 -330
- package/dist/declaration/types.d.ts.map +1 -1
- package/dist/declaration/utils/events.d.ts +2 -1
- package/dist/declaration/utils/events.d.ts.map +1 -1
- package/dist/doc.d.ts +1819 -347
- package/dist/kaboom.cjs +8 -8
- package/dist/kaboom.cjs.map +4 -4
- package/dist/kaboom.js +8 -8
- package/dist/kaboom.js.map +4 -4
- package/dist/kaboom.mjs +8 -8
- package/dist/kaboom.mjs.map +4 -4
- package/dist/kaplay.cjs +8 -8
- package/dist/kaplay.cjs.map +4 -4
- package/dist/kaplay.js +8 -8
- package/dist/kaplay.js.map +4 -4
- package/dist/kaplay.mjs +8 -8
- package/dist/kaplay.mjs.map +4 -4
- package/package.json +5 -5
- package/dist/declaration/math/tests/color.spec.d.ts +0 -2
- package/dist/declaration/math/tests/color.spec.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,92 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Changelog
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is (mostly) based on
|
|
6
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
|
|
7
|
+
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
|
+
|
|
9
|
+
## [4000.0.0] - TBD
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added `ellipse()` component.
|
|
14
|
+
- Added circle and (rotated) ellipse collision shapes.
|
|
15
|
+
- Added `clipLineToRect()`
|
|
16
|
+
- Added support to circle shapes in `area()`.
|
|
17
|
+
- Added `obj.setParent()` to change the parent of a game object.
|
|
18
|
+
- Added `fakeMouse()` to create a fake mouse cursor.
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
const myCursor = add([fakeMouse(), sprite("kat"), pos(100, 100)]);
|
|
22
|
+
|
|
23
|
+
myCursor.press(); // trigger onClick events if the mouse is over
|
|
24
|
+
myCursor.release();
|
|
25
|
+
myCursor.move(vec2(100, 200)); // move as your wish
|
|
26
|
+
```
|
|
27
|
+
- Added restitution and friction.
|
|
28
|
+
- Added `k.system()` to replace internal events or create new.
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
system("collision", () => {
|
|
32
|
+
// system code
|
|
33
|
+
}, [LCEvents.AfterFixedUpdate, LCEvents.AfterUpdate]),
|
|
34
|
+
```
|
|
35
|
+
- Added LCEvents enum for identify different lifecycle events.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- Replaced the Separating Axis Theorem (SAT) with the "Gilbert–Johnson–Keerthi"
|
|
40
|
+
(`GJK`) distance algorithm.
|
|
41
|
+
- Changed default behaviour of `kaplay({ tagsAsComponents: false })` to `false`.
|
|
42
|
+
|
|
43
|
+
## [3001.0.5] - 2024-12-18
|
|
44
|
+
|
|
45
|
+
### Added
|
|
46
|
+
|
|
47
|
+
- Added tags and components separation in `KAPLAYOpt.tagsAsComponents`
|
|
48
|
+
(**experimental**)
|
|
49
|
+
- Added `.is()`, `.tag()` and `.untag()` to `GameObjRaw`, check, add and remove
|
|
50
|
+
(**experimental**)
|
|
51
|
+
- Added `.has()` to `GameObjRaw`, to check if a game object has a component tags
|
|
52
|
+
(**experimental**)
|
|
53
|
+
- Added events for listen to comps being removed or added `onUse()` and
|
|
54
|
+
`onUnused()` (**experimental**)
|
|
55
|
+
- Added `k.cancel()` to cancel the current event (**experimental**)
|
|
56
|
+
- ```js
|
|
57
|
+
onKeyPress("space", () => {
|
|
58
|
+
// do something
|
|
59
|
+
// cancel the event
|
|
60
|
+
return cancel();
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
- Added `getDefaultLayer()` to get the default layer (**experimental**)
|
|
64
|
+
- Added `getLayers()` to get the layers list (**experimental**)
|
|
65
|
+
- Added many JSDoc specifiers on many functions (@require, @deprecated, @since,
|
|
66
|
+
@group, etc)
|
|
67
|
+
|
|
68
|
+
### Changed
|
|
69
|
+
|
|
70
|
+
- Added `.use()`, `.unuse()` and `.has()` to `GameObjRaw`, to add, remove and
|
|
71
|
+
check components. This only works with `KAPLAYOpt.tagsAsComponents` set to
|
|
72
|
+
`true` (**experimental**)
|
|
73
|
+
|
|
74
|
+
### Deprecated
|
|
75
|
+
|
|
76
|
+
- Deprecated camera methods `camScale()`, `camPos()` and `camRot()` in favor of
|
|
77
|
+
`setCamScale()`, `getCamScale()`, `setCamPos()`, `getCamPos()`, `setCamRot()`
|
|
78
|
+
and `getCamRot`.
|
|
79
|
+
- Deprecated `camTransform()` in favor of `getCamTransform()`.
|
|
80
|
+
- Deprecated `camFlash()` in favor of `flash()`, for a `shake()`-like name.
|
|
81
|
+
|
|
82
|
+
### Fixed
|
|
83
|
+
|
|
84
|
+
- Fixed artifacts present in some TrueType fonts.
|
|
85
|
+
- Fixed `.use()` and `.unuse()` with area components.
|
|
86
|
+
|
|
87
|
+
## [3001.0.0] "Spooky Beans!" - 2024-10-31
|
|
88
|
+
|
|
89
|
+
### Input
|
|
4
90
|
|
|
5
91
|
- Added input bindings, `onButtonPress`, `onButtonRelease`, `onButtonDown`, and
|
|
6
92
|
it's corresponding boolean versions, `isButtonPressed`, `isButtonDown` and
|
|
@@ -69,7 +155,7 @@
|
|
|
69
155
|
});
|
|
70
156
|
```
|
|
71
157
|
|
|
72
|
-
|
|
158
|
+
### Physics
|
|
73
159
|
|
|
74
160
|
- added effector components: `areaEffector()`, `buoyancyEffector()`,
|
|
75
161
|
`pointEffector()`, `surfaceEffector()`.
|
|
@@ -80,7 +166,7 @@
|
|
|
80
166
|
- added `pathfinder()` component to calculate a list of waypoints on a graph.
|
|
81
167
|
- now collision checks are only done if there's area objects.
|
|
82
168
|
|
|
83
|
-
|
|
169
|
+
### Game Object
|
|
84
170
|
|
|
85
171
|
- added `getTreeRoot()` to get the game's root object, which is the parent of
|
|
86
172
|
all other objects
|
|
@@ -101,7 +187,7 @@
|
|
|
101
187
|
debug.log(obj.tags); // ["enemy", "dangerous"]
|
|
102
188
|
```
|
|
103
189
|
|
|
104
|
-
|
|
190
|
+
### Components
|
|
105
191
|
|
|
106
192
|
- added support to setters/getters syntax in `ScaleComp` and `SpriteComp`
|
|
107
193
|
components
|
|
@@ -114,7 +200,7 @@
|
|
|
114
200
|
obj.sprite = "bag";
|
|
115
201
|
```
|
|
116
202
|
|
|
117
|
-
|
|
203
|
+
### Rendering and Animation
|
|
118
204
|
|
|
119
205
|
- added the `animate()` component to _animate_ the properties of an object using
|
|
120
206
|
keyframes. Check out
|
|
@@ -214,7 +300,7 @@
|
|
|
214
300
|
- Added `SpriteComp.animFrame` to get the frame of the current animation (not on
|
|
215
301
|
the spritesheet)
|
|
216
302
|
|
|
217
|
-
|
|
303
|
+
### Audio
|
|
218
304
|
|
|
219
305
|
- now you can pass an `AudioBuffer` to `loadSound()`
|
|
220
306
|
- added `loadMusic()` to load streaming audio (doesn't block in loading screen).
|
|
@@ -226,7 +312,7 @@
|
|
|
226
312
|
play("bgm");
|
|
227
313
|
```
|
|
228
314
|
|
|
229
|
-
|
|
315
|
+
### Math
|
|
230
316
|
|
|
231
317
|
- added `Vec2.fromArray()` to convert an array to a `Vec2`.
|
|
232
318
|
|
|
@@ -255,7 +341,7 @@
|
|
|
255
341
|
shuffle(numbers); // [3, 1, 5, 2, 4]
|
|
256
342
|
```
|
|
257
343
|
|
|
258
|
-
|
|
344
|
+
### Debug mode
|
|
259
345
|
|
|
260
346
|
- added `outline()`, `shader()`, and `area()` properties to `debug.inspect`.
|
|
261
347
|
- added `KAPLAYOpt.debugKey` for customizing the key used to toggle debug mode.
|
|
@@ -286,7 +372,7 @@
|
|
|
286
372
|
|
|
287
373
|
- Now `debug.log()` accepts multiple argument of any type, like `console.log()`.
|
|
288
374
|
|
|
289
|
-
|
|
375
|
+
### Helpers
|
|
290
376
|
|
|
291
377
|
- added `getSceneName()` to get the current scene name
|
|
292
378
|
- added `Color.toArray()` to convert a color to an array
|
|
@@ -301,7 +387,7 @@
|
|
|
301
387
|
- added evaluation of the first and second derivatives for all splines
|
|
302
388
|
- added higher order easing functions linear, steps and cubic-bezier
|
|
303
389
|
|
|
304
|
-
|
|
390
|
+
### TypeScript
|
|
305
391
|
|
|
306
392
|
- Now you can type `get()` with a type parameter and passing component types.
|
|
307
393
|
(**v4000**)
|
|
@@ -317,7 +403,7 @@
|
|
|
317
403
|
- Now `loadShader()` and `loadShaderURL()` accepts null for unused parameters.
|
|
318
404
|
- Now `RectCompOpt` accepts a array of numbers for `radius`.
|
|
319
405
|
|
|
320
|
-
|
|
406
|
+
### Deprecations
|
|
321
407
|
|
|
322
408
|
> All changes applies for both v3001 and v4000
|
|
323
409
|
|
|
@@ -327,7 +413,7 @@
|
|
|
327
413
|
- deprecated `Event`, `EventHandler` and `EventController` in favor of `KEvent`,
|
|
328
414
|
`KEventHandler` and `KEventController`
|
|
329
415
|
|
|
330
|
-
|
|
416
|
+
### Bug fixes
|
|
331
417
|
|
|
332
418
|
> All changes applies for both v3001 and v4000
|
|
333
419
|
|
|
@@ -459,7 +545,7 @@ getSprite("bean").then((spr) => {
|
|
|
459
545
|
|
|
460
546
|
- fixed some indirect `fixed` related issues
|
|
461
547
|
|
|
462
|
-
##
|
|
548
|
+
## [3000.1.0] - 2023-08-18 (kaboom.js)
|
|
463
549
|
|
|
464
550
|
- added game object level input handling
|
|
465
551
|
|
|
@@ -543,9 +629,9 @@ ui.add([rect(100, 100)]);
|
|
|
543
629
|
reset it?
|
|
544
630
|
- fixed incorrect touch position when canvas is not at top left of page
|
|
545
631
|
|
|
546
|
-
|
|
632
|
+
## [3000.0.0] - 2023-05-25 (kaboom.js)
|
|
547
633
|
|
|
548
|
-
|
|
634
|
+
### Game Objects
|
|
549
635
|
|
|
550
636
|
- added scene graph, game objects are now stored in a tree-like structure and
|
|
551
637
|
can have children with `obj.add()`
|
|
@@ -599,7 +685,7 @@ console.log(enemies.length); // 4
|
|
|
599
685
|
- added `onAdd()` and `onDestroy()` events to listen to added / destroyed game
|
|
600
686
|
objects
|
|
601
687
|
|
|
602
|
-
|
|
688
|
+
### Components
|
|
603
689
|
|
|
604
690
|
- added support for getter and setters in component properties
|
|
605
691
|
|
|
@@ -689,7 +775,7 @@ player.onBeforePhysicsResolve((collision) => {
|
|
|
689
775
|
`stay(["gameover", "menu"])`
|
|
690
776
|
- (**BREAK**) changed `SpriteComp#flipX` and `SpriteComp#flipY` to properties
|
|
691
777
|
instead of functions
|
|
692
|
-
- (**
|
|
778
|
+
- (**BREAK**) `sprite.onAnimStart()` and `sprite.onAnimEnd()` now triggers on
|
|
693
779
|
any animation
|
|
694
780
|
|
|
695
781
|
```js
|
|
@@ -720,7 +806,7 @@ const player = add([
|
|
|
720
806
|
]);
|
|
721
807
|
```
|
|
722
808
|
|
|
723
|
-
|
|
809
|
+
### Assets
|
|
724
810
|
|
|
725
811
|
- added `loadProgress()` that returns a `0.0 - 1.0` that indicates current asset
|
|
726
812
|
loading progress
|
|
@@ -753,7 +839,7 @@ loadSprite("player", [
|
|
|
753
839
|
- (**BREAK**) added `loadShaderURL()`, `loadShader()` now only load shader code
|
|
754
840
|
not files
|
|
755
841
|
|
|
756
|
-
|
|
842
|
+
### Text
|
|
757
843
|
|
|
758
844
|
- added `loadFont()` to load `.ttf`, `.otf`, `.woff2` or any font supported by
|
|
759
845
|
browser `FontFace`
|
|
@@ -782,7 +868,7 @@ loadFont("apl386", "/examples/fonts/apl386.ttf", {
|
|
|
782
868
|
"[green]oh hi[/green] here's some [wavy]styled[/wavy] text";
|
|
783
869
|
```
|
|
784
870
|
|
|
785
|
-
|
|
871
|
+
### Graphics
|
|
786
872
|
|
|
787
873
|
- fixed visual artifacts on text rendering
|
|
788
874
|
- added `colors` option to `drawPolygon()` that controls the color of each
|
|
@@ -834,7 +920,7 @@ onMouseMove(() => {
|
|
|
834
920
|
});
|
|
835
921
|
```
|
|
836
922
|
|
|
837
|
-
|
|
923
|
+
### Audio
|
|
838
924
|
|
|
839
925
|
- added option `kaboom({ backgroundAudio: false })` to not pause audio when tab
|
|
840
926
|
not active
|
|
@@ -856,7 +942,7 @@ music.volume = 0.5;
|
|
|
856
942
|
music.loop = true;
|
|
857
943
|
```
|
|
858
944
|
|
|
859
|
-
|
|
945
|
+
### Input
|
|
860
946
|
|
|
861
947
|
- added `onScroll(action: (delta: Vec2) => void)` to listen mouse wheel scroll
|
|
862
948
|
- fixed touches not treated as mouse
|
|
@@ -872,7 +958,7 @@ music.loop = true;
|
|
|
872
958
|
- added `onGamepadConnect()` and `onGamepadDisconnect()`
|
|
873
959
|
- added `gamepads` option to `kaboom()` to define custom gamepads
|
|
874
960
|
|
|
875
|
-
|
|
961
|
+
### Level
|
|
876
962
|
|
|
877
963
|
- (**BREAK**) changed `addLevel()` options API
|
|
878
964
|
- renamed `width` and `height` to `tileWidth` and `tileHeight`
|
|
@@ -913,7 +999,7 @@ addLevel(["@ ^ $$", "======="], {
|
|
|
913
999
|
});
|
|
914
1000
|
```
|
|
915
1001
|
|
|
916
|
-
|
|
1002
|
+
### Misc
|
|
917
1003
|
|
|
918
1004
|
- sprites are now automatically packed, improving performance
|
|
919
1005
|
- (**BREAK**) renamed `gravity()` into `getGravity()` and `setGravity()`
|
|
@@ -1019,7 +1105,7 @@ timer.resume();
|
|
|
1019
1105
|
- (**BREAK**) removed `debug.objCount()` in favor of `getAll().length`
|
|
1020
1106
|
- added `debug.numFrames()` to get the current frame count
|
|
1021
1107
|
|
|
1022
|
-
|
|
1108
|
+
## [2000.2.6] - 2022-01-27 (kaboom.js)
|
|
1023
1109
|
|
|
1024
1110
|
- fixed text always being wrapped if updated
|
|
1025
1111
|
- fixed text comp properties `letterSpacing`, `charSpacing`, `transform`,
|
|
@@ -1046,7 +1132,7 @@ timer.resume();
|
|
|
1046
1132
|
|
|
1047
1133
|
- fixed updates not running at all when `kaboom({ debug: false })`
|
|
1048
1134
|
|
|
1049
|
-
##
|
|
1135
|
+
## [2000.2.0] "Fancy Text Mode" 2022-01-23 (kaboom.js)
|
|
1050
1136
|
|
|
1051
1137
|
- added `formatText()` and `drawFormattedText()`
|
|
1052
1138
|
- added `charSpacing` and `lineSpacing` in `TextCompOpt` and `DrawTextOpt`
|
|
@@ -1070,7 +1156,7 @@ timer.resume();
|
|
|
1070
1156
|
- allow non-stretch letterbox
|
|
1071
1157
|
- fixed mouse position malfunction in fullscreen, stretch and letterbox mode
|
|
1072
1158
|
|
|
1073
|
-
###
|
|
1159
|
+
### [2000.1.8]
|
|
1074
1160
|
|
|
1075
1161
|
- fixed `Color#eq()` not giving correct result
|
|
1076
1162
|
|
|
@@ -1100,7 +1186,7 @@ timer.resume();
|
|
|
1100
1186
|
|
|
1101
1187
|
- fixed `StateComp#enterState()` not accepting any state
|
|
1102
1188
|
|
|
1103
|
-
##
|
|
1189
|
+
## [2000.1.0] "Record Mode" - 2021-11-04 (kaboom.js)
|
|
1104
1190
|
|
|
1105
1191
|
- added `hsl2rgb()` for converting HSL color to kaboom RGB
|
|
1106
1192
|
- added `record()` to start a screen recording
|
|
@@ -1161,7 +1247,7 @@ timer.resume();
|
|
|
1161
1247
|
- `AudioPlay#isStopped()`
|
|
1162
1248
|
- `AudioPlay#isPaused()`
|
|
1163
1249
|
|
|
1164
|
-
|
|
1250
|
+
## [2000.0.0] "Burp Mode" - 2021-10-20 (kaboom.js)
|
|
1165
1251
|
|
|
1166
1252
|
- version jumped to v2000.0.0 (still semver, just big)
|
|
1167
1253
|
- added `burp()` for easy burping
|
|
@@ -1393,7 +1479,7 @@ if (area.shape === "rect") {
|
|
|
1393
1479
|
- added plugins npm package support e.g.
|
|
1394
1480
|
`import asepritePlugin from "kaboom/plugins/aseprite"`
|
|
1395
1481
|
|
|
1396
|
-
|
|
1482
|
+
## [0.5.0] "Sticky Type" - 2021-05-11 (kaboom.js)
|
|
1397
1483
|
|
|
1398
1484
|
- platforms are now sticky
|
|
1399
1485
|
- moved to TypeScript
|
|
@@ -1435,7 +1521,7 @@ if (area.shape === "rect") {
|
|
|
1435
1521
|
- fixed `on("destroy")` handler getting called twice
|
|
1436
1522
|
- fixed sprite `play()` not playing
|
|
1437
1523
|
|
|
1438
|
-
|
|
1524
|
+
## [0.4.0] "Multiboom" - UNKNOWN (kaboom.js)
|
|
1439
1525
|
|
|
1440
1526
|
- **BREAK** removed `init()` and `kaboom.global()`, in favor of `kaboom()`, also
|
|
1441
1527
|
allows multiple kaboom games on one page
|
|
@@ -1472,7 +1558,7 @@ k.vec2();
|
|
|
1472
1558
|
- added `numFrames()` by `sprite()`
|
|
1473
1559
|
- added `screenshot()` that returns of a png base64 data url for a screenshot
|
|
1474
1560
|
|
|
1475
|
-
|
|
1561
|
+
## [0.3.0] "King Dedede...Bug!" - UNKNOWN
|
|
1476
1562
|
|
|
1477
1563
|
- **BREAK** removed `pause()` and `paused()` in favor to `kaboom.debug.paused`
|
|
1478
1564
|
- **BREAK** removed `velY`, `curPlatform` and `maxVel` fields by `body()`
|
|
@@ -1490,7 +1576,7 @@ k.vec2();
|
|
|
1490
1576
|
- added on screen logging with `log()` and `error()`
|
|
1491
1577
|
- fixed `loadRoot()` sometimes doesn't work in async tasks
|
|
1492
1578
|
|
|
1493
|
-
|
|
1579
|
+
## [0.2.0] "Hear the Tremble" - UNKNOWN
|
|
1494
1580
|
|
|
1495
1581
|
- **BREAK** removed `aseSpriteSheet` conf field from
|
|
1496
1582
|
`loadSprite(name, src, conf)`
|
|
@@ -1515,7 +1601,7 @@ k.vec2();
|
|
|
1515
1601
|
- added `readd()` to re-add an object to the scene without triggering events
|
|
1516
1602
|
- added `level.spawn()`
|
|
1517
1603
|
|
|
1518
|
-
|
|
1604
|
+
## [0.1.0] "Oh Hi Mark" -
|
|
1519
1605
|
|
|
1520
1606
|
- **BREAK** changed default origin point to `"topleft"`, so if you want object
|
|
1521
1607
|
origin point to be at center you'll need to manual `origin("center")`
|
package/README.md
CHANGED
|
@@ -102,7 +102,7 @@ The fastest way to start a KAPLAY game is with
|
|
|
102
102
|
[`create-kaplay`](https://github.com/kaplayjs/create-kaplay)
|
|
103
103
|
|
|
104
104
|
```sh
|
|
105
|
-
$ create-kaplay mygame
|
|
105
|
+
$ npx create-kaplay mygame
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
This will create a directory called `mygame` for you, containing all the files
|
|
@@ -184,17 +184,18 @@ Collections of games made with KAPLAY (and Kaboom), selected by KAPLAY:
|
|
|
184
184
|
- [Newgrounds.com](https://www.newgrounds.com/playlist/379920/kaplay-games)
|
|
185
185
|
|
|
186
186
|
## Credits
|
|
187
|
-
|
|
188
187
|
- Thanks to [tga](https://space55.xyz) for all his work on the original
|
|
189
188
|
Kaboom.js
|
|
190
|
-
- Thanks to [mulfok](https://twitter.com/MulfoK) for the
|
|
189
|
+
- Thanks to [mulfok](https://twitter.com/MulfoK) for the awesome
|
|
191
190
|
[mulfok32](https://lospec.com/palette-list/mulfok32) color palette, used in
|
|
192
|
-
KAPLAY sprites
|
|
191
|
+
KAPLAY sprites and art
|
|
192
|
+
- Thanks to [Pixabay](https://pixabay.com/users/pixabay-1/) for the great [burp](https://pixabay.com/sound-effects/burp-104984/) sound, used in `burp()` function
|
|
193
|
+
- Thansk to [Kenney](https://kenney.nl/) for all used assets for examples
|
|
194
|
+
- [Impact Sound Pack](https://kenney.nl/assets/impact-sounds)
|
|
195
|
+
- [1-Bit Platformer Pack](https://kenney.nl/assets/1-bit-platformer-pack)
|
|
193
196
|
- Thanks to [abrudz](https://github.com/abrudz) for the amazing
|
|
194
197
|
[APL386 font](https://abrudz.github.io/APL386/)
|
|
195
198
|
- Thanks to [Polyducks](http://polyducks.co.uk/) for the amazing
|
|
196
199
|
[kitchen sink font](https://polyducks.itch.io/kitchen-sink-textmode-font) font
|
|
197
200
|
- Thanks to [0x72](https://0x72.itch.io/) for the amazing
|
|
198
201
|
[Dungeon Tileset](https://0x72.itch.io/dungeontileset-ii)
|
|
199
|
-
- Thanks to [Kenney](https://kenney.nl/) for the amazing
|
|
200
|
-
[1-Bit Platformer Pack](https://kenney.nl/assets/1-bit-platformer-pack)
|
|
@@ -29,6 +29,7 @@ export declare class AssetBucket<D> {
|
|
|
29
29
|
addLoaded(name: string | null, data: D): Asset<D>;
|
|
30
30
|
get(handle: string): Asset<D> | undefined;
|
|
31
31
|
progress(): number;
|
|
32
|
+
getFailedAssets(): [string, Asset<D>][];
|
|
32
33
|
}
|
|
33
34
|
export declare function fetchURL(url: string): Promise<Response>;
|
|
34
35
|
export declare function fetchJSON(path: string): Promise<any>;
|
|
@@ -38,6 +39,7 @@ export declare function loadRoot(path?: string): string;
|
|
|
38
39
|
export declare function loadJSON(name: string, url: string): Asset<any>;
|
|
39
40
|
export declare function loadImg(src: string): Promise<HTMLImageElement>;
|
|
40
41
|
export declare function loadProgress(): number;
|
|
42
|
+
export declare function getFailedAssets(): [string, Asset<any>][];
|
|
41
43
|
export declare function getAsset(name: string): Asset<any> | null;
|
|
42
44
|
export declare function load<T>(prom: Promise<T>): Asset<T>;
|
|
43
45
|
export type AssetsCtx = ReturnType<typeof initAssets>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../../src/assets/asset.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAIzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SA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CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,CAExD;AAGD,wBAAgB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAElD;AAGD,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAEtD,eAAO,MAAM,UAAU,QAAS,MAAM;;;;;;;;WAUjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;;;CAO1C,CAAC"}
|
|
@@ -37,7 +37,7 @@ export type SpriteAnims = Record<string, SpriteAnim>;
|
|
|
37
37
|
*/
|
|
38
38
|
export interface LoadSpriteOpt {
|
|
39
39
|
/**
|
|
40
|
-
* If the defined area contains multiple sprites, how many frames are in the area
|
|
40
|
+
* If the defined area contains multiple sprites, how many frames are in the area horizontally.
|
|
41
41
|
*/
|
|
42
42
|
sliceX?: number;
|
|
43
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playMusic.d.ts","sourceRoot":"","sources":["../../../src/audio/playMusic.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,YAAiB,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"playMusic.d.ts","sourceRoot":"","sources":["../../../src/audio/playMusic.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,YAAiB,GAAG,SAAS,CAuGxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"volume.d.ts","sourceRoot":"","sources":["../../../src/audio/volume.ts"],"names":[],"mappings":"AAGA,wBAAgB,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"volume.d.ts","sourceRoot":"","sources":["../../../src/audio/volume.ts"],"names":[],"mappings":"AAGA,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,QAElC;AAED,wBAAgB,SAAS,WAExB;AAGD,wBAAgB,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAOzC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from './agent';
|
|
2
|
+
export * from './pathfinder';
|
|
3
|
+
export * from './patrol';
|
|
4
|
+
export * from './sentry';
|
|
5
|
+
export * from './tile';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../../src/components/level/tile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAQ,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACH,KAAK,IAAI,EACT,KAAK,IAAI,EACT,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,SAAS,EACjB,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,MAAM,WAAW,QAAS,SAAQ,IAAI;IAClC;;OAEG;IACH,OAAO,EAAE,IAAI,CAAC;IACd;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,EAAE,IAAI,EAAE,CAAC;IACd;;OAEG;IACH,aAAa,EAAE,IAAI,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B,QAAQ,IAAI,IAAI,CAAC;IACjB,SAAS,IAAI,I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ACtB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,wBAAgB,IAAI,CAAC,IAAI,GAAE,WAAgB,GAAG,QAAQ,CAqGrD"}
|
|
@@ -80,9 +80,20 @@ export interface AnimateComp extends Comp {
|
|
|
80
80
|
* Base values for relative animation
|
|
81
81
|
*/
|
|
82
82
|
base: BaseValues;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
animation: {
|
|
84
|
+
/**
|
|
85
|
+
* Pauses playing
|
|
86
|
+
*/
|
|
87
|
+
paused: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Move the animation to a specific point in time
|
|
90
|
+
*/
|
|
91
|
+
seek(time: number): void;
|
|
92
|
+
/**
|
|
93
|
+
* Returns the duration of the animation
|
|
94
|
+
*/
|
|
95
|
+
duration: number;
|
|
96
|
+
};
|
|
86
97
|
serializeAnimationChannels(): Record<string, AnimationChannel>;
|
|
87
98
|
/**
|
|
88
99
|
* Serializes the options of this object to plain Javascript types
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animate.d.ts","sourceRoot":"","sources":["../../../../src/components/misc/animate.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"animate.d.ts","sourceRoot":"","sources":["../../../../src/components/misc/animate.ts"],"names":[],"mappings":"AAGA,OAAO,EAMH,IAAI,EAEP,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGpD,KAAK,aAAa,GAEZ,SAAS,GAET,SAAS,GA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CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,CAiBvE;AA0BD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,SAAS,EAAE,SAAS,QAwBrE"}
|
|
@@ -9,6 +9,10 @@ export interface TextInputComp extends Comp {
|
|
|
9
9
|
* Enable the text input array from being modified by user input.
|
|
10
10
|
*/
|
|
11
11
|
hasFocus: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The "real" text that the user typed, without any escaping.
|
|
14
|
+
*/
|
|
15
|
+
typedText: string;
|
|
12
16
|
}
|
|
13
17
|
export declare function textInput(this: KAPLAYCtx, hasFocus?: boolean, maxInputLength?: number): TextInputComp;
|
|
14
18
|
//# sourceMappingURL=textInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textInput.d.ts","sourceRoot":"","sources":["../../../../src/components/misc/textInput.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAW,SAAS,EAAE,MAAM,aAAa,CAAC;AAI5D;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI;IACvC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,SAAS,CACrB,IAAI,EAAE,SAAS,EACf,QAAQ,GAAE,OAAc,EACxB,cAAc,CAAC,EAAE,MAAM,GACxB,aAAa,
|
|
1
|
+
{"version":3,"file":"textInput.d.ts","sourceRoot":"","sources":["../../../../src/components/misc/textInput.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAW,SAAS,EAAE,MAAM,aAAa,CAAC;AAI5D;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,IAAI;IACvC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,SAAS,CACrB,IAAI,EAAE,SAAS,EACf,QAAQ,GAAE,OAAc,EACxB,cAAc,CAAC,EAAE,MAAM,GACxB,aAAa,CAwCf"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { Comp, LerpValue, TimerController, TweenController } from "../../types";
|
|
2
|
-
import type { KEventController } from "../../utils";
|
|
3
2
|
/**
|
|
4
3
|
* The {@link timer `timer()`} component.
|
|
5
4
|
*
|
|
6
5
|
* @group Component Types
|
|
7
6
|
*/
|
|
8
7
|
export interface TimerComp extends Comp {
|
|
8
|
+
/**
|
|
9
|
+
* The maximum number of loops per frame allowed,
|
|
10
|
+
* to keep loops with sub-frame intervals from freezing the game.
|
|
11
|
+
*/
|
|
12
|
+
maxLoopsPerFrame: number;
|
|
9
13
|
/**
|
|
10
14
|
* Run the callback after n seconds.
|
|
11
15
|
*/
|
|
@@ -13,9 +17,12 @@ export interface TimerComp extends Comp {
|
|
|
13
17
|
/**
|
|
14
18
|
* Run the callback every n seconds.
|
|
15
19
|
*
|
|
20
|
+
* If waitFirst is false (the default), the function will
|
|
21
|
+
* be called once on the very next frame, and then loop like normal.
|
|
22
|
+
*
|
|
16
23
|
* @since v3000.0
|
|
17
24
|
*/
|
|
18
|
-
loop(time: number, action: () => void):
|
|
25
|
+
loop(time: number, action: () => void, maxLoops?: number, waitFirst?: boolean): TimerController;
|
|
19
26
|
/**
|
|
20
27
|
* Tweeeeen! Note that this doesn't specifically mean tweening on this object's property, this just registers the timer on this object, so the tween will cancel with the object gets destroyed, or paused when obj.paused is true.
|
|
21
28
|
*
|
|
@@ -23,5 +30,5 @@ export interface TimerComp extends Comp {
|
|
|
23
30
|
*/
|
|
24
31
|
tween<V extends LerpValue>(from: V, to: V, duration: number, setValue: (value: V) => void, easeFunc?: (t: number) => number): TweenController;
|
|
25
32
|
}
|
|
26
|
-
export declare function timer(): TimerComp;
|
|
33
|
+
export declare function timer(maxLoopsPerFrame?: number): TimerComp;
|
|
27
34
|
//# sourceMappingURL=timer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.d.ts","sourceRoot":"","sources":["../../../../src/components/misc/timer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,IAAI,EAEJ,SAAS,EACT,eAAe,EACf,eAAe,EAClB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"timer.d.ts","sourceRoot":"","sources":["../../../../src/components/misc/timer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACR,IAAI,EAEJ,SAAS,EACT,eAAe,EACf,eAAe,EAClB,MAAM,aAAa,CAAC;AAGrB;;;;GAIG;AACH,MAAM,WAAW,SAAU,SAAQ,IAAI;IACnC;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAA;IACxB;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,IAAI,GAAG,eAAe,CAAC;IACzD;;;;;;;OAOG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC;IAChG;;;;OAIG;IACH,KAAK,CAAC,CAAC,SAAS,SAAS,EACrB,IAAI,EAAE,CAAC,EACP,EAAE,EAAE,CAAC,EACL,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,EAC5B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,GACjC,eAAe,CAAC;CACtB;AAED,wBAAgB,KAAK,CAAC,gBAAgB,GAAE,MAAa,GAAG,SAAS,CAkFhE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"area.d.ts","sourceRoot":"","sources":["../../../../src/components/physics/area.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"area.d.ts","sourceRoot":"","sources":["../../../../src/components/physics/area.ts"],"names":[],"mappings":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;;;;OAYG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,IAAI,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,eAAe,CAAC,EAAE,GAAG,EAAE,CAAC;CAC3B;AAED,wBAAgB,IAAI,CAAC,GAAG,GAAE,WAAgB,GAAG,QAAQ,CA8UpD"}
|
|
@@ -20,7 +20,8 @@ export interface BodyComp extends Comp {
|
|
|
20
20
|
*/
|
|
21
21
|
drag: number;
|
|
22
22
|
/**
|
|
23
|
-
* If object is static, won't move,
|
|
23
|
+
* If object is static, it won't move, all non static objects won't move past it, and all
|
|
24
|
+
* calls to addForce(), applyImpulse(), or jump() on this body will do absolutely nothing.
|
|
24
25
|
*/
|
|
25
26
|
isStatic: boolean;
|
|
26
27
|
/**
|
|
@@ -151,7 +152,8 @@ export interface BodyCompOpt {
|
|
|
151
152
|
*/
|
|
152
153
|
gravityScale?: number;
|
|
153
154
|
/**
|
|
154
|
-
* If object is static, won't move,
|
|
155
|
+
* If object is static, it won't move, all non static objects won't move past it, and all
|
|
156
|
+
* calls to addForce(), applyImpulse(), or jump() on this body will do absolutely nothing.
|
|
155
157
|
*
|
|
156
158
|
* @since v3000.0
|
|
157
159
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../../src/components/physics/body.ts"],"names":[],"mappings":"AAIA,OAAO,EAAQ,KAAK,IAAI,EAAQ,MAAM,iBAAiB,CAAC;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAIrD;;;;GAIG;AACH,MAAM,WAAW,QAAS,SAAQ,IAAI;IAClC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