@origingame/create-game 0.0.0-stage → 0.1.1

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 (590) hide show
  1. package/README.md +57 -2
  2. package/archetypes/README.md +99 -0
  3. package/archetypes/idle/.origin/setup +14 -0
  4. package/archetypes/idle/LICENSES.md +12 -0
  5. package/archetypes/idle/README.md +234 -0
  6. package/archetypes/idle/assets/audio/buy.wav +0 -0
  7. package/archetypes/idle/assets/audio/milestone.wav +0 -0
  8. package/archetypes/idle/assets/audio/nova.wav +0 -0
  9. package/archetypes/idle/assets/audio/orbit.wav +0 -0
  10. package/archetypes/idle/assets/audio/tap.wav +0 -0
  11. package/archetypes/idle/assets/audio/ui-close.ogt +9 -0
  12. package/archetypes/idle/assets/audio/ui-error.ogt +9 -0
  13. package/archetypes/idle/assets/audio/ui-open.ogt +9 -0
  14. package/archetypes/idle/assets/audio/ui-press.ogt +9 -0
  15. package/archetypes/idle/assets/audio/ui-success.ogt +9 -0
  16. package/archetypes/idle/assets/fonts/NotoSansSC-subset.ttf +0 -0
  17. package/archetypes/idle/assets/fonts/NotoSansSC-subset.ttf.ogt +10 -0
  18. package/archetypes/idle/assets/fonts/OFL.txt +93 -0
  19. package/archetypes/idle/assets/fx/drift.ogt +21 -0
  20. package/archetypes/idle/assets/fx/milestone.ogt +21 -0
  21. package/archetypes/idle/assets/fx/nova.ogt +22 -0
  22. package/archetypes/idle/assets/fx/stars.ogt +20 -0
  23. package/archetypes/idle/assets/fx/tap.ogt +23 -0
  24. package/archetypes/idle/assets/looks/idle.ogt +17 -0
  25. package/archetypes/idle/assets/skins/sparkorb/ChakraPetch-BoldItalic.ttf +0 -0
  26. package/archetypes/idle/assets/skins/sparkorb/ChakraPetch-BoldItalic.ttf.ogt +9 -0
  27. package/archetypes/idle/assets/skins/sparkorb/LICENSES.md +19 -0
  28. package/archetypes/idle/assets/skins/sparkorb/OFL.txt +95 -0
  29. package/archetypes/idle/assets/skins/sparkorb/Orbitron-Medium.ttf +0 -0
  30. package/archetypes/idle/assets/skins/sparkorb/Orbitron-Medium.ttf.ogt +9 -0
  31. package/archetypes/idle/assets/skins/sparkorb/Rajdhani-Bold.ttf +0 -0
  32. package/archetypes/idle/assets/skins/sparkorb/Rajdhani-Bold.ttf.ogt +9 -0
  33. package/archetypes/idle/assets/skins/sparkorb/atlas.png +0 -0
  34. package/archetypes/idle/assets/skins/sparkorb/atlas.png.ogt +7 -0
  35. package/archetypes/idle/assets/skins/sparkorb/icons.png +0 -0
  36. package/archetypes/idle/assets/skins/sparkorb/icons.png.ogt +7 -0
  37. package/archetypes/idle/assets/skins/sparkorb/skin.ogt +113 -0
  38. package/archetypes/idle/assets/sprites/glow.png +0 -0
  39. package/archetypes/idle/assets/sprites/glow.png.ogt +8 -0
  40. package/archetypes/idle/assets/sprites/mote-crystal.png +0 -0
  41. package/archetypes/idle/assets/sprites/mote-crystal.png.ogt +7 -0
  42. package/archetypes/idle/assets/sprites/mote-ember.png +0 -0
  43. package/archetypes/idle/assets/sprites/mote-ember.png.ogt +7 -0
  44. package/archetypes/idle/assets/sprites/mote-star.png +0 -0
  45. package/archetypes/idle/assets/sprites/mote-star.png.ogt +7 -0
  46. package/archetypes/idle/assets/sprites/mote-storm.png +0 -0
  47. package/archetypes/idle/assets/sprites/mote-storm.png.ogt +7 -0
  48. package/archetypes/idle/assets/sprites/orb.png +0 -0
  49. package/archetypes/idle/assets/sprites/orb.png.ogt +7 -0
  50. package/archetypes/idle/assets/sprites/spark.png +0 -0
  51. package/archetypes/idle/assets/sprites/spark.png.ogt +7 -0
  52. package/archetypes/idle/assets/strings/en.ogt +62 -0
  53. package/archetypes/idle/assets/strings/zh-CN.ogt +62 -0
  54. package/archetypes/idle/gitattributes +22 -0
  55. package/archetypes/idle/gitignore +8 -0
  56. package/archetypes/idle/host.d.ts +46 -0
  57. package/archetypes/idle/package.json +18 -0
  58. package/archetypes/idle/project.ogt +14 -0
  59. package/archetypes/idle/references/metal/card.png +0 -0
  60. package/archetypes/idle/references/metal/orbit.png +0 -0
  61. package/archetypes/idle/references/metal/title.png +0 -0
  62. package/archetypes/idle/src/components.ts +139 -0
  63. package/archetypes/idle/src/main.ts +247 -0
  64. package/archetypes/idle/src/numbers.ts +126 -0
  65. package/archetypes/idle/src/systems.ts +340 -0
  66. package/archetypes/idle/src/ui.ts +412 -0
  67. package/archetypes/idle/tests/away.og.ts +42 -0
  68. package/archetypes/idle/tests/flow.og.ts +57 -0
  69. package/archetypes/idle/tests/frames.og.ts +33 -0
  70. package/archetypes/idle/tests/frames.ts +134 -0
  71. package/archetypes/idle/tests/lib.ts +74 -0
  72. package/archetypes/idle/tests/milestone.og.ts +32 -0
  73. package/archetypes/idle/tests/nova.og.ts +52 -0
  74. package/archetypes/idle/tests/offline.og.ts +60 -0
  75. package/archetypes/idle/tests/pad.og.ts +55 -0
  76. package/archetypes/idle/tests/pause.og.ts +68 -0
  77. package/archetypes/idle/tests/phone.og.ts +50 -0
  78. package/archetypes/idle/tests/replay.og.ts +28 -0
  79. package/archetypes/idle/tools/make-assets.py +448 -0
  80. package/archetypes/idle/tools/oglite.py +285 -0
  81. package/archetypes/idle/tsconfig.json +17 -0
  82. package/archetypes/match3/.origin/setup +14 -0
  83. package/archetypes/match3/LICENSES.md +7 -0
  84. package/archetypes/match3/README.md +205 -0
  85. package/archetypes/match3/assets/audio/cascade.wav +0 -0
  86. package/archetypes/match3/assets/audio/clear.wav +0 -0
  87. package/archetypes/match3/assets/audio/lost.wav +0 -0
  88. package/archetypes/match3/assets/audio/refused.wav +0 -0
  89. package/archetypes/match3/assets/audio/select.wav +0 -0
  90. package/archetypes/match3/assets/audio/swap.wav +0 -0
  91. package/archetypes/match3/assets/audio/won.wav +0 -0
  92. package/archetypes/match3/assets/fonts/OFL.txt +93 -0
  93. package/archetypes/match3/assets/fonts/ui.ttf +0 -0
  94. package/archetypes/match3/assets/fonts/ui.ttf.ogt +11 -0
  95. package/archetypes/match3/assets/scenes/main.ogt +24 -0
  96. package/archetypes/match3/assets/sprites/backdrop.png +0 -0
  97. package/archetypes/match3/assets/sprites/board.ogt +21 -0
  98. package/archetypes/match3/assets/sprites/cells.ogt +7 -0
  99. package/archetypes/match3/assets/sprites/cells.png +0 -0
  100. package/archetypes/match3/assets/sprites/cells.png.ogt +7 -0
  101. package/archetypes/match3/assets/sprites/gems.ogt +75 -0
  102. package/archetypes/match3/assets/sprites/gems.png +0 -0
  103. package/archetypes/match3/assets/sprites/panel.png +0 -0
  104. package/archetypes/match3/assets/sprites/ring.png +0 -0
  105. package/archetypes/match3/gitattributes +22 -0
  106. package/archetypes/match3/gitignore +8 -0
  107. package/archetypes/match3/host.d.ts +46 -0
  108. package/archetypes/match3/package.json +18 -0
  109. package/archetypes/match3/project.ogt +18 -0
  110. package/archetypes/match3/references/metal/cascade.png +0 -0
  111. package/archetypes/match3/references/metal/clearing.png +0 -0
  112. package/archetypes/match3/references/metal/dealt.png +0 -0
  113. package/archetypes/match3/src/art.ts +54 -0
  114. package/archetypes/match3/src/board.ts +112 -0
  115. package/archetypes/match3/src/components.ts +95 -0
  116. package/archetypes/match3/src/layout.ts +25 -0
  117. package/archetypes/match3/src/main.ts +199 -0
  118. package/archetypes/match3/src/systems.ts +631 -0
  119. package/archetypes/match3/tests/drag.og.ts +31 -0
  120. package/archetypes/match3/tests/endings.og.ts +40 -0
  121. package/archetypes/match3/tests/frames.og.ts +49 -0
  122. package/archetypes/match3/tests/frames.ts +134 -0
  123. package/archetypes/match3/tests/hidpi.og.ts +41 -0
  124. package/archetypes/match3/tests/lib.ts +64 -0
  125. package/archetypes/match3/tests/replay.og.ts +28 -0
  126. package/archetypes/match3/tests/sounds.og.ts +50 -0
  127. package/archetypes/match3/tests/swap.og.ts +67 -0
  128. package/archetypes/match3/tools/make-assets.py +404 -0
  129. package/archetypes/match3/tools/oglite.py +285 -0
  130. package/archetypes/match3/tsconfig.json +17 -0
  131. package/archetypes/rhythm/.origin/setup +14 -0
  132. package/archetypes/rhythm/LICENSES.md +13 -0
  133. package/archetypes/rhythm/README.md +235 -0
  134. package/archetypes/rhythm/assets/audio/bass0.wav +0 -0
  135. package/archetypes/rhythm/assets/audio/bass1.wav +0 -0
  136. package/archetypes/rhythm/assets/audio/bass2.wav +0 -0
  137. package/archetypes/rhythm/assets/audio/bass3.wav +0 -0
  138. package/archetypes/rhythm/assets/audio/chords0.wav +0 -0
  139. package/archetypes/rhythm/assets/audio/chords1.wav +0 -0
  140. package/archetypes/rhythm/assets/audio/chords2.wav +0 -0
  141. package/archetypes/rhythm/assets/audio/chords3.wav +0 -0
  142. package/archetypes/rhythm/assets/audio/clear.wav +0 -0
  143. package/archetypes/rhythm/assets/audio/click.wav +0 -0
  144. package/archetypes/rhythm/assets/audio/drums.wav +0 -0
  145. package/archetypes/rhythm/assets/audio/fail.wav +0 -0
  146. package/archetypes/rhythm/assets/audio/leadA.wav +0 -0
  147. package/archetypes/rhythm/assets/audio/leadB.wav +0 -0
  148. package/archetypes/rhythm/assets/audio/miss.wav +0 -0
  149. package/archetypes/rhythm/assets/audio/tap0.wav +0 -0
  150. package/archetypes/rhythm/assets/audio/tap1.wav +0 -0
  151. package/archetypes/rhythm/assets/audio/tap2.wav +0 -0
  152. package/archetypes/rhythm/assets/audio/ui-close.ogt +9 -0
  153. package/archetypes/rhythm/assets/audio/ui-error.ogt +9 -0
  154. package/archetypes/rhythm/assets/audio/ui-open.ogt +9 -0
  155. package/archetypes/rhythm/assets/audio/ui-press.ogt +9 -0
  156. package/archetypes/rhythm/assets/audio/ui-success.ogt +9 -0
  157. package/archetypes/rhythm/assets/charts/neon-pulse.ogt +919 -0
  158. package/archetypes/rhythm/assets/fonts/NotoSansSC-subset.ttf +0 -0
  159. package/archetypes/rhythm/assets/fonts/NotoSansSC-subset.ttf.ogt +10 -0
  160. package/archetypes/rhythm/assets/fonts/OFL.txt +93 -0
  161. package/archetypes/rhythm/assets/fx/hit.ogt +22 -0
  162. package/archetypes/rhythm/assets/skins/lanebeat/ChakraPetch-Medium.ttf +0 -0
  163. package/archetypes/rhythm/assets/skins/lanebeat/ChakraPetch-Medium.ttf.ogt +9 -0
  164. package/archetypes/rhythm/assets/skins/lanebeat/JetBrainsMono-Regular.ttf +0 -0
  165. package/archetypes/rhythm/assets/skins/lanebeat/JetBrainsMono-Regular.ttf.ogt +9 -0
  166. package/archetypes/rhythm/assets/skins/lanebeat/LICENSES.md +17 -0
  167. package/archetypes/rhythm/assets/skins/lanebeat/OFL.txt +95 -0
  168. package/archetypes/rhythm/assets/skins/lanebeat/Orbitron-Bold.ttf +0 -0
  169. package/archetypes/rhythm/assets/skins/lanebeat/Orbitron-Bold.ttf.ogt +9 -0
  170. package/archetypes/rhythm/assets/skins/lanebeat/atlas.png +0 -0
  171. package/archetypes/rhythm/assets/skins/lanebeat/atlas.png.ogt +7 -0
  172. package/archetypes/rhythm/assets/skins/lanebeat/icons.png +0 -0
  173. package/archetypes/rhythm/assets/skins/lanebeat/icons.png.ogt +7 -0
  174. package/archetypes/rhythm/assets/skins/lanebeat/skin.ogt +110 -0
  175. package/archetypes/rhythm/assets/sprites/lane.png +0 -0
  176. package/archetypes/rhythm/assets/sprites/lane.png.ogt +7 -0
  177. package/archetypes/rhythm/assets/sprites/note.png +0 -0
  178. package/archetypes/rhythm/assets/sprites/note.png.ogt +7 -0
  179. package/archetypes/rhythm/assets/sprites/ring.png +0 -0
  180. package/archetypes/rhythm/assets/sprites/ring.png.ogt +7 -0
  181. package/archetypes/rhythm/assets/sprites/spark.png +0 -0
  182. package/archetypes/rhythm/assets/sprites/spark.png.ogt +7 -0
  183. package/archetypes/rhythm/assets/strings/en.ogt +61 -0
  184. package/archetypes/rhythm/assets/strings/zh-CN.ogt +61 -0
  185. package/archetypes/rhythm/gitattributes +22 -0
  186. package/archetypes/rhythm/gitignore +8 -0
  187. package/archetypes/rhythm/host.d.ts +46 -0
  188. package/archetypes/rhythm/package.json +18 -0
  189. package/archetypes/rhythm/project.ogt +14 -0
  190. package/archetypes/rhythm/references/metal/highway.png +0 -0
  191. package/archetypes/rhythm/references/metal/results.png +0 -0
  192. package/archetypes/rhythm/references/metal/title.png +0 -0
  193. package/archetypes/rhythm/src/components.ts +147 -0
  194. package/archetypes/rhythm/src/main.ts +202 -0
  195. package/archetypes/rhythm/src/systems.ts +490 -0
  196. package/archetypes/rhythm/src/ui.ts +421 -0
  197. package/archetypes/rhythm/tests/band.og.ts +45 -0
  198. package/archetypes/rhythm/tests/calibrate.og.ts +49 -0
  199. package/archetypes/rhythm/tests/clear.og.ts +51 -0
  200. package/archetypes/rhythm/tests/fail.og.ts +40 -0
  201. package/archetypes/rhythm/tests/flow.og.ts +54 -0
  202. package/archetypes/rhythm/tests/frames.og.ts +35 -0
  203. package/archetypes/rhythm/tests/frames.ts +134 -0
  204. package/archetypes/rhythm/tests/lib.ts +123 -0
  205. package/archetypes/rhythm/tests/pad.og.ts +41 -0
  206. package/archetypes/rhythm/tests/pause.og.ts +77 -0
  207. package/archetypes/rhythm/tests/phone.og.ts +44 -0
  208. package/archetypes/rhythm/tests/replay.og.ts +27 -0
  209. package/archetypes/rhythm/tests/timing.og.ts +37 -0
  210. package/archetypes/rhythm/tools/make-assets.py +383 -0
  211. package/archetypes/rhythm/tools/oglite.py +285 -0
  212. package/archetypes/rhythm/tsconfig.json +17 -0
  213. package/archetypes/roguelike/.origin/setup +14 -0
  214. package/archetypes/roguelike/LICENSES.md +14 -0
  215. package/archetypes/roguelike/README.md +256 -0
  216. package/archetypes/roguelike/assets/ai/foe.ogt +28 -0
  217. package/archetypes/roguelike/assets/ai/guardian.ogt +26 -0
  218. package/archetypes/roguelike/assets/audio/bump.wav +0 -0
  219. package/archetypes/roguelike/assets/audio/drink.wav +0 -0
  220. package/archetypes/roguelike/assets/audio/fall.wav +0 -0
  221. package/archetypes/roguelike/assets/audio/hit.wav +0 -0
  222. package/archetypes/roguelike/assets/audio/hurt.wav +0 -0
  223. package/archetypes/roguelike/assets/audio/item.wav +0 -0
  224. package/archetypes/roguelike/assets/audio/kill.wav +0 -0
  225. package/archetypes/roguelike/assets/audio/pickup.wav +0 -0
  226. package/archetypes/roguelike/assets/audio/roar.wav +0 -0
  227. package/archetypes/roguelike/assets/audio/stairs.wav +0 -0
  228. package/archetypes/roguelike/assets/audio/step.ogt +9 -0
  229. package/archetypes/roguelike/assets/audio/telegraph.wav +0 -0
  230. package/archetypes/roguelike/assets/audio/tomb.wav +0 -0
  231. package/archetypes/roguelike/assets/audio/ui-close.ogt +9 -0
  232. package/archetypes/roguelike/assets/audio/ui-error.ogt +9 -0
  233. package/archetypes/roguelike/assets/audio/ui-open.ogt +9 -0
  234. package/archetypes/roguelike/assets/audio/ui-press.ogt +9 -0
  235. package/archetypes/roguelike/assets/audio/ui-success.ogt +9 -0
  236. package/archetypes/roguelike/assets/audio/won.wav +0 -0
  237. package/archetypes/roguelike/assets/fonts/NotoSansSC-subset.ttf +0 -0
  238. package/archetypes/roguelike/assets/fonts/NotoSansSC-subset.ttf.ogt +10 -0
  239. package/archetypes/roguelike/assets/fonts/OFL.txt +93 -0
  240. package/archetypes/roguelike/assets/maps/dive.ogt +106 -0
  241. package/archetypes/roguelike/assets/skins/lampdive/DotGothic16-Regular.ttf +0 -0
  242. package/archetypes/roguelike/assets/skins/lampdive/DotGothic16-Regular.ttf.ogt +9 -0
  243. package/archetypes/roguelike/assets/skins/lampdive/LICENSES.md +16 -0
  244. package/archetypes/roguelike/assets/skins/lampdive/OFL.txt +93 -0
  245. package/archetypes/roguelike/assets/skins/lampdive/atlas.png +0 -0
  246. package/archetypes/roguelike/assets/skins/lampdive/atlas.png.ogt +7 -0
  247. package/archetypes/roguelike/assets/skins/lampdive/icons.png +0 -0
  248. package/archetypes/roguelike/assets/skins/lampdive/icons.png.ogt +7 -0
  249. package/archetypes/roguelike/assets/skins/lampdive/skin.ogt +115 -0
  250. package/archetypes/roguelike/assets/sprites/dive.ogt +50 -0
  251. package/archetypes/roguelike/assets/sprites/dive.png +0 -0
  252. package/archetypes/roguelike/assets/sprites/dive.png.ogt +7 -0
  253. package/archetypes/roguelike/assets/sprites/glow.png +0 -0
  254. package/archetypes/roguelike/assets/sprites/glow.png.ogt +7 -0
  255. package/archetypes/roguelike/assets/strings/en.ogt +57 -0
  256. package/archetypes/roguelike/assets/strings/zh-CN.ogt +57 -0
  257. package/archetypes/roguelike/assets/tiles/tomb.ogt +31 -0
  258. package/archetypes/roguelike/assets/tiles/tomb.png +0 -0
  259. package/archetypes/roguelike/assets/tiles/tomb.png.ogt +7 -0
  260. package/archetypes/roguelike/gitattributes +22 -0
  261. package/archetypes/roguelike/gitignore +8 -0
  262. package/archetypes/roguelike/host.d.ts +46 -0
  263. package/archetypes/roguelike/package.json +18 -0
  264. package/archetypes/roguelike/project.ogt +14 -0
  265. package/archetypes/roguelike/references/metal/dive.png +0 -0
  266. package/archetypes/roguelike/references/metal/over.png +0 -0
  267. package/archetypes/roguelike/references/metal/title.png +0 -0
  268. package/archetypes/roguelike/src/art.ts +23 -0
  269. package/archetypes/roguelike/src/components.ts +169 -0
  270. package/archetypes/roguelike/src/dive.ts +144 -0
  271. package/archetypes/roguelike/src/foes.ts +174 -0
  272. package/archetypes/roguelike/src/main.ts +258 -0
  273. package/archetypes/roguelike/src/systems.ts +620 -0
  274. package/archetypes/roguelike/src/ui.ts +350 -0
  275. package/archetypes/roguelike/tests/flow.og.ts +54 -0
  276. package/archetypes/roguelike/tests/foes.og.ts +45 -0
  277. package/archetypes/roguelike/tests/frames.og.ts +32 -0
  278. package/archetypes/roguelike/tests/frames.ts +134 -0
  279. package/archetypes/roguelike/tests/lib.ts +83 -0
  280. package/archetypes/roguelike/tests/lose.og.ts +44 -0
  281. package/archetypes/roguelike/tests/pad.og.ts +54 -0
  282. package/archetypes/roguelike/tests/pause.og.ts +59 -0
  283. package/archetypes/roguelike/tests/phone.og.ts +54 -0
  284. package/archetypes/roguelike/tests/replay.og.ts +24 -0
  285. package/archetypes/roguelike/tests/win.og.ts +60 -0
  286. package/archetypes/roguelike/tools/make-assets.py +518 -0
  287. package/archetypes/roguelike/tools/oglite.py +285 -0
  288. package/archetypes/roguelike/tsconfig.json +17 -0
  289. package/archetypes/runner/.origin/setup +14 -0
  290. package/archetypes/runner/LICENSES.md +10 -0
  291. package/archetypes/runner/README.md +225 -0
  292. package/archetypes/runner/assets/audio/coin.wav +0 -0
  293. package/archetypes/runner/assets/audio/crash.wav +0 -0
  294. package/archetypes/runner/assets/audio/hold.ogt +9 -0
  295. package/archetypes/runner/assets/audio/jump.wav +0 -0
  296. package/archetypes/runner/assets/audio/start.wav +0 -0
  297. package/archetypes/runner/assets/fonts/OFL.txt +93 -0
  298. package/archetypes/runner/assets/fonts/ui.ttf +0 -0
  299. package/archetypes/runner/assets/fonts/ui.ttf.ogt +11 -0
  300. package/archetypes/runner/assets/maps/far.ogt +25 -0
  301. package/archetypes/runner/assets/maps/near.ogt +25 -0
  302. package/archetypes/runner/assets/maps/roofs.ogt +19 -0
  303. package/archetypes/runner/assets/scenes/main.ogt +35 -0
  304. package/archetypes/runner/assets/sprites/coin.ogt +11 -0
  305. package/archetypes/runner/assets/sprites/coin.png +0 -0
  306. package/archetypes/runner/assets/sprites/coin.png.ogt +7 -0
  307. package/archetypes/runner/assets/sprites/courier.ogt +32 -0
  308. package/archetypes/runner/assets/sprites/courier.png +0 -0
  309. package/archetypes/runner/assets/sprites/courier.png.ogt +7 -0
  310. package/archetypes/runner/assets/sprites/props.ogt +21 -0
  311. package/archetypes/runner/assets/sprites/props.png +0 -0
  312. package/archetypes/runner/assets/sprites/props.png.ogt +7 -0
  313. package/archetypes/runner/assets/sprites/sky.png +0 -0
  314. package/archetypes/runner/assets/sprites/sky.png.ogt +7 -0
  315. package/archetypes/runner/assets/tiles/city.ogt +18 -0
  316. package/archetypes/runner/assets/tiles/city.png +0 -0
  317. package/archetypes/runner/assets/tiles/city.png.ogt +7 -0
  318. package/archetypes/runner/gitattributes +22 -0
  319. package/archetypes/runner/gitignore +8 -0
  320. package/archetypes/runner/host.d.ts +46 -0
  321. package/archetypes/runner/package.json +18 -0
  322. package/archetypes/runner/project.ogt +18 -0
  323. package/archetypes/runner/references/metal/frames-coin.png +0 -0
  324. package/archetypes/runner/references/metal/frames-crash.png +0 -0
  325. package/archetypes/runner/references/metal/frames-title.png +0 -0
  326. package/archetypes/runner/src/art.ts +57 -0
  327. package/archetypes/runner/src/components.ts +94 -0
  328. package/archetypes/runner/src/main.ts +241 -0
  329. package/archetypes/runner/src/systems.ts +553 -0
  330. package/archetypes/runner/tests/coins.og.ts +30 -0
  331. package/archetypes/runner/tests/flow.og.ts +72 -0
  332. package/archetypes/runner/tests/frames.og.ts +37 -0
  333. package/archetypes/runner/tests/frames.ts +134 -0
  334. package/archetypes/runner/tests/jump.og.ts +44 -0
  335. package/archetypes/runner/tests/lib.ts +42 -0
  336. package/archetypes/runner/tests/records.og.ts +43 -0
  337. package/archetypes/runner/tests/replay.og.ts +36 -0
  338. package/archetypes/runner/tests/sounds.og.ts +43 -0
  339. package/archetypes/runner/tests/tune.og.ts +36 -0
  340. package/archetypes/runner/tools/make-assets.py +603 -0
  341. package/archetypes/runner/tools/oglite.py +285 -0
  342. package/archetypes/runner/tsconfig.json +17 -0
  343. package/archetypes/third-person/.origin/setup +14 -0
  344. package/archetypes/third-person/LICENSES.md +23 -0
  345. package/archetypes/third-person/README.md +249 -0
  346. package/archetypes/third-person/assets/ai/sentinel-east.ogt +69 -0
  347. package/archetypes/third-person/assets/ai/sentinel-north.ogt +69 -0
  348. package/archetypes/third-person/assets/ai/sentinel-west.ogt +69 -0
  349. package/archetypes/third-person/assets/anims/humanoid-clips.glb +0 -0
  350. package/archetypes/third-person/assets/audio/alarm.wav +0 -0
  351. package/archetypes/third-person/assets/audio/dawn.wav +0 -0
  352. package/archetypes/third-person/assets/audio/grab.wav +0 -0
  353. package/archetypes/third-person/assets/audio/ignite.wav +0 -0
  354. package/archetypes/third-person/assets/audio/jump.wav +0 -0
  355. package/archetypes/third-person/assets/audio/night.wav +0 -0
  356. package/archetypes/third-person/assets/audio/splash.wav +0 -0
  357. package/archetypes/third-person/assets/audio/step.ogt +9 -0
  358. package/archetypes/third-person/assets/audio/ui-close.ogt +9 -0
  359. package/archetypes/third-person/assets/audio/ui-error.ogt +9 -0
  360. package/archetypes/third-person/assets/audio/ui-open.ogt +9 -0
  361. package/archetypes/third-person/assets/audio/ui-press.ogt +9 -0
  362. package/archetypes/third-person/assets/audio/ui-success.ogt +9 -0
  363. package/archetypes/third-person/assets/audio/vale.wav +0 -0
  364. package/archetypes/third-person/assets/fonts/NotoSansSC-subset.ttf +0 -0
  365. package/archetypes/third-person/assets/fonts/NotoSansSC-subset.ttf.ogt +10 -0
  366. package/archetypes/third-person/assets/fonts/OFL.txt +93 -0
  367. package/archetypes/third-person/assets/fx/burst.ogt +25 -0
  368. package/archetypes/third-person/assets/fx/fire.ogt +24 -0
  369. package/archetypes/third-person/assets/fx/smoke.ogt +24 -0
  370. package/archetypes/third-person/assets/fx/splash.ogt +24 -0
  371. package/archetypes/third-person/assets/luts/teal-orange.cube +4917 -0
  372. package/archetypes/third-person/assets/models/stout.glb +0 -0
  373. package/archetypes/third-person/assets/models/strider.glb +0 -0
  374. package/archetypes/third-person/assets/models/strider.glb.ogt +9 -0
  375. package/archetypes/third-person/assets/nav/vale.ogt +43 -0
  376. package/archetypes/third-person/assets/rigs/strider.ogt +6 -0
  377. package/archetypes/third-person/assets/skins/ember/Cinzel-Bold.ttf +0 -0
  378. package/archetypes/third-person/assets/skins/ember/Cinzel-Bold.ttf.ogt +9 -0
  379. package/archetypes/third-person/assets/skins/ember/LICENSES.md +13 -0
  380. package/archetypes/third-person/assets/skins/ember/Newsreader-Medium.ttf +0 -0
  381. package/archetypes/third-person/assets/skins/ember/Newsreader-Medium.ttf.ogt +9 -0
  382. package/archetypes/third-person/assets/skins/ember/OFL.txt +94 -0
  383. package/archetypes/third-person/assets/skins/ember/atlas.png +0 -0
  384. package/archetypes/third-person/assets/skins/ember/atlas.png.ogt +7 -0
  385. package/archetypes/third-person/assets/skins/ember/icons.png +0 -0
  386. package/archetypes/third-person/assets/skins/ember/icons.png.ogt +7 -0
  387. package/archetypes/third-person/assets/skins/ember/skin.ogt +109 -0
  388. package/archetypes/third-person/assets/strings/en.ogt +47 -0
  389. package/archetypes/third-person/assets/strings/zh-CN.ogt +47 -0
  390. package/archetypes/third-person/assets/terrain/vale-control.png +0 -0
  391. package/archetypes/third-person/assets/terrain/vale.ogt +42 -0
  392. package/archetypes/third-person/assets/terrain/vale.png +0 -0
  393. package/archetypes/third-person/assets/textures/decals.png +0 -0
  394. package/archetypes/third-person/assets/textures/flame.png +0 -0
  395. package/archetypes/third-person/assets/textures/smoke.png +0 -0
  396. package/archetypes/third-person/assets/textures/spark.png +0 -0
  397. package/archetypes/third-person/assets/textures/terrain-grass.png +0 -0
  398. package/archetypes/third-person/assets/textures/terrain-path.png +0 -0
  399. package/archetypes/third-person/assets/textures/terrain-rock.png +0 -0
  400. package/archetypes/third-person/assets/textures/terrain-sand.png +0 -0
  401. package/archetypes/third-person/gitattributes +22 -0
  402. package/archetypes/third-person/gitignore +8 -0
  403. package/archetypes/third-person/host.d.ts +46 -0
  404. package/archetypes/third-person/package.json +18 -0
  405. package/archetypes/third-person/project.ogt +14 -0
  406. package/archetypes/third-person/references/metal/beacon.png +0 -0
  407. package/archetypes/third-person/references/metal/dawn.png +0 -0
  408. package/archetypes/third-person/references/metal/title.png +0 -0
  409. package/archetypes/third-person/references/webgl2/beacon.png +0 -0
  410. package/archetypes/third-person/src/anim.ts +87 -0
  411. package/archetypes/third-person/src/beacons.ts +80 -0
  412. package/archetypes/third-person/src/components.ts +148 -0
  413. package/archetypes/third-person/src/hero.ts +293 -0
  414. package/archetypes/third-person/src/main.ts +164 -0
  415. package/archetypes/third-person/src/sentinels.ts +159 -0
  416. package/archetypes/third-person/src/sound.ts +66 -0
  417. package/archetypes/third-person/src/ui.ts +451 -0
  418. package/archetypes/third-person/src/world.ts +212 -0
  419. package/archetypes/third-person/tests/flow.og.ts +70 -0
  420. package/archetypes/third-person/tests/frames.og.ts +35 -0
  421. package/archetypes/third-person/tests/frames.ts +134 -0
  422. package/archetypes/third-person/tests/hitstop.og.ts +26 -0
  423. package/archetypes/third-person/tests/lib.ts +87 -0
  424. package/archetypes/third-person/tests/lose.og.ts +44 -0
  425. package/archetypes/third-person/tests/pause.og.ts +64 -0
  426. package/archetypes/third-person/tests/phone.og.ts +65 -0
  427. package/archetypes/third-person/tests/replay.og.ts +32 -0
  428. package/archetypes/third-person/tests/restart.og.ts +28 -0
  429. package/archetypes/third-person/tests/sentinels.og.ts +48 -0
  430. package/archetypes/third-person/tests/win.og.ts +62 -0
  431. package/archetypes/third-person/tools/make-assets.py +353 -0
  432. package/archetypes/third-person/tools/oglite.py +285 -0
  433. package/archetypes/third-person/tsconfig.json +17 -0
  434. package/archetypes/topdown/.origin/setup +14 -0
  435. package/archetypes/topdown/LICENSES.md +10 -0
  436. package/archetypes/topdown/README.md +235 -0
  437. package/archetypes/topdown/assets/ai/slime.ogt +49 -0
  438. package/archetypes/topdown/assets/audio/coin.wav +0 -0
  439. package/archetypes/topdown/assets/audio/door.wav +0 -0
  440. package/archetypes/topdown/assets/audio/hit.wav +0 -0
  441. package/archetypes/topdown/assets/audio/hurt.wav +0 -0
  442. package/archetypes/topdown/assets/audio/key.wav +0 -0
  443. package/archetypes/topdown/assets/audio/step.ogt +9 -0
  444. package/archetypes/topdown/assets/fonts/OFL.txt +93 -0
  445. package/archetypes/topdown/assets/fonts/ui.ttf +0 -0
  446. package/archetypes/topdown/assets/fonts/ui.ttf.ogt +9 -0
  447. package/archetypes/topdown/assets/maps/tomb.tmj +2183 -0
  448. package/archetypes/topdown/assets/sprites/hero.ogt +58 -0
  449. package/archetypes/topdown/assets/sprites/hero.png +0 -0
  450. package/archetypes/topdown/assets/sprites/hero.png.ogt +7 -0
  451. package/archetypes/topdown/assets/sprites/items.ogt +15 -0
  452. package/archetypes/topdown/assets/sprites/items.png +0 -0
  453. package/archetypes/topdown/assets/sprites/items.png.ogt +7 -0
  454. package/archetypes/topdown/assets/sprites/slime.ogt +17 -0
  455. package/archetypes/topdown/assets/sprites/slime.png +0 -0
  456. package/archetypes/topdown/assets/sprites/slime.png.ogt +7 -0
  457. package/archetypes/topdown/assets/tiles/dungeon.ogt +65 -0
  458. package/archetypes/topdown/assets/tiles/dungeon.png +0 -0
  459. package/archetypes/topdown/assets/tiles/dungeon.png.ogt +7 -0
  460. package/archetypes/topdown/gitattributes +22 -0
  461. package/archetypes/topdown/gitignore +8 -0
  462. package/archetypes/topdown/host.d.ts +46 -0
  463. package/archetypes/topdown/package.json +18 -0
  464. package/archetypes/topdown/project.ogt +14 -0
  465. package/archetypes/topdown/references/metal/crit.png +0 -0
  466. package/archetypes/topdown/references/metal/dash.png +0 -0
  467. package/archetypes/topdown/references/metal/east.png +0 -0
  468. package/archetypes/topdown/references/metal/start.png +0 -0
  469. package/archetypes/topdown/src/art.ts +48 -0
  470. package/archetypes/topdown/src/components.ts +128 -0
  471. package/archetypes/topdown/src/main.ts +275 -0
  472. package/archetypes/topdown/src/systems.ts +503 -0
  473. package/archetypes/topdown/tests/ai.og.ts +64 -0
  474. package/archetypes/topdown/tests/combat.og.ts +72 -0
  475. package/archetypes/topdown/tests/door.og.ts +62 -0
  476. package/archetypes/topdown/tests/flee.og.ts +49 -0
  477. package/archetypes/topdown/tests/frames.og.ts +45 -0
  478. package/archetypes/topdown/tests/frames.ts +134 -0
  479. package/archetypes/topdown/tests/lib.ts +71 -0
  480. package/archetypes/topdown/tests/replay.og.ts +40 -0
  481. package/archetypes/topdown/tests/walk.og.ts +46 -0
  482. package/archetypes/topdown/tools/make-assets.py +623 -0
  483. package/archetypes/topdown/tools/oglite.py +285 -0
  484. package/archetypes/topdown/tsconfig.json +17 -0
  485. package/archetypes/tower-defense/.origin/setup +14 -0
  486. package/archetypes/tower-defense/LICENSES.md +15 -0
  487. package/archetypes/tower-defense/README.md +240 -0
  488. package/archetypes/tower-defense/assets/ai/plant.ogt +16 -0
  489. package/archetypes/tower-defense/assets/audio/clear.wav +0 -0
  490. package/archetypes/tower-defense/assets/audio/frost.wav +0 -0
  491. package/archetypes/tower-defense/assets/audio/leak.wav +0 -0
  492. package/archetypes/tower-defense/assets/audio/lost.wav +0 -0
  493. package/archetypes/tower-defense/assets/audio/night.wav +0 -0
  494. package/archetypes/tower-defense/assets/audio/plant.wav +0 -0
  495. package/archetypes/tower-defense/assets/audio/pop.wav +0 -0
  496. package/archetypes/tower-defense/assets/audio/thorn.wav +0 -0
  497. package/archetypes/tower-defense/assets/audio/ui-close.ogt +9 -0
  498. package/archetypes/tower-defense/assets/audio/ui-error.ogt +9 -0
  499. package/archetypes/tower-defense/assets/audio/ui-open.ogt +9 -0
  500. package/archetypes/tower-defense/assets/audio/ui-press.ogt +9 -0
  501. package/archetypes/tower-defense/assets/audio/ui-success.ogt +9 -0
  502. package/archetypes/tower-defense/assets/audio/wave.wav +0 -0
  503. package/archetypes/tower-defense/assets/audio/won.wav +0 -0
  504. package/archetypes/tower-defense/assets/fonts/NotoSansSC-subset.ttf +0 -0
  505. package/archetypes/tower-defense/assets/fonts/NotoSansSC-subset.ttf.ogt +10 -0
  506. package/archetypes/tower-defense/assets/fonts/OFL.txt +93 -0
  507. package/archetypes/tower-defense/assets/fx/fireflies.ogt +21 -0
  508. package/archetypes/tower-defense/assets/fx/pop.ogt +21 -0
  509. package/archetypes/tower-defense/assets/maps/garden.ogt +91 -0
  510. package/archetypes/tower-defense/assets/skins/pathguard/Fredoka-SemiBold.ttf +0 -0
  511. package/archetypes/tower-defense/assets/skins/pathguard/Fredoka-SemiBold.ttf.ogt +9 -0
  512. package/archetypes/tower-defense/assets/skins/pathguard/LICENSES.md +13 -0
  513. package/archetypes/tower-defense/assets/skins/pathguard/LilitaOne-Regular.ttf +0 -0
  514. package/archetypes/tower-defense/assets/skins/pathguard/LilitaOne-Regular.ttf.ogt +9 -0
  515. package/archetypes/tower-defense/assets/skins/pathguard/OFL.txt +94 -0
  516. package/archetypes/tower-defense/assets/skins/pathguard/atlas.png +0 -0
  517. package/archetypes/tower-defense/assets/skins/pathguard/atlas.png.ogt +7 -0
  518. package/archetypes/tower-defense/assets/skins/pathguard/icons.png +0 -0
  519. package/archetypes/tower-defense/assets/skins/pathguard/icons.png.ogt +7 -0
  520. package/archetypes/tower-defense/assets/skins/pathguard/skin.ogt +111 -0
  521. package/archetypes/tower-defense/assets/sprites/garden.ogt +66 -0
  522. package/archetypes/tower-defense/assets/sprites/garden.png +0 -0
  523. package/archetypes/tower-defense/assets/sprites/garden.png.ogt +7 -0
  524. package/archetypes/tower-defense/assets/sprites/glow.png +0 -0
  525. package/archetypes/tower-defense/assets/sprites/glow.png.ogt +7 -0
  526. package/archetypes/tower-defense/assets/sprites/ring.png +0 -0
  527. package/archetypes/tower-defense/assets/sprites/ring.png.ogt +7 -0
  528. package/archetypes/tower-defense/assets/sprites/spark.png +0 -0
  529. package/archetypes/tower-defense/assets/sprites/spark.png.ogt +7 -0
  530. package/archetypes/tower-defense/assets/strings/en.ogt +47 -0
  531. package/archetypes/tower-defense/assets/strings/zh-CN.ogt +47 -0
  532. package/archetypes/tower-defense/assets/tiles/garden.ogt +10 -0
  533. package/archetypes/tower-defense/assets/tiles/garden.png +0 -0
  534. package/archetypes/tower-defense/assets/tiles/garden.png.ogt +7 -0
  535. package/archetypes/tower-defense/gitattributes +22 -0
  536. package/archetypes/tower-defense/gitignore +8 -0
  537. package/archetypes/tower-defense/host.d.ts +46 -0
  538. package/archetypes/tower-defense/package.json +18 -0
  539. package/archetypes/tower-defense/project.ogt +14 -0
  540. package/archetypes/tower-defense/references/metal/end.png +0 -0
  541. package/archetypes/tower-defense/references/metal/title.png +0 -0
  542. package/archetypes/tower-defense/references/metal/wave.png +0 -0
  543. package/archetypes/tower-defense/src/art.ts +24 -0
  544. package/archetypes/tower-defense/src/components.ts +156 -0
  545. package/archetypes/tower-defense/src/main.ts +253 -0
  546. package/archetypes/tower-defense/src/systems.ts +658 -0
  547. package/archetypes/tower-defense/src/ui.ts +382 -0
  548. package/archetypes/tower-defense/tests/flow.og.ts +56 -0
  549. package/archetypes/tower-defense/tests/frames.og.ts +31 -0
  550. package/archetypes/tower-defense/tests/frames.ts +134 -0
  551. package/archetypes/tower-defense/tests/lib.ts +81 -0
  552. package/archetypes/tower-defense/tests/lose.og.ts +40 -0
  553. package/archetypes/tower-defense/tests/maze.og.ts +53 -0
  554. package/archetypes/tower-defense/tests/pad.og.ts +41 -0
  555. package/archetypes/tower-defense/tests/pause.og.ts +59 -0
  556. package/archetypes/tower-defense/tests/phone.og.ts +49 -0
  557. package/archetypes/tower-defense/tests/replay.og.ts +28 -0
  558. package/archetypes/tower-defense/tests/win.og.ts +58 -0
  559. package/archetypes/tower-defense/tools/make-assets.py +640 -0
  560. package/archetypes/tower-defense/tools/oglite.py +285 -0
  561. package/archetypes/tower-defense/tsconfig.json +17 -0
  562. package/bin/create.ts +503 -0
  563. package/looks/catalogue.json +1871 -0
  564. package/package.json +31 -4
  565. package/template/.origin/setup +14 -0
  566. package/template/LICENSES.md +23 -0
  567. package/template/README.md +37 -0
  568. package/template/assets/ai/guard.ogt +48 -0
  569. package/template/assets/audio/blip.wav +0 -0
  570. package/template/assets/audio/click.ogt +9 -0
  571. package/template/assets/fonts/NotoSansSC-Regular-subset.ttf +0 -0
  572. package/template/assets/fonts/NotoSansSC-Regular-subset.ttf.ogt +12 -0
  573. package/template/assets/fonts/OFL.txt +93 -0
  574. package/template/assets/looks/origin-game.ogt +12 -0
  575. package/template/assets/models/dropship.glb +0 -0
  576. package/template/assets/models/walker.glb +0 -0
  577. package/template/assets/nav/yard.ogt +27 -0
  578. package/template/assets/scenes/main.ogt +34 -0
  579. package/template/assets/strings/en.ogt +14 -0
  580. package/template/assets/textures/stone.png +0 -0
  581. package/template/assets/textures/stone_n.png +0 -0
  582. package/template/assets/textures/stone_n.png.ogt +7 -0
  583. package/template/gitattributes +22 -0
  584. package/template/gitignore +8 -0
  585. package/template/package.json +18 -0
  586. package/template/project.ogt +25 -0
  587. package/template/src/main.ts +246 -0
  588. package/template/tests/guard.og.ts +67 -0
  589. package/template/tests/smoke.og.ts +43 -0
  590. package/template/tsconfig.json +17 -0
