kaplay 3001.0.2 → 3001.0.6
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 +134 -35
- package/README.md +5 -6
- package/dist/declaration/app/app.d.ts +4 -84
- package/dist/declaration/app/app.d.ts.map +1 -1
- 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/draw/text.d.ts +5 -0
- package/dist/declaration/components/draw/text.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 +5 -1
- 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/events → events}/eventMap.d.ts +49 -4
- package/dist/declaration/events/eventMap.d.ts.map +1 -0
- package/dist/declaration/{utils → events}/events.d.ts +2 -1
- package/dist/declaration/events/events.d.ts.map +1 -0
- package/dist/declaration/{game/events/events.d.ts → events/globalEvents.d.ts} +12 -5
- package/dist/declaration/events/globalEvents.d.ts.map +1 -0
- package/dist/declaration/events/index.d.ts +3 -0
- package/dist/declaration/events/index.d.ts.map +1 -0
- package/dist/declaration/game/camera.d.ts +12 -4
- package/dist/declaration/game/camera.d.ts.map +1 -1
- package/dist/declaration/game/game.d.ts +8 -2
- package/dist/declaration/game/game.d.ts.map +1 -1
- package/dist/declaration/game/index.d.ts +1 -1
- package/dist/declaration/game/index.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/drawText.d.ts +11 -0
- package/dist/declaration/gfx/draw/drawText.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 +21 -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 +1711 -333
- package/dist/declaration/types.d.ts.map +1 -1
- package/dist/declaration/utils/index.d.ts +1 -1
- package/dist/declaration/utils/index.d.ts.map +1 -1
- package/dist/doc.d.ts +1983 -544
- 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/components/draw/ellipse.d.ts +0 -32
- package/dist/declaration/components/draw/ellipse.d.ts.map +0 -1
- package/dist/declaration/components/misc/fakeMouse.d.ts +0 -37
- package/dist/declaration/components/misc/fakeMouse.d.ts.map +0 -1
- package/dist/declaration/game/events/eventMap.d.ts.map +0 -1
- package/dist/declaration/game/events/events.d.ts.map +0 -1
- package/dist/declaration/game/events/index.d.ts +0 -3
- package/dist/declaration/game/events/index.d.ts.map +0 -1
- package/dist/declaration/gfx/classes/FrameBuffer.d.ts +0 -22
- package/dist/declaration/gfx/classes/FrameBuffer.d.ts.map +0 -1
- package/dist/declaration/gfx/classes/TexPacker.d.ts +0 -20
- package/dist/declaration/gfx/classes/TexPacker.d.ts.map +0 -1
- package/dist/declaration/math/gjk.d.ts +0 -27
- package/dist/declaration/math/gjk.d.ts.map +0 -1
- package/dist/declaration/math/sat.d.ts +0 -7
- package/dist/declaration/math/sat.d.ts.map +0 -1
- package/dist/declaration/math/spatial/hashgrid.d.ts +0 -2
- package/dist/declaration/math/spatial/hashgrid.d.ts.map +0 -1
- package/dist/declaration/math/spatial/sweepandprune.d.ts +0 -40
- package/dist/declaration/math/spatial/sweepandprune.d.ts.map +0 -1
- package/dist/declaration/math/tests/color.spec.d.ts +0 -2
- package/dist/declaration/math/tests/color.spec.d.ts.map +0 -1
- package/dist/declaration/math/vec3.d.ts +0 -9
- package/dist/declaration/math/vec3.d.ts.map +0 -1
- package/dist/declaration/utils/events.d.ts.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,105 @@
|
|
|
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
|
+
## [3001.0.6] "Santa Events" - 2024-12-27
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added `trigger(event, tag, ...args)` for global triggering events on a
|
|
14
|
+
specific tag (**experimental**) - @lajbel
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
trigger("shoot", "target", 140);
|
|
18
|
+
|
|
19
|
+
on("shoot", "target", (obj, score) => {
|
|
20
|
+
obj.destroy();
|
|
21
|
+
debug.log(140); // every bomb was 140 score points!
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Added `{ override?: true }` in `CharTransform` for overridding text styles -
|
|
26
|
+
@dragoncoder047
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
add([
|
|
30
|
+
pos(100, 150),
|
|
31
|
+
text("With override: Hello [foo]styled[/foo] text", {
|
|
32
|
+
transform: {
|
|
33
|
+
color: BLACK, // Default text color for every character
|
|
34
|
+
},
|
|
35
|
+
styles: {
|
|
36
|
+
foo: {
|
|
37
|
+
color: RED, // [foo] will be red
|
|
38
|
+
override: true, // will override the black def color
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
]);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- Added `{ indentAll?: boolean }` in `TextCompOpt` to indent every new line -
|
|
46
|
+
@dragoncoder047
|
|
47
|
+
|
|
48
|
+
- Added TypeScript definition for all App Events and missing Game Object
|
|
49
|
+
Events - @lajbel
|
|
50
|
+
|
|
51
|
+
### Fixed
|
|
52
|
+
|
|
53
|
+
- Fixed an incorrect mention to the component in `TextInputComp` type -
|
|
54
|
+
@dragoncoder047
|
|
55
|
+
|
|
56
|
+
## [3001.0.5] - 2024-12-18
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- Added tags and components separation in `KAPLAYOpt.tagsAsComponents`
|
|
61
|
+
(**experimental**)
|
|
62
|
+
- Added `.is()`, `.tag()` and `.untag()` to `GameObjRaw`, check, add and remove
|
|
63
|
+
(**experimental**)
|
|
64
|
+
- Added `.has()` to `GameObjRaw`, to check if a game object has a component tags
|
|
65
|
+
(**experimental**)
|
|
66
|
+
- Added events for listen to comps being removed or added `onUse()` and
|
|
67
|
+
`onUnused()` (**experimental**)
|
|
68
|
+
- Added `k.cancel()` to cancel the current event (**experimental**)
|
|
69
|
+
- ```js
|
|
70
|
+
onKeyPress("space", () => {
|
|
71
|
+
// do something
|
|
72
|
+
// cancel the event
|
|
73
|
+
return cancel();
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
- Added `getDefaultLayer()` to get the default layer (**experimental**)
|
|
77
|
+
- Added `getLayers()` to get the layers list (**experimental**)
|
|
78
|
+
- Added many JSDoc specifiers on many functions (@require, @deprecated, @since,
|
|
79
|
+
@group, etc)
|
|
80
|
+
|
|
81
|
+
### Changed
|
|
82
|
+
|
|
83
|
+
- Added `.use()`, `.unuse()` and `.has()` to `GameObjRaw`, to add, remove and
|
|
84
|
+
check components. This only works with `KAPLAYOpt.tagsAsComponents` set to
|
|
85
|
+
`true` (**experimental**)
|
|
86
|
+
|
|
87
|
+
### Deprecated
|
|
88
|
+
|
|
89
|
+
- Deprecated camera methods `camScale()`, `camPos()` and `camRot()` in favor of
|
|
90
|
+
`setCamScale()`, `getCamScale()`, `setCamPos()`, `getCamPos()`, `setCamRot()`
|
|
91
|
+
and `getCamRot`.
|
|
92
|
+
- Deprecated `camTransform()` in favor of `getCamTransform()`.
|
|
93
|
+
- Deprecated `camFlash()` in favor of `flash()`, for a `shake()`-like name.
|
|
94
|
+
|
|
95
|
+
### Fixed
|
|
96
|
+
|
|
97
|
+
- Fixed artifacts present in some TrueType fonts.
|
|
98
|
+
- Fixed `.use()` and `.unuse()` with area components.
|
|
99
|
+
|
|
100
|
+
## [3001.0.0] "Spooky Beans!" - 2024-10-31
|
|
101
|
+
|
|
102
|
+
### Input
|
|
4
103
|
|
|
5
104
|
- Added input bindings, `onButtonPress`, `onButtonRelease`, `onButtonDown`, and
|
|
6
105
|
it's corresponding boolean versions, `isButtonPressed`, `isButtonDown` and
|
|
@@ -69,7 +168,7 @@
|
|
|
69
168
|
});
|
|
70
169
|
```
|
|
71
170
|
|
|
72
|
-
|
|
171
|
+
### Physics
|
|
73
172
|
|
|
74
173
|
- added effector components: `areaEffector()`, `buoyancyEffector()`,
|
|
75
174
|
`pointEffector()`, `surfaceEffector()`.
|
|
@@ -80,7 +179,7 @@
|
|
|
80
179
|
- added `pathfinder()` component to calculate a list of waypoints on a graph.
|
|
81
180
|
- now collision checks are only done if there's area objects.
|
|
82
181
|
|
|
83
|
-
|
|
182
|
+
### Game Object
|
|
84
183
|
|
|
85
184
|
- added `getTreeRoot()` to get the game's root object, which is the parent of
|
|
86
185
|
all other objects
|
|
@@ -101,7 +200,7 @@
|
|
|
101
200
|
debug.log(obj.tags); // ["enemy", "dangerous"]
|
|
102
201
|
```
|
|
103
202
|
|
|
104
|
-
|
|
203
|
+
### Components
|
|
105
204
|
|
|
106
205
|
- added support to setters/getters syntax in `ScaleComp` and `SpriteComp`
|
|
107
206
|
components
|
|
@@ -114,7 +213,7 @@
|
|
|
114
213
|
obj.sprite = "bag";
|
|
115
214
|
```
|
|
116
215
|
|
|
117
|
-
|
|
216
|
+
### Rendering and Animation
|
|
118
217
|
|
|
119
218
|
- added the `animate()` component to _animate_ the properties of an object using
|
|
120
219
|
keyframes. Check out
|
|
@@ -214,7 +313,7 @@
|
|
|
214
313
|
- Added `SpriteComp.animFrame` to get the frame of the current animation (not on
|
|
215
314
|
the spritesheet)
|
|
216
315
|
|
|
217
|
-
|
|
316
|
+
### Audio
|
|
218
317
|
|
|
219
318
|
- now you can pass an `AudioBuffer` to `loadSound()`
|
|
220
319
|
- added `loadMusic()` to load streaming audio (doesn't block in loading screen).
|
|
@@ -226,7 +325,7 @@
|
|
|
226
325
|
play("bgm");
|
|
227
326
|
```
|
|
228
327
|
|
|
229
|
-
|
|
328
|
+
### Math
|
|
230
329
|
|
|
231
330
|
- added `Vec2.fromArray()` to convert an array to a `Vec2`.
|
|
232
331
|
|
|
@@ -255,7 +354,7 @@
|
|
|
255
354
|
shuffle(numbers); // [3, 1, 5, 2, 4]
|
|
256
355
|
```
|
|
257
356
|
|
|
258
|
-
|
|
357
|
+
### Debug mode
|
|
259
358
|
|
|
260
359
|
- added `outline()`, `shader()`, and `area()` properties to `debug.inspect`.
|
|
261
360
|
- added `KAPLAYOpt.debugKey` for customizing the key used to toggle debug mode.
|
|
@@ -286,7 +385,7 @@
|
|
|
286
385
|
|
|
287
386
|
- Now `debug.log()` accepts multiple argument of any type, like `console.log()`.
|
|
288
387
|
|
|
289
|
-
|
|
388
|
+
### Helpers
|
|
290
389
|
|
|
291
390
|
- added `getSceneName()` to get the current scene name
|
|
292
391
|
- added `Color.toArray()` to convert a color to an array
|
|
@@ -301,7 +400,7 @@
|
|
|
301
400
|
- added evaluation of the first and second derivatives for all splines
|
|
302
401
|
- added higher order easing functions linear, steps and cubic-bezier
|
|
303
402
|
|
|
304
|
-
|
|
403
|
+
### TypeScript
|
|
305
404
|
|
|
306
405
|
- Now you can type `get()` with a type parameter and passing component types.
|
|
307
406
|
(**v4000**)
|
|
@@ -317,7 +416,7 @@
|
|
|
317
416
|
- Now `loadShader()` and `loadShaderURL()` accepts null for unused parameters.
|
|
318
417
|
- Now `RectCompOpt` accepts a array of numbers for `radius`.
|
|
319
418
|
|
|
320
|
-
|
|
419
|
+
### Deprecations
|
|
321
420
|
|
|
322
421
|
> All changes applies for both v3001 and v4000
|
|
323
422
|
|
|
@@ -327,7 +426,7 @@
|
|
|
327
426
|
- deprecated `Event`, `EventHandler` and `EventController` in favor of `KEvent`,
|
|
328
427
|
`KEventHandler` and `KEventController`
|
|
329
428
|
|
|
330
|
-
|
|
429
|
+
### Bug fixes
|
|
331
430
|
|
|
332
431
|
> All changes applies for both v3001 and v4000
|
|
333
432
|
|
|
@@ -459,7 +558,7 @@ getSprite("bean").then((spr) => {
|
|
|
459
558
|
|
|
460
559
|
- fixed some indirect `fixed` related issues
|
|
461
560
|
|
|
462
|
-
##
|
|
561
|
+
## [3000.1.0] - 2023-08-18 (kaboom.js)
|
|
463
562
|
|
|
464
563
|
- added game object level input handling
|
|
465
564
|
|
|
@@ -543,9 +642,9 @@ ui.add([rect(100, 100)]);
|
|
|
543
642
|
reset it?
|
|
544
643
|
- fixed incorrect touch position when canvas is not at top left of page
|
|
545
644
|
|
|
546
|
-
|
|
645
|
+
## [3000.0.0] - 2023-05-25 (kaboom.js)
|
|
547
646
|
|
|
548
|
-
|
|
647
|
+
### Game Objects
|
|
549
648
|
|
|
550
649
|
- added scene graph, game objects are now stored in a tree-like structure and
|
|
551
650
|
can have children with `obj.add()`
|
|
@@ -599,7 +698,7 @@ console.log(enemies.length); // 4
|
|
|
599
698
|
- added `onAdd()` and `onDestroy()` events to listen to added / destroyed game
|
|
600
699
|
objects
|
|
601
700
|
|
|
602
|
-
|
|
701
|
+
### Components
|
|
603
702
|
|
|
604
703
|
- added support for getter and setters in component properties
|
|
605
704
|
|
|
@@ -689,7 +788,7 @@ player.onBeforePhysicsResolve((collision) => {
|
|
|
689
788
|
`stay(["gameover", "menu"])`
|
|
690
789
|
- (**BREAK**) changed `SpriteComp#flipX` and `SpriteComp#flipY` to properties
|
|
691
790
|
instead of functions
|
|
692
|
-
- (**
|
|
791
|
+
- (**BREAK**) `sprite.onAnimStart()` and `sprite.onAnimEnd()` now triggers on
|
|
693
792
|
any animation
|
|
694
793
|
|
|
695
794
|
```js
|
|
@@ -720,7 +819,7 @@ const player = add([
|
|
|
720
819
|
]);
|
|
721
820
|
```
|
|
722
821
|
|
|
723
|
-
|
|
822
|
+
### Assets
|
|
724
823
|
|
|
725
824
|
- added `loadProgress()` that returns a `0.0 - 1.0` that indicates current asset
|
|
726
825
|
loading progress
|
|
@@ -753,7 +852,7 @@ loadSprite("player", [
|
|
|
753
852
|
- (**BREAK**) added `loadShaderURL()`, `loadShader()` now only load shader code
|
|
754
853
|
not files
|
|
755
854
|
|
|
756
|
-
|
|
855
|
+
### Text
|
|
757
856
|
|
|
758
857
|
- added `loadFont()` to load `.ttf`, `.otf`, `.woff2` or any font supported by
|
|
759
858
|
browser `FontFace`
|
|
@@ -782,7 +881,7 @@ loadFont("apl386", "/examples/fonts/apl386.ttf", {
|
|
|
782
881
|
"[green]oh hi[/green] here's some [wavy]styled[/wavy] text";
|
|
783
882
|
```
|
|
784
883
|
|
|
785
|
-
|
|
884
|
+
### Graphics
|
|
786
885
|
|
|
787
886
|
- fixed visual artifacts on text rendering
|
|
788
887
|
- added `colors` option to `drawPolygon()` that controls the color of each
|
|
@@ -834,7 +933,7 @@ onMouseMove(() => {
|
|
|
834
933
|
});
|
|
835
934
|
```
|
|
836
935
|
|
|
837
|
-
|
|
936
|
+
### Audio
|
|
838
937
|
|
|
839
938
|
- added option `kaboom({ backgroundAudio: false })` to not pause audio when tab
|
|
840
939
|
not active
|
|
@@ -856,7 +955,7 @@ music.volume = 0.5;
|
|
|
856
955
|
music.loop = true;
|
|
857
956
|
```
|
|
858
957
|
|
|
859
|
-
|
|
958
|
+
### Input
|
|
860
959
|
|
|
861
960
|
- added `onScroll(action: (delta: Vec2) => void)` to listen mouse wheel scroll
|
|
862
961
|
- fixed touches not treated as mouse
|
|
@@ -872,7 +971,7 @@ music.loop = true;
|
|
|
872
971
|
- added `onGamepadConnect()` and `onGamepadDisconnect()`
|
|
873
972
|
- added `gamepads` option to `kaboom()` to define custom gamepads
|
|
874
973
|
|
|
875
|
-
|
|
974
|
+
### Level
|
|
876
975
|
|
|
877
976
|
- (**BREAK**) changed `addLevel()` options API
|
|
878
977
|
- renamed `width` and `height` to `tileWidth` and `tileHeight`
|
|
@@ -913,7 +1012,7 @@ addLevel(["@ ^ $$", "======="], {
|
|
|
913
1012
|
});
|
|
914
1013
|
```
|
|
915
1014
|
|
|
916
|
-
|
|
1015
|
+
### Misc
|
|
917
1016
|
|
|
918
1017
|
- sprites are now automatically packed, improving performance
|
|
919
1018
|
- (**BREAK**) renamed `gravity()` into `getGravity()` and `setGravity()`
|
|
@@ -1019,7 +1118,7 @@ timer.resume();
|
|
|
1019
1118
|
- (**BREAK**) removed `debug.objCount()` in favor of `getAll().length`
|
|
1020
1119
|
- added `debug.numFrames()` to get the current frame count
|
|
1021
1120
|
|
|
1022
|
-
|
|
1121
|
+
## [2000.2.6] - 2022-01-27 (kaboom.js)
|
|
1023
1122
|
|
|
1024
1123
|
- fixed text always being wrapped if updated
|
|
1025
1124
|
- fixed text comp properties `letterSpacing`, `charSpacing`, `transform`,
|
|
@@ -1046,7 +1145,7 @@ timer.resume();
|
|
|
1046
1145
|
|
|
1047
1146
|
- fixed updates not running at all when `kaboom({ debug: false })`
|
|
1048
1147
|
|
|
1049
|
-
##
|
|
1148
|
+
## [2000.2.0] "Fancy Text Mode" 2022-01-23 (kaboom.js)
|
|
1050
1149
|
|
|
1051
1150
|
- added `formatText()` and `drawFormattedText()`
|
|
1052
1151
|
- added `charSpacing` and `lineSpacing` in `TextCompOpt` and `DrawTextOpt`
|
|
@@ -1070,7 +1169,7 @@ timer.resume();
|
|
|
1070
1169
|
- allow non-stretch letterbox
|
|
1071
1170
|
- fixed mouse position malfunction in fullscreen, stretch and letterbox mode
|
|
1072
1171
|
|
|
1073
|
-
###
|
|
1172
|
+
### [2000.1.8]
|
|
1074
1173
|
|
|
1075
1174
|
- fixed `Color#eq()` not giving correct result
|
|
1076
1175
|
|
|
@@ -1100,7 +1199,7 @@ timer.resume();
|
|
|
1100
1199
|
|
|
1101
1200
|
- fixed `StateComp#enterState()` not accepting any state
|
|
1102
1201
|
|
|
1103
|
-
##
|
|
1202
|
+
## [2000.1.0] "Record Mode" - 2021-11-04 (kaboom.js)
|
|
1104
1203
|
|
|
1105
1204
|
- added `hsl2rgb()` for converting HSL color to kaboom RGB
|
|
1106
1205
|
- added `record()` to start a screen recording
|
|
@@ -1161,7 +1260,7 @@ timer.resume();
|
|
|
1161
1260
|
- `AudioPlay#isStopped()`
|
|
1162
1261
|
- `AudioPlay#isPaused()`
|
|
1163
1262
|
|
|
1164
|
-
|
|
1263
|
+
## [2000.0.0] "Burp Mode" - 2021-10-20 (kaboom.js)
|
|
1165
1264
|
|
|
1166
1265
|
- version jumped to v2000.0.0 (still semver, just big)
|
|
1167
1266
|
- added `burp()` for easy burping
|
|
@@ -1393,7 +1492,7 @@ if (area.shape === "rect") {
|
|
|
1393
1492
|
- added plugins npm package support e.g.
|
|
1394
1493
|
`import asepritePlugin from "kaboom/plugins/aseprite"`
|
|
1395
1494
|
|
|
1396
|
-
|
|
1495
|
+
## [0.5.0] "Sticky Type" - 2021-05-11 (kaboom.js)
|
|
1397
1496
|
|
|
1398
1497
|
- platforms are now sticky
|
|
1399
1498
|
- moved to TypeScript
|
|
@@ -1435,7 +1534,7 @@ if (area.shape === "rect") {
|
|
|
1435
1534
|
- fixed `on("destroy")` handler getting called twice
|
|
1436
1535
|
- fixed sprite `play()` not playing
|
|
1437
1536
|
|
|
1438
|
-
|
|
1537
|
+
## [0.4.0] "Multiboom" - UNKNOWN (kaboom.js)
|
|
1439
1538
|
|
|
1440
1539
|
- **BREAK** removed `init()` and `kaboom.global()`, in favor of `kaboom()`, also
|
|
1441
1540
|
allows multiple kaboom games on one page
|
|
@@ -1472,7 +1571,7 @@ k.vec2();
|
|
|
1472
1571
|
- added `numFrames()` by `sprite()`
|
|
1473
1572
|
- added `screenshot()` that returns of a png base64 data url for a screenshot
|
|
1474
1573
|
|
|
1475
|
-
|
|
1574
|
+
## [0.3.0] "King Dedede...Bug!" - UNKNOWN
|
|
1476
1575
|
|
|
1477
1576
|
- **BREAK** removed `pause()` and `paused()` in favor to `kaboom.debug.paused`
|
|
1478
1577
|
- **BREAK** removed `velY`, `curPlatform` and `maxVel` fields by `body()`
|
|
@@ -1490,7 +1589,7 @@ k.vec2();
|
|
|
1490
1589
|
- added on screen logging with `log()` and `error()`
|
|
1491
1590
|
- fixed `loadRoot()` sometimes doesn't work in async tasks
|
|
1492
1591
|
|
|
1493
|
-
|
|
1592
|
+
## [0.2.0] "Hear the Tremble" - UNKNOWN
|
|
1494
1593
|
|
|
1495
1594
|
- **BREAK** removed `aseSpriteSheet` conf field from
|
|
1496
1595
|
`loadSprite(name, src, conf)`
|
|
@@ -1515,7 +1614,7 @@ k.vec2();
|
|
|
1515
1614
|
- added `readd()` to re-add an object to the scene without triggering events
|
|
1516
1615
|
- added `level.spawn()`
|
|
1517
1616
|
|
|
1518
|
-
|
|
1617
|
+
## [0.1.0] "Oh Hi Mark" -
|
|
1519
1618
|
|
|
1520
1619
|
- **BREAK** changed default origin point to `"topleft"`, so if you want object
|
|
1521
1620
|
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,19 +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 and art
|
|
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
193
|
- Thansk to [Kenney](https://kenney.nl/) for all used assets for examples
|
|
194
194
|
- [Impact Sound Pack](https://kenney.nl/assets/impact-sounds)
|
|
195
|
+
- [1-Bit Platformer Pack](https://kenney.nl/assets/1-bit-platformer-pack)
|
|
195
196
|
- Thanks to [abrudz](https://github.com/abrudz) for the amazing
|
|
196
197
|
[APL386 font](https://abrudz.github.io/APL386/)
|
|
197
198
|
- Thanks to [Polyducks](http://polyducks.co.uk/) for the amazing
|
|
198
199
|
[kitchen sink font](https://polyducks.itch.io/kitchen-sink-textmode-font) font
|
|
199
200
|
- Thanks to [0x72](https://0x72.itch.io/) for the amazing
|
|
200
201
|
[Dungeon Tileset](https://0x72.itch.io/dungeontileset-ii)
|
|
201
|
-
- Thanks to [Kenney](https://kenney.nl/) for the amazing
|
|
202
|
-
[1-Bit Platformer Pack](https://kenney.nl/assets/1-bit-platformer-pack)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Cursor, GamepadDef, GamepadStick, Key, KGamepad, KGamepadButton, MouseButton } from "../types";
|
|
2
2
|
import { Vec2 } from "../math/math";
|
|
3
3
|
import { KEventController, KEventHandler } from "../utils";
|
|
4
|
+
import type { AppEventMap } from "../game";
|
|
4
5
|
import { type ButtonBinding, type ButtonsDef } from "./inputBindings";
|
|
5
6
|
export declare class ButtonState<T = string> {
|
|
6
7
|
pressed: Set<T>;
|
|
@@ -64,34 +65,7 @@ export declare const initAppState: (opt: {
|
|
|
64
65
|
isMouseMoved: boolean;
|
|
65
66
|
lastWidth: number;
|
|
66
67
|
lastHeight: number;
|
|
67
|
-
events: KEventHandler<
|
|
68
|
-
mouseMove: [];
|
|
69
|
-
mouseDown: [MouseButton];
|
|
70
|
-
mousePress: [MouseButton];
|
|
71
|
-
mouseRelease: [MouseButton];
|
|
72
|
-
charInput: [string];
|
|
73
|
-
keyPress: [Key];
|
|
74
|
-
keyDown: [Key];
|
|
75
|
-
keyPressRepeat: [Key];
|
|
76
|
-
keyRelease: [Key];
|
|
77
|
-
touchStart: [Vec2, Touch];
|
|
78
|
-
touchMove: [Vec2, Touch];
|
|
79
|
-
touchEnd: [Vec2, Touch];
|
|
80
|
-
gamepadButtonDown: [KGamepadButton, KGamepad];
|
|
81
|
-
gamepadButtonPress: [KGamepadButton, KGamepad];
|
|
82
|
-
gamepadButtonRelease: [KGamepadButton, KGamepad];
|
|
83
|
-
gamepadStick: [string, Vec2, KGamepad];
|
|
84
|
-
gamepadConnect: [KGamepad];
|
|
85
|
-
gamepadDisconnect: [KGamepad];
|
|
86
|
-
buttonDown: [string];
|
|
87
|
-
buttonPress: [string];
|
|
88
|
-
buttonRelease: [string];
|
|
89
|
-
scroll: [Vec2];
|
|
90
|
-
hide: [];
|
|
91
|
-
show: [];
|
|
92
|
-
resize: [];
|
|
93
|
-
input: [];
|
|
94
|
-
}>;
|
|
68
|
+
events: KEventHandler<AppEventMap>;
|
|
95
69
|
};
|
|
96
70
|
export declare const initApp: (opt: {
|
|
97
71
|
canvas: HTMLCanvasElement;
|
|
@@ -133,34 +107,7 @@ export declare const initApp: (opt: {
|
|
|
133
107
|
isMouseMoved: boolean;
|
|
134
108
|
lastWidth: number;
|
|
135
109
|
lastHeight: number;
|
|
136
|
-
events: KEventHandler<
|
|
137
|
-
mouseMove: [];
|
|
138
|
-
mouseDown: [MouseButton];
|
|
139
|
-
mousePress: [MouseButton];
|
|
140
|
-
mouseRelease: [MouseButton];
|
|
141
|
-
charInput: [string];
|
|
142
|
-
keyPress: [Key];
|
|
143
|
-
keyDown: [Key];
|
|
144
|
-
keyPressRepeat: [Key];
|
|
145
|
-
keyRelease: [Key];
|
|
146
|
-
touchStart: [Vec2, Touch];
|
|
147
|
-
touchMove: [Vec2, Touch];
|
|
148
|
-
touchEnd: [Vec2, Touch];
|
|
149
|
-
gamepadButtonDown: [KGamepadButton, KGamepad];
|
|
150
|
-
gamepadButtonPress: [KGamepadButton, KGamepad];
|
|
151
|
-
gamepadButtonRelease: [KGamepadButton, KGamepad];
|
|
152
|
-
gamepadStick: [string, Vec2, KGamepad];
|
|
153
|
-
gamepadConnect: [KGamepad];
|
|
154
|
-
gamepadDisconnect: [KGamepad];
|
|
155
|
-
buttonDown: [string];
|
|
156
|
-
buttonPress: [string];
|
|
157
|
-
buttonRelease: [string];
|
|
158
|
-
scroll: [Vec2];
|
|
159
|
-
hide: [];
|
|
160
|
-
show: [];
|
|
161
|
-
resize: [];
|
|
162
|
-
input: [];
|
|
163
|
-
}>;
|
|
110
|
+
events: KEventHandler<AppEventMap>;
|
|
164
111
|
};
|
|
165
112
|
dt: () => number;
|
|
166
113
|
fixedDt: () => number;
|
|
@@ -229,34 +176,7 @@ export declare const initApp: (opt: {
|
|
|
229
176
|
onButtonDown: ((action: (btn: string) => void) => KEventController) & ((btn: string | string, action: (btn: string) => void) => KEventController);
|
|
230
177
|
onButtonRelease: ((action: (btn: string) => void) => KEventController) & ((btn: string | string, action: (btn: string) => void) => KEventController);
|
|
231
178
|
getLastInputDeviceType: () => import("./inputBindings").ButtonBindingDevice | null;
|
|
232
|
-
events: KEventHandler<
|
|
233
|
-
mouseMove: [];
|
|
234
|
-
mouseDown: [MouseButton];
|
|
235
|
-
mousePress: [MouseButton];
|
|
236
|
-
mouseRelease: [MouseButton];
|
|
237
|
-
charInput: [string];
|
|
238
|
-
keyPress: [Key];
|
|
239
|
-
keyDown: [Key];
|
|
240
|
-
keyPressRepeat: [Key];
|
|
241
|
-
keyRelease: [Key];
|
|
242
|
-
touchStart: [Vec2, Touch];
|
|
243
|
-
touchMove: [Vec2, Touch];
|
|
244
|
-
touchEnd: [Vec2, Touch];
|
|
245
|
-
gamepadButtonDown: [KGamepadButton, KGamepad];
|
|
246
|
-
gamepadButtonPress: [KGamepadButton, KGamepad];
|
|
247
|
-
gamepadButtonRelease: [KGamepadButton, KGamepad];
|
|
248
|
-
gamepadStick: [string, Vec2, KGamepad];
|
|
249
|
-
gamepadConnect: [KGamepad];
|
|
250
|
-
gamepadDisconnect: [KGamepad];
|
|
251
|
-
buttonDown: [string];
|
|
252
|
-
buttonPress: [string];
|
|
253
|
-
buttonRelease: [string];
|
|
254
|
-
scroll: [Vec2];
|
|
255
|
-
hide: [];
|
|
256
|
-
show: [];
|
|
257
|
-
resize: [];
|
|
258
|
-
input: [];
|
|
259
|
-
}>;
|
|
179
|
+
events: KEventHandler<AppEventMap>;
|
|
260
180
|
};
|
|
261
181
|
export {};
|
|
262
182
|
//# sourceMappingURL=app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app/app.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,MAAM,EACN,UAAU,EACV,YAAY,EACZ,GAAG,EACH,QAAQ,EACR,cAAc,EACd,WAAW,EACd,MAAM,UAAU,CAAC;AAElB,OAAO,EAAO,IAAI,EAAQ,MAAM,cAAc,CAAC;AAE/C,OAAO,EAEH,gBAAgB,EAChB,aAAa,EAGhB,MAAM,UAAU,CAAC;AAGlB,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,UAAU,EAGlB,MAAM,iBAAiB,CAAC;AAEzB,qBAAa,WAAW,CAAC,CAAC,GAAG,MAAM;IAC/B,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,CAAe;IAC9B,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC,CAAe;IACpC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAe;IAC/B,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAe;IAC3B,MAAM;IAKN,KAAK,CAAC,GAAG,EAAE,CAAC;IAKZ,WAAW,CAAC,GAAG,EAAE,CAAC;IAGlB,OAAO,CAAC,GAAG,EAAE,CAAC;CAKjB;AAED,cAAM,YAAY;IACd,WAAW,EAAE,WAAW,CAAC,cAAc,CAAC,CAAqB;IAC7D,UAAU,EAAE,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,CAAa;CACnD;AAED,cAAM,UAAU;IACZ,OAAO,CAAC,GAAG,CAAgB;IAC3B,OAAO,CAAC,KAAK,CAAa;IAC1B,GAAG,EAAE,MA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GAAG,EAAE,MAAM,KAAK,IAAI;;;CAgnB1D,CAAC"}
|
|
@@ -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,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C;;GAEG;AACH,qBAAa,KAAK,CAAC,CAAC;IAChB,MAAM,EAAE,OAAO,CAAS;IACxB,IAAI,EAAE,CAAC,GAAG,IAAI,CAAQ;IACtB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAQ;IAC3B,OAAO,CAAC,YAAY,CAA6B;IACjD,OAAO,CAAC,a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AS,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"}
|
|
@@ -116,6 +116,11 @@ export interface TextCompOpt {
|
|
|
116
116
|
* @since v2000.2
|
|
117
117
|
*/
|
|
118
118
|
styles?: Record<string, CharTransform | CharTransformFunc>;
|
|
119
|
+
/**
|
|
120
|
+
* If true, any (whitespace) indent on the first line of the paragraph
|
|
121
|
+
* will be copied to all of the lines for those parts that text-wrap.
|
|
122
|
+
*/
|
|
123
|
+
indentAll?: boolean;
|
|
119
124
|
}
|
|
120
125
|
export declare function text(t: string, opt?: TextCompOpt): TextComp;
|
|
121
126
|
//# sourceMappingURL=text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/components/draw/text.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAInD,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,iBAAiB,EAItB,KAAK,SAAS,EACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,IAAI,EAAQ,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAsB,MAAM,aAAa,CAAC;AAE5D;;;;GAIG;AACH,MAAM,WAAW,QAAS,SAAQ,IAAI;IAClC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC;IAC9B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OA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
-
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
|