brick-engine-js 1.0.38 → 1.0.40
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 +1 -1
- package/dist/docs/index.html +2 -2
- package/dist/docs/reference/enums/ControlKey.html +4 -0
- package/dist/docs/reference/enums/ScoreProperty.html +526 -0
- package/dist/docs/reference/enums/StateProperty.html +4 -0
- package/dist/docs/reference/interfaces/StateSyncable.html +1 -1
- package/dist/docs/reference/interfaces/modules/Score.html +182 -32
- package/dist/docs/reference/interfaces/modules/State.html +88 -36
- package/dist/docs/reference/interfaces/modules/Time.html +61 -145
- package/dist/docs/reference/modules/GameEventRegistry.html +10 -4
- package/dist/docs/reference/modules/GameScore.html +339 -71
- package/dist/docs/reference/modules/GameState.html +256 -163
- package/dist/docs/reference/modules/GameTime.html +136 -149
- package/dist/game.bundle.js +1 -1
- package/dist/types/config/configs.d.ts +2 -4
- package/dist/types/core/Game.d.ts +17 -10
- package/dist/types/core/module/score/GameScore.d.ts +24 -0
- package/dist/types/core/module/time/GameTime.d.ts +62 -63
- package/dist/types/core/types/enums.d.ts +11 -0
- package/dist/types/core/types/modules.d.ts +70 -60
- package/dist/types/view/ShortcutsModal.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
7
|
<meta name="generator" content="Asciidoctor 2.0.20">
|
|
8
|
-
<meta name="description" content="Interface
|
|
8
|
+
<meta name="description" content="Interface defining the contract for logical game time management.">
|
|
9
9
|
<meta name="keywords" content="time, clock, tick, interval, game-loop">
|
|
10
10
|
<title>Time Reference</title>
|
|
11
11
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
|
|
@@ -444,21 +444,25 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
444
444
|
<div id="toctitle">Table of Contents</div>
|
|
445
445
|
<ul class="sectlevel1">
|
|
446
446
|
<li><a href="#architectural-purpose">1. Architectural Purpose</a></li>
|
|
447
|
-
<li><a href="#
|
|
448
|
-
<li><a href="#methods">3. Methods</a>
|
|
447
|
+
<li><a href="#api-reference">2. API Reference</a>
|
|
449
448
|
<ul class="sectlevel2">
|
|
450
|
-
<li><a href="#
|
|
451
|
-
<
|
|
452
|
-
<li><a href="#
|
|
453
|
-
<li><a href="#
|
|
454
|
-
<li><a href="#
|
|
455
|
-
<li><a href="#
|
|
456
|
-
<li><a href="#settickintervalinterval-number-void">3.7. <code>setTickInterval(interval: number): void</code></a></li>
|
|
457
|
-
<li><a href="#setmintickintervalinterval-number-void">3.8. <code>setMinTickInterval(interval: number): void</code></a></li>
|
|
458
|
-
<li><a href="#captureinitialstate-void">3.9. <code>captureInitialState(): void</code></a></li>
|
|
449
|
+
<li><a href="#core-simulation">2.1. Core Simulation</a>
|
|
450
|
+
<ul class="sectlevel3">
|
|
451
|
+
<li><a href="#updatedeltatime-number-void">2.1.1. <code>update(deltaTime: number): void</code></a></li>
|
|
452
|
+
<li><a href="#accumulatedeltatime-number-void">2.1.2. <code>accumulate(deltaTime: number): void</code></a></li>
|
|
453
|
+
<li><a href="#shouldtick-boolean">2.1.3. <code>shouldTick(): boolean</code></a></li>
|
|
454
|
+
<li><a href="#reset-void">2.1.4. <code>reset(): void</code></a></li>
|
|
459
455
|
</ul>
|
|
460
456
|
</li>
|
|
461
|
-
<li><a href="#
|
|
457
|
+
<li><a href="#declarative-api">2.2. Declarative API</a>
|
|
458
|
+
<ul class="sectlevel3">
|
|
459
|
+
<li><a href="#atintervalms-number-boolean">2.2.1. <code>atInterval(ms: number): boolean</code></a></li>
|
|
460
|
+
<li><a href="#everyms-number-action-void-void">2.2.2. <code>every(ms: number, action: () ⇒ void): void</code></a></li>
|
|
461
|
+
</ul>
|
|
462
|
+
</li>
|
|
463
|
+
</ul>
|
|
464
|
+
</li>
|
|
465
|
+
<li><a href="#general-usage">3. General Usage</a></li>
|
|
462
466
|
</ul>
|
|
463
467
|
</div>
|
|
464
468
|
</div>
|
|
@@ -467,51 +471,19 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
467
471
|
<h2 id="architectural-purpose"><a class="link" href="#architectural-purpose">1. Architectural Purpose</a></h2>
|
|
468
472
|
<div class="sectionbody">
|
|
469
473
|
<div class="paragraph">
|
|
470
|
-
<p>
|
|
474
|
+
<p>The <code>Time</code> interface defines the core contract for managing the engine’s logical clock and update frequency. It ensures that any implementation provides the necessary tools to decouple deterministic game logic from the visual frame rate.</p>
|
|
471
475
|
</div>
|
|
472
476
|
</div>
|
|
473
477
|
</div>
|
|
474
478
|
<div class="sect1">
|
|
475
|
-
<h2 id="
|
|
476
|
-
<div class="sectionbody">
|
|
477
|
-
<table class="tableblock frame-all grid-all stretch">
|
|
478
|
-
<colgroup>
|
|
479
|
-
<col style="width: 20%;">
|
|
480
|
-
<col style="width: 20%;">
|
|
481
|
-
<col style="width: 60%;">
|
|
482
|
-
</colgroup>
|
|
483
|
-
<tbody>
|
|
484
|
-
<tr>
|
|
485
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Name</p></td>
|
|
486
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
|
|
487
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
488
|
-
</tr>
|
|
489
|
-
<tr>
|
|
490
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>tickInterval</code></p></td>
|
|
491
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
|
|
492
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">The duration in milliseconds between logic updates.</p></td>
|
|
493
|
-
</tr>
|
|
494
|
-
<tr>
|
|
495
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>totalTicks</code></p></td>
|
|
496
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
|
|
497
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">The total number of logic ticks that have occurred since the game started.</p></td>
|
|
498
|
-
</tr>
|
|
499
|
-
<tr>
|
|
500
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>elapsedTime</code></p></td>
|
|
501
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
|
|
502
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">The total time in milliseconds elapsed since the game started.</p></td>
|
|
503
|
-
</tr>
|
|
504
|
-
</tbody>
|
|
505
|
-
</table>
|
|
506
|
-
</div>
|
|
507
|
-
</div>
|
|
508
|
-
<div class="sect1">
|
|
509
|
-
<h2 id="methods"><a class="link" href="#methods">3. Methods</a></h2>
|
|
479
|
+
<h2 id="api-reference"><a class="link" href="#api-reference">2. API Reference</a></h2>
|
|
510
480
|
<div class="sectionbody">
|
|
511
481
|
<div class="sect2">
|
|
512
|
-
<h3 id="
|
|
482
|
+
<h3 id="core-simulation"><a class="link" href="#core-simulation">2.1. Core Simulation</a></h3>
|
|
483
|
+
<div class="sect3">
|
|
484
|
+
<h4 id="updatedeltatime-number-void"><a class="link" href="#updatedeltatime-number-void">2.1.1. <code>update(deltaTime: number): void</code></a></h4>
|
|
513
485
|
<div class="paragraph">
|
|
514
|
-
<p>
|
|
486
|
+
<p>Advances the internal physical stats (FPS/TPS).</p>
|
|
515
487
|
</div>
|
|
516
488
|
<div class="paragraph">
|
|
517
489
|
<p><strong>Parameters</strong></p>
|
|
@@ -531,36 +503,16 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
531
503
|
<tr>
|
|
532
504
|
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>deltaTime</code></p></td>
|
|
533
505
|
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
|
|
534
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Time
|
|
506
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Time physically elapsed since the last rendering frame in milliseconds.</p></td>
|
|
535
507
|
</tr>
|
|
536
508
|
</tbody>
|
|
537
509
|
</table>
|
|
538
510
|
<hr>
|
|
539
511
|
</div>
|
|
540
|
-
<div class="
|
|
541
|
-
<
|
|
542
|
-
<div class="paragraph">
|
|
543
|
-
<p>Returns <code>true</code> if the tick accumulator has exceeded the <code>tickInterval</code>, indicating a logic update is due.</p>
|
|
544
|
-
</div>
|
|
545
|
-
<div class="paragraph">
|
|
546
|
-
<p><strong>Returns</strong></p>
|
|
547
|
-
</div>
|
|
548
|
-
<div class="paragraph">
|
|
549
|
-
<p><code>boolean</code> - <code>true</code> if a tick should occur.</p>
|
|
550
|
-
</div>
|
|
551
|
-
<hr>
|
|
552
|
-
</div>
|
|
553
|
-
<div class="sect2">
|
|
554
|
-
<h3 id="reset-void"><a class="link" href="#reset-void">3.3. <code>reset(): void</code></a></h3>
|
|
512
|
+
<div class="sect3">
|
|
513
|
+
<h4 id="accumulatedeltatime-number-void"><a class="link" href="#accumulatedeltatime-number-void">2.1.2. <code>accumulate(deltaTime: number): void</code></a></h4>
|
|
555
514
|
<div class="paragraph">
|
|
556
|
-
<p>
|
|
557
|
-
</div>
|
|
558
|
-
<hr>
|
|
559
|
-
</div>
|
|
560
|
-
<div class="sect2">
|
|
561
|
-
<h3 id="istickeveryinterval-number-boolean"><a class="link" href="#istickeveryinterval-number-boolean">3.4. <code>isTickEvery(interval: number): boolean</code></a></h3>
|
|
562
|
-
<div class="paragraph">
|
|
563
|
-
<p>Returns <code>true</code> if the <code>totalTicks</code> is a multiple of the specified <code>interval</code>. Useful for scheduling recurring game events.</p>
|
|
515
|
+
<p>Adds elapsed time to the simulation accumulator.</p>
|
|
564
516
|
</div>
|
|
565
517
|
<div class="paragraph">
|
|
566
518
|
<p><strong>Parameters</strong></p>
|
|
@@ -578,53 +530,41 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
578
530
|
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
579
531
|
</tr>
|
|
580
532
|
<tr>
|
|
581
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>
|
|
533
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>deltaTime</code></p></td>
|
|
582
534
|
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
|
|
583
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">
|
|
535
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Time in milliseconds to add to the simulation.</p></td>
|
|
584
536
|
</tr>
|
|
585
537
|
</tbody>
|
|
586
538
|
</table>
|
|
539
|
+
<hr>
|
|
540
|
+
</div>
|
|
541
|
+
<div class="sect3">
|
|
542
|
+
<h4 id="shouldtick-boolean"><a class="link" href="#shouldtick-boolean">2.1.3. <code>shouldTick(): boolean</code></a></h4>
|
|
543
|
+
<div class="paragraph">
|
|
544
|
+
<p>Evaluates if a logical simulation tick should be executed.</p>
|
|
545
|
+
</div>
|
|
587
546
|
<div class="paragraph">
|
|
588
547
|
<p><strong>Returns</strong></p>
|
|
589
548
|
</div>
|
|
590
549
|
<div class="paragraph">
|
|
591
|
-
<p><code>boolean</code> - <code>true</code> if
|
|
550
|
+
<p><code>boolean</code> - <code>true</code> if at least one tick was consumed.</p>
|
|
592
551
|
</div>
|
|
593
552
|
<hr>
|
|
594
553
|
</div>
|
|
595
|
-
<div class="
|
|
596
|
-
<
|
|
597
|
-
<div class="paragraph">
|
|
598
|
-
<p>Slows down the game by increasing the time between ticks.</p>
|
|
599
|
-
</div>
|
|
554
|
+
<div class="sect3">
|
|
555
|
+
<h4 id="reset-void"><a class="link" href="#reset-void">2.1.4. <code>reset(): void</code></a></h4>
|
|
600
556
|
<div class="paragraph">
|
|
601
|
-
<p
|
|
557
|
+
<p>Resets all internal timers and counters.</p>
|
|
602
558
|
</div>
|
|
603
|
-
<table class="tableblock frame-all grid-all stretch">
|
|
604
|
-
<colgroup>
|
|
605
|
-
<col style="width: 20%;">
|
|
606
|
-
<col style="width: 20%;">
|
|
607
|
-
<col style="width: 60%;">
|
|
608
|
-
</colgroup>
|
|
609
|
-
<tbody>
|
|
610
|
-
<tr>
|
|
611
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Name</p></td>
|
|
612
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
|
|
613
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
614
|
-
</tr>
|
|
615
|
-
<tr>
|
|
616
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>amount</code></p></td>
|
|
617
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
|
|
618
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Milliseconds to add to the interval.</p></td>
|
|
619
|
-
</tr>
|
|
620
|
-
</tbody>
|
|
621
|
-
</table>
|
|
622
559
|
<hr>
|
|
623
560
|
</div>
|
|
561
|
+
</div>
|
|
624
562
|
<div class="sect2">
|
|
625
|
-
<h3 id="
|
|
563
|
+
<h3 id="declarative-api"><a class="link" href="#declarative-api">2.2. Declarative API</a></h3>
|
|
564
|
+
<div class="sect3">
|
|
565
|
+
<h4 id="atintervalms-number-boolean"><a class="link" href="#atintervalms-number-boolean">2.2.1. <code>atInterval(ms: number): boolean</code></a></h4>
|
|
626
566
|
<div class="paragraph">
|
|
627
|
-
<p>
|
|
567
|
+
<p>Checks if the logical clock has crossed a millisecond interval.</p>
|
|
628
568
|
</div>
|
|
629
569
|
<div class="paragraph">
|
|
630
570
|
<p><strong>Parameters</strong></p>
|
|
@@ -642,47 +582,24 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
642
582
|
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
643
583
|
</tr>
|
|
644
584
|
<tr>
|
|
645
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>
|
|
585
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>ms</code></p></td>
|
|
646
586
|
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
|
|
647
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">
|
|
587
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">The millisecond interval to check.</p></td>
|
|
648
588
|
</tr>
|
|
649
589
|
</tbody>
|
|
650
590
|
</table>
|
|
651
|
-
<hr>
|
|
652
|
-
</div>
|
|
653
|
-
<div class="sect2">
|
|
654
|
-
<h3 id="settickintervalinterval-number-void"><a class="link" href="#settickintervalinterval-number-void">3.7. <code>setTickInterval(interval: number): void</code></a></h3>
|
|
655
591
|
<div class="paragraph">
|
|
656
|
-
<p>
|
|
592
|
+
<p><strong>Returns</strong></p>
|
|
657
593
|
</div>
|
|
658
594
|
<div class="paragraph">
|
|
659
|
-
<p><
|
|
595
|
+
<p><code>boolean</code> - <code>true</code> if the interval boundary was crossed.</p>
|
|
660
596
|
</div>
|
|
661
|
-
<table class="tableblock frame-all grid-all stretch">
|
|
662
|
-
<colgroup>
|
|
663
|
-
<col style="width: 20%;">
|
|
664
|
-
<col style="width: 20%;">
|
|
665
|
-
<col style="width: 60%;">
|
|
666
|
-
</colgroup>
|
|
667
|
-
<tbody>
|
|
668
|
-
<tr>
|
|
669
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Name</p></td>
|
|
670
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
|
|
671
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
672
|
-
</tr>
|
|
673
|
-
<tr>
|
|
674
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>interval</code></p></td>
|
|
675
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
|
|
676
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">The new interval between logic updates (in milliseconds).</p></td>
|
|
677
|
-
</tr>
|
|
678
|
-
</tbody>
|
|
679
|
-
</table>
|
|
680
597
|
<hr>
|
|
681
598
|
</div>
|
|
682
|
-
<div class="
|
|
683
|
-
<
|
|
599
|
+
<div class="sect3">
|
|
600
|
+
<h4 id="everyms-number-action-void-void"><a class="link" href="#everyms-number-action-void-void">2.2.2. <code>every(ms: number, action: () ⇒ void): void</code></a></h4>
|
|
684
601
|
<div class="paragraph">
|
|
685
|
-
<p>
|
|
602
|
+
<p>Executes a callback every N milliseconds of logical game time.</p>
|
|
686
603
|
</div>
|
|
687
604
|
<div class="paragraph">
|
|
688
605
|
<p><strong>Parameters</strong></p>
|
|
@@ -700,27 +617,26 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
700
617
|
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
701
618
|
</tr>
|
|
702
619
|
<tr>
|
|
703
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>
|
|
620
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>ms</code></p></td>
|
|
704
621
|
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
|
|
705
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">
|
|
622
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Millisecond interval.</p></td>
|
|
623
|
+
</tr>
|
|
624
|
+
<tr>
|
|
625
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>action</code></p></td>
|
|
626
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>() ⇒ void</code></p></td>
|
|
627
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Callback function.</p></td>
|
|
706
628
|
</tr>
|
|
707
629
|
</tbody>
|
|
708
630
|
</table>
|
|
709
|
-
<hr>
|
|
710
|
-
</div>
|
|
711
|
-
<div class="sect2">
|
|
712
|
-
<h3 id="captureinitialstate-void"><a class="link" href="#captureinitialstate-void">3.9. <code>captureInitialState(): void</code></a></h3>
|
|
713
|
-
<div class="paragraph">
|
|
714
|
-
<p>Captures the current <code>tickInterval</code> as the initial state. This should be called after a game has performed its specific initialization to ensure that future resets restore the correct starting speed.</p>
|
|
715
631
|
</div>
|
|
716
632
|
</div>
|
|
717
633
|
</div>
|
|
718
634
|
</div>
|
|
719
635
|
<div class="sect1">
|
|
720
|
-
<h2 id="general-usage"><a class="link" href="#general-usage">
|
|
636
|
+
<h2 id="general-usage"><a class="link" href="#general-usage">3. General Usage</a></h2>
|
|
721
637
|
<div class="sectionbody">
|
|
722
638
|
<div class="paragraph">
|
|
723
|
-
<p>Implemented by <code><a href="../../modules/GameTime.html">GameTime</a></code>. This
|
|
639
|
+
<p>Implemented by <code><a href="../../modules/GameTime.html">GameTime</a></code>. This interface allows other modules to depend on a standardized timing contract without being tied to a specific implementation.</p>
|
|
724
640
|
</div>
|
|
725
641
|
</div>
|
|
726
642
|
</div>
|
|
@@ -448,7 +448,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
448
448
|
<li><a href="#api-reference">3. API Reference</a>
|
|
449
449
|
<ul class="sectlevel2">
|
|
450
450
|
<li><a href="#setupcontroleventsmodules-gamemodules-onreset-void-void">3.1. <code>setupControlEvents(modules: GameModules, onReset: () ⇒ void): void</code></a></li>
|
|
451
|
-
<li><a href="#setupstateeventsmodules-gamemodules-void">3.2. <code>setupStateEvents(modules: GameModules): void</code></a></li>
|
|
451
|
+
<li><a href="#setupstateeventsmodules-gamemodules-view-gameview-void">3.2. <code>setupStateEvents(modules: GameModules, view: GameView): void</code></a></li>
|
|
452
452
|
</ul>
|
|
453
453
|
</li>
|
|
454
454
|
</ul>
|
|
@@ -534,9 +534,9 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
534
534
|
<hr>
|
|
535
535
|
</div>
|
|
536
536
|
<div class="sect2">
|
|
537
|
-
<h3 id="setupstateeventsmodules-gamemodules-void"><a class="link" href="#setupstateeventsmodules-gamemodules-void">3.2. <code>setupStateEvents(modules: GameModules): void</code></a></h3>
|
|
537
|
+
<h3 id="setupstateeventsmodules-gamemodules-view-gameview-void"><a class="link" href="#setupstateeventsmodules-gamemodules-view-gameview-void">3.2. <code>setupStateEvents(modules: GameModules, view: <a href="../view/GameView.html">GameView</a>): void</code></a></h3>
|
|
538
538
|
<div class="paragraph">
|
|
539
|
-
<p>Sets up all system-level state property subscriptions. Binds lifecycle behaviors to state property changes, such as clearing current session data upon encountering Game Over,
|
|
539
|
+
<p>Sets up all system-level state property subscriptions. Binds lifecycle behaviors to state property changes, such as clearing current session data upon encountering Game Over, fully purging rendering/grid variables when the system is virtually powered down, or toggling the trackpad layout.</p>
|
|
540
540
|
</div>
|
|
541
541
|
<div class="paragraph">
|
|
542
542
|
<p><strong>Parameters</strong></p>
|
|
@@ -558,6 +558,11 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
558
558
|
<td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="../types/GameModules.html">GameModules</a></code></p></td>
|
|
559
559
|
<td class="tableblock halign-left valign-top"><p class="tableblock">The structured collection of engine modules.</p></td>
|
|
560
560
|
</tr>
|
|
561
|
+
<tr>
|
|
562
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>view</code></p></td>
|
|
563
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code><a href="../view/GameView.html">GameView</a></code></p></td>
|
|
564
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">The active game view to notify about visual state changes.</p></td>
|
|
565
|
+
</tr>
|
|
561
566
|
</tbody>
|
|
562
567
|
</table>
|
|
563
568
|
<div class="paragraph">
|
|
@@ -566,7 +571,8 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
566
571
|
<div class="paragraph">
|
|
567
572
|
<p>Registers listeners for:
|
|
568
573
|
* <code>StateProperty.ON</code>: Resets all modules when the system is turned off.
|
|
569
|
-
* <code>StateProperty.GAME_OVER</code>: Clears the session when the player loses
|
|
574
|
+
* <code>StateProperty.GAME_OVER</code>: Clears the session when the player loses.
|
|
575
|
+
* <code>StateProperty.TRACKPAD</code>: Toggles the trackpad layout mode.</p>
|
|
570
576
|
</div>
|
|
571
577
|
<hr>
|
|
572
578
|
</div>
|