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.
Files changed (53) hide show
  1. package/README.adoc +7 -2
  2. package/dist/docs/getting-started.html +1 -1
  3. package/dist/docs/index.html +17 -1
  4. package/dist/docs/publishing.html +1 -1
  5. package/dist/docs/reference/context/RendererContext.html +584 -0
  6. package/dist/docs/reference/{types/GameEntry.html → enums/EventSuffix.html} +21 -22
  7. package/dist/docs/reference/helpers/CoordinateHelper.html +10 -35
  8. package/dist/docs/reference/helpers/RelativeValuesHelper.html +4 -14
  9. package/dist/docs/reference/interfaces/GameModules.html +14 -9
  10. package/dist/docs/reference/{modules/GameMenu.html → interfaces/StateContext.html} +50 -71
  11. package/dist/docs/reference/interfaces/modules/Score.html +6 -6
  12. package/dist/docs/reference/interfaces/modules/Session.html +31 -1
  13. package/dist/docs/reference/modules/EventEmitter.html +624 -0
  14. package/dist/docs/reference/modules/Game.html +18 -136
  15. package/dist/docs/reference/modules/GameControl.html +170 -9
  16. package/dist/docs/reference/modules/GameEventRegistry.html +605 -0
  17. package/dist/docs/reference/modules/GameScore.html +40 -10
  18. package/dist/docs/reference/modules/GameSession.html +37 -7
  19. package/dist/docs/reference/modules/GameState.html +119 -6
  20. package/dist/docs/reference/modules/InitialStateSnapshot.html +5 -2
  21. package/dist/docs/reference/view/GameView.html +606 -0
  22. package/dist/game.bundle.js +1 -1
  23. package/dist/types/bootstrap.d.ts +1 -1
  24. package/dist/types/core/Game.d.ts +16 -5
  25. package/dist/types/core/context/RendererContext.d.ts +25 -0
  26. package/dist/types/core/context/RendererContext.test.d.ts +1 -0
  27. package/dist/types/core/event/EventEmitter.d.ts +71 -0
  28. package/dist/types/core/event/EventEmitter.test.d.ts +1 -0
  29. package/dist/types/core/event/GameEventRegistry.d.ts +28 -0
  30. package/dist/types/core/event/GameEventRegistry.test.d.ts +1 -0
  31. package/dist/types/core/helpers/CoordinateHelper.d.ts +5 -11
  32. package/dist/types/core/helpers/RelativeValuesHelper.d.ts +2 -5
  33. package/dist/types/core/module/control/GameControl.d.ts +11 -15
  34. package/dist/types/core/module/renderer/DisplayRenderer.d.ts +0 -8
  35. package/dist/types/core/module/renderer/GameRenderer.d.ts +0 -8
  36. package/dist/types/core/module/renderer/HudRenderer.d.ts +0 -8
  37. package/dist/types/core/module/score/GameScore.d.ts +5 -3
  38. package/dist/types/core/module/session/GameSession.d.ts +0 -1
  39. package/dist/types/core/module/state/GameState.d.ts +12 -16
  40. package/dist/types/core/module/text/GameText.d.ts +0 -9
  41. package/dist/types/core/types/modules.d.ts +77 -7
  42. package/dist/types/index.d.ts +2 -0
  43. package/dist/types/view/Debugger.d.ts +1 -3
  44. package/dist/types/view/GameView.d.ts +1 -2
  45. package/dist/types/view/SessionModal.d.ts +1 -3
  46. package/dist/types/view/components/layout/ButtonLayout.d.ts +1 -1
  47. package/dist/types/view/components/layout/ContainerLayout.d.ts +1 -1
  48. package/dist/types/view/components/layout/FrameLayout.d.ts +1 -1
  49. package/dist/types/view/components/ui/BigButton.d.ts +1 -1
  50. package/dist/types/view/components/ui/Button.d.ts +1 -1
  51. package/dist/types/view/components/ui/Canvas.d.ts +1 -1
  52. package/dist/types/view/components/ui/SmallButton.d.ts +1 -1
  53. package/package.json +1 -1
