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
|
@@ -443,25 +443,37 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
443
443
|
<div id="toc" class="toc2">
|
|
444
444
|
<div id="toctitle">Table of Contents</div>
|
|
445
445
|
<ul class="sectlevel1">
|
|
446
|
-
<li><a href="#
|
|
447
|
-
<li><a href="#
|
|
448
|
-
<li><a href="#methods">3. Methods</a>
|
|
446
|
+
<li><a href="#properties">1. Properties</a></li>
|
|
447
|
+
<li><a href="#methods">2. Methods</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="#setupgamehighscoreid-string-void">3.6. <code>setupGameHighScore(id: string): void</code></a></li>
|
|
449
|
+
<li><a href="#score-management">2.1. Score Management</a>
|
|
450
|
+
<ul class="sectlevel3">
|
|
451
|
+
<li><a href="#increasescoreamount-number-void">2.1.1. <code>increaseScore(amount: number): void</code></a></li>
|
|
452
|
+
<li><a href="#resetscore-void">2.1.2. <code>resetScore(): void</code></a></li>
|
|
453
|
+
<li><a href="#getformattedscoredigits-number-string">2.1.3. <code>getFormattedScore(digits?: number): string</code></a></li>
|
|
456
454
|
</ul>
|
|
457
455
|
</li>
|
|
458
|
-
<li><a href="#
|
|
456
|
+
<li><a href="#level-management">2.2. Level Management</a>
|
|
457
|
+
<ul class="sectlevel3">
|
|
458
|
+
<li><a href="#increaselevelamount-number-void">2.2.1. <code>increaseLevel(amount: number): void</code></a></li>
|
|
459
|
+
<li><a href="#resetlevel-void">2.2.2. <code>resetLevel(): void</code></a></li>
|
|
460
|
+
<li><a href="#setupgamehighscoreid-string-void">2.2.3. <code>setupGameHighScore(id: string): void</code></a></li>
|
|
461
|
+
</ul>
|
|
462
|
+
</li>
|
|
463
|
+
<li><a href="#subscriptions">2.3. Subscriptions</a>
|
|
464
|
+
<ul class="sectlevel3">
|
|
465
|
+
<li><a href="#subscribecallback-score-number-void-void">2.3.1. <code>subscribe(callback: (score: number) ⇒ void): void</code></a></li>
|
|
466
|
+
<li><a href="#unsubscribecallback-score-number-void-void">2.3.2. <code>unsubscribe(callback: (score: number) ⇒ void): void</code></a></li>
|
|
467
|
+
</ul>
|
|
468
|
+
</li>
|
|
469
|
+
</ul>
|
|
470
|
+
</li>
|
|
471
|
+
<li><a href="#general-usage">3. General Usage</a></li>
|
|
459
472
|
</ul>
|
|
460
473
|
</div>
|
|
461
474
|
</div>
|
|
462
475
|
<div id="content">
|
|
463
|
-
<div
|
|
464
|
-
<h2 id="architectural-purpose"><a class="link" href="#architectural-purpose">1. Architectural Purpose</a></h2>
|
|
476
|
+
<div id="preamble">
|
|
465
477
|
<div class="sectionbody">
|
|
466
478
|
<div class="paragraph">
|
|
467
479
|
<p>Interface for tracking session performance, multipliers, and levels.</p>
|
|
@@ -469,7 +481,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
469
481
|
</div>
|
|
470
482
|
</div>
|
|
471
483
|
<div class="sect1">
|
|
472
|
-
<h2 id="properties"><a class="link" href="#properties">
|
|
484
|
+
<h2 id="properties"><a class="link" href="#properties">1. Properties</a></h2>
|
|
473
485
|
<div class="sectionbody">
|
|
474
486
|
<table class="tableblock frame-all grid-all stretch">
|
|
475
487
|
<colgroup>
|
|
@@ -477,12 +489,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
477
489
|
<col style="width: 20%;">
|
|
478
490
|
<col style="width: 60%;">
|
|
479
491
|
</colgroup>
|
|
480
|
-
<
|
|
492
|
+
<thead>
|
|
481
493
|
<tr>
|
|
482
|
-
<
|
|
483
|
-
<
|
|
484
|
-
<
|
|
494
|
+
<th class="tableblock halign-left valign-top">Name</th>
|
|
495
|
+
<th class="tableblock halign-left valign-top">Type</th>
|
|
496
|
+
<th class="tableblock halign-left valign-top">Description</th>
|
|
485
497
|
</tr>
|
|
498
|
+
</thead>
|
|
499
|
+
<tbody>
|
|
486
500
|
<tr>
|
|
487
501
|
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>score</code></p></td>
|
|
488
502
|
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
|
|
@@ -508,10 +522,15 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
508
522
|
</div>
|
|
509
523
|
</div>
|
|
510
524
|
<div class="sect1">
|
|
511
|
-
<h2 id="methods"><a class="link" href="#methods">
|
|
525
|
+
<h2 id="methods"><a class="link" href="#methods">2. Methods</a></h2>
|
|
512
526
|
<div class="sectionbody">
|
|
513
527
|
<div class="sect2">
|
|
514
|
-
<h3 id="
|
|
528
|
+
<h3 id="score-management"><a class="link" href="#score-management">2.1. Score Management</a></h3>
|
|
529
|
+
<div class="paragraph">
|
|
530
|
+
<p>Methods for adding and resetting session points.</p>
|
|
531
|
+
</div>
|
|
532
|
+
<div class="sect3">
|
|
533
|
+
<h4 id="increasescoreamount-number-void"><a class="link" href="#increasescoreamount-number-void">2.1.1. <code>increaseScore(amount: number): void</code></a></h4>
|
|
515
534
|
<div class="paragraph">
|
|
516
535
|
<p>Adds points to the total, automatically applying any active multipliers.</p>
|
|
517
536
|
</div>
|
|
@@ -537,17 +556,34 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
537
556
|
</tr>
|
|
538
557
|
</tbody>
|
|
539
558
|
</table>
|
|
559
|
+
<div class="paragraph">
|
|
560
|
+
<p><strong>Example</strong></p>
|
|
561
|
+
</div>
|
|
562
|
+
<div class="listingblock">
|
|
563
|
+
<div class="content">
|
|
564
|
+
<pre class="highlightjs highlight"><code class="language-typescript hljs" data-lang="typescript">// Adds 100 * multiplier to the total score
|
|
565
|
+
game.score.increaseScore(100);</code></pre>
|
|
566
|
+
</div>
|
|
567
|
+
</div>
|
|
540
568
|
<hr>
|
|
541
569
|
</div>
|
|
542
|
-
<div class="
|
|
543
|
-
<
|
|
570
|
+
<div class="sect3">
|
|
571
|
+
<h4 id="resetscore-void"><a class="link" href="#resetscore-void">2.1.2. <code>resetScore(): void</code></a></h4>
|
|
544
572
|
<div class="paragraph">
|
|
545
573
|
<p>Resets the session score to <code>0</code>.</p>
|
|
546
574
|
</div>
|
|
575
|
+
<div class="paragraph">
|
|
576
|
+
<p><strong>Example</strong></p>
|
|
577
|
+
</div>
|
|
578
|
+
<div class="listingblock">
|
|
579
|
+
<div class="content">
|
|
580
|
+
<pre class="highlightjs highlight"><code class="language-typescript hljs" data-lang="typescript">game.score.resetScore();</code></pre>
|
|
581
|
+
</div>
|
|
582
|
+
</div>
|
|
547
583
|
<hr>
|
|
548
584
|
</div>
|
|
549
|
-
<div class="
|
|
550
|
-
<
|
|
585
|
+
<div class="sect3">
|
|
586
|
+
<h4 id="getformattedscoredigits-number-string"><a class="link" href="#getformattedscoredigits-number-string">2.1.3. <code>getFormattedScore(digits?: number): string</code></a></h4>
|
|
551
587
|
<div class="paragraph">
|
|
552
588
|
<p>Returns a string representation of the score padded with leading zeros (defaulting to 6 digits).</p>
|
|
553
589
|
</div>
|
|
@@ -579,12 +615,27 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
579
615
|
<div class="paragraph">
|
|
580
616
|
<p><code>string</code> - The formatted score (e.g., "001500").</p>
|
|
581
617
|
</div>
|
|
582
|
-
<
|
|
618
|
+
<div class="paragraph">
|
|
619
|
+
<p><strong>Example</strong></p>
|
|
620
|
+
</div>
|
|
621
|
+
<div class="listingblock">
|
|
622
|
+
<div class="content">
|
|
623
|
+
<pre class="highlightjs highlight"><code class="language-typescript hljs" data-lang="typescript">const displayValue = game.score.getFormattedScore(8);
|
|
624
|
+
console.log(displayValue); // "00001500"</code></pre>
|
|
625
|
+
</div>
|
|
626
|
+
</div>
|
|
627
|
+
</div>
|
|
583
628
|
</div>
|
|
584
629
|
<div class="sect2">
|
|
585
|
-
<h3 id="
|
|
630
|
+
<h3 id="level-management"><a class="link" href="#level-management">2.2. Level Management</a></h3>
|
|
631
|
+
<div class="paragraph">
|
|
632
|
+
<p>Methods for difficulty scaling and high score initialization.</p>
|
|
633
|
+
</div>
|
|
634
|
+
<hr>
|
|
635
|
+
<div class="sect3">
|
|
636
|
+
<h4 id="increaselevelamount-number-void"><a class="link" href="#increaselevelamount-number-void">2.2.1. <code>increaseLevel(amount: number): void</code></a></h4>
|
|
586
637
|
<div class="paragraph">
|
|
587
|
-
<p>Increments the current game level
|
|
638
|
+
<p>Increments the current game level.</p>
|
|
588
639
|
</div>
|
|
589
640
|
<div class="paragraph">
|
|
590
641
|
<p><strong>Parameters</strong></p>
|
|
@@ -608,17 +659,33 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
608
659
|
</tr>
|
|
609
660
|
</tbody>
|
|
610
661
|
</table>
|
|
662
|
+
<div class="paragraph">
|
|
663
|
+
<p><strong>Example</strong></p>
|
|
664
|
+
</div>
|
|
665
|
+
<div class="listingblock">
|
|
666
|
+
<div class="content">
|
|
667
|
+
<pre class="highlightjs highlight"><code class="language-typescript hljs" data-lang="typescript">game.score.increaseLevel(1);</code></pre>
|
|
668
|
+
</div>
|
|
669
|
+
</div>
|
|
611
670
|
<hr>
|
|
612
671
|
</div>
|
|
613
|
-
<div class="
|
|
614
|
-
<
|
|
672
|
+
<div class="sect3">
|
|
673
|
+
<h4 id="resetlevel-void"><a class="link" href="#resetlevel-void">2.2.2. <code>resetLevel(): void</code></a></h4>
|
|
615
674
|
<div class="paragraph">
|
|
616
675
|
<p>Resets the game difficulty level to its initial value.</p>
|
|
617
676
|
</div>
|
|
677
|
+
<div class="paragraph">
|
|
678
|
+
<p><strong>Example</strong></p>
|
|
679
|
+
</div>
|
|
680
|
+
<div class="listingblock">
|
|
681
|
+
<div class="content">
|
|
682
|
+
<pre class="highlightjs highlight"><code class="language-typescript hljs" data-lang="typescript">game.score.resetLevel();</code></pre>
|
|
683
|
+
</div>
|
|
684
|
+
</div>
|
|
618
685
|
<hr>
|
|
619
686
|
</div>
|
|
620
|
-
<div class="
|
|
621
|
-
<
|
|
687
|
+
<div class="sect3">
|
|
688
|
+
<h4 id="setupgamehighscoreid-string-void"><a class="link" href="#setupgamehighscoreid-string-void">2.2.3. <code>setupGameHighScore(id: string): void</code></a></h4>
|
|
622
689
|
<div class="paragraph">
|
|
623
690
|
<p>Initializes the high score for a specific game, loading it from namespaced storage.</p>
|
|
624
691
|
</div>
|
|
@@ -640,15 +707,98 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
640
707
|
<tr>
|
|
641
708
|
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>id</code></p></td>
|
|
642
709
|
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>string</code></p></td>
|
|
643
|
-
<td class="tableblock halign-left valign-top"><p class="tableblock">The unique identifier of the game (e.g., from <code><a href="
|
|
710
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">The unique identifier of the game (e.g., from <code><a href="../../modules/Game.html">Game.gameId</a></code>).</p></td>
|
|
711
|
+
</tr>
|
|
712
|
+
</tbody>
|
|
713
|
+
</table>
|
|
714
|
+
<div class="paragraph">
|
|
715
|
+
<p><strong>Example</strong></p>
|
|
716
|
+
</div>
|
|
717
|
+
<div class="listingblock">
|
|
718
|
+
<div class="content">
|
|
719
|
+
<pre class="highlightjs highlight"><code class="language-typescript hljs" data-lang="typescript">game.score.setupGameHighScore("space-invaders-123");</code></pre>
|
|
720
|
+
</div>
|
|
721
|
+
</div>
|
|
722
|
+
</div>
|
|
723
|
+
</div>
|
|
724
|
+
<div class="sect2">
|
|
725
|
+
<h3 id="subscriptions"><a class="link" href="#subscriptions">2.3. Subscriptions</a></h3>
|
|
726
|
+
<div class="paragraph">
|
|
727
|
+
<p>Reactivity methods for listening to score updates.</p>
|
|
728
|
+
</div>
|
|
729
|
+
<hr>
|
|
730
|
+
<div class="sect3">
|
|
731
|
+
<h4 id="subscribecallback-score-number-void-void"><a class="link" href="#subscribecallback-score-number-void-void">2.3.1. <code>subscribe(callback: (score: number) ⇒ void): void</code></a></h4>
|
|
732
|
+
<div class="paragraph">
|
|
733
|
+
<p>Registers a listener for score changes.</p>
|
|
734
|
+
</div>
|
|
735
|
+
<div class="paragraph">
|
|
736
|
+
<p><strong>Parameters</strong></p>
|
|
737
|
+
</div>
|
|
738
|
+
<table class="tableblock frame-all grid-all stretch">
|
|
739
|
+
<colgroup>
|
|
740
|
+
<col style="width: 20%;">
|
|
741
|
+
<col style="width: 20%;">
|
|
742
|
+
<col style="width: 60%;">
|
|
743
|
+
</colgroup>
|
|
744
|
+
<tbody>
|
|
745
|
+
<tr>
|
|
746
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Name</p></td>
|
|
747
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
|
|
748
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
749
|
+
</tr>
|
|
750
|
+
<tr>
|
|
751
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>callback</code></p></td>
|
|
752
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>(score: number) ⇒ void</code></p></td>
|
|
753
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">The function to execute when the score changes.</p></td>
|
|
644
754
|
</tr>
|
|
645
755
|
</tbody>
|
|
646
756
|
</table>
|
|
757
|
+
<div class="paragraph">
|
|
758
|
+
<p><strong>Example</strong></p>
|
|
759
|
+
</div>
|
|
760
|
+
<div class="listingblock">
|
|
761
|
+
<div class="content">
|
|
762
|
+
<pre class="highlightjs highlight"><code class="language-typescript hljs" data-lang="typescript">game.score.subscribe((newScore) => {
|
|
763
|
+
hud.updateScore(newScore);
|
|
764
|
+
});</code></pre>
|
|
765
|
+
</div>
|
|
766
|
+
</div>
|
|
767
|
+
<hr>
|
|
768
|
+
</div>
|
|
769
|
+
<div class="sect3">
|
|
770
|
+
<h4 id="unsubscribecallback-score-number-void-void"><a class="link" href="#unsubscribecallback-score-number-void-void">2.3.2. <code>unsubscribe(callback: (score: number) ⇒ void): void</code></a></h4>
|
|
771
|
+
<div class="paragraph">
|
|
772
|
+
<p>Removes a previously registered score listener.</p>
|
|
773
|
+
</div>
|
|
774
|
+
<div class="paragraph">
|
|
775
|
+
<p><strong>Parameters</strong></p>
|
|
776
|
+
</div>
|
|
777
|
+
<table class="tableblock frame-all grid-all stretch">
|
|
778
|
+
<colgroup>
|
|
779
|
+
<col style="width: 20%;">
|
|
780
|
+
<col style="width: 20%;">
|
|
781
|
+
<col style="width: 60%;">
|
|
782
|
+
</colgroup>
|
|
783
|
+
<tbody>
|
|
784
|
+
<tr>
|
|
785
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Name</p></td>
|
|
786
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
|
|
787
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
788
|
+
</tr>
|
|
789
|
+
<tr>
|
|
790
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>callback</code></p></td>
|
|
791
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>(score: number) ⇒ void</code></p></td>
|
|
792
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">The function to remove.</p></td>
|
|
793
|
+
</tr>
|
|
794
|
+
</tbody>
|
|
795
|
+
</table>
|
|
796
|
+
</div>
|
|
647
797
|
</div>
|
|
648
798
|
</div>
|
|
649
799
|
</div>
|
|
650
800
|
<div class="sect1">
|
|
651
|
-
<h2 id="general-usage"><a class="link" href="#general-usage">
|
|
801
|
+
<h2 id="general-usage"><a class="link" href="#general-usage">3. General Usage</a></h2>
|
|
652
802
|
<div class="sectionbody">
|
|
653
803
|
<div class="paragraph">
|
|
654
804
|
<p>Implemented by <code><a href="../../modules/GameScore.html">GameScore</a></code>. It handles the numeric progression of the game and formats the data for display on the HUD.</p>
|
|
@@ -454,24 +454,27 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
454
454
|
<li><a href="#isgameover-boolean">2.6. <code>isGameOver(): boolean</code></a></li>
|
|
455
455
|
<li><a href="#iscolorenabled-boolean">2.7. <code>isColorEnabled(): boolean</code></a></li>
|
|
456
456
|
<li><a href="#setcolorenabledvalue-boolean-void">2.8. <code>setColorEnabled(value: boolean): void</code></a></li>
|
|
457
|
-
<li><a href="#
|
|
458
|
-
<li><a href="#
|
|
459
|
-
<li><a href="#
|
|
460
|
-
<li><a href="#
|
|
461
|
-
<li><a href="#
|
|
462
|
-
<li><a href="#
|
|
463
|
-
<li><a href="#
|
|
464
|
-
<li><a href="#
|
|
465
|
-
<li><a href="#
|
|
466
|
-
<li><a href="#
|
|
467
|
-
<li><a href="#
|
|
468
|
-
<li><a href="#
|
|
469
|
-
<li><a href="#
|
|
470
|
-
<li><a href="#
|
|
471
|
-
<li><a href="#
|
|
472
|
-
<li><a href="#
|
|
473
|
-
<li><a href="#
|
|
474
|
-
<li><a href="#
|
|
457
|
+
<li><a href="#istrackpadenabled-boolean">2.9. <code>isTrackpadEnabled(): boolean</code></a></li>
|
|
458
|
+
<li><a href="#settrackpadenabledvalue-boolean-void">2.10. <code>setTrackpadEnabled(value: boolean): void</code></a></li>
|
|
459
|
+
<li><a href="#toggletrackpadenabled-void">2.11. <code>toggleTrackpadEnabled(): void</code></a></li>
|
|
460
|
+
<li><a href="#ismuted-boolean">2.12. <code>isMuted(): boolean</code></a></li>
|
|
461
|
+
<li><a href="#setmutedvalue-boolean-void">2.13. <code>setMuted(value: boolean): void</code></a></li>
|
|
462
|
+
<li><a href="#gethighscore-number">2.14. <code>getHighScore(): number</code></a></li>
|
|
463
|
+
<li><a href="#sethighscorevalue-number-void">2.15. <code>setHighScore(value: number): void</code></a></li>
|
|
464
|
+
<li><a href="#subscribeproperty-stateproperty-callback-value-boolean-number-void-void">2.16. <code>subscribe(property: StateProperty, callback: (value: boolean | number) ⇒ void): void</code></a></li>
|
|
465
|
+
<li><a href="#unsubscribeproperty-stateproperty-callback-value-boolean-number-void-void">2.17. <code>unsubscribe(property: StateProperty, callback: (value: boolean | number) ⇒ void): void</code></a></li>
|
|
466
|
+
<li><a href="#turnon-void">2.18. <code>turnOn(): void</code></a></li>
|
|
467
|
+
<li><a href="#turnoff-void">2.19. <code>turnOff(): void</code></a></li>
|
|
468
|
+
<li><a href="#startgame-void">2.20. <code>startGame(): void</code></a></li>
|
|
469
|
+
<li><a href="#exitgame-void">2.21. <code>exitGame(): void</code></a></li>
|
|
470
|
+
<li><a href="#pause-void">2.22. <code>pause(): void</code></a></li>
|
|
471
|
+
<li><a href="#resume-void">2.23. <code>resume(): void</code></a></li>
|
|
472
|
+
<li><a href="#triggergameover-void">2.24. <code>triggerGameOver(): void</code></a></li>
|
|
473
|
+
<li><a href="#resetgame-void">2.25. <code>resetGame(): void</code></a></li>
|
|
474
|
+
<li><a href="#togglecolorenabled-void">2.26. <code>toggleColorEnabled(): void</code></a></li>
|
|
475
|
+
<li><a href="#togglemuted-void">2.27. <code>toggleMuted(): void</code></a></li>
|
|
476
|
+
<li><a href="#setpersistencekeykey-string-void">2.28. <code>setPersistenceKey(key: string): void</code></a></li>
|
|
477
|
+
<li><a href="#getpersistencekey-string">2.29. <code>getPersistenceKey(): string</code></a></li>
|
|
475
478
|
</ul>
|
|
476
479
|
</li>
|
|
477
480
|
<li><a href="#general-usage">3. General Usage</a></li>
|
|
@@ -611,7 +614,56 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
611
614
|
<hr>
|
|
612
615
|
</div>
|
|
613
616
|
<div class="sect2">
|
|
614
|
-
<h3 id="
|
|
617
|
+
<h3 id="istrackpadenabled-boolean"><a class="link" href="#istrackpadenabled-boolean">2.9. <code>isTrackpadEnabled(): boolean</code></a></h3>
|
|
618
|
+
<div class="paragraph">
|
|
619
|
+
<p>Returns <code>true</code> if the trackpad input method is enabled.</p>
|
|
620
|
+
</div>
|
|
621
|
+
<div class="paragraph">
|
|
622
|
+
<p><strong>Returns</strong></p>
|
|
623
|
+
</div>
|
|
624
|
+
<div class="paragraph">
|
|
625
|
+
<p><code>boolean</code> - <code>true</code> if the trackpad is active.</p>
|
|
626
|
+
</div>
|
|
627
|
+
<hr>
|
|
628
|
+
</div>
|
|
629
|
+
<div class="sect2">
|
|
630
|
+
<h3 id="settrackpadenabledvalue-boolean-void"><a class="link" href="#settrackpadenabledvalue-boolean-void">2.10. <code>setTrackpadEnabled(value: boolean): void</code></a></h3>
|
|
631
|
+
<div class="paragraph">
|
|
632
|
+
<p>Manually enables or disables the trackpad input method.</p>
|
|
633
|
+
</div>
|
|
634
|
+
<div class="paragraph">
|
|
635
|
+
<p><strong>Parameters</strong></p>
|
|
636
|
+
</div>
|
|
637
|
+
<table class="tableblock frame-all grid-all stretch">
|
|
638
|
+
<colgroup>
|
|
639
|
+
<col style="width: 20%;">
|
|
640
|
+
<col style="width: 20%;">
|
|
641
|
+
<col style="width: 60%;">
|
|
642
|
+
</colgroup>
|
|
643
|
+
<tbody>
|
|
644
|
+
<tr>
|
|
645
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Name</p></td>
|
|
646
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
|
|
647
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
|
|
648
|
+
</tr>
|
|
649
|
+
<tr>
|
|
650
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>value</code></p></td>
|
|
651
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>boolean</code></p></td>
|
|
652
|
+
<td class="tableblock halign-left valign-top"><p class="tableblock"><code>true</code> to enable trackpad, <code>false</code> for classic buttons.</p></td>
|
|
653
|
+
</tr>
|
|
654
|
+
</tbody>
|
|
655
|
+
</table>
|
|
656
|
+
<hr>
|
|
657
|
+
</div>
|
|
658
|
+
<div class="sect2">
|
|
659
|
+
<h3 id="toggletrackpadenabled-void"><a class="link" href="#toggletrackpadenabled-void">2.11. <code>toggleTrackpadEnabled(): void</code></a></h3>
|
|
660
|
+
<div class="paragraph">
|
|
661
|
+
<p>Toggles the trackpad input method.</p>
|
|
662
|
+
</div>
|
|
663
|
+
<hr>
|
|
664
|
+
</div>
|
|
665
|
+
<div class="sect2">
|
|
666
|
+
<h3 id="ismuted-boolean"><a class="link" href="#ismuted-boolean">2.12. <code>isMuted(): boolean</code></a></h3>
|
|
615
667
|
<div class="paragraph">
|
|
616
668
|
<p>Returns <code>true</code> if the audio system is suppressed.</p>
|
|
617
669
|
</div>
|
|
@@ -624,7 +676,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
624
676
|
<hr>
|
|
625
677
|
</div>
|
|
626
678
|
<div class="sect2">
|
|
627
|
-
<h3 id="setmutedvalue-boolean-void"><a class="link" href="#setmutedvalue-boolean-void">2.
|
|
679
|
+
<h3 id="setmutedvalue-boolean-void"><a class="link" href="#setmutedvalue-boolean-void">2.13. <code>setMuted(value: boolean): void</code></a></h3>
|
|
628
680
|
<div class="paragraph">
|
|
629
681
|
<p>Manually sets the audio suppression preference.</p>
|
|
630
682
|
</div>
|
|
@@ -653,7 +705,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
653
705
|
<hr>
|
|
654
706
|
</div>
|
|
655
707
|
<div class="sect2">
|
|
656
|
-
<h3 id="gethighscore-number"><a class="link" href="#gethighscore-number">2.
|
|
708
|
+
<h3 id="gethighscore-number"><a class="link" href="#gethighscore-number">2.14. <code>getHighScore(): number</code></a></h3>
|
|
657
709
|
<div class="paragraph">
|
|
658
710
|
<p>Retrieves the persistent high score for the current game.</p>
|
|
659
711
|
</div>
|
|
@@ -666,7 +718,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
666
718
|
<hr>
|
|
667
719
|
</div>
|
|
668
720
|
<div class="sect2">
|
|
669
|
-
<h3 id="sethighscorevalue-number-void"><a class="link" href="#sethighscorevalue-number-void">2.
|
|
721
|
+
<h3 id="sethighscorevalue-number-void"><a class="link" href="#sethighscorevalue-number-void">2.15. <code>setHighScore(value: number): void</code></a></h3>
|
|
670
722
|
<div class="paragraph">
|
|
671
723
|
<p>Updates the persistent high score.</p>
|
|
672
724
|
</div>
|
|
@@ -695,7 +747,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
695
747
|
<hr>
|
|
696
748
|
</div>
|
|
697
749
|
<div class="sect2">
|
|
698
|
-
<h3 id="subscribeproperty-stateproperty-callback-value-boolean-number-void-void"><a class="link" href="#subscribeproperty-stateproperty-callback-value-boolean-number-void-void">2.
|
|
750
|
+
<h3 id="subscribeproperty-stateproperty-callback-value-boolean-number-void-void"><a class="link" href="#subscribeproperty-stateproperty-callback-value-boolean-number-void-void">2.16. <code>subscribe(property: <a href="../../enums/StateProperty.html">StateProperty</a>, callback: (value: boolean | number) ⇒ void): void</code></a></h3>
|
|
699
751
|
<div class="paragraph">
|
|
700
752
|
<p>Registers a listener for changes to a specific state property.</p>
|
|
701
753
|
</div>
|
|
@@ -729,7 +781,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
729
781
|
<hr>
|
|
730
782
|
</div>
|
|
731
783
|
<div class="sect2">
|
|
732
|
-
<h3 id="unsubscribeproperty-stateproperty-callback-value-boolean-number-void-void"><a class="link" href="#unsubscribeproperty-stateproperty-callback-value-boolean-number-void-void">2.
|
|
784
|
+
<h3 id="unsubscribeproperty-stateproperty-callback-value-boolean-number-void-void"><a class="link" href="#unsubscribeproperty-stateproperty-callback-value-boolean-number-void-void">2.17. <code>unsubscribe(property: <a href="../../enums/StateProperty.html">StateProperty</a>, callback: (value: boolean | number) ⇒ void): void</code></a></h3>
|
|
733
785
|
<div class="paragraph">
|
|
734
786
|
<p>Removes a previously registered property listener.</p>
|
|
735
787
|
</div>
|
|
@@ -763,77 +815,77 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
763
815
|
<hr>
|
|
764
816
|
</div>
|
|
765
817
|
<div class="sect2">
|
|
766
|
-
<h3 id="turnon-void"><a class="link" href="#turnon-void">2.
|
|
818
|
+
<h3 id="turnon-void"><a class="link" href="#turnon-void">2.18. <code>turnOn(): void</code></a></h3>
|
|
767
819
|
<div class="paragraph">
|
|
768
820
|
<p>Powers up the engine.</p>
|
|
769
821
|
</div>
|
|
770
822
|
<hr>
|
|
771
823
|
</div>
|
|
772
824
|
<div class="sect2">
|
|
773
|
-
<h3 id="turnoff-void"><a class="link" href="#turnoff-void">2.
|
|
825
|
+
<h3 id="turnoff-void"><a class="link" href="#turnoff-void">2.19. <code>turnOff(): void</code></a></h3>
|
|
774
826
|
<div class="paragraph">
|
|
775
827
|
<p>Powers down the engine and saves state.</p>
|
|
776
828
|
</div>
|
|
777
829
|
<hr>
|
|
778
830
|
</div>
|
|
779
831
|
<div class="sect2">
|
|
780
|
-
<h3 id="startgame-void"><a class="link" href="#startgame-void">2.
|
|
832
|
+
<h3 id="startgame-void"><a class="link" href="#startgame-void">2.20. <code>startGame(): void</code></a></h3>
|
|
781
833
|
<div class="paragraph">
|
|
782
834
|
<p>Transitions from the menu to an active game session.</p>
|
|
783
835
|
</div>
|
|
784
836
|
<hr>
|
|
785
837
|
</div>
|
|
786
838
|
<div class="sect2">
|
|
787
|
-
<h3 id="exitgame-void"><a class="link" href="#exitgame-void">2.
|
|
839
|
+
<h3 id="exitgame-void"><a class="link" href="#exitgame-void">2.21. <code>exitGame(): void</code></a></h3>
|
|
788
840
|
<div class="paragraph">
|
|
789
841
|
<p>Ends the current game session and returns to the menu.</p>
|
|
790
842
|
</div>
|
|
791
843
|
<hr>
|
|
792
844
|
</div>
|
|
793
845
|
<div class="sect2">
|
|
794
|
-
<h3 id="pause-void"><a class="link" href="#pause-void">2.
|
|
846
|
+
<h3 id="pause-void"><a class="link" href="#pause-void">2.22. <code>pause(): void</code></a></h3>
|
|
795
847
|
<div class="paragraph">
|
|
796
848
|
<p>Toggles the gameplay state to paused.</p>
|
|
797
849
|
</div>
|
|
798
850
|
<hr>
|
|
799
851
|
</div>
|
|
800
852
|
<div class="sect2">
|
|
801
|
-
<h3 id="resume-void"><a class="link" href="#resume-void">2.
|
|
853
|
+
<h3 id="resume-void"><a class="link" href="#resume-void">2.23. <code>resume(): void</code></a></h3>
|
|
802
854
|
<div class="paragraph">
|
|
803
855
|
<p>Toggles the gameplay state back to playing.</p>
|
|
804
856
|
</div>
|
|
805
857
|
<hr>
|
|
806
858
|
</div>
|
|
807
859
|
<div class="sect2">
|
|
808
|
-
<h3 id="triggergameover-void"><a class="link" href="#triggergameover-void">2.
|
|
860
|
+
<h3 id="triggergameover-void"><a class="link" href="#triggergameover-void">2.24. <code>triggerGameOver(): void</code></a></h3>
|
|
809
861
|
<div class="paragraph">
|
|
810
862
|
<p>Transitions to the game over screen.</p>
|
|
811
863
|
</div>
|
|
812
864
|
<hr>
|
|
813
865
|
</div>
|
|
814
866
|
<div class="sect2">
|
|
815
|
-
<h3 id="resetgame-void"><a class="link" href="#resetgame-void">2.
|
|
867
|
+
<h3 id="resetgame-void"><a class="link" href="#resetgame-void">2.25. <code>resetGame(): void</code></a></h3>
|
|
816
868
|
<div class="paragraph">
|
|
817
869
|
<p>Resets session-specific state (score, grids) while maintaining high score and preferences.</p>
|
|
818
870
|
</div>
|
|
819
871
|
<hr>
|
|
820
872
|
</div>
|
|
821
873
|
<div class="sect2">
|
|
822
|
-
<h3 id="togglecolorenabled-void"><a class="link" href="#togglecolorenabled-void">2.
|
|
874
|
+
<h3 id="togglecolorenabled-void"><a class="link" href="#togglecolorenabled-void">2.26. <code>toggleColorEnabled(): void</code></a></h3>
|
|
823
875
|
<div class="paragraph">
|
|
824
876
|
<p>Flips the current <code>colorEnabled</code> flag.</p>
|
|
825
877
|
</div>
|
|
826
878
|
<hr>
|
|
827
879
|
</div>
|
|
828
880
|
<div class="sect2">
|
|
829
|
-
<h3 id="togglemuted-void"><a class="link" href="#togglemuted-void">2.
|
|
881
|
+
<h3 id="togglemuted-void"><a class="link" href="#togglemuted-void">2.27. <code>toggleMuted(): void</code></a></h3>
|
|
830
882
|
<div class="paragraph">
|
|
831
883
|
<p>Flips the current <code>muted</code> flag.</p>
|
|
832
884
|
</div>
|
|
833
885
|
<hr>
|
|
834
886
|
</div>
|
|
835
887
|
<div class="sect2">
|
|
836
|
-
<h3 id="setpersistencekeykey-string-void"><a class="link" href="#setpersistencekeykey-string-void">2.
|
|
888
|
+
<h3 id="setpersistencekeykey-string-void"><a class="link" href="#setpersistencekeykey-string-void">2.28. <code>setPersistenceKey(key: string): void</code></a></h3>
|
|
837
889
|
<div class="paragraph">
|
|
838
890
|
<p>Sets the unique namespace used for <code>localStorage</code>.</p>
|
|
839
891
|
</div>
|
|
@@ -862,7 +914,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
862
914
|
<hr>
|
|
863
915
|
</div>
|
|
864
916
|
<div class="sect2">
|
|
865
|
-
<h3 id="getpersistencekey-string"><a class="link" href="#getpersistencekey-string">2.
|
|
917
|
+
<h3 id="getpersistencekey-string"><a class="link" href="#getpersistencekey-string">2.29. <code>getPersistenceKey(): string</code></a></h3>
|
|
866
918
|
<div class="paragraph">
|
|
867
919
|
<p>Returns the active namespace prefix.</p>
|
|
868
920
|
</div>
|