brick-engine-js 1.0.17 → 1.0.18
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/README.adoc +6 -1
- package/dist/docs/index.html +16 -0
- package/dist/docs/reference/context/RendererContext.html +584 -0
- package/dist/docs/reference/enums/EventSuffix.html +513 -0
- package/dist/docs/reference/helpers/CoordinateHelper.html +10 -35
- package/dist/docs/reference/helpers/RelativeValuesHelper.html +4 -14
- package/dist/docs/reference/interfaces/GameModules.html +14 -9
- package/dist/docs/reference/interfaces/StateContext.html +517 -0
- package/dist/docs/reference/modules/EventEmitter.html +624 -0
- package/dist/docs/reference/modules/Game.html +4 -4
- package/dist/docs/reference/modules/GameControl.html +170 -9
- package/dist/docs/reference/modules/GameEventRegistry.html +605 -0
- package/dist/docs/reference/modules/GameState.html +119 -6
- package/dist/docs/reference/modules/InitialStateSnapshot.html +5 -2
- package/dist/docs/reference/view/GameView.html +606 -0
- package/dist/game.bundle.js +1 -1
- package/dist/types/bootstrap.d.ts +1 -1
- package/dist/types/core/Game.d.ts +16 -5
- package/dist/types/core/context/RendererContext.d.ts +25 -0
- package/dist/types/core/context/RendererContext.test.d.ts +1 -0
- package/dist/types/core/event/EventEmitter.d.ts +71 -0
- package/dist/types/core/event/EventEmitter.test.d.ts +1 -0
- package/dist/types/core/event/GameEventRegistry.d.ts +28 -0
- package/dist/types/core/event/GameEventRegistry.test.d.ts +1 -0
- package/dist/types/core/helpers/CoordinateHelper.d.ts +5 -11
- package/dist/types/core/helpers/RelativeValuesHelper.d.ts +2 -5
- package/dist/types/core/module/control/GameControl.d.ts +11 -15
- package/dist/types/core/module/renderer/DisplayRenderer.d.ts +0 -8
- package/dist/types/core/module/renderer/GameRenderer.d.ts +0 -8
- package/dist/types/core/module/renderer/HudRenderer.d.ts +0 -8
- package/dist/types/core/module/session/GameSession.d.ts +0 -1
- package/dist/types/core/module/state/GameState.d.ts +12 -16
- package/dist/types/core/module/text/GameText.d.ts +0 -9
- package/dist/types/core/types/modules.d.ts +70 -6
- package/dist/types/index.d.ts +2 -0
- package/dist/types/view/Debugger.d.ts +1 -3
- package/dist/types/view/GameView.d.ts +1 -2
- package/dist/types/view/SessionModal.d.ts +1 -3
- package/dist/types/view/components/layout/ButtonLayout.d.ts +1 -1
- package/dist/types/view/components/layout/ContainerLayout.d.ts +1 -1
- package/dist/types/view/components/layout/FrameLayout.d.ts +1 -1
- package/dist/types/view/components/ui/BigButton.d.ts +1 -1
- package/dist/types/view/components/ui/Button.d.ts +1 -1
- package/dist/types/view/components/ui/Canvas.d.ts +1 -1
- package/dist/types/view/components/ui/SmallButton.d.ts +1 -1
- package/package.json +1 -1
|
@@ -468,9 +468,15 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
468
468
|
<li><a href="#ismuted-boolean">3.19. <code>isMuted(): boolean</code></a></li>
|
|
469
469
|
<li><a href="#setmutedvalue-boolean-void">3.20. <code>setMuted(value: boolean): void</code></a></li>
|
|
470
470
|
<li><a href="#togglemuted-void">3.21. <code>toggleMuted(): void</code></a></li>
|
|
471
|
-
<li><a href="#
|
|
472
|
-
<li><a href="#
|
|
473
|
-
<li><a href="#
|
|
471
|
+
<li><a href="#notifyproperty-stateproperty-void">3.22. <code>notify(property: StateProperty): void</code></a></li>
|
|
472
|
+
<li><a href="#syncstatestate-state-void">3.23. <code>syncState(state: State): void</code></a></li>
|
|
473
|
+
<li><a href="#subscribeproperty-stateproperty-callback-value-boolean-number-void-void">3.24. <code>subscribe(property: StateProperty, callback: (value: boolean | number) ⇒ void): void</code></a></li>
|
|
474
|
+
<li><a href="#unsubscribeproperty-stateproperty-callback-value-boolean-number-void-void">3.25. <code>unsubscribe(property: StateProperty, callback: (value: boolean | number) ⇒ void): void</code></a></li>
|
|
475
|
+
<li><a href="#subscribefortitlescreen-unsubscribefortitlescreen">3.26. <code>subscribeForTitleScreen(…​) / unsubscribeForTitleScreen(…​)</code></a></li>
|
|
476
|
+
<li><a href="#subscribeforgameoverscreen-unsubscribeforgameoverscreen">3.27. <code>subscribeForGameOverScreen(…​) / unsubscribeForGameOverScreen(…​)</code></a></li>
|
|
477
|
+
<li><a href="#subscribeforplayingscreen-unsubscribeforplayingscreen">3.28. <code>subscribeForPlayingScreen(…​) / unsubscribeForPlayingScreen(…​)</code></a></li>
|
|
478
|
+
<li><a href="#subscribeforpausedscreen-unsubscribeforpausedscreen">3.29. <code>subscribeForPausedScreen(…​) / unsubscribeForPausedScreen(…​)</code></a></li>
|
|
479
|
+
<li><a href="#getdebugdata-recordstring-string-number-boolean">3.30. <code>getDebugData(): Record<string, string | number | boolean></code></a></li>
|
|
474
480
|
</ul>
|
|
475
481
|
</li>
|
|
476
482
|
</ul>
|
|
@@ -817,9 +823,60 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
817
823
|
<p>Toggles the master mute status.</p>
|
|
818
824
|
</div>
|
|
819
825
|
<hr>
|
|
826
|
+
<hr>
|
|
827
|
+
</div>
|
|
828
|
+
<div class="sect2">
|
|
829
|
+
<h3 id="notifyproperty-stateproperty-void"><a class="link" href="#notifyproperty-stateproperty-void">3.22. <code>notify(property: StateProperty): void</code></a></h3>
|
|
830
|
+
<div class="paragraph">
|
|
831
|
+
<p>Manually triggers notifications for a state property.</p>
|
|
832
|
+
</div>
|
|
833
|
+
<div class="admonitionblock important">
|
|
834
|
+
<table>
|
|
835
|
+
<tr>
|
|
836
|
+
<td class="icon">
|
|
837
|
+
<i class="fa icon-important" title="Important"></i>
|
|
838
|
+
</td>
|
|
839
|
+
<td class="content">
|
|
840
|
+
<div class="paragraph">
|
|
841
|
+
<p>This method dispatches to the base property channel AND to state-specific context channels (e.g., <code>TITLE</code>, <code>GAME_OVER</code>, <code>PLAYING</code>) based on the current engine state.</p>
|
|
842
|
+
</div>
|
|
843
|
+
</td>
|
|
844
|
+
</tr>
|
|
845
|
+
</table>
|
|
846
|
+
</div>
|
|
847
|
+
<div class="paragraph">
|
|
848
|
+
<p><strong>Parameters</strong></p>
|
|
849
|
+
</div>
|
|
850
|
+
<table class="tableblock frame-all grid-all stretch">
|
|
851
|
+
<colgroup>
|
|
852
|
+
<col style="width: 20%;">
|
|
853
|
+
<col style="width: 20%;">
|
|
854
|
+
<col style="width: 60%;">
|
|
855
|
+
</colgroup>
|
|
856
|
+
<tbody>
|
|
857
|
+
<tr>
|
|
858
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Name</p></td>
|
|
859
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
|
|
860
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
861
|
+
</tr>
|
|
862
|
+
<tr>
|
|
863
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>property</code></p></td>
|
|
864
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="../enums/StateProperty.html">StateProperty</a></code></p></td>
|
|
865
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">The property to trigger notifications for.</p></td>
|
|
866
|
+
</tr>
|
|
867
|
+
</tbody>
|
|
868
|
+
</table>
|
|
869
|
+
<hr>
|
|
870
|
+
</div>
|
|
871
|
+
<div class="sect2">
|
|
872
|
+
<h3 id="syncstatestate-state-void"><a class="link" href="#syncstatestate-state-void">3.23. <code>syncState(state: State): void</code></a></h3>
|
|
873
|
+
<div class="paragraph">
|
|
874
|
+
<p>Syncs the internal state with the <code><a href="#">GameState</a></code>. This is required for modules that implement the <code><a href="../interfaces/StateSyncable.html">StateSyncable</a></code> interface.</p>
|
|
875
|
+
</div>
|
|
876
|
+
<hr>
|
|
820
877
|
</div>
|
|
821
878
|
<div class="sect2">
|
|
822
|
-
<h3 id="subscribeproperty-stateproperty-callback-value-boolean-number-void-void"><a class="link" href="#subscribeproperty-stateproperty-callback-value-boolean-number-void-void">3.
|
|
879
|
+
<h3 id="subscribeproperty-stateproperty-callback-value-boolean-number-void-void"><a class="link" href="#subscribeproperty-stateproperty-callback-value-boolean-number-void-void">3.24. <code>subscribe(property: StateProperty, callback: (value: boolean | number) ⇒ void): void</code></a></h3>
|
|
823
880
|
<div class="paragraph">
|
|
824
881
|
<p>Registers a listener for state changes.</p>
|
|
825
882
|
</div>
|
|
@@ -865,7 +922,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
865
922
|
<hr>
|
|
866
923
|
</div>
|
|
867
924
|
<div class="sect2">
|
|
868
|
-
<h3 id="unsubscribeproperty-stateproperty-callback-value-boolean-number-void-void"><a class="link" href="#unsubscribeproperty-stateproperty-callback-value-boolean-number-void-void">3.
|
|
925
|
+
<h3 id="unsubscribeproperty-stateproperty-callback-value-boolean-number-void-void"><a class="link" href="#unsubscribeproperty-stateproperty-callback-value-boolean-number-void-void">3.25. <code>unsubscribe(property: StateProperty, callback: (value: boolean | number) ⇒ void): void</code></a></h3>
|
|
869
926
|
<div class="paragraph">
|
|
870
927
|
<p>Removes a state change listener.</p>
|
|
871
928
|
</div>
|
|
@@ -899,7 +956,63 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
899
956
|
<hr>
|
|
900
957
|
</div>
|
|
901
958
|
<div class="sect2">
|
|
902
|
-
<h3 id="
|
|
959
|
+
<h3 id="subscribefortitlescreen-unsubscribefortitlescreen"><a class="link" href="#subscribefortitlescreen-unsubscribefortitlescreen">3.26. <code>subscribeForTitleScreen(…​) / unsubscribeForTitleScreen(…​)</code></a></h3>
|
|
960
|
+
<div class="paragraph">
|
|
961
|
+
<p>Specialized methods to listen for state changes <strong>ONLY</strong> while the engine is in the Title Screen state.</p>
|
|
962
|
+
</div>
|
|
963
|
+
<div class="admonitionblock note">
|
|
964
|
+
<table>
|
|
965
|
+
<tr>
|
|
966
|
+
<td class="icon">
|
|
967
|
+
<i class="fa icon-note" title="Note"></i>
|
|
968
|
+
</td>
|
|
969
|
+
<td class="content">
|
|
970
|
+
<div class="paragraph">
|
|
971
|
+
<p>These follow the same signature as <code>subscribe</code>.</p>
|
|
972
|
+
</div>
|
|
973
|
+
</td>
|
|
974
|
+
</tr>
|
|
975
|
+
</table>
|
|
976
|
+
</div>
|
|
977
|
+
<hr>
|
|
978
|
+
</div>
|
|
979
|
+
<div class="sect2">
|
|
980
|
+
<h3 id="subscribeforgameoverscreen-unsubscribeforgameoverscreen"><a class="link" href="#subscribeforgameoverscreen-unsubscribeforgameoverscreen">3.27. <code>subscribeForGameOverScreen(…​) / unsubscribeForGameOverScreen(…​)</code></a></h3>
|
|
981
|
+
<div class="paragraph">
|
|
982
|
+
<p>Specialized methods to listen for state changes <strong>ONLY</strong> while the engine is in the Game Over state.</p>
|
|
983
|
+
</div>
|
|
984
|
+
<hr>
|
|
985
|
+
</div>
|
|
986
|
+
<div class="sect2">
|
|
987
|
+
<h3 id="subscribeforplayingscreen-unsubscribeforplayingscreen"><a class="link" href="#subscribeforplayingscreen-unsubscribeforplayingscreen">3.28. <code>subscribeForPlayingScreen(…​) / unsubscribeForPlayingScreen(…​)</code></a></h3>
|
|
988
|
+
<div class="paragraph">
|
|
989
|
+
<p>Specialized methods to listen for state changes <strong>ONLY</strong> while the engine is in the active Gameplay state.</p>
|
|
990
|
+
</div>
|
|
991
|
+
<hr>
|
|
992
|
+
</div>
|
|
993
|
+
<div class="sect2">
|
|
994
|
+
<h3 id="subscribeforpausedscreen-unsubscribeforpausedscreen"><a class="link" href="#subscribeforpausedscreen-unsubscribeforpausedscreen">3.29. <code>subscribeForPausedScreen(…​) / unsubscribeForPausedScreen(…​)</code></a></h3>
|
|
995
|
+
<div class="paragraph">
|
|
996
|
+
<p>Specialized methods to listen for state changes <strong>ONLY</strong> while the engine is in the Paused state.</p>
|
|
997
|
+
</div>
|
|
998
|
+
<div class="admonitionblock note">
|
|
999
|
+
<table>
|
|
1000
|
+
<tr>
|
|
1001
|
+
<td class="icon">
|
|
1002
|
+
<i class="fa icon-note" title="Note"></i>
|
|
1003
|
+
</td>
|
|
1004
|
+
<td class="content">
|
|
1005
|
+
<div class="paragraph">
|
|
1006
|
+
<p>These follow the same signature as <code>subscribe</code>.</p>
|
|
1007
|
+
</div>
|
|
1008
|
+
</td>
|
|
1009
|
+
</tr>
|
|
1010
|
+
</table>
|
|
1011
|
+
</div>
|
|
1012
|
+
<hr>
|
|
1013
|
+
</div>
|
|
1014
|
+
<div class="sect2">
|
|
1015
|
+
<h3 id="getdebugdata-recordstring-string-number-boolean"><a class="link" href="#getdebugdata-recordstring-string-number-boolean">3.30. <code>getDebugData(): Record<string, string | number | boolean></code></a></h3>
|
|
903
1016
|
<div class="paragraph">
|
|
904
1017
|
<p>Returns metadata for the real-time debugger.</p>
|
|
905
1018
|
</div>
|
|
@@ -493,7 +493,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
493
493
|
<div class="sect2">
|
|
494
494
|
<h3 id="captureinitialstate"><a class="link" href="#captureinitialstate">1.2. <code>captureInitialState</code></a></h3>
|
|
495
495
|
<div class="paragraph">
|
|
496
|
-
<p>Stores the initial state of custom client properties. It selectively clones properties that were not present in the base properties and are not functions
|
|
496
|
+
<p>Stores the initial state of custom client properties. It selectively clones properties that were not present in the base properties and are not functions. The deep cloning strategy involves:
|
|
497
|
+
1. Checking if the object has a custom <code>clone()</code> method.
|
|
498
|
+
2. Attempting to use <code>structuredClone</code> for plain objects.
|
|
499
|
+
3. Safely falling back to by-reference assignment for complex objects like P5 Vectors if other methods fail.</p>
|
|
497
500
|
</div>
|
|
498
501
|
<table class="tableblock frame-all grid-all stretch">
|
|
499
502
|
<colgroup>
|
|
@@ -550,7 +553,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
550
553
|
</div>
|
|
551
554
|
<div id="footer">
|
|
552
555
|
<div id="footer-text">
|
|
553
|
-
Last updated 2026-02-
|
|
556
|
+
Last updated 2026-02-25 03:59:03 -0300
|
|
554
557
|
</div>
|
|
555
558
|
</div>
|
|
556
559
|
</body>
|