brick-engine-js 1.0.16 → 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 +7 -2
- package/dist/docs/getting-started.html +1 -1
- package/dist/docs/index.html +17 -1
- package/dist/docs/publishing.html +1 -1
- package/dist/docs/reference/context/RendererContext.html +584 -0
- package/dist/docs/reference/{types/GameEntry.html → enums/EventSuffix.html} +21 -22
- 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/{modules/GameMenu.html → interfaces/StateContext.html} +50 -71
- package/dist/docs/reference/interfaces/modules/Score.html +6 -6
- package/dist/docs/reference/interfaces/modules/Session.html +31 -1
- package/dist/docs/reference/modules/EventEmitter.html +624 -0
- package/dist/docs/reference/modules/Game.html +18 -136
- package/dist/docs/reference/modules/GameControl.html +170 -9
- package/dist/docs/reference/modules/GameEventRegistry.html +605 -0
- package/dist/docs/reference/modules/GameScore.html +40 -10
- package/dist/docs/reference/modules/GameSession.html +37 -7
- 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/score/GameScore.d.ts +5 -3
- 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 +77 -7
- 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
|
@@ -453,10 +453,11 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
453
453
|
<li><a href="#resetscore-void">1.6. <code>resetScore(): void</code></a></li>
|
|
454
454
|
<li><a href="#increaselevelamount-number-void">1.7. <code>increaseLevel(amount: number): void</code></a></li>
|
|
455
455
|
<li><a href="#resetlevel-void">1.8. <code>resetLevel(): void</code></a></li>
|
|
456
|
-
<li><a href="#
|
|
457
|
-
<li><a href="#
|
|
458
|
-
<li><a href="#
|
|
459
|
-
<li><a href="#
|
|
456
|
+
<li><a href="#setupgamehighscoreid-string-void">1.9. <code>setupGameHighScore(id: string): void</code></a></li>
|
|
457
|
+
<li><a href="#getformattedscoredigits-number-string">1.10. <code>getFormattedScore(digits: number): string</code></a></li>
|
|
458
|
+
<li><a href="#serialize-string">1.11. <code>serialize(): string</code></a></li>
|
|
459
|
+
<li><a href="#deserializedata-string-void">1.12. <code>deserialize(data: string): void</code></a></li>
|
|
460
|
+
<li><a href="#getdebugdata-recordstring-string-number-boolean">1.13. <code>getDebugData(): Record<string, string | number | boolean></code></a></li>
|
|
460
461
|
</ul>
|
|
461
462
|
</li>
|
|
462
463
|
</ul>
|
|
@@ -503,7 +504,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
503
504
|
<p><strong>Behavior</strong></p>
|
|
504
505
|
</div>
|
|
505
506
|
<div class="paragraph">
|
|
506
|
-
<p>When set, it automatically persists the value directly to <code>LocalStorage</code> under the <code
|
|
507
|
+
<p>When set, it automatically persists the value directly to <code>LocalStorage</code> under the namespaced key <code>${gameId}::highScore</code>. This ensures that different games do not overwrite each other’s records.</p>
|
|
507
508
|
</div>
|
|
508
509
|
<hr>
|
|
509
510
|
</div>
|
|
@@ -581,12 +582,41 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
581
582
|
<div class="sect2">
|
|
582
583
|
<h3 id="resetlevel-void"><a class="link" href="#resetlevel-void">1.8. <code>resetLevel(): void</code></a></h3>
|
|
583
584
|
<div class="paragraph">
|
|
584
|
-
<p>Resets the level counter to 1
|
|
585
|
+
<p>Resets the level counter to 1.
|
|
586
|
+
'''</p>
|
|
585
587
|
</div>
|
|
588
|
+
</div>
|
|
589
|
+
<div class="sect2">
|
|
590
|
+
<h3 id="setupgamehighscoreid-string-void"><a class="link" href="#setupgamehighscoreid-string-void">1.9. <code>setupGameHighScore(id: string): void</code></a></h3>
|
|
591
|
+
<div class="paragraph">
|
|
592
|
+
<p>Initializes the module with the specific game ID and loads the corresponding high score.</p>
|
|
593
|
+
</div>
|
|
594
|
+
<div class="paragraph">
|
|
595
|
+
<p><strong>Parameters</strong></p>
|
|
596
|
+
</div>
|
|
597
|
+
<table class="tableblock frame-all grid-all stretch">
|
|
598
|
+
<colgroup>
|
|
599
|
+
<col style="width: 20%;">
|
|
600
|
+
<col style="width: 20%;">
|
|
601
|
+
<col style="width: 60%;">
|
|
602
|
+
</colgroup>
|
|
603
|
+
<tbody>
|
|
604
|
+
<tr>
|
|
605
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Name</p></td>
|
|
606
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
|
|
607
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
608
|
+
</tr>
|
|
609
|
+
<tr>
|
|
610
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>id</code></p></td>
|
|
611
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>string</code></p></td>
|
|
612
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">The unique game identifier used as a prefix for LocalStorage.</p></td>
|
|
613
|
+
</tr>
|
|
614
|
+
</tbody>
|
|
615
|
+
</table>
|
|
586
616
|
<hr>
|
|
587
617
|
</div>
|
|
588
618
|
<div class="sect2">
|
|
589
|
-
<h3 id="getformattedscoredigits-number-string"><a class="link" href="#getformattedscoredigits-number-string">1.
|
|
619
|
+
<h3 id="getformattedscoredigits-number-string"><a class="link" href="#getformattedscoredigits-number-string">1.10. <code>getFormattedScore(digits: number): string</code></a></h3>
|
|
590
620
|
<div class="paragraph">
|
|
591
621
|
<p>Returns the score as a padded string suitable for HUD display.</p>
|
|
592
622
|
</div>
|
|
@@ -621,7 +651,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
621
651
|
<hr>
|
|
622
652
|
</div>
|
|
623
653
|
<div class="sect2">
|
|
624
|
-
<h3 id="serialize-string"><a class="link" href="#serialize-string">1.
|
|
654
|
+
<h3 id="serialize-string"><a class="link" href="#serialize-string">1.11. <code>serialize(): string</code></a></h3>
|
|
625
655
|
<div class="paragraph">
|
|
626
656
|
<p><strong>Behavior</strong></p>
|
|
627
657
|
</div>
|
|
@@ -631,7 +661,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
631
661
|
<hr>
|
|
632
662
|
</div>
|
|
633
663
|
<div class="sect2">
|
|
634
|
-
<h3 id="deserializedata-string-void"><a class="link" href="#deserializedata-string-void">1.
|
|
664
|
+
<h3 id="deserializedata-string-void"><a class="link" href="#deserializedata-string-void">1.12. <code>deserialize(data: string): void</code></a></h3>
|
|
635
665
|
<div class="paragraph">
|
|
636
666
|
<p><strong>Behavior</strong></p>
|
|
637
667
|
</div>
|
|
@@ -641,7 +671,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
641
671
|
<hr>
|
|
642
672
|
</div>
|
|
643
673
|
<div class="sect2">
|
|
644
|
-
<h3 id="getdebugdata-recordstring-string-number-boolean"><a class="link" href="#getdebugdata-recordstring-string-number-boolean">1.
|
|
674
|
+
<h3 id="getdebugdata-recordstring-string-number-boolean"><a class="link" href="#getdebugdata-recordstring-string-number-boolean">1.13. <code>getDebugData(): Record<string, string | number | boolean></code></a></h3>
|
|
645
675
|
<div class="paragraph">
|
|
646
676
|
<p>Returns metadata for the real-time debugger.</p>
|
|
647
677
|
</div>
|
|
@@ -445,8 +445,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
445
445
|
<li><a href="#_session_management">1. Session Management</a>
|
|
446
446
|
<ul class="sectlevel2">
|
|
447
447
|
<li><a href="#_savesession_void">1.1. <code>saveSession(): void</code></a></li>
|
|
448
|
-
<li><a href="#
|
|
449
|
-
<li><a href="#
|
|
448
|
+
<li><a href="#_setsessionenabledenabled_boolean_void">1.2. <code>setSessionEnabled(enabled: boolean): void</code></a></li>
|
|
449
|
+
<li><a href="#_clearsession_void">1.3. <code>clearSession(): void</code></a></li>
|
|
450
|
+
<li><a href="#_syncstatestate_state_void">1.4. <code>syncState(state: State): void</code></a></li>
|
|
450
451
|
</ul>
|
|
451
452
|
</li>
|
|
452
453
|
<li><a href="#_internals">2. Internals</a></li>
|
|
@@ -467,17 +468,46 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
467
468
|
<div class="sect2">
|
|
468
469
|
<h3 id="_savesession_void"><a class="link" href="#_savesession_void">1.1. <code>saveSession(): void</code></a></h3>
|
|
469
470
|
<div class="paragraph">
|
|
470
|
-
<p>Creates or updates the session. Early returns if the
|
|
471
|
+
<p>Creates or updates the session. Early returns if the session is disabled (via <code>setSessionEnabled</code>) or if the <code>SessionModal</code> (if existing) has not been confirmed/rejected yet.</p>
|
|
471
472
|
</div>
|
|
473
|
+
<hr>
|
|
472
474
|
</div>
|
|
473
475
|
<div class="sect2">
|
|
474
|
-
<h3 id="
|
|
476
|
+
<h3 id="_setsessionenabledenabled_boolean_void"><a class="link" href="#_setsessionenabledenabled_boolean_void">1.2. <code>setSessionEnabled(enabled: boolean): void</code></a></h3>
|
|
477
|
+
<div class="paragraph">
|
|
478
|
+
<p>Enables or disables the session recovery mechanism. When disabled, the engine will neither show the session recovery modal nor save the session.</p>
|
|
479
|
+
</div>
|
|
480
|
+
<div class="paragraph">
|
|
481
|
+
<p><strong>Parameters</strong></p>
|
|
482
|
+
</div>
|
|
483
|
+
<table class="tableblock frame-all grid-all stretch">
|
|
484
|
+
<colgroup>
|
|
485
|
+
<col style="width: 20%;">
|
|
486
|
+
<col style="width: 20%;">
|
|
487
|
+
<col style="width: 60%;">
|
|
488
|
+
</colgroup>
|
|
489
|
+
<tbody>
|
|
490
|
+
<tr>
|
|
491
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Name</p></td>
|
|
492
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
|
|
493
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
494
|
+
</tr>
|
|
495
|
+
<tr>
|
|
496
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>enabled</code></p></td>
|
|
497
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>boolean</code></p></td>
|
|
498
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Whether the session should be enabled.</p></td>
|
|
499
|
+
</tr>
|
|
500
|
+
</tbody>
|
|
501
|
+
</table>
|
|
502
|
+
</div>
|
|
503
|
+
<div class="sect2">
|
|
504
|
+
<h3 id="_clearsession_void"><a class="link" href="#_clearsession_void">1.3. <code>clearSession(): void</code></a></h3>
|
|
475
505
|
<div class="paragraph">
|
|
476
506
|
<p>Removes the saved instances from <code>localStorage</code>.</p>
|
|
477
507
|
</div>
|
|
478
508
|
</div>
|
|
479
509
|
<div class="sect2">
|
|
480
|
-
<h3 id="_syncstatestate_state_void"><a class="link" href="#_syncstatestate_state_void">1.
|
|
510
|
+
<h3 id="_syncstatestate_state_void"><a class="link" href="#_syncstatestate_state_void">1.4. <code>syncState(state: State): void</code></a></h3>
|
|
481
511
|
<div class="paragraph">
|
|
482
512
|
<p>Subscribes to <code><a href="GameState.html">GameState</a></code> interactions.</p>
|
|
483
513
|
</div>
|
|
@@ -508,7 +538,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
508
538
|
</div>
|
|
509
539
|
<div class="paragraph">
|
|
510
540
|
<p>Reacts to:
|
|
511
|
-
- <code>PLAYING</code>: If a session for the current <code>gameId</code> exists, is
|
|
541
|
+
- <code>PLAYING</code>: If a session for the current <code>gameId</code> exists, session is enabled, and the modal hasn’t been closed, it invokes the modal via <code>_showSessionModal</code>. If accepted, calls deserialize on all registered targets. If canceled or if no previous session exists, proceeds normally. The modal state is tracked to prevent re-triggering during the same power cycle.
|
|
512
542
|
- <code>ON</code> (when false): Resets the modal state tracking closure, allowing the session modal to appear again after the device is powered back on.
|
|
513
543
|
- <code>GAME_OVER</code>: Clears active session entirely.</p>
|
|
514
544
|
</div>
|
|
@@ -526,7 +556,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
526
556
|
</div>
|
|
527
557
|
<div id="footer">
|
|
528
558
|
<div id="footer-text">
|
|
529
|
-
Last updated 2026-02-
|
|
559
|
+
Last updated 2026-02-24 23:17:20 -0300
|
|
530
560
|
</div>
|
|
531
561
|
</div>
|
|
532
562
|
</body>
|
|
@@ -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>
|