@@ -0,0 +1,623 @@
1
+ #!/usr/bin/env python3
2
+ """Regenerates the topdown archetype's self-made assets (CC0), byte for byte:
3
+
4
+ python3 tools/make-assets.py # from the archetype directory
5
+
6
+ - assets/tiles/dungeon.png + dungeon.ogt: a 16 px pixel-art tileset (the 47
7
+ blob shapes of the wall terrain, floor slabs, a three-frame torch, a door)
8
+ and its tileset text (solid walls, the animated torch, the blob47 rules),
9
+ - assets/maps/tomb.tmj: the two-room Tiled map (floor, walls with
10
+ `autotile` = wall and `collision`, the door, torches above the hero, and
11
+ the objects: spawn, enemy, pickups, door, rooms),
12
+ - assets/sprites/{hero,slime,items}.png + .ogt: flipbook sheets,
13
+ - assets/audio/*.wav: hit, hurt, coin, key and door sounds,
14
+ - assets/fonts/ui.ttf: Noto Sans SC subset to Latin-1 (needs fontTools and
15
+ the project template's font; skipped with a note when either is missing).
16
+
17
+ Standard library only except the font subset; deterministic.
18
+ """
19
+ import json, os, sys
20
+
21
+ here = os.path.dirname(os.path.abspath(__file__))
22
+ sys.path.insert(0, here)
23
+ from oglite import png_bytes, write_wav, tone, noise, mix, concat, subset_font # noqa: E402
24
+
25
+ root = os.path.dirname(here)
26
+ assets = os.path.join(root, "assets")
27
+ T = 16 # pixels per tile and per sprite frame
28
+
29
+
30
+ def rgb(h, a=255):
31
+ h = h.lstrip("#")
32
+ return (int(h[0:2], 16), int(h[2:4], 16), int(h[4:6], 16), a)
33
+
34
+
35
+ CLEAR = (0, 0, 0, 0)
36
+
37
+
38
+ class Pix:
39
+ """Hard-edged pixels (no antialiasing): pixel art, sampled nearest."""
40
+
41
+ def __init__(self, w, h):
42
+ self.w, self.h = w, h
43
+ self.p = [CLEAR] * (w * h)
44
+
45
+ def set(self, x, y, c):
46
+ if 0 <= x < self.w and 0 <= y < self.h:
47
+ self.p[y * self.w + x] = rgb(c) if isinstance(c, str) else c
48
+
49
+ def rect(self, x, y, w, h, c):
50
+ for yy in range(y, y + h):
51
+ for xx in range(x, x + w):
52
+ self.set(xx, yy, c)
53
+
54
+ def blit(self, other, ox, oy, flip=False):
55
+ for y in range(other.h):
56
+ for x in range(other.w):
57
+ c = other.p[y * other.w + (other.w - 1 - x if flip else x)]
58
+ if c[3]:
59
+ self.set(ox + x, oy + y, c)
60
+
61
+ def outline(self, colour="#14161b"):
62
+ """A one-pixel outline around every opaque pixel (on transparent ones)."""
63
+ src = list(self.p)
64
+ for y in range(self.h):
65
+ for x in range(self.w):
66
+ if src[y * self.w + x][3]:
67
+ continue
68
+ for dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)):
69
+ xx, yy = x + dx, y + dy
70
+ if 0 <= xx < self.w and 0 <= yy < self.h and src[yy * self.w + xx][3]:
71
+ self.set(x, y, colour)
72
+ break
73
+
74
+ def png(self):
75
+ rows = [bytes(v for c in self.p[y * self.w:(y + 1) * self.w] for v in c) for y in range(self.h)]
76
+ return png_bytes(self.w, self.h, rows)
77
+
78
+
79
+ def hashn(*v):
80
+ """A small deterministic hash for speckles."""
81
+ h = 2166136261
82
+ for x in v:
83
+ h = ((h ^ (x & 0xFFFFFFFF)) * 16777619) & 0xFFFFFFFF
84
+ return h
85
+
86
+
87
+ # ── the tileset ──────────────────────────────────────────────────────────
88
+
89
+ N, NE, E, SE, S, SW, W, NW = 1, 2, 4, 8, 16, 32, 64, 128
90
+
91
+
92
+ def reduce_blob(m):
93
+ """Keep a corner bit only when both of its edge bits are set (og-tilemap's rule)."""
94
+ out = m & (N | E | S | W)
95
+ for corner, a, b in ((NE, N, E), (SE, S, E), (SW, S, W), (NW, N, W)):
96
+ if m & corner and m & a and m & b:
97
+ out |= corner
98
+ return out
99
+
100
+
101
+ BLOB = sorted({reduce_blob(m) for m in range(256)}) # the 47 shapes; tile id = index
102
+ assert len(BLOB) == 47
103
+ FLOOR = [47, 48, 49]
104
+ MOSS = 50
105
+ TORCH = [51, 52, 53]
106
+ DOOR_TOP, DOOR_BOTTOM = 54, 55
107
+ COLS, ROWS = 8, 8
108
+
109
+ TOP = "#1b1724"
110
+ TOP_DOT = "#231e2e"
111
+ RIM = "#6d5f80"
112
+ FACE = "#4a3f5c"
113
+ FACE_HI = "#56496a"
114
+ MORTAR = "#2a2336"
115
+ FLOOR_A, FLOOR_B, GROUT = "#312c3a", "#38323f", "#24202b"
116
+
117
+
118
+ def wall_tile(m):
119
+ t = Pix(T, T)
120
+ t.rect(0, 0, T, T, TOP)
121
+ for i in range(6):
122
+ h = hashn(m, i)
123
+ t.set(h % T, (h >> 8) % T, TOP_DOT)
124
+ if not m & S:
125
+ # The face towards the viewer: bricks under a light rim.
126
+ t.rect(0, 8, T, 8, FACE)
127
+ for row, y in enumerate(range(8, 16, 4)):
128
+ t.rect(0, y + 3, T, 1, MORTAR)
129
+ off = 0 if row % 2 == 0 else 4
130
+ for x in range(off, T, 8):
131
+ t.rect(x, y, 1, 3, MORTAR)
132
+ t.set(x + 1, y, FACE_HI)
133
+ t.rect(0, 7, T, 1, RIM)
134
+ if not m & N:
135
+ t.rect(0, 0, T, 2, RIM)
136
+ if not m & W:
137
+ t.rect(0, 0, 2, 8 if not m & S else T, RIM)
138
+ if not m & E:
139
+ t.rect(T - 2, 0, 2, 8 if not m & S else T, RIM)
140
+ # Inner corners: both edges filled, the diagonal open.
141
+ if m & N and m & W and not m & NW:
142
+ t.rect(0, 0, 2, 2, RIM)
143
+ if m & N and m & E and not m & NE:
144
+ t.rect(T - 2, 0, 2, 2, RIM)
145
+ if m & S and m & W and not m & SW:
146
+ t.rect(0, T - 2, 2, 2, RIM)
147
+ if m & S and m & E and not m & SE:
148
+ t.rect(T - 2, T - 2, 2, 2, RIM)
149
+ return t
150
+
151
+
152
+ def floor_tile(v):
153
+ t = Pix(T, T)
154
+ t.rect(0, 0, T, T, FLOOR_A)
155
+ # Two slabs per tile, offset by variant.
156
+ t.rect(0, 0, T, 1, GROUT)
157
+ t.rect(0, 0, 1, T, GROUT)
158
+ t.rect(0, 8, T, 1, GROUT)
159
+ t.rect(4 + 4 * v, 1, 1, 7, GROUT)
160
+ t.rect(10 - 3 * v, 9, 1, 7, GROUT)
161
+ for i in range(5 + v * 2):
162
+ h = hashn(v, i, 7)
163
+ t.set(1 + h % 15, 1 + (h >> 8) % 15, FLOOR_B)
164
+ return t
165
+
166
+
167
+ def moss_tile():
168
+ t = floor_tile(0)
169
+ for i in range(18):
170
+ h = hashn(99, i)
171
+ t.set(h % T, (h >> 8) % T, "#2f4a36" if i % 3 else "#3c5e40")
172
+ return t
173
+
174
+
175
+ def torch_tile(frame):
176
+ t = Pix(T, T)
177
+ # The sconce on the wall face, the flame above it.
178
+ # A glow on the bricks behind it, the sconce, the flame above it.
179
+ for y in range(6, 15):
180
+ for x in range(3, 13):
181
+ if (x - 7.5) ** 2 + (y - 10) ** 2 < 20 and (x + y + frame) % 2 == 0:
182
+ t.set(x, y, "#5e3f3a")
183
+ t.rect(6, 12, 4, 2, "#8a6a3a")
184
+ t.rect(7, 14, 2, 2, "#5b4426")
185
+ flames = [
186
+ [(7, 7, 2, 5, "#ff7a2f"), (7, 9, 2, 3, "#ffb347"), (7, 10, 1, 2, "#ffe08a")],
187
+ [(6, 8, 3, 4, "#ff7a2f"), (7, 9, 2, 3, "#ffb347"), (8, 10, 1, 2, "#ffe08a")],
188
+ [(7, 6, 3, 6, "#ff7a2f"), (8, 8, 1, 4, "#ffb347"), (8, 10, 1, 1, "#ffe08a")],
189
+ ][frame]
190
+ for x, y, w, h, c in flames:
191
+ t.rect(x, y, w, h, c)
192
+ t.set(6 + frame, 5, "#ff7a2f")
193
+ return t
194
+
195
+
196
+ def door_tile(top):
197
+ t = Pix(T, T)
198
+ t.rect(0, 0, T, T, "#5a3720")
199
+ for x in (1, 5, 10, 14):
200
+ t.rect(x, 0, 1, T, "#3e2514")
201
+ t.rect(0, 4 if top else 10, T, 2, "#8b8f99")
202
+ if top:
203
+ t.rect(0, 0, T, 2, "#3e2514")
204
+ else:
205
+ t.rect(6, 2, 4, 4, "#d9b04a") # the lock plate
206
+ t.rect(7, 3, 2, 2, "#5a3720")
207
+ t.rect(0, T - 1, T, 1, "#2a1810")
208
+ return t
209
+
210
+
211
+ def tileset():
212
+ sheet = Pix(COLS * T, ROWS * T)
213
+ tiles = {i: wall_tile(m) for i, m in enumerate(BLOB)}
214
+ for k, i in enumerate(FLOOR):
215
+ tiles[i] = floor_tile(k)
216
+ tiles[MOSS] = moss_tile()
217
+ for k, i in enumerate(TORCH):
218
+ tiles[i] = torch_tile(k)
219
+ tiles[DOOR_TOP] = door_tile(True)
220
+ tiles[DOOR_BOTTOM] = door_tile(False)
221
+ for i, t in tiles.items():
222
+ sheet.blit(t, (i % COLS) * T, (i // COLS) * T)
223
+ return sheet
224
+
225
+
226
+ def tileset_text():
227
+ lines = [
228
+ "type tileset",
229
+ "version 1",
230
+ "---",
231
+ "# Written by tools/make-assets.py: tiles 0-46 are the wall terrain's 47 blob",
232
+ "# shapes, 47-49 floor, 50 moss, 51-53 the torch, 54-55 the door.",
233
+ 'texture "tiles/dungeon.png"',
234
+ f"grid {T} {T} {COLS} {ROWS}",
235
+ "filter nearest",
236
+ "solid " + " ".join(str(i) for i in range(len(BLOB))),
237
+ f"tile {TORCH[0]} {{",
238
+ " frames " + " ".join(str(i) for i in TORCH + [TORCH[1]]),
239
+ " fps 7",
240
+ "}",
241
+ "terrain wall {",
242
+ " mode blob47",
243
+ ]
244
+ lines += [f" rule {m} {i}" for i, m in enumerate(BLOB)]
245
+ lines += [f" default {BLOB.index(255)}", " edge filled", "}"]
246
+ return "\n".join(lines) + "\n"
247
+
248
+
249
+ # ── the map ──────────────────────────────────────────────────────────────
250
+
251
+ MW, MH = 40, 12
252
+ DOOR = (19, 5, 2, 2) # x y w h in cells: the doorway in the dividing wall
253
+
254
+
255
+ def map_layout():
256
+ walls = [[0] * MW for _ in range(MH)]
257
+ for y in range(MH):
258
+ for x in range(MW):
259
+ if y in (0, MH - 1) or x in (0, MW - 1, 19, 20):
260
+ walls[y][x] = 1
261
+ # Pillars: a 2x2 block in the first room, an L and a short wall in the second.
262
+ for x, y in ((6, 3), (7, 3), (6, 4), (7, 4), (26, 3), (26, 4), (26, 5), (27, 5), (28, 5), (33, 7), (34, 7), (35, 7), (35, 8)):
263
+ walls[y][x] = 1
264
+ floor = [[0] * MW for _ in range(MH)]
265
+ for y in range(MH):
266
+ for x in range(MW):
267
+ h = hashn(x, y, 3)
268
+ floor[y][x] = FLOOR[h % 3] if h % 11 else MOSS
269
+ door = [[0] * MW for _ in range(MH)]
270
+ dx, dy, dw, dh = DOOR
271
+ for y in range(dy, dy + dh):
272
+ for x in range(dx, dx + dw):
273
+ door[y][x] = DOOR_TOP if y == dy else DOOR_BOTTOM
274
+ decor = [[0] * MW for _ in range(MH)]
275
+ for x in (3, 10, 16, 23, 30, 36):
276
+ decor[0][x] = TORCH[0]
277
+ return floor, walls, door, decor
278
+
279
+
280
+ def tiled_map():
281
+ floor, walls, door, decor = map_layout()
282
+ gid = lambda t: t + 1 # noqa: E731 (firstgid 1)
283
+ flat = lambda g, f: [f(v) for row in g for v in row] # noqa: E731
284
+
285
+ def tile_layer(i, name, cells, props, f):
286
+ return {
287
+ "id": i, "name": name, "type": "tilelayer", "x": 0, "y": 0,
288
+ "width": MW, "height": MH, "opacity": 1, "visible": True,
289
+ "data": flat(cells, f), "properties": props,
290
+ }
291
+
292
+ def prop(n, t, v):
293
+ return {"name": n, "type": t, "value": v}
294
+
295
+ def obj(i, name, kind, x, y, w=0, h=0, props=None):
296
+ o = {"id": i, "name": name, "type": kind, "x": x * T, "y": y * T, "width": w * T, "height": h * T,
297
+ "rotation": 0, "visible": True}
298
+ if w == 0 and h == 0:
299
+ o["point"] = True
300
+ if props:
301
+ o["properties"] = props
302
+ return o
303
+
304
+ objects = [
305
+ obj(1, "spawn", "spawn", 4.5, 6.5),
306
+ obj(2, "slime", "enemy", 13.5, 5.5),
307
+ obj(3, "coin-0", "coin", 3.5, 2.5),
308
+ obj(4, "coin-1", "coin", 10.5, 8.5),
309
+ obj(5, "coin-2", "coin", 15.5, 2.5),
310
+ obj(6, "key", "key", 16.5, 9.5),
311
+ obj(7, "coin-3", "coin", 24.5, 8.5),
312
+ obj(8, "coin-4", "coin", 31.5, 3.5),
313
+ obj(9, "coin-5", "coin", 37.5, 9.5),
314
+ obj(10, "door", "door", DOOR[0], DOOR[1], DOOR[2], DOOR[3]),
315
+ obj(11, "room-1", "room", 0, 0, 20, MH, [prop("index", "int", 1)]),
316
+ obj(12, "room-2", "room", 20, 0, 20, MH, [prop("index", "int", 2)]),
317
+ ]
318
+ return {
319
+ "compressionlevel": -1, "height": MH, "width": MW, "infinite": False,
320
+ "orientation": "orthogonal", "renderorder": "right-down",
321
+ "tiledversion": "1.10.2", "type": "map", "version": "1.10",
322
+ "tilewidth": T, "tileheight": T, "nextlayerid": 6, "nextobjectid": 13,
323
+ "tilesets": [{"firstgid": 1, "source": "../tiles/dungeon.tsx"}],
324
+ "layers": [
325
+ tile_layer(1, "floor", floor, [], gid),
326
+ tile_layer(2, "walls", walls, [prop("autotile", "string", "wall"), prop("collision", "bool", True)],
327
+ lambda v: gid(BLOB.index(255)) if v else 0),
328
+ tile_layer(3, "door", door, [], lambda v: gid(v) if v else 0),
329
+ tile_layer(4, "decor", decor, [prop("z", "int", 15)], lambda v: gid(v) if v else 0),
330
+ {"id": 5, "name": "objects", "type": "objectgroup", "x": 0, "y": 0, "opacity": 1, "visible": True,
331
+ "draworder": "topdown", "objects": objects},
332
+ ],
333
+ }
334
+
335
+
336
+ # ── sprites ──────────────────────────────────────────────────────────────
337
+
338
+ OUT = "#14161b"
339
+ SKIN, HAIR, TUNIC, TUNIC_D, BELT, BOOT, STEEL = "#f2c79a", "#e8a33a", "#3f9b62", "#2b6e45", "#7a4a2a", "#4a2f22", "#d8dde6"
340
+
341
+
342
+ def hero_frame(facing, step, attack=-1):
343
+ """facing: 0 down, 1 up, 2 side (right). step: 0-3 walk phase. attack: -1, 0 wind-up, 1 strike."""
344
+ f = Pix(T, T)
345
+ bob = 1 if step in (1, 3) else 0
346
+ # Legs alternate.
347
+ lx = [(5, 9), (5, 9), (5, 9), (5, 9)][step]
348
+ if facing == 2:
349
+ a, b = [(6, 8), (5, 9), (6, 8), (7, 7)][step]
350
+ f.rect(a, 12, 2, 3 - (step == 1), BOOT)
351
+ f.rect(b, 12, 2, 3 - (step == 3), BOOT)
352
+ else:
353
+ left_up = step == 1
354
+ right_up = step == 3
355
+ f.rect(lx[0], 12, 2, 2 if left_up else 3, BOOT)
356
+ f.rect(lx[1], 12, 2, 2 if right_up else 3, BOOT)
357
+ # Body.
358
+ f.rect(4, 7 + bob, 8, 5, TUNIC)
359
+ f.rect(4, 10 + bob, 8, 1, BELT)
360
+ f.rect(4, 7 + bob, 1, 5, TUNIC_D)
361
+ # Head.
362
+ f.rect(4, 1 + bob, 8, 6, SKIN)
363
+ if facing == 1:
364
+ f.rect(4, 1 + bob, 8, 5, HAIR)
365
+ elif facing == 0:
366
+ f.rect(4, 1 + bob, 8, 2, HAIR)
367
+ f.set(6, 4 + bob, OUT)
368
+ f.set(9, 4 + bob, OUT)
369
+ else:
370
+ f.rect(4, 1 + bob, 8, 2, HAIR)
371
+ f.rect(4, 1 + bob, 3, 5, HAIR)
372
+ f.set(10, 4 + bob, OUT)
373
+ # The sword.
374
+ if attack >= 0:
375
+ if facing == 0:
376
+ f.rect(10, 9, 3, 1, BELT)
377
+ f.rect(11, 10, 2 if attack else 1, 6 if attack else 2, STEEL)
378
+ elif facing == 1:
379
+ f.rect(2, 6, 3, 1, BELT)
380
+ f.rect(3, 0 if attack else 4, 2 if attack else 1, 6 if attack else 2, STEEL)
381
+ else:
382
+ f.rect(11, 8, 1, 3, BELT)
383
+ f.rect(12, 9, 4 if attack else 2, 2 if attack else 1, STEEL)
384
+ f.outline()
385
+ return f
386
+
387
+
388
+ def hero_sheet():
389
+ # Rows: down, up, side. Columns: walk 0-3, attack 0-1.
390
+ s = Pix(6 * T, 3 * T)
391
+ for r in range(3):
392
+ for c in range(4):
393
+ s.blit(hero_frame(r, c), c * T, r * T)
394
+ for k in range(2):
395
+ s.blit(hero_frame(r, 0, k), (4 + k) * T, r * T)
396
+ return s
397
+
398
+
399
+ HERO_OGT = """type flipbook
400
+ version 1
401
+ ---
402
+ # Written by tools/make-assets.py. Rows: down, up, side (facing right; flipX
403
+ # faces left); columns: four walk frames, then the attack's wind-up and
404
+ # strike. The clip order is the code's (src/art.ts): idle, walk, attack,
405
+ # each down, up, side.
406
+ texture "hero.png"
407
+ pivot 0.5 0
408
+ grid 16 16 6 3
409
+ clip idle_down {
410
+ frames 0
411
+ fps 1
412
+ }
413
+ clip idle_up {
414
+ frames 6
415
+ fps 1
416
+ }
417
+ clip idle_side {
418
+ frames 12
419
+ fps 1
420
+ }
421
+ clip walk_down {
422
+ frames 0 1 2 3
423
+ fps 8
424
+ event 0 "step"
425
+ event 2 "step"
426
+ }
427
+ clip walk_up {
428
+ frames 6 7 8 9
429
+ fps 8
430
+ event 0 "step"
431
+ event 2 "step"
432
+ }
433
+ clip walk_side {
434
+ frames 12 13 14 15
435
+ fps 8
436
+ event 0 "step"
437
+ event 2 "step"
438
+ }
439
+ clip attack_down {
440
+ frames 4 5
441
+ durations 0.07 0.18
442
+ mode once
443
+ event 1 "hit"
444
+ }
445
+ clip attack_up {
446
+ frames 10 11
447
+ durations 0.07 0.18
448
+ mode once
449
+ event 1 "hit"
450
+ }
451
+ clip attack_side {
452
+ frames 16 17
453
+ durations 0.07 0.18
454
+ mode once
455
+ event 1 "hit"
456
+ }
457
+ """
458
+
459
+ SLIME, SLIME_D, SLIME_HI = "#6fd16a", "#2f7a3a", "#c8f5b0"
460
+
461
+
462
+ def slime_frame(k, hurt=False):
463
+ f = Pix(T, T)
464
+ h = [6, 7, 8, 7][k] if not hurt else 4
465
+ w = [12, 11, 10, 11][k] if not hurt else 14
466
+ x0 = (T - w) // 2
467
+ y0 = T - 1 - h
468
+ f.rect(x0, y0 + 1, w, h, SLIME)
469
+ f.rect(x0 + 1, y0, w - 2, 1, SLIME)
470
+ f.rect(x0, T - 2, w, 1, SLIME_D)
471
+ f.rect(x0 + 2, y0 + 1, 2, 1, SLIME_HI)
472
+ ey = y0 + h // 2
473
+ if hurt:
474
+ f.rect(x0 + 3, ey, 2, 1, OUT)
475
+ f.rect(x0 + w - 5, ey, 2, 1, OUT)
476
+ else:
477
+ f.rect(x0 + 3, ey, 2, 2, "#ffffff")
478
+ f.rect(x0 + w - 5, ey, 2, 2, "#ffffff")
479
+ f.set(x0 + 4, ey + 1, OUT)
480
+ f.set(x0 + w - 4, ey + 1, OUT)
481
+ f.outline()
482
+ return f
483
+
484
+
485
+ def slime_sheet():
486
+ s = Pix(5 * T, T)
487
+ for k in range(4):
488
+ s.blit(slime_frame(k), k * T, 0)
489
+ s.blit(slime_frame(0, True), 4 * T, 0)
490
+ return s
491
+
492
+
493
+ SLIME_OGT = """type flipbook
494
+ version 1
495
+ ---
496
+ # Written by tools/make-assets.py: a four-frame bob and a hurt frame.
497
+ texture "slime.png"
498
+ pivot 0.5 0
499
+ grid 16 16 5 1
500
+ clip bob {
501
+ frames 0 1 2 3
502
+ fps 6
503
+ mode pingPong
504
+ }
505
+ clip hurt {
506
+ frames 4
507
+ durations 0.25
508
+ mode once
509
+ }
510
+ """
511
+
512
+ GOLD, GOLD_D, GOLD_HI = "#f2c14e", "#b9862b", "#fff1b0"
513
+
514
+
515
+ def coin_frame(k):
516
+ f = Pix(T, T)
517
+ w = [8, 6, 2, 6][k]
518
+ x0 = (T - w) // 2
519
+ f.rect(x0, 4, w, 8, GOLD)
520
+ f.rect(x0 + 1, 3, max(1, w - 2), 1, GOLD)
521
+ f.rect(x0 + 1, 12, max(1, w - 2), 1, GOLD_D)
522
+ if w > 2:
523
+ f.rect(x0 + 1, 5, 1, 4, GOLD_HI)
524
+ f.outline()
525
+ return f
526
+
527
+
528
+ def key_frame():
529
+ f = Pix(T, T)
530
+ f.rect(3, 4, 5, 5, "#e8d07a")
531
+ f.rect(5, 6, 1, 1, CLEAR)
532
+ f.rect(8, 6, 6, 2, "#e8d07a")
533
+ f.rect(11, 8, 1, 2, "#e8d07a")
534
+ f.rect(13, 8, 1, 2, "#e8d07a")
535
+ f.rect(3, 4, 1, 5, "#b99a3e")
536
+ f.outline()
537
+ return f
538
+
539
+
540
+ def items_sheet():
541
+ s = Pix(5 * T, T)
542
+ for k in range(4):
543
+ s.blit(coin_frame(k), k * T, 0)
544
+ s.blit(key_frame(), 4 * T, 0)
545
+ return s
546
+
547
+
548
+ ITEMS_OGT = """type flipbook
549
+ version 1
550
+ ---
551
+ # Written by tools/make-assets.py: a spinning coin and a key.
552
+ texture "items.png"
553
+ pivot 0.5 0
554
+ grid 16 16 5 1
555
+ clip coin {
556
+ frames 0 1 2 3
557
+ fps 10
558
+ }
559
+ clip key {
560
+ frames 4
561
+ fps 1
562
+ }
563
+ """
564
+
565
+ PIXEL = """type import
566
+ version 1
567
+ ---
568
+ # Pixel art: lossless, no mips, sampled nearest.
569
+ texture {
570
+ kind pixel
571
+ }
572
+ """
573
+
574
+ FONT_IMPORT = """type import
575
+ version 1
576
+ ---
577
+ # Written by tools/make-assets.py: the HUD and floating texts use Latin-1 only.
578
+ font {
579
+ charset latin
580
+ em_px 48
581
+ px_range 6
582
+ }
583
+ """
584
+
585
+
586
+ def write(path, data):
587
+ path = os.path.join(assets, path)
588
+ os.makedirs(os.path.dirname(path), exist_ok=True)
589
+ mode = "wb" if isinstance(data, bytes) else "w"
590
+ with open(path, mode) as f:
591
+ f.write(data)
592
+
593
+
594
+ def main():
595
+ write("tiles/dungeon.png", tileset().png())
596
+ write("tiles/dungeon.png.ogt", PIXEL)
597
+ write("tiles/dungeon.ogt", tileset_text())
598
+ write("maps/tomb.tmj", json.dumps(tiled_map(), indent=1, sort_keys=True) + "\n")
599
+ for name, sheet, ogt in (("hero", hero_sheet(), HERO_OGT), ("slime", slime_sheet(), SLIME_OGT), ("items", items_sheet(), ITEMS_OGT)):
600
+ write(f"sprites/{name}.png", sheet.png())
601
+ write(f"sprites/{name}.png.ogt", PIXEL)
602
+ write(f"sprites/{name}.ogt", ogt)
603
+
604
+ a = os.path.join(assets, "audio")
605
+ os.makedirs(a, exist_ok=True)
606
+ write_wav(os.path.join(a, "hit.wav"), mix(noise(0.12, decay=0.04, gain=0.5, seed=3), tone(0.12, 220, 110, shape="square", decay=0.05, gain=0.35)))
607
+ write_wav(os.path.join(a, "hurt.wav"), tone(0.25, 440, 140, shape="square", decay=0.1, gain=0.35))
608
+ write_wav(os.path.join(a, "coin.wav"), concat(tone(0.05, 988, shape="square", decay=0.04, gain=0.3), tone(0.18, 1319, shape="square", decay=0.07, gain=0.3)))
609
+ write_wav(os.path.join(a, "key.wav"), concat(tone(0.08, 659, shape="tri", gain=0.4), tone(0.08, 880, shape="tri", gain=0.4), tone(0.2, 1175, shape="tri", gain=0.4, decay=0.1)))
610
+ write_wav(os.path.join(a, "door.wav"), mix(noise(0.4, decay=0.15, gain=0.4, seed=11), tone(0.4, 90, 60, shape="tri", gain=0.5, decay=0.2)))
611
+
612
+ fonts = os.path.join(assets, "fonts")
613
+ os.makedirs(fonts, exist_ok=True)
614
+ font_src = os.path.join(root, "..", "..", "game", "assets", "fonts", "NotoSansSC-Regular-subset.ttf")
615
+ try:
616
+ subset_font(font_src, os.path.join(fonts, "ui.ttf"), "")
617
+ except Exception as e: # noqa: BLE001
618
+ print(f"font subset skipped ({e}); the committed assets/fonts/ui.ttf stays")
619
+ write("fonts/ui.ttf.ogt", FONT_IMPORT)
620
+
621
+
622
+ if __name__ == "__main__":
623
+ main()