@inglorious/engine 20.0.3 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/engine",
3
- "version": "20.0.3",
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": "9.5.3",
37
- "@inglorious/utils": "3.7.3"
36
+ "@inglorious/store": "10.0.0",
37
+ "@inglorious/utils": "3.8.0"
38
38
  },
39
39
  "peerDependencies": {
40
- "@inglorious/store": "9.5.3",
41
- "@inglorious/utils": "3.7.3"
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
- keyboard: [keyboard()],
8
- gamepads_poller: [gamepadsPoller(targetIds)],
9
- gamepad_listener: [gamepadListener()],
10
- input: [input()],
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: "gamepads_poller" },
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),
@@ -86,5 +86,5 @@ export function gamepadListener() {
86
86
  }
87
87
 
88
88
  export function createGamepad(targetId, mapping = {}) {
89
- return { type: "gamepad_listener", targetId, mapping }
89
+ return { type: "GamepadListener", targetId, mapping }
90
90
  }
@@ -27,5 +27,5 @@ export function input() {
27
27
  }
28
28
 
29
29
  export function createInput(targetId, mapping = {}) {
30
- return { type: "input", targetId, mapping }
30
+ return { type: "Input", targetId, mapping }
31
31
  }
@@ -41,7 +41,7 @@ export function keyboard() {
41
41
  }
42
42
 
43
43
  export function createKeyboard(targetId, mapping = {}) {
44
- return { type: "keyboard", targetId, mapping }
44
+ return { type: "Keyboard", targetId, mapping }
45
45
  }
46
46
 
47
47
  function createKeyboardHandler(id, api) {
@@ -48,7 +48,7 @@ export function trackMouse(parent, api, toGamePosition) {
48
48
 
49
49
  export function createMouse(overrides = {}) {
50
50
  return {
51
- type: "mouse",
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,
@@ -88,7 +88,7 @@ export function trackTouch(parent, api, toGamePosition) {
88
88
 
89
89
  export function createTouch() {
90
90
  return {
91
- type: "touch",
91
+ type: "Touch",
92
92
  layer: 999, // A high layer value to ensure it's always rendered on top
93
93
  positions: [],
94
94
  collisions: {
@@ -23,16 +23,16 @@ const DEFAULT_GAME_CONFIG = {
23
23
  systems: [],
24
24
 
25
25
  types: {
26
- game: [game()],
27
- audio: [audio()],
28
- images: [images()],
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: "game", size: v(800, 600) },
34
- audio: { type: "audio", sounds: {} },
35
- images: { type: "images", images: {} },
33
+ game: { type: "Game", size: v(800, 600) },
34
+ audio: { type: "Audio", sounds: {} },
35
+ images: { type: "Images", images: {} },
36
36
  },
37
37
  }
38
38