brick-engine-js 1.0.39 → 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.
@@ -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="Manages the engine's logical clock, decoupling game logic ticks from the visual frame rate.">
8
+ <meta name="description" content="Orchestrates the engine's logical clock and performance metrics.">
9
9
  <meta name="keywords" content="time, clock, tick, interval, game-loop">
10
10
  <title>GameTime Module 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">
@@ -446,19 +446,27 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
446
446
  <li><a href="#architectural-purpose">1. Architectural Purpose</a></li>
447
447
  <li><a href="#api-reference">2. API Reference</a>
448
448
  <ul class="sectlevel2">
449
- <li><a href="#tickinterval-number">2.1. <code>tickInterval: number</code></a></li>
450
- <li><a href="#totalticks-number">2.2. <code>totalTicks: number</code></a></li>
451
- <li><a href="#elapsedtime-number">2.3. <code>elapsedTime: number</code></a></li>
452
- <li><a href="#shouldtick-boolean">2.4. <code>shouldTick(): boolean</code></a></li>
453
- <li><a href="#updatedeltatime-number-void">2.5. <code>update(deltaTime: number): void</code></a></li>
454
- <li><a href="#reset-void">2.6. <code>reset(): void</code></a></li>
455
- <li><a href="#istickeveryinterval-number-boolean">2.7. <code>isTickEvery(interval: number): boolean</code></a></li>
456
- <li><a href="#incrementtickintervalamount-number-void">2.8. <code>incrementTickInterval(amount: number): void</code></a></li>
457
- <li><a href="#decrementtickintervalamount-number-void">2.9. <code>decrementTickInterval(amount: number): void</code></a></li>
458
- <li><a href="#settickintervalinterval-number-void">2.10. <code>setTickInterval(interval: number): void</code></a></li>
459
- <li><a href="#setmintickintervalinterval-number-void">2.11. <code>setMinTickInterval(interval: number): void</code></a></li>
460
- <li><a href="#getdebugdata-recordstring-string-number-boolean">2.12. <code>getDebugData(): Record&lt;string, string | number | boolean&gt;</code></a></li>
461
- <li><a href="#captureinitialstate-void">2.13. <code>captureInitialState(): void</code></a></li>
449
+ <li><a href="#core-loop-control">2.1. Core Loop Control</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>
455
+ </ul>
456
+ </li>
457
+ <li><a href="#declarative-timing">2.2. Declarative Timing</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: () &#8658; void): void</code></a></li>
461
+ </ul>
462
+ </li>
463
+ <li><a href="#persistence-debug">2.3. Persistence &amp; Debug</a>
464
+ <ul class="sectlevel3">
465
+ <li><a href="#getdebugdata-recordstring-string-number-boolean">2.3.1. <code>getDebugData(): Record&lt;string, string | number | boolean&gt;</code></a></li>
466
+ <li><a href="#serialize-string">2.3.2. <code>serialize(): string</code></a></li>
467
+ <li><a href="#deserializedata-string-void">2.3.3. <code>deserialize(data: string): void</code></a></li>
468
+ </ul>
469
+ </li>
462
470
  </ul>
463
471
  </li>
464
472
  </ul>
@@ -469,7 +477,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
469
477
  <h2 id="architectural-purpose"><a class="link" href="#architectural-purpose">1. Architectural Purpose</a></h2>
470
478
  <div class="sectionbody">
471
479
  <div class="paragraph">
472
- <p>The <code>GameTime</code> module manages the engine&#8217;s logical clock independent of the visual context. By decoupling the deterministic game logic "ticks" from the unpredictable visual frame rate of the browser, it ensures consistent gameplay speed and difficulty-progression physics regardless of the device&#8217;s hardware performance capabilities.</p>
480
+ <p>The <code>GameTime</code> module is designed to decouple deterministic game logic "ticks" from the unpredictable visual frame rate of the browser. By maintaining an internal time accumulator, it ensures that gameplay events (like physics, timers, and difficulty scaling) execute at a consistent speed regardless of the host device&#8217;s hardware performance or FPS fluctuations.</p>
473
481
  </div>
