@lewismoten/gamemaker-sandbox-tools 3.1.0 → 3.4.0

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 (343) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/NOTICE.md +105 -3
  3. package/README.md +301 -15
  4. package/dist/audio-files.js +82 -0
  5. package/dist/audio.js +23 -138
  6. package/dist/block-merge.js +43 -0
  7. package/dist/color-reduce.js +44 -0
  8. package/dist/colors.js +87 -0
  9. package/dist/delta.js +75 -0
  10. package/dist/disk-diff.js +220 -0
  11. package/dist/drawing.js +83 -869
  12. package/dist/embroidery/compile.js +85 -0
  13. package/dist/embroidery/dst.js +79 -0
  14. package/dist/embroidery/exp.js +26 -0
  15. package/dist/embroidery/fill.js +49 -0
  16. package/dist/embroidery/geom.js +82 -0
  17. package/dist/embroidery/pes.js +79 -0
  18. package/dist/embroidery/satin.js +29 -0
  19. package/dist/embroidery/simulate.js +30 -0
  20. package/dist/embroidery/strokeFont.js +253 -0
  21. package/dist/embroidery/svg.js +24 -0
  22. package/dist/embroidery/types.js +13 -0
  23. package/dist/embroidery/units.js +26 -0
  24. package/dist/embroidery/validate.js +15 -0
  25. package/dist/formats/blocks.js +1 -103
  26. package/dist/formats/character.js +1 -83
  27. package/dist/formats/cmf.js +1 -37
  28. package/dist/formats/fli.js +1 -296
  29. package/dist/formats/fliLimits.js +1 -54
  30. package/dist/formats/game.js +1 -193
  31. package/dist/formats/gif.js +1 -125
  32. package/dist/formats/graphicScripts.js +1 -44
  33. package/dist/formats/map.js +1 -38
  34. package/dist/formats/monster.js +1 -69
  35. package/dist/formats/palette.js +1 -58
  36. package/dist/formats/recording.js +1 -17
  37. package/dist/formats/sound.js +1 -44
  38. package/dist/formats/voc.js +1 -303
  39. package/dist/gif-shrink.js +56 -0
  40. package/dist/image/png.js +42 -0
  41. package/dist/images.js +81 -43
  42. package/dist/kit/actors.js +19 -0
  43. package/dist/kit/align.js +204 -0
  44. package/dist/kit/blit.js +45 -0
  45. package/dist/kit/blockRoles.js +97 -0
  46. package/dist/kit/clips.js +40 -0
  47. package/dist/kit/coverPaint.js +18 -0
  48. package/dist/kit/disk.js +76 -0
  49. package/dist/kit/fadeOut.js +13 -0
  50. package/dist/kit/fliClips.js +133 -0
  51. package/dist/kit/fliShrink.js +277 -0
  52. package/dist/kit/gameSim.js +235 -0
  53. package/dist/kit/hopBot.js +142 -0
  54. package/dist/kit/levelGen.js +1423 -0
  55. package/dist/kit/levelGrid.js +33 -0
  56. package/dist/kit/levelPicture.js +27 -0
  57. package/dist/kit/menuVersion.js +19 -0
  58. package/dist/kit/microText.js +35 -0
  59. package/dist/kit/mumble.js +74 -0
  60. package/dist/kit/music.js +8 -0
  61. package/dist/kit/palRamps.js +32 -0
  62. package/dist/kit/palette.js +49 -0
  63. package/dist/kit/pcText.js +72 -0
  64. package/dist/kit/photo.js +150 -0
  65. package/dist/kit/pixels.js +79 -0
  66. package/dist/kit/png.js +40 -0
  67. package/dist/kit/quantize.js +72 -0
  68. package/dist/kit/raytrace.js +379 -0
  69. package/dist/kit/recordedDemo.js +10 -0
  70. package/dist/kit/reel.js +77 -0
  71. package/dist/kit/road3d.js +67 -0
  72. package/dist/kit/routeChecks.js +8 -0
  73. package/dist/kit/saveSlots.js +11 -0
  74. package/dist/kit/sceneInit.js +13 -0
  75. package/dist/kit/sceneSim.js +112 -0
  76. package/dist/kit/screenText.js +15 -0
  77. package/dist/kit/sdftext.js +237 -0
  78. package/dist/kit/shading.js +69 -0
  79. package/dist/kit/song.js +251 -0
  80. package/dist/kit/songFx.js +179 -0
  81. package/dist/kit/sound.js +52 -0
  82. package/dist/kit/synthParts.js +20 -0
  83. package/dist/kit/tar.js +53 -0
  84. package/dist/kit/textBounds.js +84 -0
  85. package/dist/kit/textfit.js +246 -0
  86. package/dist/kit/transforms.js +57 -0
  87. package/dist/kit/tune.js +21 -0
  88. package/dist/look-alike.js +50 -0
  89. package/dist/menu-version.js +4 -0
  90. package/dist/mesh/colorBodies.js +137 -0
  91. package/dist/mesh/decimate.js +207 -0
  92. package/dist/mesh/meshCheck.js +51 -0
  93. package/dist/mesh/overhang.js +41 -0
  94. package/dist/mesh/sampledField.js +12 -0
  95. package/dist/mesh/stl.js +36 -0
  96. package/dist/mesh/surfaceNets.js +79 -0
  97. package/dist/mesh/tetraMesh.js +62 -0
  98. package/dist/mesh/threeMf.js +58 -0
  99. package/dist/mesh/zipFile.js +52 -0
  100. package/dist/microFont.js +101 -0
  101. package/dist/music/compose.js +72 -0
  102. package/dist/pack/meshPack.js +198 -0
  103. package/dist/pack/threeMfPack.js +92 -0
  104. package/dist/palette-reserve.js +116 -0
  105. package/dist/palettes.js +138 -0
  106. package/dist/release-notes.js +40 -0
  107. package/dist/simulation.js +16 -2774
  108. package/dist/text.js +74 -0
  109. package/dist/types/audio.d.ts +4 -0
  110. package/dist/types/audioFiles.d.ts +22 -0
  111. package/dist/types/audioWav.d.ts +4 -0
  112. package/dist/types/blockMerge.d.ts +24 -0
  113. package/dist/types/colorReduce.d.ts +23 -0
  114. package/dist/types/{web/packages/tools/src/colors.d.ts → colors.d.ts} +6 -0
  115. package/dist/types/delta.d.ts +32 -0
  116. package/dist/types/diskDiff.d.ts +47 -0
  117. package/dist/types/drawing.d.ts +15 -0
  118. package/dist/types/embroidery/compile.d.ts +3 -0
  119. package/dist/types/embroidery/dst.d.ts +13 -0
  120. package/dist/types/embroidery/exp.d.ts +8 -0
  121. package/dist/types/embroidery/fill.d.ts +6 -0
  122. package/dist/types/embroidery/geom.d.ts +19 -0
  123. package/dist/types/embroidery/pes.d.ts +10 -0
  124. package/dist/types/embroidery/satin.d.ts +11 -0
  125. package/dist/types/embroidery/simulate.d.ts +19 -0
  126. package/dist/types/embroidery/strokeFont.d.ts +20 -0
  127. package/dist/types/embroidery/svg.d.ts +3 -0
  128. package/dist/types/embroidery/types.d.ts +70 -0
  129. package/dist/types/embroidery/units.d.ts +10 -0
  130. package/dist/types/embroidery/validate.d.ts +22 -0
  131. package/dist/types/formats/blocks.d.ts +1 -0
  132. package/dist/types/formats/character.d.ts +1 -0
  133. package/dist/types/formats/cmf.d.ts +1 -0
  134. package/dist/types/formats/fli.d.ts +1 -0
  135. package/dist/types/formats/fliLimits.d.ts +1 -0
  136. package/dist/types/formats/game.d.ts +1 -0
  137. package/dist/types/formats/gif.d.ts +1 -0
  138. package/dist/types/formats/graphicScripts.d.ts +1 -0
  139. package/dist/types/formats/map.d.ts +1 -0
  140. package/dist/types/formats/monster.d.ts +1 -0
  141. package/dist/types/formats/palette.d.ts +1 -0
  142. package/dist/types/formats/recording.d.ts +1 -0
  143. package/dist/types/formats/sound.d.ts +1 -0
  144. package/dist/types/formats/voc.d.ts +1 -0
  145. package/dist/types/gifShrink.d.ts +8 -0
  146. package/dist/types/image/animatedGif.d.ts +9 -0
  147. package/dist/types/image/surface.d.ts +26 -0
  148. package/dist/types/images.d.ts +13 -0
  149. package/dist/types/kit/actors.d.ts +7 -0
  150. package/dist/types/kit/align.d.ts +93 -0
  151. package/dist/types/kit/audioEvents.d.ts +26 -0
  152. package/dist/types/kit/blit.d.ts +20 -0
  153. package/dist/types/kit/blockRoles.d.ts +243 -0
  154. package/dist/types/{games/kit → kit}/clips.d.ts +1 -1
  155. package/dist/types/kit/coverPaint.d.ts +7 -0
  156. package/dist/types/kit/disk.d.ts +15 -0
  157. package/dist/types/kit/fadeOut.d.ts +12 -0
  158. package/dist/types/kit/fliClips.d.ts +32 -0
  159. package/dist/types/kit/fliShrink.d.ts +149 -0
  160. package/dist/types/{games/kit → kit}/gameSim.d.ts +9 -5
  161. package/dist/types/kit/hopBot.d.ts +72 -0
  162. package/dist/types/kit/laserClearance.d.ts +16 -0
  163. package/dist/types/kit/laserJoints.d.ts +39 -0
  164. package/dist/types/kit/laserLayout.d.ts +54 -0
  165. package/dist/types/kit/laserPixels.d.ts +52 -0
  166. package/dist/types/kit/laserPreview.d.ts +9 -0
  167. package/dist/types/kit/laserSvg.d.ts +35 -0
  168. package/dist/types/kit/levelGen/castle.d.ts +17 -0
  169. package/dist/types/kit/levelGen/dungeon.d.ts +11 -0
  170. package/dist/types/kit/levelGen/forest.d.ts +17 -0
  171. package/dist/types/kit/levelGen/furnish.d.ts +31 -0
  172. package/dist/types/kit/levelGen/grid.d.ts +46 -0
  173. package/dist/types/kit/levelGen/index.d.ts +138 -0
  174. package/dist/types/kit/levelGen/interior.d.ts +18 -0
  175. package/dist/types/kit/levelGen/jumpModel.d.ts +78 -0
  176. package/dist/types/kit/levelGen/needs.d.ts +44 -0
  177. package/dist/types/kit/levelGen/overworld.d.ts +21 -0
  178. package/dist/types/kit/levelGen/platform.d.ts +59 -0
  179. package/dist/types/kit/levelGen/platformCap.d.ts +13 -0
  180. package/dist/types/kit/levelGen/platformReach.d.ts +37 -0
  181. package/dist/types/kit/levelGen/props.d.ts +37 -0
  182. package/dist/types/kit/levelGen/town.d.ts +24 -0
  183. package/dist/types/kit/levelGrid.d.ts +16 -0
  184. package/dist/types/kit/levelPicture.d.ts +9 -0
  185. package/dist/types/kit/menuVersion.d.ts +7 -0
  186. package/dist/types/kit/microText.d.ts +18 -0
  187. package/dist/types/kit/mumble.d.ts +41 -0
  188. package/dist/types/kit/music.d.ts +1 -0
  189. package/dist/types/kit/palMerge.d.ts +10 -0
  190. package/dist/types/kit/palRamps.d.ts +28 -0
  191. package/dist/types/kit/pcText.d.ts +19 -0
  192. package/dist/types/kit/photo.d.ts +69 -0
  193. package/dist/types/kit/png.d.ts +7 -0
  194. package/dist/types/kit/quantize.d.ts +20 -0
  195. package/dist/types/kit/raytrace.d.ts +169 -0
  196. package/dist/types/kit/recordedDemo.d.ts +1 -0
  197. package/dist/types/kit/road3d.d.ts +71 -0
  198. package/dist/types/kit/routeChecks.d.ts +6 -0
  199. package/dist/types/kit/saveSlots.d.ts +17 -0
  200. package/dist/types/kit/sceneInit.d.ts +11 -0
  201. package/dist/types/{games/kit → kit}/sceneSim.d.ts +5 -5
  202. package/dist/types/kit/screenText.d.ts +3 -0
  203. package/dist/types/kit/sdftext.d.ts +34 -0
  204. package/dist/types/kit/shading.d.ts +23 -0
  205. package/dist/types/kit/shareBlocks.d.ts +20 -0
  206. package/dist/types/kit/song.d.ts +89 -0
  207. package/dist/types/kit/songFx.d.ts +99 -0
  208. package/dist/types/kit/synthParts.d.ts +7 -0
  209. package/dist/types/kit/tar.d.ts +13 -0
  210. package/dist/types/kit/textfit.d.ts +74 -0
  211. package/dist/types/kit/transforms.d.ts +8 -0
  212. package/dist/types/lookAlike.d.ts +31 -0
  213. package/dist/types/menuVersionEntry.d.ts +1 -0
  214. package/dist/types/mesh/colorBodies.d.ts +18 -0
  215. package/dist/types/mesh/decimate.d.ts +10 -0
  216. package/dist/types/mesh/fieldTrinket.d.ts +40 -0
  217. package/dist/types/mesh/figureShapes.d.ts +24 -0
  218. package/dist/types/mesh/mesh.d.ts +9 -0
  219. package/dist/types/mesh/meshCheck.d.ts +22 -0
  220. package/dist/types/mesh/overhang.d.ts +24 -0
  221. package/dist/types/mesh/pixelFigure.d.ts +41 -0
  222. package/dist/types/mesh/sampledField.d.ts +3 -0
  223. package/dist/types/mesh/sdfShapes.d.ts +20 -0
  224. package/dist/types/mesh/stl.d.ts +9 -0
  225. package/dist/types/mesh/strokeText.d.ts +8 -0
  226. package/dist/types/mesh/surfaceNets.d.ts +14 -0
  227. package/dist/types/mesh/tetraMesh.d.ts +4 -0
  228. package/dist/types/mesh/threeMf.d.ts +12 -0
  229. package/dist/types/mesh/trinketKinds.d.ts +72 -0
  230. package/dist/types/mesh/trinketTool.d.ts +26 -0
  231. package/dist/types/mesh/voxel.d.ts +10 -0
  232. package/dist/types/mesh/zipFile.d.ts +13 -0
  233. package/dist/types/microFont.d.ts +6 -0
  234. package/dist/types/pack/meshPack.d.ts +26 -0
  235. package/dist/types/pack/threeMfPack.d.ts +11 -0
  236. package/dist/types/palettePresetData.d.ts +4 -0
  237. package/dist/types/palettePresets.d.ts +12 -0
  238. package/dist/types/paletteReserve.d.ts +52 -0
  239. package/dist/types/palettes.d.ts +4 -0
  240. package/dist/types/releaseNotes.d.ts +3 -0
  241. package/dist/types/simulation.d.ts +6 -0
  242. package/dist/types/{web/packages/tools/src/text.d.ts → text.d.ts} +6 -6
  243. package/package.json +145 -15
  244. package/dist/binary-D7wuaC5g.js +0 -120
  245. package/dist/pixels-DzfIIUOl.js +0 -76
  246. package/dist/types/games/kit/blit.d.ts +0 -10
  247. package/dist/types/games/kit/music.d.ts +0 -1
  248. package/dist/types/games/kit/pcText.d.ts +0 -8
  249. package/dist/types/games/kit/shading.d.ts +0 -11
  250. package/dist/types/web/packages/tools/src/audio.d.ts +0 -3
  251. package/dist/types/web/packages/tools/src/drawing.d.ts +0 -10
  252. package/dist/types/web/packages/tools/src/images.d.ts +0 -2
  253. package/dist/types/web/packages/tools/src/microFont.d.ts +0 -1
  254. package/dist/types/web/packages/tools/src/simulation.d.ts +0 -3
  255. package/dist/types/web/scripts/cdGames.d.ts +0 -103
  256. package/dist/types/web/scripts/gameShots.d.ts +0 -12
  257. package/dist/types/web/scripts/ogImage.d.ts +0 -21
  258. package/dist/types/web/src/audio/cmfLoad.d.ts +0 -7
  259. package/dist/types/web/src/audio/cmfPlayer.d.ts +0 -69
  260. package/dist/types/web/src/audio/context.d.ts +0 -12
  261. package/dist/types/web/src/audio/engine.d.ts +0 -39
  262. package/dist/types/web/src/audio/music.worklet.d.ts +0 -14
  263. package/dist/types/web/src/audio/opl.d.ts +0 -37
  264. package/dist/types/web/src/audio/output.d.ts +0 -13
  265. package/dist/types/web/src/desk/boxes/boxFacts.d.ts +0 -85
  266. package/dist/types/web/src/dosPlayer/fileExtensions.d.ts +0 -44
  267. package/dist/types/web/src/dosPlayer/patchRules.d.ts +0 -24
  268. package/dist/types/web/src/dosPlayer/patchTable.d.ts +0 -80
  269. package/dist/types/web/src/edition.d.ts +0 -6
  270. package/dist/types/web/src/eggs/eggState.d.ts +0 -26
  271. package/dist/types/web/src/eggs/eggs.d.ts +0 -31
  272. package/dist/types/web/src/engine/character.d.ts +0 -30
  273. package/dist/types/web/src/engine/funcKeys.d.ts +0 -33
  274. package/dist/types/web/src/engine/game.d.ts +0 -52
  275. package/dist/types/web/src/engine/keys.d.ts +0 -17
  276. package/dist/types/web/src/engine/machine.d.ts +0 -99
  277. package/dist/types/web/src/engine/menus.d.ts +0 -46
  278. package/dist/types/web/src/engine/monsters.d.ts +0 -19
  279. package/dist/types/web/src/engine/playGain.d.ts +0 -11
  280. package/dist/types/web/src/engine/playerLook.d.ts +0 -26
  281. package/dist/types/web/src/engine/recorder.d.ts +0 -60
  282. package/dist/types/web/src/engine/render.d.ts +0 -8
  283. package/dist/types/web/src/engine/scene.d.ts +0 -156
  284. package/dist/types/web/src/engine/scroll.d.ts +0 -16
  285. package/dist/types/web/src/engine/showGraphic.d.ts +0 -39
  286. package/dist/types/web/src/engine/slowPc.d.ts +0 -62
  287. package/dist/types/web/src/engine/touch.d.ts +0 -33
  288. package/dist/types/web/src/engine/world.d.ts +0 -215
  289. package/dist/types/web/src/export/gameAbout.d.ts +0 -15
  290. package/dist/types/web/src/formats/binary.d.ts +0 -44
  291. package/dist/types/web/src/formats/blocks.d.ts +0 -52
  292. package/dist/types/web/src/formats/character.d.ts +0 -65
  293. package/dist/types/web/src/formats/cmf.d.ts +0 -33
  294. package/dist/types/web/src/formats/fli.d.ts +0 -45
  295. package/dist/types/web/src/formats/fliLimits.d.ts +0 -13
  296. package/dist/types/web/src/formats/game.d.ts +0 -72
  297. package/dist/types/web/src/formats/gif.d.ts +0 -15
  298. package/dist/types/web/src/formats/graphicScripts.d.ts +0 -18
  299. package/dist/types/web/src/formats/highscore.d.ts +0 -10
  300. package/dist/types/web/src/formats/map.d.ts +0 -24
  301. package/dist/types/web/src/formats/monster.d.ts +0 -48
  302. package/dist/types/web/src/formats/palette.d.ts +0 -15
  303. package/dist/types/web/src/formats/recording.d.ts +0 -7
  304. package/dist/types/web/src/formats/sound.d.ts +0 -13
  305. package/dist/types/web/src/formats/voc.d.ts +0 -13
  306. package/dist/types/web/src/gfx/cp437Glyphs.d.ts +0 -2
  307. package/dist/types/web/src/gfx/font8x8.d.ts +0 -2
  308. package/dist/types/web/src/gfx/levelPicture.d.ts +0 -81
  309. package/dist/types/web/src/gfx/screen.d.ts +0 -46
  310. package/dist/types/web/src/gfx/titlePicture.d.ts +0 -21
  311. package/dist/types/web/src/input/chords.d.ts +0 -22
  312. package/dist/types/web/src/input/deskMouse.d.ts +0 -14
  313. package/dist/types/web/src/input/keyboard.d.ts +0 -39
  314. package/dist/types/web/src/input/scancodes.d.ts +0 -3
  315. package/dist/types/web/src/manual/printables/types.d.ts +0 -277
  316. package/dist/types/web/src/project/bizarre.d.ts +0 -28
  317. package/dist/types/web/src/project/companion.d.ts +0 -35
  318. package/dist/types/web/src/project/diskFacts.d.ts +0 -30
  319. package/dist/types/web/src/project/files.d.ts +0 -124
  320. package/dist/types/web/src/project/gameFiles.d.ts +0 -49
  321. package/dist/types/web/src/project/gamePack.d.ts +0 -17
  322. package/dist/types/web/src/project/health.d.ts +0 -30
  323. package/dist/types/web/src/project/secretGames.d.ts +0 -19
  324. package/dist/types/web/src/project/storage.d.ts +0 -46
  325. package/dist/types/web/src/project/streamGame.d.ts +0 -38
  326. package/dist/types/web/src/project/zip.d.ts +0 -33
  327. package/dist/types/web/src/retro/dos/disks.d.ts +0 -33
  328. package/dist/types/web/src/retro/text/cp437.d.ts +0 -4
  329. package/dist/types/web/src/seededRandom.d.ts +0 -6
  330. package/dist/types/web/src/tinHearts/deskHearts.d.ts +0 -33
  331. package/dist/types/web/src/tinHearts/manifest.d.ts +0 -30
  332. package/dist/types/web/src/tinHearts/tinHearts.d.ts +0 -84
  333. package/dist/types/web/src/walkthrough/format.d.ts +0 -92
  334. package/dist/types/web/src/walkthrough/madeUpScores.d.ts +0 -6
  335. package/dist/types/web/src/walkthrough/runtime.d.ts +0 -134
  336. /package/dist/types/{web/src/assistant → image}/png.d.ts +0 -0
  337. /package/dist/types/{games/kit → kit}/palette.d.ts +0 -0
  338. /package/dist/types/{games/kit → kit}/pixels.d.ts +0 -0
  339. /package/dist/types/{games/kit → kit}/reel.d.ts +0 -0
  340. /package/dist/types/{games/kit → kit}/sound.d.ts +0 -0
  341. /package/dist/types/{games/kit → kit}/textBounds.d.ts +0 -0
  342. /package/dist/types/{games/kit → kit}/tune.d.ts +0 -0
  343. /package/dist/types/{web/src/audio → music}/compose.d.ts +0 -0