package/README.adoc CHANGED
@@ -56,7 +56,7 @@ The engine is organized into the following core modules:
56
56
  | Module | Description
57
57
 
58
58
  | xref:docs/reference/modules/Game.adoc[Game (Core)]
59
- | The central orchestrator. It manages the main loop (ticks and frames), and coordinates dynamic game loading and transitions via an instance-based switch handler.
59
+ | The central orchestrator. It manages the main loop (ticks and frames) and maintains the lifecycle of all engine modules.
60
60
 
61
61
  | xref:docs/reference/modules/GameGrid.adoc[GameGrid]
62
62
  | Manages the 2D grid data structure. Handles cell values, colors, row/column operations, and collision detection. Includes `GameHudGrid` for custom HUD content.
@@ -81,4 +81,9 @@ The engine is organized into the following core modules:
81
81
 
82
82
  | xref:docs/reference/modules/GameScore.adoc[GameScore]
83
83
  | Tracks session score, level logic, and syncs high scores with `GameState`.
84
- |===
84
+ |===
85
+
86
+ == Core Utilities
87
+
88
+ * **xref:docs/reference/event/EventEmitter.adoc[EventEmitter]**: Global Pub/Sub bus for decoupled communication.
89
+ * **xref:docs/reference/context/RendererContext.adoc[RendererContext]**: Central provider for the P5.js instance, eliminating the need for manual dependency injection in components.
@@ -634,7 +634,7 @@ export default class MyGame extends Game {
634
634
  </div>
635
635
  <div id="footer">
636
636
  <div id="footer-text">
637
- Last updated 2026-02-23 16:20:59 -0300
637
+ Last updated 2026-02-24 23:24:58 -0300
638
638
  </div>
639
639
  </div>
640
640
  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/highlight.min.js"></script>
@@ -448,6 +448,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
448
448
  <li><a href="#getting-started">3. Getting Started</a></li>
449
449
  <li><a href="#publishing-your-game">4. Publishing Your Game</a></li>
450
450
  <li><a href="#structure">5. Structure</a></li>
451
+ <li><a href="#core-utilities">6. Core Utilities</a></li>
451
452
  </ul>
452
453
  </div>
453
454
  </div>
@@ -539,7 +540,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
539
540
  <tbody>
540
541
  <tr>
541
542
  <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="reference/modules/Game.html">Game (Core)</a></p></td>
542
- <td class="tableblock halign-left valign-top"><p class="tableblock">The central orchestrator. It manages the main loop (ticks and frames), and coordinates dynamic game loading and transitions via an instance-based switch handler.</p></td>
543
+ <td class="tableblock halign-left valign-top"><p class="tableblock">The central orchestrator. It manages the main loop (ticks and frames) and maintains the lifecycle of all engine modules.</p></td>
543
544
  </tr>
544
545
  <tr>
545
546
  <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="reference/modules/GameGrid.html">GameGrid</a></p></td>
@@ -577,6 +578,21 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
577
578
  </table>
578
579
  </div>
579
580
  </div>
581
+ <div class="sect1">
582
+ <h2 id="core-utilities"><a class="link" href="#core-utilities">6. Core Utilities</a></h2>
583
+ <div class="sectionbody">
584
+ <div class="ulist">
585
+ <ul>
586
+ <li>
587
+ <p><strong><a href="reference/event/EventEmitter.html">EventEmitter</a></strong>: Global Pub/Sub bus for decoupled communication.</p>
588
+ </li>
589
+ <li>
590
+ <p><strong><a href="reference/context/RendererContext.html">RendererContext</a></strong>: Central provider for the P5.js instance, eliminating the need for manual dependency injection in components.</p>
591
+ </li>
592
+ </ul>
593
+ </div>
594
+ </div>
595
+ </div>
580
596
  </div>
581
597
  <div id="footer">
582
598
  <div id="footer-text">
@@ -559,7 +559,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
559
559
  </div>
560
560
  <div id="footer">
561
561
  <div id="footer-text">
562
- Last updated 2026-02-23 16:10:29 -0300
562
+ Last updated 2026-02-24 23:18:56 -0300
563
563
  </div>
564
564
  </div>
565
565
  <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.3/highlight.min.js"></script>