474
482
  </div>
475
483
  </div>
@@ -477,61 +485,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
477
485
  <h2 id="api-reference"><a class="link" href="#api-reference">2. API Reference</a></h2>
478
486
  <div class="sectionbody">
479
487
  <div class="sect2">
480
- <h3 id="tickinterval-number"><a class="link" href="#tickinterval-number">2.1. <code>tickInterval: number</code></a></h3>
481
- <div class="paragraph">
482
- <p>Getter/Setter for the game logic speed in milliseconds.</p>
483
- </div>
484
- <div class="paragraph">
485
- <p><strong>Returns</strong></p>
486
- </div>
487
- <div class="paragraph">
488
- <p><code>number</code> - The current time between logic ticks.</p>
489
- </div>
490
- <div class="paragraph">
491
- <p><strong>Behavior</strong></p>
492
- </div>
493
- <div class="paragraph">
494
- <p>Lowering this value makes the game run faster (e.g., used for difficulty progression).</p>
495
- </div>
496
- <hr>
497
- </div>
498
- <div class="sect2">
499
- <h3 id="totalticks-number"><a class="link" href="#totalticks-number">2.2. <code>totalTicks: number</code></a></h3>
500
- <div class="paragraph">
501
- <p>Read-only property returning the total number of logic ticks that have occurred since the game started.</p>
502
- </div>
503
- <hr>
504
- </div>
505
- <div class="sect2">
506
- <h3 id="elapsedtime-number"><a class="link" href="#elapsedtime-number">2.3. <code>elapsedTime: number</code></a></h3>
507
- <div class="paragraph">
508
- <p>Read-only property returning the total time in milliseconds elapsed since the game started.</p>
509
- </div>
510
- <hr>
511
- </div>
512
- <div class="sect2">
513
- <h3 id="shouldtick-boolean"><a class="link" href="#shouldtick-boolean">2.4. <code>shouldTick(): boolean</code></a></h3>
514
- <div class="paragraph">
515
- <p>Determines if a logic update should be executed.</p>
516
- </div>
517
- <div class="paragraph">
518
- <p><strong>Returns</strong></p>
519
- </div>
520
- <div class="paragraph">
521
- <p><code>boolean</code> - <code>true</code> if the internal ticker buffer (accumulator) has exceeded the <code>tickInterval</code>.</p>
522
- </div>
488
+ <h3 id="core-loop-control"><a class="link" href="#core-loop-control">2.1. Core Loop Control</a></h3>
523
489
  <div class="paragraph">
524
- <p><strong>Behavior</strong></p>
525
- </div>
526
- <div class="paragraph">
527
- <p>Called by the main loop. If it returns true, it automatically subtracts the <code>tickInterval</code> from the <code>tickAccumulator</code> to maintain a stable clock.</p>
528
- </div>
529
- <hr>
490
+ <p>These methods are used by the engine&#8217;s main loop to synchronize logical state updates with the physical rendering time.</p>
530
491
  </div>
531
- <div class="sect2">
532
- <h3 id="updatedeltatime-number-void"><a class="link" href="#updatedeltatime-number-void">2.5. <code>update(deltaTime: number): void</code></a></h3>
492
+ <div class="sect3">
493
+ <h4 id="updatedeltatime-number-void"><a class="link" href="#updatedeltatime-number-void">2.1.1. <code>update(deltaTime: number): void</code></a></h4>
533
494
  <div class="paragraph">
534
- <p>Advances the internal time buffer (tick accumulator).</p>
495
+ <p>Calculates the current physical performance metrics (FPS/TPS). This method should be called exactly once per visual frame.</p>
535
496
  </div>
536
497
  <div class="paragraph">