@@ -0,0 +1,44 @@
1
+ import { type Role, type RoleMap } from '../blockRoles.js';
2
+ export type GenKind = 'dungeon' | 'forest' | 'home' | 'shop' | 'castle' | 'town' | 'overworld' | 'platform';
3
+ export interface KindInfo {
4
+ id: GenKind;
5
+ label: string;
6
+ blurb: string;
7
+ /** The smallest area it can draw in (blocks). */
8
+ min: {
9
+ w: number;
10
+ h: number;
11
+ };
12
+ /** Roles the generator cannot run without. */
13
+ must: Role[];
14
+ /** Roles used when set; without them that part is skipped. */
15
+ want: {
16
+ role: Role;
17
+ use: string;
18
+ without: string;
19
+ }[];
20
+ }
21
+ export declare const KINDS: readonly KindInfo[];
22
+ export declare const kindInfo: (kind: GenKind) => KindInfo;
23
+ export interface NeedItem {
24
+ role: Role;
25
+ label: string;
26
+ must: boolean;
27
+ /** How many blocks hold the role. */
28
+ count: number;
29
+ /** For a "want": what it adds, and what happens without it. */
30
+ use?: string;
31
+ without?: string;
32
+ }
33
+ export interface NeedsReport {
34
+ kind: GenKind;
35
+ items: NeedItem[];
36
+ /** Every "must" is set. */
37
+ ok: boolean;
38
+ /** Plain words for a person when it is not ok (what to mark in the block editor). */
39
+ message: string;
40
+ /** Lines for the "wants" that are missing (skipped parts). */
41
+ skipped: string[];
42
+ }
43
+ /** Which of a kind's roles are set in `roles`, and whether it can run. */
44
+ export declare function checkNeeds(kind: GenKind, roles: RoleMap): NeedsReport;
@@ -0,0 +1,21 @@
1
+ import { type Area, type Stream } from './grid.js';
2
+ import type { SceneLink } from './town.js';
3
+ export declare const OVERWORLD_MIN: {
4
+ w: number;
5
+ h: number;
6
+ };
7
+ export interface Overworld {
8
+ area: Area;
9
+ entry: number;
10
+ exit: number;
11
+ links: SceneLink[];
12
+ }
13
+ export interface OverworldUses {
14
+ tree: boolean;
15
+ rock: boolean;
16
+ decor: boolean;
17
+ /** The map wraps over its edges: the land lines up across the seam. */
18
+ wrap: boolean;
19
+ }
20
+ /** An overworld filling a w by h area (at least 40 by 40). */
21
+ export declare function overworld(w: number, h: number, r: Stream, u: OverworldUses): Overworld;
@@ -0,0 +1,59 @@
1
+ import { type Area, type Stream } from './grid.js';
2
+ import type { HeroPhysics } from './jumpModel.js';
3
+ import type { LockInfo } from './props.js';
4
+ export interface PlatformOptions {
5
+ physics: HeroPhysics;
6
+ /** 0.1 to 1: the share of the hero's most (gap width and step height) the layout asks of him. */
7
+ difficulty: number;
8
+ /** Which blocks the set has. */
9
+ ladder: boolean;
10
+ hazard: boolean;
11
+ /** A solid-on-top-only ledge block. */
12
+ ledge: boolean;
13
+ /** The top of the ground is a different block (wall-top). */
14
+ cap: boolean;
15
+ /** Lock numbers that have both a locked-door block and a key block (the first is used). */
16
+ pairs: number[];
17
+ treasure: boolean;
18
+ life: boolean;
19
+ monsters: number[];
20
+ decorate: boolean;
21
+ }
22
+ export interface PlatformProof {
23
+ /** The exit can be reached by jump math (with the key picked up first when there is a lock). */
24
+ exit: boolean;
25
+ /** Every coin, the key and the heart were touched on some move. */
26
+ collectable: boolean;
27
+ /** With the lock shut he cannot reach the exit, and he can reach the key. True with no lock. */
28
+ lockHolds: boolean;
29
+ }
30
+ export interface PlatformLayout {
31
+ area: Area;
32
+ entry: number;
33
+ exit: number;
34
+ locks: LockInfo[];
35
+ /** Every cell of each locked door (a tall one), as area indexes. */
36
+ doorCells: number[];
37
+ treasure: number[];
38
+ life?: number;
39
+ monsters: {
40
+ cell: number;
41
+ monnum: number;
42
+ }[];
43
+ notes: string[];
44
+ proof: PlatformProof;
45
+ /** The difficulty the layout was finally drawn with (lower than asked when a harder one could not be proven). */
46
+ difficulty: number;
47
+ /** What the hero can do, in cells: the highest step and the widest gap on level ground. */
48
+ can: {
49
+ rise: number;
50
+ gap: number;
51
+ };
52
+ /** The tallest step and widest pit (cells) the layout actually asks him to jump (ladders and spikes not counted). */
53
+ asked: {
54
+ rise: number;
55
+ gap: number;
56
+ };
57
+ }
58
+ /** A side view filling a w by h area (at least 40 by 20). Draws again, easier, when a layout cannot be proven. */
59
+ export declare function platform(w: number, h: number, r: Stream, o: PlatformOptions): PlatformLayout;
@@ -0,0 +1,13 @@
1
+ import type { HeroPhysics } from './jumpModel.js';
2
+ export interface Capability {
3
+ /** The highest step up he can jump onto (cells), with no gap. */
4
+ maxRise: number;
5
+ /** The widest gap he clears on level ground (cells). */
6
+ maxGap: number;
7
+ /** `gapAt[r]`: the widest gap he clears to ground r cells higher (r from 0 to maxRise); 0 where none. */
8
+ gapAt: number[];
9
+ /** The widest run of spikes, one block high, he clears on level ground (cells). */
10
+ maxSpikes: number;
11
+ }
12
+ /** What the hero can cross; remembered for the same walk and jump. */
13
+ export declare function capability(p: HeroPhysics): Capability;
@@ -0,0 +1,37 @@
1
+ import { type Area } from './grid.js';
2
+ import { type HeroPhysics } from './jumpModel.js';
3
+ /** One move of a route: from the node (X pixels, feet row) before it to the node it leads to. */
4
+ export interface Step {
5
+ kind: 'walk' | 'jump' | 'fall' | 'climb';
6
+ dir: -1 | 0 | 1;
7
+ /** Jump or fall: how many ticks he steers. */
8
+ steerTicks: number;
9
+ from: {
10
+ X: number;
11
+ row: number;
12
+ };
13
+ to: {
14
+ X: number;
15
+ row: number;
16
+ };
17
+ /** Jump or fall: where the arc starts (a fall begins past the node's edge, after he has walked on to here). */
18
+ startX: number;
19
+ }
20
+ export interface Reach {
21
+ /** Cells the hero's body overlapped on some move he can make (row-major, as the area). */
22
+ touched: Uint8Array;
23
+ /** Cells he can stand in (his feet cell). */
24
+ stood: Uint8Array;
25
+ /** The moves, from the start to the first node standing in `cell` (a feet cell), when the search was asked to keep them. */
26
+ routeTo(cell: number): Step[] | undefined;
27
+ }
28
+ export interface ReachOptions {
29
+ /** A feet cell: stop as soon as he can stand there. */
30
+ goal?: number;
31
+ /** Keep the moves, so `routeTo` can say how to get somewhere. */
32
+ route?: boolean;
33
+ }
34
+ /** Plays every move from `start` (the feet cell) and says where he gets. `locksOpen`: the locked doors are open. */
35
+ export declare function reachFrom(a: Area, p: HeroPhysics, start: number, locksOpen: boolean, opt?: ReachOptions): Reach;
36
+ /** Whether a cell was touched. */
37
+ export declare const touchedAt: (r: Reach, cell: number) => boolean;
@@ -0,0 +1,37 @@
1
+ import { type Area, type Stream } from './grid.js';
2
+ export interface LockInfo {
3
+ /** The door's cell and its key's cell (area-local indexes), and the lock number they share. */
4
+ cell: number;
5
+ key: number;
6
+ pair: number;
7
+ /** 0 is the nearest to the entry. */
8
+ order: number;
9
+ }
10
+ export interface PropsOptions {
11
+ /** Lock numbers that have both a locked-door block and a key block. */
12
+ pairs: number[];
13
+ treasure: boolean;
14
+ life: boolean;
15
+ /** Monster numbers to place (empty: none). */
16
+ monsters: number[];
17
+ }
18
+ export interface Props {
19
+ locks: LockInfo[];
20
+ treasure: number[];
21
+ life?: number;
22
+ monsters: {
23
+ cell: number;
24
+ monnum: number;
25
+ }[];
26
+ }
27
+ /** Adds the props to `a` (changing its cell codes) and says what went where. Uses its own random stream. */
28
+ export declare function addProps(a: Area, entry: number, exit: number, r: Stream, o: PropsOptions): Props;
29
+ /**
30
+ * Plays the keys out on the cell codes: from the entry, a locked door opens once the hero has picked up its
31
+ * key. `strict` also asks that each key can be reached with its own lock and every later one shut
32
+ * (the key-before-lock rule). Everything picked up and the exit must be reachable at the end.
33
+ */
34
+ export declare function proveKeys(a: Area, entry: number, exit: number, locks: LockInfo[], pickups: number[]): {
35
+ ok: boolean;
36
+ strict: boolean;
37
+ };
@@ -0,0 +1,24 @@
1
+ import { type Area, type Stream } from './grid.js';
2
+ export declare const TOWN_MIN: {
3
+ w: number;
4
+ h: number;
5
+ };
6
+ export interface SceneLink {
7
+ /** The door or site (area-local cell). */
8
+ cell: number;
9
+ /** What it could lead to. */
10
+ kind: 'home' | 'shop' | 'town' | 'dungeon' | 'castle' | 'overworld';
11
+ label: string;
12
+ }
13
+ export interface Town {
14
+ area: Area;
15
+ entry: number;
16
+ exit: number;
17
+ links: SceneLink[];
18
+ }
19
+ export interface TownUses {
20
+ tree: boolean;
21
+ decor: boolean;
22
+ }
23
+ /** A town filling a w by h area (at least 40 by 28). */
24
+ export declare function town(w: number, h: number, r: Stream, u: TownUses): Town;
@@ -0,0 +1,16 @@
1
+ export declare class Grid {
2
+ readonly width: number;
3
+ readonly height: number;
4
+ private readonly cells;
5
+ constructor(width: number, height: number);
6
+ /** One block. */
7
+ put(x: number, y: number, ch: string): this;
8
+ /** A rectangle of `ch`, w blocks wide and h high. */
9
+ fill(x: number, y: number, w: number, h: number, ch: string): this;
10
+ /** Blocks `x0` to `x1` (both included) along row `y`. */
11
+ row(y: number, x0: number, x1: number, ch: string): this;
12
+ /** Blocks `y0` to `y1` (both included) down column `x`. */
13
+ col(x: number, y0: number, y1: number, ch: string): this;
14
+ /** The level as rows of text, for StarterMap. */
15
+ rows(): string[];
16
+ }
@@ -0,0 +1,9 @@
1
+ import type { Block } from '@lewismoten/gamemaker-sandbox-engine/formats/blocks';
2
+ import type { GameMap } from '@lewismoten/gamemaker-sandbox-engine/formats/map';
3
+ import type { Monster } from '@lewismoten/gamemaker-sandbox-engine/formats/monster';
4
+ import { Pixels } from './pixels.js';
5
+ export declare function renderRegion(map: GameMap, bg: Block[], mbl: Block[], mons: Monster[], x0: number, y0: number, w: number, h: number, extra?: {
6
+ pixels: Uint8Array;
7
+ x: number;
8
+ y: number;
9
+ }[]): Pixels;
@@ -0,0 +1,7 @@
1
+ /** Where a game wants its version instead of the corner: the text's top-left, or false for none. */
2
+ export type MenuVersionSpot = {
3
+ x?: number;
4
+ y?: number;
5
+ } | false;
6
+ /** Stamps "v<version>" on the menu picture among `files` (a disk's files, lower-case names). */
7
+ export declare function stampMenuVersion(files: Map<string, Uint8Array>, version: string, spot?: MenuVersionSpot): void;
@@ -0,0 +1,18 @@
1
+ import { type MicroGlyphs } from '../microFont.js';
2
+ import { Pixels } from './pixels.js';
3
+ export interface MicroTextOptions {
4
+ glyphs?: MicroGlyphs;
5
+ fallback?: string;
6
+ /** Include the final one-pixel spacer in the returned advance. */
7
+ trailingGap?: boolean;
8
+ /** Match a glyph before uppercasing it (for symbols such as µ). */
9
+ glyphCase?: boolean;
10
+ /** Consumer-owned multicolor glyphs; clear pixels are 255. */
11
+ custom?: (character: string) => Pixels | undefined;
12
+ }
13
+ export declare function createMicroText(options?: MicroTextOptions): (p: Pixels, x: number, y: number, s: string, col: number, scale?: number) => number;
14
+ /** Legacy cell advance with the final spacer omitted (including the historical empty-string value). */
15
+ export declare const microAdvance: (s: string, scale?: number) => number;
16
+ /** Visible-cell width; empty strings have no ink. */
17
+ export declare const microWidth: (s: string, scale?: number) => number;
18
+ export declare const micro: (p: Pixels, x: number, y: number, s: string, col: number, scale?: number) => number;
@@ -0,0 +1,41 @@
1
+ /** A vowel's first two formants in Hz. */
2
+ declare const VOWEL: {
3
+ readonly a: readonly [800, 1250];
4
+ readonly e: readonly [520, 1850];
5
+ readonly i: readonly [310, 2250];
6
+ readonly o: readonly [520, 950];
7
+ readonly u: readonly [340, 850];
8
+ };
9
+ /** The vowels a syllable can have. */
10
+ export type MumbleVowel = keyof typeof VOWEL;
11
+ /** One syllable: a vowel, its pitch at the start and the end (Hz), how long it lasts (s), and a short pause after it (s). */
12
+ export type Syllable = [vowel: MumbleVowel, from: number, to: number, seconds: number, rest?: number];
13
+ /** How a line is voiced. */
14
+ export interface MumbleOptions {
15
+ /** Samples per second. Default 11025. */
16
+ rate?: number;
17
+ /** Loudness before clipping. Default 1.6; samples are clamped to -1..1. */
18
+ gain?: number;
19
+ /** Seed of the breath noise at each syllable's start. Default 11. */
20
+ noiseSeed?: number;
21
+ }
22
+ /** A voice's settings for `syllablesFromText`. */
23
+ export interface TextVoice {
24
+ /** Middle pitch in Hz. */
25
+ pitch: number;
26
+ /** 1 is normal; 2 is twice as fast. */
27
+ speed: number;
28
+ }
29
+ /** Ready-made voices: `syllablesFromText(text, MUMBLE_VOICES.deep)`. */
30
+ export declare const MUMBLE_VOICES: Record<'bright' | 'deep' | 'small', TextVoice>;
31
+ /** How long a line lasts, in seconds. */
32
+ export declare function mumbleSeconds(line: Syllable[]): number;
33
+ /** Renders a line of syllables as samples in -1..1 (never clipped past that). */
34
+ export declare function mumble(line: Syllable[], opts?: MumbleOptions): Float32Array;
35
+ /** Renders a line of syllables as a .VOC (8 bits, mono, 11 025 Hz unless `rate` says otherwise). */
36
+ export declare function mumbleVoc(line: Syllable[], opts?: MumbleOptions): Uint8Array;
37
+ /** Turns a line of text into syllables: one per vowel group in its words, the vowel taken from the letters, so the same line (and seed) always mumbles the same way. A question rises at the end; a period or an exclamation falls. */
38
+ export declare function syllablesFromText(text: string, opts?: Partial<TextVoice> & {
39
+ seed?: number;
40
+ }): Syllable[];
41
+ export {};
@@ -0,0 +1 @@
1
+ export * from '../music/compose.js';
@@ -0,0 +1,10 @@
1
+ export interface PalMerge {
2
+ /** Dropped file name -> the file kept in its place. */
3
+ merged: Map<string, string>;
4
+ /** Bytes the dropped files held. */
5
+ saved: number;
6
+ }
7
+ /** Groups of byte-identical palettes, each group in keep-first order; groups of one are left out. */
8
+ export declare function identicalPalettes(files: ReadonlyMap<string, Uint8Array>): string[][];
9
+ /** Merges the identical palettes in a disk's files in place (the map is changed; .gam files are rewritten only when a scene is repointed). */
10
+ export declare function mergeIdenticalPalettes(files: Map<string, Uint8Array>): PalMerge;
@@ -0,0 +1,28 @@
1
+ import { PaletteBuilder } from './palette.js';
2
+ export interface Pal {
3
+ pal: Uint8Array;
4
+ r: (name: string) => number[];
5
+ /** Shade k of a ramp, clamped. */
6
+ c: (name: string, k: number) => number;
7
+ }
8
+ export declare function wrap(b: PaletteBuilder): Pal;
9
+ /** A palette handle that also exposes its builder for consumer-owned extra ramps. */
10
+ export interface PalWithBuilder extends Pal {
11
+ b: PaletteBuilder;
12
+ }
13
+ export declare const wrapWithBuilder: (b: PaletteBuilder) => PalWithBuilder;
14
+ export type RampSpec = readonly [
15
+ name: string,
16
+ shades: number,
17
+ from: readonly [number, number, number],
18
+ to: readonly [number, number, number],
19
+ mid?: readonly [number, number, number],
20
+ glows?: boolean
21
+ ];
22
+ export interface RampPaletteOptions {
23
+ designerColors?: boolean;
24
+ overrides?: Readonly<Record<string, readonly [readonly [number, number, number], readonly [number, number, number], (readonly [number, number, number])?]>>;
25
+ transform?: (name: string, color: readonly [number, number, number], glows: boolean) => readonly [number, number, number];
26
+ }
27
+ /** Build caller-supplied ramps, with optional endpoint transforms and named replacements. */
28
+ export declare function buildRampPalette(ramps: readonly RampSpec[], options?: RampPaletteOptions): PalWithBuilder;
@@ -0,0 +1,19 @@
1
+ import { Pixels } from './pixels.js';
2
+ export interface PcTextOptions {
3
+ custom?: (character: string, color: number, flat: boolean) => Pixels | undefined;
4
+ shadowOffsets?: readonly (readonly [number, number])[];
5
+ /** Absolute output-pixel offsets, when spacing is not proportional to glyph scale. */
6
+ shadowPixels?: (scale: number) => readonly (readonly [number, number])[];
7
+ outlineDistance?: (scale: number) => number;
8
+ /** Some older consumers measure code points rather than UTF-16 units. */
9
+ codePointWidth?: boolean;
10
+ /** Treat palette index zero as a valid shadow (default true). */
11
+ shadowZero?: boolean;
12
+ }
13
+ export declare const textWidth: (s: string, scale?: number) => number;
14
+ export declare function createPcText(options?: PcTextOptions): {
15
+ text: (p: Pixels, x: number, y: number, s: string, col: number, scale?: number, flat?: boolean) => number;
16
+ outlined: (p: Pixels, x: number, y: number, s: string, col: number, edge: number, scale?: number, shadow?: number) => void;
17
+ centered: (p: Pixels, y: number, s: string, col: number, scale?: number, edge?: number, cx?: number, shadow?: number) => void;
18
+ };
19
+ export declare const text: (p: Pixels, x: number, y: number, s: string, col: number, scale?: number, flat?: boolean) => number, outlined: (p: Pixels, x: number, y: number, s: string, col: number, edge: number, scale?: number, shadow?: number) => void, centered: (p: Pixels, y: number, s: string, col: number, scale?: number, edge?: number, cx?: number, shadow?: number) => void;
@@ -0,0 +1,69 @@
1
+ import { Pixels } from './pixels.js';
2
+ /** True-color pixels, 3 bytes each, square. */
3
+ export interface Scan {
4
+ w: number;
5
+ h: number;
6
+ rgb: Uint8Array;
7
+ }
8
+ /** Read a consumer-supplied JPEG file; no reference images are bundled. */
9
+ export declare function readScan(file: string | URL): Scan;
10
+ /**
11
+ * The part of a scan inside `crop` (fractions), resampled by area to w x h screen pixels.
12
+ * Pass h = 0 for the height that keeps its shape on a 4:3 monitor (tall VGA pixels).
13
+ */
14
+ export declare function resample(s: Scan, w: number, h?: number, crop?: [number, number, number, number]): Scan;
15
+ /** Each pixel through fn([r, g, b]) → [r, g, b] (0..255): tints, sepia, brightness. */
16
+ export declare function tone(s: Scan, fn: (rgb: [number, number, number]) => [number, number, number]): Scan;
17
+ /** An old print: gray, then toned from `dark` to `light` (8-bit RGB). */
18
+ export declare function sepia(s: Scan, dark?: [number, number, number], light?: [number, number, number], contrast?: number): Scan;
19
+ /** Median cut over a 5-bit histogram: `count` colors for the scan, as 6-bit VGA values. */
20
+ export declare function medianCut(s: Scan, count: number): [number, number, number][];
21
+ /** Palette entries a picture never uses (outside `skip`, a rectangle about to be painted over). */
22
+ export declare function freeColors(p: Pixels, skip?: {
23
+ x: number;
24
+ y: number;
25
+ w: number;
26
+ h: number;
27
+ }, reserved?: number[]): number[];
28
+ /**
29
+ * Floyd-Steinberg dithers the scan onto the palette, choosing only among `allowed` entries,
30
+ * with serpentine rows so the error doesn't streak. Returns the palette indices.
31
+ */
32
+ export declare function ditherTo(s: Scan, pal: Uint8Array, allowed: number[]): Uint8Array;
33
+ interface PasteOptions {
34
+ /** Most palette entries to give the photo (default: every free one). */
35
+ colors?: number;
36
+ /** Entries the picture needs kept as they are even though no pixel uses them yet. */
37
+ reserved?: number[];
38
+ /** Let the photo use the picture's own colors as well as its new ones (default true). */
39
+ share?: boolean;
40
+ }
41
+ /**
42
+ * Pastes a scan (already the size it will be on screen) into the picture at (x, y). The
43
+ * picture's unused palette entries get the photo's colors. Returns the new palette and the
44
+ * entries the photo was given.
45
+ */
46
+ export declare function pastePhoto(p: Pixels, pal: Uint8Array, s: Scan, x: number, y: number, o?: PasteOptions): {
47
+ pal: Uint8Array;
48
+ slots: number[];
49
+ };
50
+ interface FrameColors {
51
+ /** The print's white border. */
52
+ paper: number;
53
+ /** Its outline. */
54
+ edge: number;
55
+ /** A drop shadow on what's under it (-1: none). */
56
+ shadow?: number;
57
+ /** Strips of tape over the top corners (-1: none), every other pixel so the print shows through. */
58
+ tape?: number;
59
+ }
60
+ /**
61
+ * An instant print with its photo area w x h at (x, y): a white border, deeper at the bottom
62
+ * for a caption, an outline, a drop shadow and tape at the top corners. Returns where the
63
+ * caption strip's middle is.
64
+ */
65
+ export declare function polaroid(p: Pixels, x: number, y: number, w: number, h: number, c: FrameColors, bottom?: number): {
66
+ cx: number;
67
+ cy: number;
68
+ };
69
+ export {};
@@ -0,0 +1,7 @@
1
+ import { Pixels } from './pixels.js';
2
+ /** Writes an indexed picture through a 6-bit VGA palette, scaled up `s` times. */
3
+ export declare function writePng(file: string, p: Pixels, pal: Uint8Array, s?: number): void;
4
+ /** A sheet of 20x20 blocks, `cols` across, with a 2 pixel gap. */
5
+ export declare function blockSheet(blocks: {
6
+ pixels: Uint8Array;
7
+ }[], cols?: number, bg?: number): Pixels;
@@ -0,0 +1,20 @@
1
+ /** 8-bit RGB pixels, 3 bytes each. */
2
+ type Rgb = Uint8Array;
3
+ /**
4
+ * A palette for these frames: `fixed` colors first (8-bit RGB, such as black), then median
5
+ * cut over a 5-bit-per-channel histogram fills the rest of the 256 entries. Returns 768
6
+ * bytes of 6-bit VGA components.
7
+ */
8
+ export declare function medianCutPalette(frames: Rgb[], fixed?: [number, number, number][]): Uint8Array;
9
+ /** Maps 8-bit RGB pixels to a 6-bit palette with a 4x4 ordered dither of `amount` (8-bit steps). */
10
+ export declare class Quantizer {
11
+ readonly palette: Uint8Array;
12
+ readonly amount: number;
13
+ private readonly lut;
14
+ constructor(palette: Uint8Array, amount?: number);
15
+ /** The nearest palette entry to a 6-bit color. */
16
+ nearest(r: number, g: number, b: number): number;
17
+ /** A whole picture: `rgb` is w*h*3 bytes. */
18
+ apply(rgb: Rgb, w: number, h: number): Uint8Array;
19
+ }
20
+ export {};