brick-engine-js 1.0.1 → 1.0.2

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 (225) hide show
  1. package/dist/docs/GAME_DEVELOPER_GUIDE.html +1 -1
  2. package/dist/docs/brick-engine-guide.html +1 -1
  3. package/dist/docs/getting-started.html +1 -1
  4. package/dist/docs/jsdoc_standard.html +1 -1
  5. package/dist/docs/publishing.html +1 -1
  6. package/dist/docs/reference/interfaces/modules/Session.html +1 -1
  7. package/dist/docs/reference/modules/GameMenu.html +1 -1
  8. package/dist/docs/reference/modules/GameSession.html +1 -1
  9. package/dist/docs/reference/modules/InitialStateSnapshot.html +1 -1
  10. package/dist/docs/reference/modules/SessionModal.html +1 -1
  11. package/dist/docs/testing_best_practices.html +1 -1
  12. package/package.json +7 -1
  13. package/.env.local.example +0 -2
  14. package/.github/workflows/publish.yml +0 -73
  15. package/.prettierignore +0 -2
  16. package/.prettierrc.json +0 -8
  17. package/eslint.config.mjs +0 -29
  18. package/public/CNAME +0 -1
  19. package/public/docs/GAME_DEVELOPER_GUIDE.html +0 -727
  20. package/public/docs/brick-engine-guide.html +0 -610
  21. package/public/docs/diagrams/lifecycle.mmd +0 -19
  22. package/public/docs/documentation_style_guide.html +0 -994
  23. package/public/docs/getting-started.html +0 -648
  24. package/public/docs/images/lifecycle.svg +0 -1
  25. package/public/docs/index.html +0 -593
  26. package/public/docs/jsdoc_standard.html +0 -656
  27. package/public/docs/publishing.html +0 -573
  28. package/public/docs/reference/enums/Color.html +0 -533
  29. package/public/docs/reference/enums/ControlEventType.html +0 -505
  30. package/public/docs/reference/enums/ControlKey.html +0 -529
  31. package/public/docs/reference/enums/FontAlignment.html +0 -545
  32. package/public/docs/reference/enums/FontSize.html +0 -517
  33. package/public/docs/reference/enums/Sound.html +0 -558
  34. package/public/docs/reference/enums/StateProperty.html +0 -525
  35. package/public/docs/reference/helpers/CellHelper.html +0 -520
  36. package/public/docs/reference/helpers/ControlInputHandlerHelper.html +0 -569
  37. package/public/docs/reference/helpers/CoordinateHelper.html +0 -703
  38. package/public/docs/reference/helpers/RelativeValuesHelper.html +0 -560
  39. package/public/docs/reference/interfaces/Debuggable.html +0 -501
  40. package/public/docs/reference/interfaces/GameModules.html +0 -544
  41. package/public/docs/reference/interfaces/Initializable.html +0 -495
  42. package/public/docs/reference/interfaces/RendererInitializable.html +0 -517
  43. package/public/docs/reference/interfaces/StateSyncable.html +0 -542
  44. package/public/docs/reference/interfaces/modules/Control.html +0 -648
  45. package/public/docs/reference/interfaces/modules/Grid.html +0 -1256
  46. package/public/docs/reference/interfaces/modules/Renderer.html +0 -522
  47. package/public/docs/reference/interfaces/modules/RendererComposite.html +0 -577
  48. package/public/docs/reference/interfaces/modules/Score.html +0 -669
  49. package/public/docs/reference/interfaces/modules/Session.html +0 -585
  50. package/public/docs/reference/interfaces/modules/State.html +0 -897
  51. package/public/docs/reference/interfaces/modules/Text.html +0 -668
  52. package/public/docs/reference/interfaces/modules/Time.html +0 -684
  53. package/public/docs/reference/modules/Debugger.html +0 -579
  54. package/public/docs/reference/modules/DisplayRenderer.html +0 -557
  55. package/public/docs/reference/modules/Game.html +0 -909
  56. package/public/docs/reference/modules/GameControl.html +0 -716
  57. package/public/docs/reference/modules/GameGrid.html +0 -1910
  58. package/public/docs/reference/modules/GameHudGrid.html +0 -508
  59. package/public/docs/reference/modules/GameMenu.html +0 -538
  60. package/public/docs/reference/modules/GameRenderer.html +0 -589
  61. package/public/docs/reference/modules/GameScore.html +0 -664
  62. package/public/docs/reference/modules/GameSession.html +0 -533
  63. package/public/docs/reference/modules/GameSound.html +0 -636
  64. package/public/docs/reference/modules/GameState.html +0 -922
  65. package/public/docs/reference/modules/GameText.html +0 -701
  66. package/public/docs/reference/modules/GameTime.html +0 -696
  67. package/public/docs/reference/modules/HudRenderer.html +0 -568
  68. package/public/docs/reference/modules/InitialStateSnapshot.html +0 -557
  69. package/public/docs/reference/modules/SessionModal.html +0 -520
  70. package/public/docs/reference/types/Axis.html +0 -505
  71. package/public/docs/reference/types/Cell.html +0 -514
  72. package/public/docs/reference/types/ControlCallback.html +0 -488
  73. package/public/docs/reference/types/Coordinate.html +0 -510
  74. package/public/docs/reference/types/GameEntry.html +0 -514
  75. package/public/docs/reference/types/GameEvent.html +0 -514
  76. package/public/docs/reference/types/Piece.html +0 -506
  77. package/public/docs/reference/types/RendererMetrics.html +0 -514
  78. package/public/docs/reference/types/Vector.html +0 -509
  79. package/public/docs/testing_best_practices.html +0 -770
  80. package/public/favicon.ico +0 -0
  81. package/public/fonts/digital-7.monoitalic.ttf +0 -0
  82. package/public/images/cell.svg +0 -32
  83. package/public/images/close.png +0 -0
  84. package/public/images/games.png +0 -0
  85. package/public/images/github.png +0 -0
  86. package/public/images/letter-a.png +0 -0
  87. package/public/images/letter-d.png +0 -0
  88. package/public/images/letter-j.png +0 -0
  89. package/public/images/letter-s.png +0 -0
  90. package/public/images/letter-w.png +0 -0
  91. package/public/images/meta-image.png +0 -0
  92. package/public/images/number-1.png +0 -0
  93. package/public/images/number-2.png +0 -0
  94. package/public/images/number-3.png +0 -0
  95. package/public/images/number-4.png +0 -0
  96. package/public/images/number-5.png +0 -0
  97. package/public/images/number-6.png +0 -0
  98. package/public/images/splash.gif +0 -0
  99. package/public/index.html +0 -15
  100. package/public/sounds/sound_00.wav +0 -0
  101. package/public/sounds/sound_01.wav +0 -0
  102. package/public/sounds/sound_02.wav +0 -0
  103. package/public/sounds/sound_03.wav +0 -0
  104. package/public/sounds/sound_04.wav +0 -0
  105. package/public/sounds/sound_05.wav +0 -0
  106. package/public/sounds/sound_06.wav +0 -0
  107. package/public/sounds/sound_07.wav +0 -0
  108. package/public/sounds/sound_08.wav +0 -0
  109. package/public/sounds/sound_09.wav +0 -0
  110. package/public/sounds/sound_10.wav +0 -0
  111. package/public/sounds/sound_11.wav +0 -0
  112. package/public/sounds/sound_12.wav +0 -0
  113. package/public/sounds/sound_13.wav +0 -0
  114. package/public/sounds/sound_14.wav +0 -0
  115. package/public/sounds/sound_15.wav +0 -0
  116. package/public/style/body.css +0 -86
  117. package/public/style/buttons.css +0 -233
  118. package/public/style/debugger.css +0 -117
  119. package/public/style/sessionModal.css +0 -155
  120. package/public/style/sourceCodeAndCommands.css +0 -74
  121. package/public/style/splash.css +0 -13
  122. package/public/style/theme.css +0 -137
  123. package/scripts/generate-diagrams.sh +0 -20
  124. package/scripts/generate-docs.js +0 -111
  125. package/src/client-game.d.ts +0 -1
  126. package/src/config/configs.test.ts +0 -20
  127. package/src/config/configs.ts +0 -197
  128. package/src/config/env.test.ts +0 -59
  129. package/src/config/env.ts +0 -7
  130. package/src/config/styles.ts +0 -5
  131. package/src/core/Game.test.ts +0 -167
  132. package/src/core/Game.ts +0 -307
  133. package/src/core/InitialStateSnapshot.test.ts +0 -51
  134. package/src/core/InitialStateSnapshot.ts +0 -46
  135. package/src/core/helpers/CellHelper.test.ts +0 -33
  136. package/src/core/helpers/CellHelper.ts +0 -21
  137. package/src/core/helpers/ControlInputHandlerHelper.test.ts +0 -116
  138. package/src/core/helpers/ControlInputHandlerHelper.ts +0 -68
  139. package/src/core/helpers/CoordinateHelper.test.ts +0 -113
  140. package/src/core/helpers/CoordinateHelper.ts +0 -82
  141. package/src/core/helpers/InterfaceIdentifierHelper.test.ts +0 -122
  142. package/src/core/helpers/InterfaceIdentifierHelper.ts +0 -43
  143. package/src/core/helpers/RelativeValuesHelper.test.ts +0 -47
  144. package/src/core/helpers/RelativeValuesHelper.ts +0 -29
  145. package/src/core/module/control/GameControl.test.ts +0 -82
  146. package/src/core/module/control/GameControl.ts +0 -142
  147. package/src/core/module/control/GameControlKeyBinding.test.ts +0 -59
  148. package/src/core/module/control/GameControlKeyBinding.ts +0 -92
  149. package/src/core/module/grid/GameGrid.test.ts +0 -83
  150. package/src/core/module/grid/GameGrid.ts +0 -610
  151. package/src/core/module/grid/GameHudGrid.test.ts +0 -22
  152. package/src/core/module/grid/GameHudGrid.ts +0 -40
  153. package/src/core/module/grid/engines/GridAnalysisEngine.test.ts +0 -157
  154. package/src/core/module/grid/engines/GridAnalysisEngine.ts +0 -124
  155. package/src/core/module/grid/engines/GridLineEngine.test.ts +0 -132
  156. package/src/core/module/grid/engines/GridLineEngine.ts +0 -165
  157. package/src/core/module/grid/engines/GridMovementEngine.test.ts +0 -125
  158. package/src/core/module/grid/engines/GridMovementEngine.ts +0 -113
  159. package/src/core/module/grid/engines/GridRegionEngine.test.ts +0 -136
  160. package/src/core/module/grid/engines/GridRegionEngine.ts +0 -52
  161. package/src/core/module/grid/engines/GridTransformEngine.test.ts +0 -98
  162. package/src/core/module/grid/engines/GridTransformEngine.ts +0 -70
  163. package/src/core/module/renderer/DisplayRenderer.test.ts +0 -86
  164. package/src/core/module/renderer/DisplayRenderer.ts +0 -152
  165. package/src/core/module/renderer/GameRenderer.test.ts +0 -103
  166. package/src/core/module/renderer/GameRenderer.ts +0 -144
  167. package/src/core/module/renderer/HudRenderer.test.ts +0 -108
  168. package/src/core/module/renderer/HudRenderer.ts +0 -203
  169. package/src/core/module/score/GameScore.test.ts +0 -71
  170. package/src/core/module/score/GameScore.ts +0 -188
  171. package/src/core/module/session/GameSession.test.ts +0 -176
  172. package/src/core/module/session/GameSession.ts +0 -103
  173. package/src/core/module/sound/GameSound.test.ts +0 -117
  174. package/src/core/module/sound/GameSound.ts +0 -229
  175. package/src/core/module/state/GameState.test.ts +0 -101
  176. package/src/core/module/state/GameState.ts +0 -339
  177. package/src/core/module/text/GameText.test.ts +0 -87
  178. package/src/core/module/text/GameText.ts +0 -150
  179. package/src/core/module/time/GameTime.test.ts +0 -86
  180. package/src/core/module/time/GameTime.ts +0 -144
  181. package/src/core/types/Interfaces.ts +0 -59
  182. package/src/core/types/Types.ts +0 -124
  183. package/src/core/types/enums.ts +0 -113
  184. package/src/core/types/modules.ts +0 -841
  185. package/src/index.test.ts +0 -15
  186. package/src/index.ts +0 -9
  187. package/src/main.test.ts +0 -137
  188. package/src/main.ts +0 -77
  189. package/src/menu/GameMenu.test.ts +0 -157
  190. package/src/menu/GameMenu.ts +0 -124
  191. package/src/menu/GameMenuSingleton.test.ts +0 -26
  192. package/src/menu/GameMenuSingleton.ts +0 -13
  193. package/src/menu/GameRepository.test.ts +0 -46
  194. package/src/menu/GameRepository.ts +0 -47
  195. package/src/menu/manager/GameManager.test.ts +0 -68
  196. package/src/menu/manager/GameManager.ts +0 -50
  197. package/src/types/global.d.ts +0 -8
  198. package/src/types/interfaces.ts +0 -5
  199. package/src/view/Debugger.test.ts +0 -152
  200. package/src/view/Debugger.ts +0 -124
  201. package/src/view/GameView.test.ts +0 -95
  202. package/src/view/GameView.ts +0 -244
  203. package/src/view/SessionModal.test.ts +0 -141
  204. package/src/view/SessionModal.ts +0 -73
  205. package/src/view/components/layout/ButtonLayout.test.ts +0 -28
  206. package/src/view/components/layout/ButtonLayout.ts +0 -63
  207. package/src/view/components/layout/ContainerLayout.test.ts +0 -48
  208. package/src/view/components/layout/ContainerLayout.ts +0 -50
  209. package/src/view/components/layout/FrameLayout.test.ts +0 -24
  210. package/src/view/components/layout/FrameLayout.ts +0 -25
  211. package/src/view/components/ui/BigButton.test.ts +0 -28
  212. package/src/view/components/ui/BigButton.ts +0 -31
  213. package/src/view/components/ui/Button.test.ts +0 -30
  214. package/src/view/components/ui/Button.ts +0 -30
  215. package/src/view/components/ui/Canvas.test.ts +0 -32
  216. package/src/view/components/ui/Canvas.ts +0 -34
  217. package/src/view/components/ui/SmallButton.test.ts +0 -48
  218. package/src/view/components/ui/SmallButton.ts +0 -32
  219. package/src/view/theme/applyColors.test.ts +0 -47
  220. package/src/view/theme/applyColors.ts +0 -38
  221. package/src/view/theme/dimensions.test.ts +0 -34
  222. package/src/view/theme/dimensions.ts +0 -53
  223. package/tsconfig.json +0 -16
  224. package/vitest.config.ts +0 -14
  225. package/webpack.config.js +0 -133