537
498
  <p><strong>Parameters</strong></p>
@@ -551,29 +512,16 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
551
512
  <tr>
552
513
  <td class="tableblock halign-left valign-top"><p class="tableblock"><code>deltaTime</code></p></td>
553
514
  <td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
554
- <td class="tableblock halign-left valign-top"><p class="tableblock">Time physically elapsed since the last rendering frame (in milliseconds).</p></td>
515
+ <td class="tableblock halign-left valign-top"><p class="tableblock">The physical time elapsed since the last rendering frame in milliseconds.</p></td>
555
516
  </tr>
556
517
  </tbody>
557
518
  </table>
558
519
  <hr>
559
520
  </div>
560
- <div class="sect2">
561
- <h3 id="reset-void"><a class="link" href="#reset-void">2.6. <code>reset(): void</code></a></h3>
521
+ <div class="sect3">
522
+ <h4 id="accumulatedeltatime-number-void"><a class="link" href="#accumulatedeltatime-number-void">2.1.2. <code>accumulate(deltaTime: number): void</code></a></h4>
562
523
  <div class="paragraph">
563
- <p>Clears the tick accumulator.</p>
564
- </div>
565
- <div class="paragraph">
566
- <p><strong>Behavior</strong></p>
567
- </div>
568
- <div class="paragraph">
569
- <p>Prevents a "burst" of logic updates after resuming from a long pause or game restart.</p>
570
- </div>
571
- <hr>
572
- </div>
573
- <div class="sect2">
574
- <h3 id="istickeveryinterval-number-boolean"><a class="link" href="#istickeveryinterval-number-boolean">2.7. <code>isTickEvery(interval: number): boolean</code></a></h3>
575
- <div class="paragraph">
576
- <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 (e.g., spawning an item every 20 ticks).</p>
524
+ <p>Adds elapsed time to the logical simulation accumulator. This allows the engine to track how much logical time needs to be processed.</p>
577
525
  </div>
578
526
  <div class="paragraph">
579
527
  <p><strong>Parameters</strong></p>
@@ -591,53 +539,56 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
591
539
  <td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
592
540
  </tr>
593
541
  <tr>
594
- <td class="tableblock halign-left valign-top"><p class="tableblock"><code>interval</code></p></td>
542
+ <td class="tableblock halign-left valign-top"><p class="tableblock"><code>deltaTime</code></p></td>
595
543
  <td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
596
- <td class="tableblock halign-left valign-top"><p class="tableblock">The tick frequency interval constraint to check against.</p></td>
544
+ <td class="tableblock halign-left valign-top"><p class="tableblock">Time in milliseconds to add to the logic simulation.</p></td>
597
545
  </tr>
598
546
  </tbody>
599
547
  </table>
548
+ <hr>
549
+ </div>
550
+ <div class="sect3">
551
+ <h4 id="shouldtick-boolean"><a class="link" href="#shouldtick-boolean">2.1.3. <code>shouldTick(): boolean</code></a></h4>
552
+ <div class="paragraph">
553
+ <p>Evaluates if the engine should execute a logical simulation tick based on the accumulated time.</p>
554
+ </div>
600
555
  <div class="paragraph">
601
556
  <p><strong>Returns</strong></p>
602
557
  </div>
603
558
  <div class="paragraph">
604
- <p><code>boolean</code> - <code>true</code> if the current tick is a multiple of the interval (and greater than 0).</p>
559
+ <p><code>boolean</code> - <code>true</code> if at least one tick&#8217;s worth of time was consumed from the accumulator.</p>
560
+ </div>
561
+ <div class="paragraph">
562
+ <p><strong>Behavior</strong></p>
563
+ </div>
564
+ <div class="paragraph">
565
+ <p>When this method returns <code>true</code>, it has already internally consumed all pending ticks from the <code>_tickAccumulator</code> to prevent "speed-up" bursts after lag, while allowing the caller to perform a single logical update.</p>
605
566
  </div>
