@inglorious/engine 21.0.0 → 22.0.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.
- package/package.json +5 -5
- package/src/behaviors/input/controls.js +5 -5
- package/src/behaviors/input/gamepad.js +1 -1
- package/src/behaviors/input/input.js +1 -1
- package/src/behaviors/input/keyboard.js +1 -1
- package/src/behaviors/input/mouse.js +1 -1
- package/src/behaviors/input/touch.js +1 -1
- package/src/core/engine.js +6 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/engine",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0",
|
|
4
4
|
"description": "A JavaScript game engine written with global state, immutability, and pure functions in mind. Have fun(ctional programming) with it!",
|
|
5
5
|
"author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
},
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@inglorious/store": "
|
|
37
|
-
"@inglorious/utils": "3.
|
|
36
|
+
"@inglorious/store": "10.0.0",
|
|
37
|
+
"@inglorious/utils": "3.8.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@inglorious/
|
|
41
|
-
"@inglorious/
|
|
40
|
+
"@inglorious/utils": "3.8.0",
|
|
41
|
+
"@inglorious/store": "10.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"prettier": "^3.5.3",
|
|
@@ -4,16 +4,16 @@ import { createKeyboard, keyboard } from "./keyboard.js"
|
|
|
4
4
|
|
|
5
5
|
export function controls(...targetIds) {
|
|
6
6
|
return {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
Keyboard: [keyboard()],
|
|
8
|
+
GamepadsPoller: [gamepadsPoller(targetIds)],
|
|
9
|
+
GamepadListener: [gamepadListener()],
|
|
10
|
+
Input: [input()],
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function createControls(targetId, mapping = {}) {
|
|
15
15
|
return {
|
|
16
|
-
gamepads: { type: "
|
|
16
|
+
gamepads: { type: "GamepadsPoller" },
|
|
17
17
|
[`keyboard_${targetId}`]: createKeyboard(targetId, mapping),
|
|
18
18
|
[`gamepad_${targetId}`]: createGamepad(targetId, mapping),
|
|
19
19
|
[`input_${targetId}`]: createInput(targetId, mapping),
|
|
@@ -48,7 +48,7 @@ export function trackMouse(parent, api, toGamePosition) {
|
|
|
48
48
|
|
|
49
49
|
export function createMouse(overrides = {}) {
|
|
50
50
|
return {
|
|
51
|
-
type: "
|
|
51
|
+
type: "Mouse",
|
|
52
52
|
layer: 999, // A high layer value to ensure it's always rendered on top
|
|
53
53
|
position: zero(),
|
|
54
54
|
...overrides,
|
package/src/core/engine.js
CHANGED
|
@@ -23,16 +23,16 @@ const DEFAULT_GAME_CONFIG = {
|
|
|
23
23
|
systems: [],
|
|
24
24
|
|
|
25
25
|
types: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
Game: [game()],
|
|
27
|
+
Audio: [audio()],
|
|
28
|
+
Images: [images()],
|
|
29
29
|
},
|
|
30
30
|
|
|
31
31
|
entities: {
|
|
32
32
|
// eslint-disable-next-line no-magic-numbers
|
|
33
|
-
game: { type: "
|
|
34
|
-
audio: { type: "
|
|
35
|
-
images: { type: "
|
|
33
|
+
game: { type: "Game", size: v(800, 600) },
|
|
34
|
+
audio: { type: "Audio", sounds: {} },
|
|
35
|
+
images: { type: "Images", images: {} },
|
|
36
36
|
},
|
|
37
37
|
}
|
|
38
38
|
|