@@ -1,155 +0,0 @@
1
- #modal-background {
2
- position: absolute;
3
- inset: 0;
4
- background-color: rgba(0, 0, 0, 0.5);
5
- z-index: 999;
6
- display: flex;
7
- justify-content: center;
8
- align-items: center;
9
- }
10
-
11
- #modal-background.hidden {
12
- display: none;
13
- }
14
-
15
- #session-modal {
16
- width: 80%;
17
- max-width: 500px;
18
- height: 44%;
19
- max-height: 360px;
20
- min-width: 320px;
21
- min-height: 280px;
22
- position: relative;
23
- overflow: hidden;
24
-
25
- display: flex;
26
- flex-direction: column;
27
- align-items: center;
28
- box-sizing: border-box;
29
- padding: 1rem 0;
30
-
31
- background-color: var(--main-color);
32
-
33
- border-radius: var(--border-radius);
34
- border: var(--border);
35
-
36
- box-shadow:
37
- calc(var(--width) * -0.03) calc(var(--width) * 0.03) var(--dispersion) black,
38
- calc(var(--width) * -0.02) calc(var(--width) * 0.02) var(--dispersion) var(--color-shadow-reflexion) inset,
39
- calc(var(--width) * 0.01) calc(var(--width) * -0.01) var(--dispersion) var(--color-shadow) inset;
40
- }
41
-
42
- #session-modal-frame {
43
- border: var(--border);
44
- border-radius: var(--border-radius);
45
-
46
- position: relative;
47
-
48
- width: 90%;
49
- flex: 1;
50
- margin: 1rem 0;
51
- min-height: 0;
52
-
53
- display: flex;
54
- justify-content: center;
55
- align-items: center;
56
- }
57
-
58
- #session-modal-frame > p {
59
- position: absolute;
60
- top: 0;
61
- transform: translateY(-50%);
62
-
63
- text-align: center;
64
-
65
- font-family: 'retro-gamming';
66
- font-weight: bold;
67
- font-size: clamp(1rem, calc(var(--height) * 0.03), 1.4rem);
68
-
69
- background-color: var(--main-color);
70
- padding: 0 calc(var(--width) * 0.02);
71
-
72
- text-shadow:
73
- calc(var(--width) * -0.003) calc(var(--width) * 0.003) 0 var(--color-shadow),
74
- calc(var(--width) * 0.002) calc(var(--width) * -0.002) 0 var(--color-shadow-reflexion);
75
- }
76
-
77
- #session-modal-screen {
78
- width: 90%;
79
- height: 80%;
80
-
81
- border: var(--border);
82
- box-shadow:
83
- calc(var(--width) * -0.01) calc(var(--width) * 0.01) var(--dispersion) var(--color-shadow),
84
- calc(var(--width) * 0.01) calc(var(--width) * -0.01) var(--dispersion) var(--color-shadow-reflexion);
85
-
86
- background-image: url('../images/cell.svg');
87
- background-size: 3.7%;
88
- background-repeat: repeat;
89
-
90
- display: flex;
91
- justify-content: center;
92
- align-items: center;
93
- }
94
-
95
- #session-modal-screen > p {
96
- text-align: center;
97
-
98
- font-family: 'retro-gamming';
99
- font-size: 1.5rem;
100
-
101
- padding: 0 calc(var(--width) * 0.02);
102
- }
103
-
104
- #session-modal-screen > p > span {
105
- font-size: 1.8rem;
106
- padding: 0 calc(var(--width) * 0.02);
107
- }
108
-
109
- #session-modal-buttons {
110
- width: 100%;
111
- padding-bottom: 0.5rem;
112
-
113
- display: flex;
114
- justify-content: center;
115
- align-items: center;
116
-
117
- gap: clamp(1rem, 5vw, 2.5rem);
118
- }
119
-
120
- .session-modal-button:active {
121
- box-shadow:
122
- calc(var(--width) * -0.005) calc(var(--width) * 0.005) var(--dispersion) var(--color-shadow),
123
- calc(var(--width) * -0.004) calc(var(--width) * 0.004) var(--dispersion) var(--button-color-reflexion) inset;
124
- transform: translate(calc(var(--width) * -0.005), calc(var(--width) * 0.005));
125
- }
126
-
127
- .session-modal-button {
128
- width: 35%;
129
- max-width: 150px;
130
- padding: 0.8rem 0;
131
-
132
- border: var(--border);
133
- border-radius: var(--border-radius);
134
-
135
- background-color: var(--button-color);
136
- box-shadow:
137
- calc(var(--width) * -0.015) calc(var(--width) * 0.015) var(--dispersion) var(--color-shadow),
138
- calc(var(--width) * -0.0175) calc(var(--width) * 0.0175) var(--dispersion) var(--button-color-reflexion) inset;
139
-
140
- font-family: 'retro-gamming';
141
- color: white;
142
- text-align: center;
143
-
144
- user-select: none;
145
-
146
- font-size: 1rem;
147
-
148
- text-shadow:
149
- calc(var(--width) * -0.003) calc(var(--width) * 0.003) 0 var(--button-color-shadow),
150
- calc(var(--width) * 0.002) calc(var(--width) * -0.002) 0 var(--button-color-reflexion);
151
-
152
- transition:
153
- transform var(--button-animation-duration),
154
- box-shadow var(--button-animation-duration);
155
- }
@@ -1,74 +0,0 @@
1
- #source-code {
2
- position: absolute;
3
- top: 2%;
4
- right: 2%;
5
- }
6
-
7
- #controls {
8
- position: absolute;
9
- top: 2%;
10
- left: 2%;
11
- }
12
-
13
- #source-code,
14
- #controls {
15
- background-color: var(--main-color);
16
- padding: 0.75rem;
17
- border-radius: 1.5rem;
18
- cursor: pointer;
19
- box-sizing: content-box;
20
- }
21
-
22
- #source-code > #source-code-button,
23
- #controls > #controls-button {
24
- display: flex;
25
- justify-content: center;
26
- align-items: center;
27
- }
28
-
29
- #source-code > #source-code-button > img,
30
- #controls > #controls-button > img {
31
- width: 2.5rem;
32
- filter: invert();
33
- }
34
- #source-code:hover,
35
- #controls:hover {
36
- background-color: var(--color-shadow-reflexion);
37
- }
38
- #source-code:active,
39
- #controls:active {
40
- filter: brightness(1.15);
41
- }
42
-
43
- #source-code::after,
44
- #controls::after {
45
- font-family: 'retro-gamming';
46
- padding: 0.5rem;
47
- width: 6rem;
48
- background-color: white;
49
- text-align: center;
50
- border-radius: 0.25rem;
51
- border: 1px black solid;
52
- box-shadow: 0.25rem 0.25rem black;
53
- opacity: 0;
54
- transition: 0.25s opacity;
55
- }
56
-
57
- #source-code:hover::after,
58
- #controls:hover::after {
59
- opacity: 1;
60
- }
61
-
62
- #source-code::after {
63
- content: 'source code';
64
- position: absolute;
65
- top: 75px;
66
- left: -65px;
67
- }
68
-
69
- #controls::after {
70
- content: 'Controls';
71
- position: absolute;
72
- top: 75px;
73
- left: 15px;
74
- }
@@ -1,13 +0,0 @@
1
- #splash {
2
- position: absolute;
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- background-color: black;
8
- opacity: 0.85;
9
- z-index: 1000;
10
- display: flex;
11
- justify-content: center;
12
- align-items: center;
13
- }
@@ -1,137 +0,0 @@
1
- @font-face {
2
- font-family: retro-gamming;
3
- src: url(./../fonts/digital-7.monoitalic.ttf);
4
- }
5
-
6
- * {
7
- margin: 0;
8
- padding: 0;
9
- box-sizing: content-box;
10
- user-select: none;
11
- }
12
-
13
- body {
14
- width: 100vw;
15
- height: 100vh;
16
-
17
- display: flex;
18
- justify-content: center;
19
- align-items: center;
20
-
21
- background: rgb(0, 158, 247);
22
- background: linear-gradient(300deg, rgb(48, 179, 255) 0%, rgba(0, 158, 247, 1) 100%);
23
- }
24
-
25
- #version {
26
- font-family: 'retro-gamming';
27
- font-size: 1rem;
28
- color: white;
29
- position: absolute;
30
- bottom: 1rem;
31
- right: 1rem;
32
- }
33
-
34
- @media only screen and (max-width: 600px) {
35
- #source-code,
36
- #controls {
37
- display: none;
38
- }
39
-
40
- body,
41
- #container {
42
- width: 100% !important;
43
- height: 100vh !important;
44
- /* height: 100dvh !important; */
45
- border-radius: 0px !important;
46
- }
47
-
48
- #frame > canvas {
49
- width: 85% !important;
50
- height: auto !important;
51
- aspect-ratio: 9/10 !important;
52
- }
53
-
54
- #frame {
55
- width: 85% !important;
56
- padding: 7.5%¨ !important;
57
- }
58
-
59
- #small-button-container {
60
- margin-top: 3.5%;
61
- }
62
- #direction-vertical-container,
63
- #direction-horizontal-container {
64
- gap: calc(var(--width) * 0.13);
65
- }
66
-
67
- #large-button-container {
68
- flex-shrink: 1.75;
69
- }
70
-
71
- .sm-btn {
72
- width: var(--sm-button-size-mobile) !important;
73
- height: var(--sm-button-size-mobile) !important;
74
- }
75
-
76
- .btn {
77
- width: var(--button-size-mobile) !important;
78
- height: var(--button-size-mobile) !important;
79
- margin: var(--button-size-mobile-spacing) !important;
80
- font-size: var(--button-size-mobile-font-size) !important;
81
- }
82
-
83
- .lg-btn {
84
- width: var(--lg-button-size-mobile) !important;
85
- height: var(--lg-button-size-mobile) !important;
86
- font-size: var(--lg-button-size-mobile-font-size) !important;
87
- }
88
-
89
- .sm-btn-p {
90
- font-size: var(--sm-button-size-mobile-font-size) !important;
91
- line-height: var(--sm-button-size-mobile-line-height) !important;
92
- }
93
- }
94
-
95
- @media only screen and (max-width: 990px) {
96
- #wasd {
97
- width: 10.5rem !important;
98
- }
99
-
100
- .key {
101
- width: 3rem !important;
102
- }
103
-
104
- .key-description {
105
- font-size: 1.5rem !important;
106
- }
107
-
108
- .command {
109
- gap: 0.5rem !important;
110
- }
111
- }
112
-
113
- @media only screen and (max-width: 815px) {
114
- #controls-tutorial {
115
- gap: 0rem;
116
- flex-direction: column !important;
117
- }
118
- }
119
-
120
- @media only screen and (max-width: 750px) {
121
- .key-description {
122
- font-size: 1.2rem !important;
123
- }
124
- }
125
-
126
- @media only screen and (max-width: 650px) {
127
- #wasd {
128
- width: 9rem !important;
129
- }
130
-
131
- .key {
132
- width: 2.5rem !important;
133
- }
134
- .key-description {
135
- font-size: 1rem !important;
136
- }
137
- }
@@ -1,20 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Create output directory if it doesn't exist
4
- mkdir -p docs/images
5
-
6
- # Loop through all .mmd files in docs/diagrams
7
- for file in docs/diagrams/*.mmd; do
8
- # Check if file exists (in case of no matches)
9
- [ -e "$file" ] || continue
10
-
11
- # Extract filename without extension
12
- filename=$(basename "$file" .mmd)
13
-
14
- echo "Generating ${filename}.svg..."
15
-
16
- # Run mermaid-cli to generate SVG
17
- npx -y @mermaid-js/mermaid-cli -i "$file" -o "docs/images/${filename}.svg"
18
- done
19
-
20
- echo "All diagrams generated successfully."
@@ -1,111 +0,0 @@
1
- const asciidoctor = require('asciidoctor')();
2
- const fs = require('fs');
3
- const path = require('path');
4
-
5
- const DOCS_DIR = path.join(__dirname, '../docs');
6
- const PUBLIC_DOCS_DIR = path.join(__dirname, '../public/docs');
7
- const README_FILE = path.join(__dirname, '../README.adoc');
8
-
9
- function getAllFiles(dirPath, arrayOfFiles) {
10
- if (!fs.existsSync(dirPath)) return [];
11
-
12
- const files = fs.readdirSync(dirPath);
13
- arrayOfFiles = arrayOfFiles || [];
14
-
15
- files.forEach(function (file) {
16
- const fullPath = path.join(dirPath, file);
17
- if (fs.statSync(fullPath).isDirectory()) {
18
- arrayOfFiles = getAllFiles(fullPath, arrayOfFiles);
19
- } else {
20
- if (file.endsWith('.adoc')) {
21
- arrayOfFiles.push(fullPath);
22
- }
23
- }
24
- });
25
-
26
- return arrayOfFiles;
27
- }
28
-
29
- /**
30
- * Copies a directory recursively.
31
- */
32
- function copyDir(src, dest) {
33
- if (!fs.existsSync(src)) return;
34
- fs.mkdirSync(dest, { recursive: true });
35
- const entries = fs.readdirSync(src, { withFileTypes: true });
36
-
37
- for (let entry of entries) {
38
- const srcPath = path.join(src, entry.name);
39
- const destPath = path.join(dest, entry.name);
40
-
41
- if (entry.isDirectory()) {
42
- copyDir(srcPath, destPath);
43
- } else {
44
- fs.copyFileSync(srcPath, destPath);
45
- }
46
- }
47
- }
48
-
49
- // Ensure public/docs exists and is clean
50
- if (fs.existsSync(PUBLIC_DOCS_DIR)) {
51
- fs.rmSync(PUBLIC_DOCS_DIR, { recursive: true, force: true });
52
- }
53
- fs.mkdirSync(PUBLIC_DOCS_DIR, { recursive: true });
54
-
55
- // 1. Convert README.adoc to index.html
56
- if (fs.existsSync(README_FILE)) {
57
- console.log(`Converting README.adoc -> index.html`);
58
- const indexPath = path.join(PUBLIC_DOCS_DIR, 'index.html');
59
- asciidoctor.convertFile(README_FILE, {
60
- to_file: indexPath,
61
- safe: 'safe',
62
- makedirs: true,
63
- });
64
-
65
- // Fix links in index.html:
66
- // - Replace 'href="docs/' with 'href="' (since index.html is in /public/docs)
67
- // - Ensure .adoc links are changed to .html
68
- let content = fs.readFileSync(indexPath, 'utf8');
69
- content = content.replace(/href="docs\//g, 'href="');
70
- content = content.replace(/\.adoc/g, '.html');
71
-
72
- fs.writeFileSync(indexPath, content);
73
- console.log('Fixed links in index.html');
74
- } else {
75
- console.warn('README.adoc not found at root.');
76
- }
77
-
78
- // 2. Convert files in docs/
79
- if (fs.existsSync(DOCS_DIR)) {
80
- const files = getAllFiles(DOCS_DIR).filter(f => !f.startsWith(path.join(DOCS_DIR, 'images')) && !f.startsWith(path.join(DOCS_DIR, 'diagrams')));
81
- console.log(`Found ${files.length} .adoc files in docs/ to process.`);
82
-
83
- files.forEach(file => {
84
- const relativePath = path.relative(DOCS_DIR, file);
85
- const destPath = path.join(PUBLIC_DOCS_DIR, relativePath.replace(/\.adoc$/, '.html'));
86
-
87
- const destDir = path.dirname(destPath);
88
- if (!fs.existsSync(destDir)) {
89
- fs.mkdirSync(destDir, { recursive: true });
90
- }
91
-
92
- console.log(`Converting: ${relativePath} -> ${path.relative(process.cwd(), destPath)}`);
93
- asciidoctor.convertFile(file, { to_file: destPath, safe: 'safe', makedirs: true });
94
-
95
- // Fix internal links in reference files that might use docs/ prefix
96
- let content = fs.readFileSync(destPath, 'utf8');
97
- // If a file in reference/modules/ links to docs/reference/enums/
98
- // Asciidoctor might have kept 'docs/reference/' if it wasn't a proper xref.
99
- content = content.replace(/href="docs\//g, 'href="../../'); // Roughly 2 levels up
100
- // Note: This is a bit naive but should solve the reported issue if it occurs in modules.
101
-
102
- fs.writeFileSync(destPath, content);
103
- });
104
- }
105
-
106
- // 3. Copy images and diagrams for full documentation support
107
- console.log('Copying images and diagrams...');
108
- copyDir(path.join(DOCS_DIR, 'images'), path.join(PUBLIC_DOCS_DIR, 'images'));
109
- copyDir(path.join(DOCS_DIR, 'diagrams'), path.join(PUBLIC_DOCS_DIR, 'diagrams'));
110
-
111
- console.log('Documentation generation complete.');
@@ -1 +0,0 @@
1
- declare module '@client-game';
@@ -1,20 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import configs from './configs';
3
-
4
- describe('configs', () => {
5
- it('should export an object containing configuration values', () => {
6
- // [ARRANGE & ACT]
7
- const configSnapshot = configs;
8
-
9
- // [ASSERT]
10
- expect(configSnapshot).toBeDefined();
11
- expect(configSnapshot.game).toBeDefined();
12
- expect(configSnapshot.screenLayout).toBeDefined();
13
- expect(configSnapshot.colors).toBeDefined();
14
- });
15
-
16
- it('should have read-only immutable structure based on as const declaration', () => {
17
- // [ASSERT]
18
- expect(configs.colors.background).toBe('rgb(172, 189, 173)');
19
- });
20
- });