606
567
  <hr>
607
568
  </div>
608
- <div class="sect2">
609
- <h3 id="incrementtickintervalamount-number-void"><a class="link" href="#incrementtickintervalamount-number-void">2.8. <code>incrementTickInterval(amount: number): void</code></a></h3>
569
+ <div class="sect3">
570
+ <h4 id="reset-void"><a class="link" href="#reset-void">2.1.4. <code>reset(): void</code></a></h4>
610
571
  <div class="paragraph">
611
- <p>Slows down the game by increasing the time between ticks.</p>
572
+ <p>Resets all internal timers, statistical accumulators, and logical counters to their baseline values.</p>
612
573
  </div>
613
574
  <div class="paragraph">
614
- <p><strong>Parameters</strong></p>
575
+ <p><strong>Behavior</strong></p>
576
+ </div>
577
+ <div class="paragraph">
578
+ <p>Prevents a "burst" of logic updates after resuming from a long pause or game restart by clearing the time accumulator.</p>
615
579
  </div>
616
- <table class="tableblock frame-all grid-all stretch">
617
- <colgroup>
618
- <col style="width: 20%;">
619
- <col style="width: 20%;">
620
- <col style="width: 60%;">
621
- </colgroup>
622
- <tbody>
623
- <tr>
624
- <td class="tableblock halign-left valign-top"><p class="tableblock">Name</p></td>
625
- <td class="tableblock halign-left valign-top"><p class="tableblock">Type</p></td>
626
- <td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
627
- </tr>
628
- <tr>
629
- <td class="tableblock halign-left valign-top"><p class="tableblock"><code>amount</code></p></td>
630
- <td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
631
- <td class="tableblock halign-left valign-top"><p class="tableblock">Milliseconds to add to the interval.</p></td>
632
- </tr>
633
- </tbody>
634
- </table>
635
580
  <hr>
636
581
  </div>
582
+ </div>
637
583
  <div class="sect2">
638
- <h3 id="decrementtickintervalamount-number-void"><a class="link" href="#decrementtickintervalamount-number-void">2.9. <code>decrementTickInterval(amount: number): void</code></a></h3>
584
+ <h3 id="declarative-timing"><a class="link" href="#declarative-timing">2.2. Declarative Timing</a></h3>
639
585
  <div class="paragraph">
640
- <p>Speeds up the game by decreasing the time between ticks.</p>
586
+ <p>These methods provide a high-level API for developers to schedule events based on logical game time rather than raw frame counts.</p>
587
+ </div>
588
+ <div class="sect3">
589
+ <h4 id="atintervalms-number-boolean"><a class="link" href="#atintervalms-number-boolean">2.2.1. <code>atInterval(ms: number): boolean</code></a></h4>
590
+ <div class="paragraph">
591
+ <p>Checks if the logical game clock has just crossed a multiple of the specified millisecond interval.</p>
641
592
  </div>
642
593
  <div class="paragraph">
643
594
  <p><strong>Parameters</strong></p>
@@ -655,18 +606,34 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
655
606
  <td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
656
607
  </tr>
657
608
  <tr>
658
- <td class="tableblock halign-left valign-top"><p class="tableblock"><code>amount</code></p></td>
609
+ <td class="tableblock halign-left valign-top"><p class="tableblock"><code>ms</code></p></td>
659
610
  <td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
660
- <td class="tableblock halign-left valign-top"><p class="tableblock">Milliseconds to subtract from the interval.</p></td>
611
+ <td class="tableblock halign-left valign-top"><p class="tableblock">The millisecond interval to check against.</p></td>
661
612
  </tr>
662
613
  </tbody>
663
614
  </table>
