brick-engine-js 1.0.8 → 1.0.10
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/dist/app.js +1 -4952
- package/dist/brick-engine.js +1 -4970
- package/dist/css/{app.bundle.css → app.0ce9b8479d1758fc15ba.css} +0 -2
- package/dist/css/{brick-engine.bundle.css → brick-engine.0ce9b8479d1758fc15ba.css} +0 -2
- package/dist/docs/GAME_DEVELOPER_GUIDE.html +1 -1
- package/dist/docs/brick-engine-guide.html +1 -1
- package/dist/docs/getting-started.html +1 -1
- package/dist/docs/jsdoc_standard.html +1 -1
- package/dist/docs/publishing.html +1 -1
- package/dist/docs/reference/interfaces/modules/Session.html +1 -1
- package/dist/docs/reference/modules/GameMenu.html +1 -1
- package/dist/docs/reference/modules/GameSession.html +1 -1
- package/dist/docs/reference/modules/InitialStateSnapshot.html +1 -1
- package/dist/docs/reference/modules/SessionModal.html +1 -1
- package/dist/docs/testing_best_practices.html +1 -1
- package/dist/index.html +1 -15
- package/dist/vendor/p5.min.js +1 -1
- package/package.json +2 -4
- package/dist/app.js.map +0 -1
- package/dist/brick-engine.js.map +0 -1
- package/dist/css/app.bundle.css.map +0 -1
- package/dist/css/brick-engine.bundle.css.map +0 -1
- package/docs/GAME_DEVELOPER_GUIDE.adoc +0 -167
- package/docs/brick-engine-guide.adoc +0 -87
- package/docs/diagrams/lifecycle.mmd +0 -19
- package/docs/documentation_style_guide.adoc +0 -210
- package/docs/getting-started.adoc +0 -147
- package/docs/images/lifecycle.svg +0 -1
- package/docs/jsdoc_standard.adoc +0 -109
- package/docs/publishing.adoc +0 -58
- package/docs/reference/enums/Color.adoc +0 -35
- package/docs/reference/enums/ControlEventType.adoc +0 -28
- package/docs/reference/enums/ControlKey.adoc +0 -34
- package/docs/reference/enums/FontAlignment.adoc +0 -43
- package/docs/reference/enums/FontSize.adoc +0 -31
- package/docs/reference/enums/Sound.adoc +0 -42
- package/docs/reference/enums/StateProperty.adoc +0 -33
- package/docs/reference/helpers/CellHelper.adoc +0 -37
- package/docs/reference/helpers/ControlInputHandlerHelper.adoc +0 -57
- package/docs/reference/helpers/CoordinateHelper.adoc +0 -118
- package/docs/reference/helpers/RelativeValuesHelper.adoc +0 -53
- package/docs/reference/interfaces/Debuggable.adoc +0 -29
- package/docs/reference/interfaces/GameModules.adoc +0 -35
- package/docs/reference/interfaces/Initializable.adoc +0 -24
- package/docs/reference/interfaces/RendererInitializable.adoc +0 -33
- package/docs/reference/interfaces/StateSyncable.adoc +0 -41
- package/docs/reference/interfaces/modules/Control.adoc +0 -98
- package/docs/reference/interfaces/modules/Grid.adoc +0 -411
- package/docs/reference/interfaces/modules/Renderer.adoc +0 -34
- package/docs/reference/interfaces/modules/RendererComposite.adoc +0 -57
- package/docs/reference/interfaces/modules/Score.adoc +0 -107
- package/docs/reference/interfaces/modules/Session.adoc +0 -66
- package/docs/reference/interfaces/modules/State.adoc +0 -290
- package/docs/reference/interfaces/modules/Text.adoc +0 -110
- package/docs/reference/interfaces/modules/Time.adoc +0 -119
- package/docs/reference/modules/Debugger.adoc +0 -71
- package/docs/reference/modules/DisplayRenderer.adoc +0 -55
- package/docs/reference/modules/Game.adoc +0 -256
- package/docs/reference/modules/GameControl.adoc +0 -139
- package/docs/reference/modules/GameGrid.adoc +0 -794
- package/docs/reference/modules/GameHudGrid.adoc +0 -38
- package/docs/reference/modules/GameMenu.adoc +0 -39
- package/docs/reference/modules/GameRenderer.adoc +0 -79
- package/docs/reference/modules/GameScore.adoc +0 -138
- package/docs/reference/modules/GameSession.adoc +0 -43
- package/docs/reference/modules/GameSound.adoc +0 -111
- package/docs/reference/modules/GameState.adoc +0 -318
- package/docs/reference/modules/GameText.adoc +0 -139
- package/docs/reference/modules/GameTime.adoc +0 -141
- package/docs/reference/modules/HudRenderer.adoc +0 -56
- package/docs/reference/modules/InitialStateSnapshot.adoc +0 -47
- package/docs/reference/modules/SessionModal.adoc +0 -34
- package/docs/reference/types/Axis.adoc +0 -28
- package/docs/reference/types/Cell.adoc +0 -29
- package/docs/reference/types/ControlCallback.adoc +0 -23
- package/docs/reference/types/Coordinate.adoc +0 -29
- package/docs/reference/types/GameEntry.adoc +0 -29
- package/docs/reference/types/GameEvent.adoc +0 -29
- package/docs/reference/types/Piece.adoc +0 -32
- package/docs/reference/types/RendererMetrics.adoc +0 -29
- package/docs/reference/types/Vector.adoc +0 -28
- package/docs/testing_best_practices.adoc +0 -190
- package/public/CNAME +0 -1
- package/public/docs/GAME_DEVELOPER_GUIDE.html +0 -727
- package/public/docs/brick-engine-guide.html +0 -610
- package/public/docs/diagrams/lifecycle.mmd +0 -19
- package/public/docs/documentation_style_guide.html +0 -994
- package/public/docs/getting-started.html +0 -648
- package/public/docs/images/lifecycle.svg +0 -1
- package/public/docs/index.html +0 -593
- package/public/docs/jsdoc_standard.html +0 -656
- package/public/docs/publishing.html +0 -573
- package/public/docs/reference/enums/Color.html +0 -533
- package/public/docs/reference/enums/ControlEventType.html +0 -505
- package/public/docs/reference/enums/ControlKey.html +0 -529
- package/public/docs/reference/enums/FontAlignment.html +0 -545
- package/public/docs/reference/enums/FontSize.html +0 -517
- package/public/docs/reference/enums/Sound.html +0 -558
- package/public/docs/reference/enums/StateProperty.html +0 -525
- package/public/docs/reference/helpers/CellHelper.html +0 -520
- package/public/docs/reference/helpers/ControlInputHandlerHelper.html +0 -569
- package/public/docs/reference/helpers/CoordinateHelper.html +0 -703
- package/public/docs/reference/helpers/RelativeValuesHelper.html +0 -560
- package/public/docs/reference/interfaces/Debuggable.html +0 -501
- package/public/docs/reference/interfaces/GameModules.html +0 -544
- package/public/docs/reference/interfaces/Initializable.html +0 -495
- package/public/docs/reference/interfaces/RendererInitializable.html +0 -517
- package/public/docs/reference/interfaces/StateSyncable.html +0 -542
- package/public/docs/reference/interfaces/modules/Control.html +0 -648
- package/public/docs/reference/interfaces/modules/Grid.html +0 -1256
- package/public/docs/reference/interfaces/modules/Renderer.html +0 -522
- package/public/docs/reference/interfaces/modules/RendererComposite.html +0 -577
- package/public/docs/reference/interfaces/modules/Score.html +0 -669
- package/public/docs/reference/interfaces/modules/Session.html +0 -585
- package/public/docs/reference/interfaces/modules/State.html +0 -897
- package/public/docs/reference/interfaces/modules/Text.html +0 -668
- package/public/docs/reference/interfaces/modules/Time.html +0 -684
- package/public/docs/reference/modules/Debugger.html +0 -579
- package/public/docs/reference/modules/DisplayRenderer.html +0 -557
- package/public/docs/reference/modules/Game.html +0 -909
- package/public/docs/reference/modules/GameControl.html +0 -716
- package/public/docs/reference/modules/GameGrid.html +0 -1910
- package/public/docs/reference/modules/GameHudGrid.html +0 -508
- package/public/docs/reference/modules/GameMenu.html +0 -538
- package/public/docs/reference/modules/GameRenderer.html +0 -589
- package/public/docs/reference/modules/GameScore.html +0 -664
- package/public/docs/reference/modules/GameSession.html +0 -533
- package/public/docs/reference/modules/GameSound.html +0 -636
- package/public/docs/reference/modules/GameState.html +0 -922
- package/public/docs/reference/modules/GameText.html +0 -701
- package/public/docs/reference/modules/GameTime.html +0 -696
- package/public/docs/reference/modules/HudRenderer.html +0 -568
- package/public/docs/reference/modules/InitialStateSnapshot.html +0 -557
- package/public/docs/reference/modules/SessionModal.html +0 -520
- package/public/docs/reference/types/Axis.html +0 -505
- package/public/docs/reference/types/Cell.html +0 -514
- package/public/docs/reference/types/ControlCallback.html +0 -488
- package/public/docs/reference/types/Coordinate.html +0 -510
- package/public/docs/reference/types/GameEntry.html +0 -514
- package/public/docs/reference/types/GameEvent.html +0 -514
- package/public/docs/reference/types/Piece.html +0 -506
- package/public/docs/reference/types/RendererMetrics.html +0 -514
- package/public/docs/reference/types/Vector.html +0 -509
- package/public/docs/testing_best_practices.html +0 -770
- package/public/favicon.ico +0 -0
- package/public/fonts/digital-7.monoitalic.ttf +0 -0
- package/public/images/cell.svg +0 -32
- package/public/images/close.png +0 -0
- package/public/images/games.png +0 -0
- package/public/images/github.png +0 -0
- package/public/images/letter-a.png +0 -0
- package/public/images/letter-d.png +0 -0
- package/public/images/letter-j.png +0 -0
- package/public/images/letter-s.png +0 -0
- package/public/images/letter-w.png +0 -0
- package/public/images/meta-image.png +0 -0
- package/public/images/number-1.png +0 -0
- package/public/images/number-2.png +0 -0
- package/public/images/number-3.png +0 -0
- package/public/images/number-4.png +0 -0
- package/public/images/number-5.png +0 -0
- package/public/images/number-6.png +0 -0
- package/public/images/splash.gif +0 -0
- package/public/index.html +0 -15
- package/public/sounds/sound_00.wav +0 -0
- package/public/sounds/sound_01.wav +0 -0
- package/public/sounds/sound_02.wav +0 -0
- package/public/sounds/sound_03.wav +0 -0
- package/public/sounds/sound_04.wav +0 -0
- package/public/sounds/sound_05.wav +0 -0
- package/public/sounds/sound_06.wav +0 -0
- package/public/sounds/sound_07.wav +0 -0
- package/public/sounds/sound_08.wav +0 -0
- package/public/sounds/sound_09.wav +0 -0
- package/public/sounds/sound_10.wav +0 -0
- package/public/sounds/sound_11.wav +0 -0
- package/public/sounds/sound_12.wav +0 -0
- package/public/sounds/sound_13.wav +0 -0
- package/public/sounds/sound_14.wav +0 -0
- package/public/sounds/sound_15.wav +0 -0
- package/public/style/body.css +0 -86
- package/public/style/buttons.css +0 -233
- package/public/style/debugger.css +0 -117
- package/public/style/sessionModal.css +0 -155
- package/public/style/sourceCodeAndCommands.css +0 -74
- package/public/style/splash.css +0 -13
- package/public/style/theme.css +0 -137
- /package/dist/{bootstrap.d.ts → types/bootstrap.d.ts} +0 -0
- /package/dist/{bootstrap.test.d.ts → types/bootstrap.test.d.ts} +0 -0
- /package/dist/{config → types/config}/configs.d.ts +0 -0
- /package/dist/{config → types/config}/configs.test.d.ts +0 -0
- /package/dist/{core → types/core}/Game.d.ts +0 -0
- /package/dist/{core → types/core}/Game.test.d.ts +0 -0
- /package/dist/{core → types/core}/InitialStateSnapshot.d.ts +0 -0
- /package/dist/{core → types/core}/InitialStateSnapshot.test.d.ts +0 -0
- /package/dist/{core → types/core}/helpers/CellHelper.d.ts +0 -0
- /package/dist/{core → types/core}/helpers/CellHelper.test.d.ts +0 -0
- /package/dist/{core → types/core}/helpers/ControlInputHandlerHelper.d.ts +0 -0
- /package/dist/{core → types/core}/helpers/ControlInputHandlerHelper.test.d.ts +0 -0
- /package/dist/{core → types/core}/helpers/CoordinateHelper.d.ts +0 -0
- /package/dist/{core → types/core}/helpers/CoordinateHelper.test.d.ts +0 -0
- /package/dist/{core → types/core}/helpers/InterfaceIdentifierHelper.d.ts +0 -0
- /package/dist/{core → types/core}/helpers/InterfaceIdentifierHelper.test.d.ts +0 -0
- /package/dist/{core → types/core}/helpers/RelativeValuesHelper.d.ts +0 -0
- /package/dist/{core → types/core}/helpers/RelativeValuesHelper.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/control/GameControl.d.ts +0 -0
- /package/dist/{core → types/core}/module/control/GameControl.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/control/GameControlKeyBinding.d.ts +0 -0
- /package/dist/{core → types/core}/module/control/GameControlKeyBinding.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/GameGrid.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/GameGrid.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/GameHudGrid.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/GameHudGrid.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/engines/GridAnalysisEngine.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/engines/GridAnalysisEngine.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/engines/GridLineEngine.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/engines/GridLineEngine.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/engines/GridMovementEngine.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/engines/GridMovementEngine.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/engines/GridRegionEngine.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/engines/GridRegionEngine.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/engines/GridTransformEngine.d.ts +0 -0
- /package/dist/{core → types/core}/module/grid/engines/GridTransformEngine.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/renderer/DisplayRenderer.d.ts +0 -0
- /package/dist/{core → types/core}/module/renderer/DisplayRenderer.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/renderer/GameRenderer.d.ts +0 -0
- /package/dist/{core → types/core}/module/renderer/GameRenderer.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/renderer/HudRenderer.d.ts +0 -0
- /package/dist/{core → types/core}/module/renderer/HudRenderer.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/score/GameScore.d.ts +0 -0
- /package/dist/{core → types/core}/module/score/GameScore.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/session/GameSession.d.ts +0 -0
- /package/dist/{core → types/core}/module/session/GameSession.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/sound/GameSound.d.ts +0 -0
- /package/dist/{core → types/core}/module/sound/GameSound.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/state/GameState.d.ts +0 -0
- /package/dist/{core → types/core}/module/state/GameState.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/text/GameText.d.ts +0 -0
- /package/dist/{core → types/core}/module/text/GameText.test.d.ts +0 -0
- /package/dist/{core → types/core}/module/time/GameTime.d.ts +0 -0
- /package/dist/{core → types/core}/module/time/GameTime.test.d.ts +0 -0
- /package/dist/{core → types/core}/types/Interfaces.d.ts +0 -0
- /package/dist/{core → types/core}/types/Types.d.ts +0 -0
- /package/dist/{core → types/core}/types/enums.d.ts +0 -0
- /package/dist/{core → types/core}/types/modules.d.ts +0 -0
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
- /package/dist/{main.d.ts → types/main.d.ts} +0 -0
- /package/dist/{menu → types/menu}/GameMenu.d.ts +0 -0
- /package/dist/{menu → types/menu}/GameMenu.test.d.ts +0 -0
- /package/dist/{menu → types/menu}/GameMenuSingleton.d.ts +0 -0
- /package/dist/{menu → types/menu}/GameMenuSingleton.test.d.ts +0 -0
- /package/dist/{menu → types/menu}/GameRepository.d.ts +0 -0
- /package/dist/{menu → types/menu}/GameRepository.test.d.ts +0 -0
- /package/dist/{menu → types/menu}/manager/GameManager.d.ts +0 -0
- /package/dist/{menu → types/menu}/manager/GameManager.test.d.ts +0 -0
- /package/dist/types/{interfaces.d.ts → types/interfaces.d.ts} +0 -0
- /package/dist/{view → types/view}/Debugger.d.ts +0 -0
- /package/dist/{view → types/view}/Debugger.test.d.ts +0 -0
- /package/dist/{view → types/view}/GameView.d.ts +0 -0
- /package/dist/{view → types/view}/GameView.test.d.ts +0 -0
- /package/dist/{view → types/view}/SessionModal.d.ts +0 -0
- /package/dist/{view → types/view}/SessionModal.test.d.ts +0 -0
- /package/dist/{view → types/view}/components/layout/ButtonLayout.d.ts +0 -0
- /package/dist/{view → types/view}/components/layout/ButtonLayout.test.d.ts +0 -0
- /package/dist/{view → types/view}/components/layout/ContainerLayout.d.ts +0 -0
- /package/dist/{view → types/view}/components/layout/ContainerLayout.test.d.ts +0 -0
- /package/dist/{view → types/view}/components/layout/FrameLayout.d.ts +0 -0
- /package/dist/{view → types/view}/components/layout/FrameLayout.test.d.ts +0 -0
- /package/dist/{view → types/view}/components/ui/BigButton.d.ts +0 -0
- /package/dist/{view → types/view}/components/ui/BigButton.test.d.ts +0 -0
- /package/dist/{view → types/view}/components/ui/Button.d.ts +0 -0
- /package/dist/{view → types/view}/components/ui/Button.test.d.ts +0 -0
- /package/dist/{view → types/view}/components/ui/Canvas.d.ts +0 -0
- /package/dist/{view → types/view}/components/ui/Canvas.test.d.ts +0 -0
- /package/dist/{view → types/view}/components/ui/SmallButton.d.ts +0 -0
- /package/dist/{view → types/view}/components/ui/SmallButton.test.d.ts +0 -0
- /package/dist/{view → types/view}/theme/applyColors.d.ts +0 -0
- /package/dist/{view → types/view}/theme/applyColors.test.d.ts +0 -0
- /package/dist/{view → types/view}/theme/dimensions.d.ts +0 -0
- /package/dist/{view → types/view}/theme/dimensions.test.d.ts +0 -0
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
= State Reference
|
|
2
|
-
:description: Interface for managing global game lifecycle flags, persistence, and preferences.
|
|
3
|
-
:keywords: state, lifecycle, persistence, preferences
|
|
4
|
-
:toc: left
|
|
5
|
-
:toclevels: 3
|
|
6
|
-
:sectnums:
|
|
7
|
-
:sectlinks:
|
|
8
|
-
:icons: font
|
|
9
|
-
:source-highlighter: highlight.js
|
|
10
|
-
:reproducible:
|
|
11
|
-
:experimental:
|
|
12
|
-
:idprefix:
|
|
13
|
-
:idseparator: -
|
|
14
|
-
|
|
15
|
-
Interface for managing global game lifecycle flags, persistence, and preferences.
|
|
16
|
-
|
|
17
|
-
== Methods
|
|
18
|
-
|
|
19
|
-
=== `isOn(): boolean`
|
|
20
|
-
|
|
21
|
-
Returns `true` if the engine is "powered on".
|
|
22
|
-
|
|
23
|
-
**Returns**
|
|
24
|
-
|
|
25
|
-
`boolean` - `true` if on.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
'''
|
|
29
|
-
|
|
30
|
-
=== `isOff(): boolean`
|
|
31
|
-
|
|
32
|
-
Returns `true` if the engine is "powered off".
|
|
33
|
-
|
|
34
|
-
**Returns**
|
|
35
|
-
|
|
36
|
-
`boolean` - `true` if off.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
'''
|
|
40
|
-
|
|
41
|
-
=== `isStarted(): boolean`
|
|
42
|
-
|
|
43
|
-
Returns `true` if a game session has been initialized.
|
|
44
|
-
|
|
45
|
-
**Returns**
|
|
46
|
-
|
|
47
|
-
`boolean` - `true` if started.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
'''
|
|
51
|
-
|
|
52
|
-
=== `isPlaying(): boolean`
|
|
53
|
-
|
|
54
|
-
Returns `true` if the game is active and logic ticks are flowing.
|
|
55
|
-
|
|
56
|
-
**Returns**
|
|
57
|
-
|
|
58
|
-
`boolean` - `true` if playing.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
'''
|
|
62
|
-
|
|
63
|
-
=== `isPaused(): boolean`
|
|
64
|
-
|
|
65
|
-
Returns `true` if the game is started but currently paused.
|
|
66
|
-
|
|
67
|
-
**Returns**
|
|
68
|
-
|
|
69
|
-
`boolean` - `true` if paused.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
'''
|
|
73
|
-
|
|
74
|
-
=== `isGameOver(): boolean`
|
|
75
|
-
|
|
76
|
-
Returns `true` if the current session has ended in defeat.
|
|
77
|
-
|
|
78
|
-
**Returns**
|
|
79
|
-
|
|
80
|
-
`boolean` - `true` if game over.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
'''
|
|
84
|
-
|
|
85
|
-
=== `isColorEnabled(): boolean`
|
|
86
|
-
|
|
87
|
-
Returns `true` if themed color rendering is active.
|
|
88
|
-
|
|
89
|
-
**Returns**
|
|
90
|
-
|
|
91
|
-
`boolean` - `true` if color is enabled.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
'''
|
|
95
|
-
|
|
96
|
-
=== `setColorEnabled(value: boolean): void`
|
|
97
|
-
|
|
98
|
-
Manually sets the color rendering preference.
|
|
99
|
-
|
|
100
|
-
**Parameters**
|
|
101
|
-
|
|
102
|
-
[cols="1,1,3"]
|
|
103
|
-
|===
|
|
104
|
-
|Name |Type |Description
|
|
105
|
-
|`value` |`boolean` |`true` to enable colors, `false` for monochrome/grayscale.
|
|
106
|
-
|===
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
'''
|
|
110
|
-
|
|
111
|
-
=== `isMuted(): boolean`
|
|
112
|
-
|
|
113
|
-
Returns `true` if the audio system is suppressed.
|
|
114
|
-
|
|
115
|
-
**Returns**
|
|
116
|
-
|
|
117
|
-
`boolean` - `true` if muted.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
'''
|
|
121
|
-
|
|
122
|
-
=== `setMuted(value: boolean): void`
|
|
123
|
-
|
|
124
|
-
Manually sets the audio suppression preference.
|
|
125
|
-
|
|
126
|
-
**Parameters**
|
|
127
|
-
|
|
128
|
-
[cols="1,1,3"]
|
|
129
|
-
|===
|
|
130
|
-
|Name |Type |Description
|
|
131
|
-
|`value` |`boolean` |`true` to mute, `false` to unmute.
|
|
132
|
-
|===
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
'''
|
|
136
|
-
|
|
137
|
-
=== `getHighScore(): number`
|
|
138
|
-
|
|
139
|
-
Retrieves the persistent high score for the current game.
|
|
140
|
-
|
|
141
|
-
**Returns**
|
|
142
|
-
|
|
143
|
-
`number` - The current high score.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
'''
|
|
147
|
-
|
|
148
|
-
=== `setHighScore(value: number): void`
|
|
149
|
-
|
|
150
|
-
Updates the persistent high score.
|
|
151
|
-
|
|
152
|
-
**Parameters**
|
|
153
|
-
|
|
154
|
-
[cols="1,1,3"]
|
|
155
|
-
|===
|
|
156
|
-
|Name |Type |Description
|
|
157
|
-
|`value` |`number` |The new high score to save.
|
|
158
|
-
|===
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
'''
|
|
162
|
-
|
|
163
|
-
=== `subscribe(property: xref:../../enums/StateProperty.adoc[StateProperty], callback: (value: boolean | number) => void): void`
|
|
164
|
-
|
|
165
|
-
Registers a listener for changes to a specific state property.
|
|
166
|
-
|
|
167
|
-
**Parameters**
|
|
168
|
-
|
|
169
|
-
[cols="1,1,3"]
|
|
170
|
-
|===
|
|
171
|
-
|Name |Type |Description
|
|
172
|
-
|`property` |`xref:../../enums/StateProperty.adoc[StateProperty]` |The property to watch.
|
|
173
|
-
|`callback` |`(value: boolean \| number) => void` |Function called when the property changes.
|
|
174
|
-
|===
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
'''
|
|
178
|
-
|
|
179
|
-
=== `unsubscribe(property: xref:../../enums/StateProperty.adoc[StateProperty], callback: (value: boolean | number) => void): void`
|
|
180
|
-
|
|
181
|
-
Removes a previously registered property listener.
|
|
182
|
-
|
|
183
|
-
**Parameters**
|
|
184
|
-
|
|
185
|
-
[cols="1,1,3"]
|
|
186
|
-
|===
|
|
187
|
-
|Name |Type |Description
|
|
188
|
-
|`property` |`xref:../../enums/StateProperty.adoc[StateProperty]` |The property being watched.
|
|
189
|
-
|`callback` |`(value: boolean \| number) => void` |The function to remove.
|
|
190
|
-
|===
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
'''
|
|
194
|
-
|
|
195
|
-
=== `turnOn(): void`
|
|
196
|
-
|
|
197
|
-
Powers up the engine.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
'''
|
|
201
|
-
|
|
202
|
-
=== `turnOff(): void`
|
|
203
|
-
|
|
204
|
-
Powers down the engine and saves state.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
'''
|
|
208
|
-
|
|
209
|
-
=== `startGame(): void`
|
|
210
|
-
|
|
211
|
-
Transitions from the menu to an active game session.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
'''
|
|
215
|
-
|
|
216
|
-
=== `exitGame(): void`
|
|
217
|
-
|
|
218
|
-
Ends the current game session and returns to the menu.
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
'''
|
|
222
|
-
|
|
223
|
-
=== `pause(): void`
|
|
224
|
-
|
|
225
|
-
Toggles the gameplay state to paused.
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
'''
|
|
229
|
-
|
|
230
|
-
=== `resume(): void`
|
|
231
|
-
|
|
232
|
-
Toggles the gameplay state back to playing.
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
'''
|
|
236
|
-
|
|
237
|
-
=== `triggerGameOver(): void`
|
|
238
|
-
|
|
239
|
-
Transitions to the game over screen.
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
'''
|
|
243
|
-
|
|
244
|
-
=== `resetGame(): void`
|
|
245
|
-
|
|
246
|
-
Resets session-specific state (score, grids) while maintaining high score and preferences.
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
'''
|
|
250
|
-
|
|
251
|
-
=== `toggleColorEnabled(): void`
|
|
252
|
-
|
|
253
|
-
Flips the current `colorEnabled` flag.
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
'''
|
|
257
|
-
|
|
258
|
-
=== `toggleMuted(): void`
|
|
259
|
-
|
|
260
|
-
Flips the current `muted` flag.
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
'''
|
|
264
|
-
|
|
265
|
-
=== `setPersistenceKey(key: string): void`
|
|
266
|
-
|
|
267
|
-
Sets the unique namespace used for `localStorage`.
|
|
268
|
-
|
|
269
|
-
**Parameters**
|
|
270
|
-
|
|
271
|
-
[cols="1,1,3"]
|
|
272
|
-
|===
|
|
273
|
-
|Name |Type |Description
|
|
274
|
-
|`key` |`string` |The unique key prefix.
|
|
275
|
-
|===
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
'''
|
|
279
|
-
|
|
280
|
-
=== `getPersistenceKey(): string`
|
|
281
|
-
|
|
282
|
-
Returns the active namespace prefix.
|
|
283
|
-
|
|
284
|
-
**Returns**
|
|
285
|
-
|
|
286
|
-
`string` - The persistence key.
|
|
287
|
-
|
|
288
|
-
== General Usage
|
|
289
|
-
|
|
290
|
-
Implemented by `xref:../../modules/GameState.adoc[GameState]`. It serves as the single source of truth for the engine's behavior tree.
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
= Text Reference
|
|
2
|
-
:description: Interface for drawing pixelated, responsive typography.
|
|
3
|
-
:keywords: text, typography, rendering, display, retro
|
|
4
|
-
:toc: left
|
|
5
|
-
:toclevels: 3
|
|
6
|
-
:sectnums:
|
|
7
|
-
:sectlinks:
|
|
8
|
-
:icons: font
|
|
9
|
-
:source-highlighter: highlight.js
|
|
10
|
-
:reproducible:
|
|
11
|
-
:experimental:
|
|
12
|
-
:idprefix:
|
|
13
|
-
:idseparator: -
|
|
14
|
-
|
|
15
|
-
Interface for drawing pixelated, responsive typography.
|
|
16
|
-
|
|
17
|
-
== Methods
|
|
18
|
-
|
|
19
|
-
=== `setTextSize(fontSize: xref:../../enums/FontSize.adoc[FontSize]): void`
|
|
20
|
-
|
|
21
|
-
Sets the scale of the subsequent text operations.
|
|
22
|
-
|
|
23
|
-
**Parameters**
|
|
24
|
-
|
|
25
|
-
[cols="1,1,3"]
|
|
26
|
-
|===
|
|
27
|
-
|Name |Type |Description
|
|
28
|
-
|`fontSize` |`xref:../../enums/FontSize.adoc[FontSize]` |Enum value for text size (SMALL, MEDIUM, LARGE).
|
|
29
|
-
|===
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'''
|
|
33
|
-
|
|
34
|
-
=== `setTextAlign(fontAlign: xref:../../enums/FontAlignment.adoc[FontAlignment], fontVerticalAlign: xref:../../enums/FontAlignment.adoc[FontAlignment]): void`
|
|
35
|
-
|
|
36
|
-
Sets both horizontal and vertical anchor points.
|
|
37
|
-
|
|
38
|
-
**Parameters**
|
|
39
|
-
|
|
40
|
-
[cols="1,1,3"]
|
|
41
|
-
|===
|
|
42
|
-
|Name |Type |Description
|
|
43
|
-
|`fontAlign` |`xref:../../enums/FontAlignment.adoc[FontAlignment]` |Horizontal alignment (LEFT, CENTER, RIGHT).
|
|
44
|
-
|`fontVerticalAlign` |`xref:../../enums/FontAlignment.adoc[FontAlignment]` |Vertical alignment (TOP, CENTER, BOTTOM).
|
|
45
|
-
|===
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
'''
|
|
49
|
-
|
|
50
|
-
=== `textOnHud(text: string, coordinate: xref:../../types/Coordinate.adoc[Coordinate]): void`
|
|
51
|
-
|
|
52
|
-
Renders a string within the HUD area at the specified normalized coordinate (0.0 to 1.0 relative to HUD bounds).
|
|
53
|
-
|
|
54
|
-
**Parameters**
|
|
55
|
-
|
|
56
|
-
[cols="1,1,3"]
|
|
57
|
-
|===
|
|
58
|
-
|Name |Type |Description
|
|
59
|
-
|`text` |`string` |The string content to display.
|
|
60
|
-
|`coordinate` |`xref:../../types/Coordinate.adoc[Coordinate]` |Normalized position `{x, y}`.
|
|
61
|
-
|===
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
'''
|
|
65
|
-
|
|
66
|
-
=== `textOnDisplay(text: string, coordinate: xref:../../types/Coordinate.adoc[Coordinate]): void`
|
|
67
|
-
|
|
68
|
-
Renders a string within the main game area at the specified normalized coordinate (0.0 to 1.0 relative to display bounds).
|
|
69
|
-
|
|
70
|
-
**Parameters**
|
|
71
|
-
|
|
72
|
-
[cols="1,1,3"]
|
|
73
|
-
|===
|
|
74
|
-
|Name |Type |Description
|
|
75
|
-
|`text` |`string` |The string content to display.
|
|
76
|
-
|`coordinate` |`xref:../../types/Coordinate.adoc[Coordinate]` |Normalized position `{x, y}`.
|
|
77
|
-
|===
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
'''
|
|
81
|
-
|
|
82
|
-
=== `setRendererMetrics(rendererMetrics: xref:../../types/RendererMetrics.adoc[RendererMetrics]): void`
|
|
83
|
-
|
|
84
|
-
Internal setup method to provide the pixel-to-grid mapping data.
|
|
85
|
-
|
|
86
|
-
**Parameters**
|
|
87
|
-
|
|
88
|
-
[cols="1,1,3"]
|
|
89
|
-
|===
|
|
90
|
-
|Name |Type |Description
|
|
91
|
-
|`rendererMetrics` |`xref:../../types/RendererMetrics.adoc[RendererMetrics]` |The calculated display dimensions.
|
|
92
|
-
|===
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
'''
|
|
96
|
-
|
|
97
|
-
=== `setActiveText(): void`
|
|
98
|
-
|
|
99
|
-
Sets the text rendering style to "active" (high contrast).
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
'''
|
|
103
|
-
|
|
104
|
-
=== `setInactiveText(): void`
|
|
105
|
-
|
|
106
|
-
Sets the text rendering style to "inactive" (low contrast, background effect).
|
|
107
|
-
|
|
108
|
-
== General Usage
|
|
109
|
-
|
|
110
|
-
Implemented by `xref:../../modules/GameText.adoc[GameText]`. Used to display scores, labels, and title screen messages across different engine layers.
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
= Time Reference
|
|
2
|
-
:description: Interface for managing the game's logical clock and update frequency.
|
|
3
|
-
:keywords: time, clock, tick, interval, game-loop
|
|
4
|
-
:toc: left
|
|
5
|
-
:toclevels: 3
|
|
6
|
-
:sectnums:
|
|
7
|
-
:sectlinks:
|
|
8
|
-
:icons: font
|
|
9
|
-
:source-highlighter: highlight.js
|
|
10
|
-
:reproducible:
|
|
11
|
-
:experimental:
|
|
12
|
-
:idprefix:
|
|
13
|
-
:idseparator: -
|
|
14
|
-
|
|
15
|
-
Interface for managing the game's logical clock and update frequency.
|
|
16
|
-
|
|
17
|
-
== Properties
|
|
18
|
-
|
|
19
|
-
[cols="1,1,3"]
|
|
20
|
-
|===
|
|
21
|
-
|Name |Type |Description
|
|
22
|
-
|`tickInterval` |`number` |The duration in milliseconds between logic updates.
|
|
23
|
-
|===
|
|
24
|
-
|
|
25
|
-
== Methods
|
|
26
|
-
|
|
27
|
-
=== `update(deltaTime: number): void`
|
|
28
|
-
|
|
29
|
-
Adds elapsed time to the internal accumulator. Called every frame.
|
|
30
|
-
|
|
31
|
-
**Parameters**
|
|
32
|
-
|
|
33
|
-
[cols="1,1,3"]
|
|
34
|
-
|===
|
|
35
|
-
|Name |Type |Description
|
|
36
|
-
|`deltaTime` |`number` |Time in milliseconds since last frame.
|
|
37
|
-
|===
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
'''
|
|
41
|
-
|
|
42
|
-
=== `shouldTick(): boolean`
|
|
43
|
-
|
|
44
|
-
Returns `true` if the accumulator has exceeded the `tickInterval`, indicating a logic update is due.
|
|
45
|
-
|
|
46
|
-
**Returns**
|
|
47
|
-
|
|
48
|
-
`boolean` - `true` if a tick should occur.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
'''
|
|
52
|
-
|
|
53
|
-
=== `reset(): void`
|
|
54
|
-
|
|
55
|
-
Clears the time accumulator. Useful during game restarts.
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
'''
|
|
59
|
-
|
|
60
|
-
=== `incrementTickInterval(amount: number): void`
|
|
61
|
-
|
|
62
|
-
Slows down the game by increasing the time between ticks.
|
|
63
|
-
|
|
64
|
-
**Parameters**
|
|
65
|
-
|
|
66
|
-
[cols="1,1,3"]
|
|
67
|
-
|===
|
|
68
|
-
|Name |Type |Description
|
|
69
|
-
|`amount` |`number` |Milliseconds to add to the interval.
|
|
70
|
-
|===
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
'''
|
|
74
|
-
|
|
75
|
-
=== `decrementTickInterval(amount: number): void`
|
|
76
|
-
|
|
77
|
-
Speeds up the game by decreasing the time between ticks.
|
|
78
|
-
|
|
79
|
-
**Parameters**
|
|
80
|
-
|
|
81
|
-
[cols="1,1,3"]
|
|
82
|
-
|===
|
|
83
|
-
|Name |Type |Description
|
|
84
|
-
|`amount` |`number` |Milliseconds to subtract from the interval.
|
|
85
|
-
|===
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
'''
|
|
89
|
-
|
|
90
|
-
=== `setTickInterval(interval: number): void`
|
|
91
|
-
|
|
92
|
-
Sets the tick interval exactly to the specified value.
|
|
93
|
-
|
|
94
|
-
**Parameters**
|
|
95
|
-
|
|
96
|
-
[cols="1,1,3"]
|
|
97
|
-
|===
|
|
98
|
-
|Name |Type |Description
|
|
99
|
-
|`interval` |`number` |The new interval between logic updates (in milliseconds).
|
|
100
|
-
|===
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
'''
|
|
104
|
-
|
|
105
|
-
=== `setMinTickInterval(interval: number): void`
|
|
106
|
-
|
|
107
|
-
Sets the minimum limit for the tick interval, preventing the game from speeding up beyond this point.
|
|
108
|
-
|
|
109
|
-
**Parameters**
|
|
110
|
-
|
|
111
|
-
[cols="1,1,3"]
|
|
112
|
-
|===
|
|
113
|
-
|Name |Type |Description
|
|
114
|
-
|`interval` |`number` |The minimum interval allowed (in milliseconds).
|
|
115
|
-
|===
|
|
116
|
-
|
|
117
|
-
== General Usage
|
|
118
|
-
|
|
119
|
-
Implemented by `xref:../../modules/GameTime.adoc[GameTime]`. This module ensures that game logic (like falling pieces) runs at a consistent speed regardless of the render frame rate.
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
= Debugger Class Reference
|
|
2
|
-
:description: Real-time, HTML-based overlay for monitoring the state of all engine modules.
|
|
3
|
-
:keywords: debug, monitoring, overlay, diagnostics
|
|
4
|
-
:toc: left
|
|
5
|
-
:toclevels: 3
|
|
6
|
-
:sectnums:
|
|
7
|
-
:sectlinks:
|
|
8
|
-
:icons: font
|
|
9
|
-
:source-highlighter: highlight.js
|
|
10
|
-
:reproducible:
|
|
11
|
-
:experimental:
|
|
12
|
-
:idprefix:
|
|
13
|
-
:idseparator: -
|
|
14
|
-
|
|
15
|
-
The `Debugger` class provides a real-time, HTML-based overlay for monitoring the state of all engine modules. It automatically identifies and extracts data from any module that implements the `xref:../interfaces/Debuggable.adoc[Debuggable]` interface.
|
|
16
|
-
|
|
17
|
-
== API Reference
|
|
18
|
-
|
|
19
|
-
=== `setup(): void`
|
|
20
|
-
|
|
21
|
-
Initializes the debugger's DOM structure.
|
|
22
|
-
|
|
23
|
-
**Behavior**
|
|
24
|
-
|
|
25
|
-
Creates the main debugger container (`<details id="debugger">`) and appends it to the document body. It scans all registered `xref:../interfaces/GameModules.adoc[GameModules]` and prepares the UI sections for those that expose debug information via `getDebugData`.
|
|
26
|
-
|
|
27
|
-
'''
|
|
28
|
-
|
|
29
|
-
=== `setGameModules(gameModules: GameModules): void`
|
|
30
|
-
|
|
31
|
-
Updates the active game modules being monitored by the debugger.
|
|
32
|
-
|
|
33
|
-
**Parameters**
|
|
34
|
-
|
|
35
|
-
[cols="1,1,3", options="header"]
|
|
36
|
-
|===
|
|
37
|
-
|Name |Type |Description
|
|
38
|
-
|`gameModules` |`xref:../interfaces/GameModules.adoc[GameModules]` | The new instance of game modules to track.
|
|
39
|
-
|===
|
|
40
|
-
|
|
41
|
-
**Behavior**
|
|
42
|
-
|
|
43
|
-
When switching games or game states, this method replaces the internal module references and automatically triggers a UI rebuild by calling `setup()`. Importantly, it preserves the `open` state of any currently expanded module details (`<details>` tags) so the layout does not unexpectedly collapse when the new modules load.
|
|
44
|
-
|
|
45
|
-
'''
|
|
46
|
-
|
|
47
|
-
=== `update(): Promise<void>`
|
|
48
|
-
|
|
49
|
-
Refreshes the overlay with new data from the modules.
|
|
50
|
-
|
|
51
|
-
**Behavior**
|
|
52
|
-
|
|
53
|
-
Executes at a frequency controlled by `configs.game.debugger.msInterval`. It fetches the latest metrics from all `Debuggable` modules and updates the corresponding UI nodes. To maintain performance, it uses a precise timing check and caches DOM references.
|
|
54
|
-
|
|
55
|
-
== Configuration
|
|
56
|
-
|
|
57
|
-
The debugger behavior is controlled via the main `configs.ts` file:
|
|
58
|
-
|
|
59
|
-
* `configs.game.debugger.enabled`: Global toggle to enable/disable the overlay.
|
|
60
|
-
* `configs.game.debugger.msInterval`: The refresh rate (in milliseconds). Higher values reduce CPU usage.
|
|
61
|
-
|
|
62
|
-
== Implementation
|
|
63
|
-
|
|
64
|
-
Modules wishing to appear in the debugger must implement the `Debuggable` interface:
|
|
65
|
-
|
|
66
|
-
[source,typescript]
|
|
67
|
-
----
|
|
68
|
-
interface Debuggable {
|
|
69
|
-
getDebugData(): Record<string, string | number | boolean>;
|
|
70
|
-
}
|
|
71
|
-
----
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
= DisplayRenderer Module Reference
|
|
2
|
-
:description: Responsible for drawing the main game grid and active bricks.
|
|
3
|
-
:keywords: rendering, display, grid, graphics
|
|
4
|
-
:toc: left
|
|
5
|
-
:toclevels: 3
|
|
6
|
-
:sectnums:
|
|
7
|
-
:sectlinks:
|
|
8
|
-
:icons: font
|
|
9
|
-
:source-highlighter: highlight.js
|
|
10
|
-
:reproducible:
|
|
11
|
-
:experimental:
|
|
12
|
-
:idprefix:
|
|
13
|
-
:idseparator: -
|
|
14
|
-
|
|
15
|
-
The `DisplayRenderer` is responsible for drawing the main game grid and the active bricks. It implements the standard `xref:../interfaces/modules/Renderer.adoc[Renderer]` interface and is managed by the `xref:GameRenderer.adoc[GameRenderer]`.
|
|
16
|
-
|
|
17
|
-
== API Reference
|
|
18
|
-
|
|
19
|
-
=== `setup(rendererMetrics: RendererMetrics): void`
|
|
20
|
-
|
|
21
|
-
Initializes the renderer and pre-calculates the static scene.
|
|
22
|
-
|
|
23
|
-
**Parameters**
|
|
24
|
-
|
|
25
|
-
[cols="1,1,3"]
|
|
26
|
-
|===
|
|
27
|
-
|Name |Type |Description
|
|
28
|
-
|`rendererMetrics` |`xref:../types/RendererMetrics.adoc[RendererMetrics]` |The layout metrics calculated by `xref:GameRenderer.adoc[GameRenderer]`.
|
|
29
|
-
|===
|
|
30
|
-
|
|
31
|
-
**Behavior**
|
|
32
|
-
|
|
33
|
-
Stores the layout metrics for use during drawing. It also initializes an off-screen graphics buffer to pre-render the static background and borders, significantly improving performance by avoiding redundant draw calls every frame.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
'''
|
|
37
|
-
|
|
38
|
-
=== `render(grid: Cell[][]): void`
|
|
39
|
-
|
|
40
|
-
Executes the main display drawing logic.
|
|
41
|
-
|
|
42
|
-
**Parameters**
|
|
43
|
-
|
|
44
|
-
[cols="1,1,3"]
|
|
45
|
-
|===
|
|
46
|
-
|Name |Type |Description
|
|
47
|
-
|`grid` |`xref:../types/Cell.adoc[Cell][][]` |The current matrix of game cells.
|
|
48
|
-
|===
|
|
49
|
-
|
|
50
|
-
**Behavior**
|
|
51
|
-
|
|
52
|
-
1. Renders the pre-cached static background.
|
|
53
|
-
2. Iterates through the active `grid` state and draws each occupied cell using the previously stored metric offsets.
|
|
54
|
-
|
|
55
|
-
|