615
+ <div class="paragraph">
616
+ <p><strong>Returns</strong></p>
617
+ </div>
618
+ <div class="paragraph">
619
+ <p><code>boolean</code> - <code>true</code> if the logical clock just crossed a boundary of the interval.</p>
620
+ </div>
621
+ <div class="paragraph">
622
+ <p><strong>Example</strong></p>
623
+ </div>
624
+ <div class="listingblock">
625
+ <div class="content">
626
+ <pre class="highlightjs highlight"><code class="language-typescript hljs" data-lang="typescript">if (time.atInterval(500)) {
627
+ this.blink();
628
+ }</code></pre>
629
+ </div>
630
+ </div>
664
631
  <hr>
665
632
  </div>
666
- <div class="sect2">
667
- <h3 id="settickintervalinterval-number-void"><a class="link" href="#settickintervalinterval-number-void">2.10. <code>setTickInterval(interval: number): void</code></a></h3>
633
+ <div class="sect3">
634
+ <h4 id="everyms-number-action-void-void"><a class="link" href="#everyms-number-action-void-void">2.2.2. <code>every(ms: number, action: () &#8658; void): void</code></a></h4>
668
635
  <div class="paragraph">
669
- <p>Sets the tick interval exactly to the specified value.</p>
636
+ <p>Executes a callback function every N milliseconds of logical game time.</p>
670
637
  </div>
671
638
  <div class="paragraph">
672
639
  <p><strong>Parameters</strong></p>
@@ -684,18 +651,63 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
684
651
  <td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
685
652
  </tr>
686
653
  <tr>
687
- <td class="tableblock halign-left valign-top"><p class="tableblock"><code>interval</code></p></td>
654
+ <td class="tableblock halign-left valign-top"><p class="tableblock"><code>ms</code></p></td>
688
655
  <td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
689
- <td class="tableblock halign-left valign-top"><p class="tableblock">The precise new integer interval interval between logic updates (in milliseconds).</p></td>
656
+ <td class="tableblock halign-left valign-top"><p class="tableblock">The millisecond interval between executions.</p></td>
657
+ </tr>
658
+ <tr>
659
+ <td class="tableblock halign-left valign-top"><p class="tableblock"><code>action</code></p></td>
660
+ <td class="tableblock halign-left valign-top"><p class="tableblock"><code>() &#8658; void</code></p></td>
661
+ <td class="tableblock halign-left valign-top"><p class="tableblock">The callback function to execute.</p></td>
690
662
  </tr>
691
663
  </tbody>
692
664
  </table>
665
+ <div class="paragraph">
666
+ <p><strong>Example</strong></p>
667
+ </div>
668
+ <div class="listingblock">
669
+ <div class="content">
670
+ <pre class="highlightjs highlight"><code class="language-typescript hljs" data-lang="typescript">time.every(1000, () =&gt; this.spawnEnemy());</code></pre>
671
+ </div>
672
+ </div>
693
673
  <hr>
694
674
  </div>
675
+ </div>
695
676
  <div class="sect2">
696
- <h3 id="setmintickintervalinterval-number-void"><a class="link" href="#setmintickintervalinterval-number-void">2.11. <code>setMinTickInterval(interval: number): void</code></a></h3>
677
+ <h3 id="persistence-debug"><a class="link" href="#persistence-debug">2.3. Persistence &amp; Debug</a></h3>
697
678
  <div class="paragraph">
698
- <p>Sets the minimum limit for the tick interval, preventing the game from speeding up beyond this point.</p>
679
+ <p>Methods for state serialization and performance inspection.</p>
680
+ </div>
681
+ <div class="sect3">
682
+ <h4 id="getdebugdata-recordstring-string-number-boolean"><a class="link" href="#getdebugdata-recordstring-string-number-boolean">2.3.1. <code>getDebugData(): Record&lt;string, string | number | boolean&gt;</code></a></h4>
683
+ <div class="paragraph">
684
+ <p>Returns metadata for the real-time debugger and performance monitoring.</p>
685
+ </div>
686
+ <div class="paragraph">
687
+ <p><strong>Returns</strong></p>
688
+ </div>
689
+ <div class="paragraph">
690
+ <p><code>Record&lt;string, string | number | boolean&gt;</code> - Object containing <code>fps</code>, <code>tps</code>, and <code>elapsedTime</code>.</p>
691
+ </div>
692
+ <hr>
693
+ </div>
694
+ <div class="sect3">
695
+ <h4 id="serialize-string"><a class="link" href="#serialize-string">2.3.2. <code>serialize(): string</code></a></h4>
696
+ <div class="paragraph">
697
+ <p>Converts the persistent time state into a JSON string.</p>
698
+ </div>
699
+ <div class="paragraph">
700
+ <p><strong>Returns</strong></p>
701
+ </div>
702
+ <div class="paragraph">
703
+ <p><code>string</code> - The serialized state.</p>
704
+ </div>
705
+ <hr>
706
+ </div>
707
+ <div class="sect3">
708
+ <h4 id="deserializedata-string-void"><a class="link" href="#deserializedata-string-void">2.3.3. <code>deserialize(data: string): void</code></a></h4>
709
+ <div class="paragraph">
710
+ <p>Restores the time state from a JSON string.</p>
699
711
  </div>
700
712
  <div class="paragraph">
701
713
  <p><strong>Parameters</strong></p>
@@ -713,37 +725,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
713
725
  <td class="tableblock halign-left valign-top"><p class="tableblock">Description</p></td>
714
726
  </tr>
715
727
  <tr>
716
- <td class="tableblock halign-left valign-top"><p class="tableblock"><code>interval</code></p></td>
717
- <td class="tableblock halign-left valign-top"><p class="tableblock"><code>number</code></p></td>
718
- <td class="tableblock halign-left valign-top"><p class="tableblock">The strict minimum boundary interval allowed (in milliseconds).</p></td>
728
+ <td class="tableblock halign-left valign-top"><p class="tableblock"><code>data</code></p></td>
729
+ <td class="tableblock halign-left valign-top"><p class="tableblock"><code>string</code></p></td>
730
+ <td class="tableblock halign-left valign-top"><p class="tableblock">The JSON string containing the state.</p></td>
719
731
  </tr>
720
732
  </tbody>
721
733
  </table>
722
- <hr>
723
- </div>
724
- <div class="sect2">
725
- <h3 id="getdebugdata-recordstring-string-number-boolean"><a class="link" href="#getdebugdata-recordstring-string-number-boolean">2.12. <code>getDebugData(): Record&lt;string, string | number | boolean&gt;</code></a></h3>
726
- <div class="paragraph">
727
- <p>Returns metadata for the real-time debugger.</p>
728
- </div>
729
- <div class="paragraph">
730
- <p><strong>Returns</strong></p>
731
- </div>
732
- <div class="paragraph">
733
- <p><code>Record&lt;string, string | number | boolean&gt;</code> - Object containing <code>fps</code> (Frames Per Second), <code>tps</code> (Ticks Per Second), <code>tick_interval</code>, and <code>tick_accumulator</code>.</p>
734
- </div>
735
- <hr>
736
- </div>
737
- <div class="sect2">
738
- <h3 id="captureinitialstate-void"><a class="link" href="#captureinitialstate-void">2.13. <code>captureInitialState(): void</code></a></h3>
739
- <div class="paragraph">
740
- <p>Captures the current <code>tickInterval</code> as the starting speed for the game session.</p>
741
- </div>
742
- <div class="paragraph">
743
- <p><strong>Behavior</strong></p>
744
- </div>
745
- <div class="paragraph">
746
- <p>This method is called by the <code>Game</code> engine after the game-specific <code>setupGame()</code> has executed. It ensures that when <code>reset()</code> is called, the game returns to its intended initial speed rather than the engine&#8217;s global default.</p>
747
734
  </div>
748
735
  </div>
749
736
  </div>