kiwiengine 0.5.2 → 0.5.3

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 (325) hide show
  1. package/README.ko.md +2 -2
  2. package/README.md +2 -2
  3. package/examples/auto-battle/assets/bgm/battle.mp3 +0 -0
  4. package/examples/auto-battle/assets/bitmap-fonts/white-peaberry.fnt +107 -0
  5. package/examples/auto-battle/assets/bitmap-fonts/white-peaberry.png +0 -0
  6. package/examples/auto-battle/assets/joystick/joystick.png +0 -0
  7. package/examples/auto-battle/assets/joystick/knob.png +0 -0
  8. package/examples/auto-battle/assets/sfx/hero/die/die.wav +0 -0
  9. package/examples/auto-battle/assets/sfx/hero/heal/heal.wav +0 -0
  10. package/examples/auto-battle/assets/sfx/hero/hit/hit1.wav +0 -0
  11. package/examples/auto-battle/assets/sfx/hero/hit/hit2.wav +0 -0
  12. package/examples/auto-battle/assets/sfx/hero/hit/hit3.wav +0 -0
  13. package/examples/auto-battle/assets/sfx/hero/miss/miss1.wav +0 -0
  14. package/examples/auto-battle/assets/sfx/hero/miss/miss2.wav +0 -0
  15. package/examples/auto-battle/assets/sfx/hero/miss/miss3.wav +0 -0
  16. package/examples/auto-battle/assets/sfx/orc/die/die.wav +0 -0
  17. package/examples/auto-battle/assets/sfx/orc/hit/hit1.wav +0 -0
  18. package/examples/auto-battle/assets/sfx/orc/hit/hit2.wav +0 -0
  19. package/examples/auto-battle/assets/sfx/orc/hit/hit3.wav +0 -0
  20. package/examples/auto-battle/assets/sfx/orc/miss/miss1.wav +0 -0
  21. package/examples/auto-battle/assets/sfx/orc/miss/miss2.wav +0 -0
  22. package/examples/auto-battle/assets/sfx/orc/miss/miss3.wav +0 -0
  23. package/examples/auto-battle/assets/spritesheets/hero-atlas.json +246 -0
  24. package/examples/auto-battle/assets/spritesheets/hero.png +0 -0
  25. package/examples/auto-battle/assets/spritesheets/orc-atlas.json +246 -0
  26. package/examples/auto-battle/assets/spritesheets/orc.png +0 -0
  27. package/examples/auto-battle/assets/spritesheets/potion-atlas.json +68 -0
  28. package/examples/auto-battle/assets/spritesheets/potion.png +0 -0
  29. package/examples/auto-battle/dist/game.js +2 -0
  30. package/examples/auto-battle/dist/game.js.LICENSE.txt +35 -0
  31. package/examples/auto-battle/hud/damage-text.ts +46 -0
  32. package/examples/auto-battle/hud/heal-text.ts +46 -0
  33. package/examples/auto-battle/hud/hp-bar.ts +38 -0
  34. package/examples/auto-battle/index.ts +41 -0
  35. package/examples/auto-battle/objects/character.ts +95 -0
  36. package/examples/auto-battle/objects/hero.ts +119 -0
  37. package/examples/auto-battle/objects/orc.ts +107 -0
  38. package/examples/auto-battle/objects/potion.ts +27 -0
  39. package/examples/auto-battle/stage.ts +366 -0
  40. package/examples/battle-benchmark-matterjs/assets/bgm/battle.mp3 +0 -0
  41. package/examples/battle-benchmark-matterjs/assets/bitmap-fonts/white-peaberry.fnt +107 -0
  42. package/examples/battle-benchmark-matterjs/assets/bitmap-fonts/white-peaberry.png +0 -0
  43. package/examples/battle-benchmark-matterjs/assets/joystick/joystick.png +0 -0
  44. package/examples/battle-benchmark-matterjs/assets/joystick/knob.png +0 -0
  45. package/examples/battle-benchmark-matterjs/assets/sfx/hero/die/die.wav +0 -0
  46. package/examples/battle-benchmark-matterjs/assets/sfx/hero/heal/heal.wav +0 -0
  47. package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit1.wav +0 -0
  48. package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit2.wav +0 -0
  49. package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit3.wav +0 -0
  50. package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss1.wav +0 -0
  51. package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss2.wav +0 -0
  52. package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss3.wav +0 -0
  53. package/examples/battle-benchmark-matterjs/assets/sfx/orc/die/die.wav +0 -0
  54. package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit1.wav +0 -0
  55. package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit2.wav +0 -0
  56. package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit3.wav +0 -0
  57. package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss1.wav +0 -0
  58. package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss2.wav +0 -0
  59. package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss3.wav +0 -0
  60. package/examples/battle-benchmark-matterjs/assets/spritesheets/hero-atlas.json +246 -0
  61. package/examples/battle-benchmark-matterjs/assets/spritesheets/hero.png +0 -0
  62. package/examples/battle-benchmark-matterjs/assets/spritesheets/orc-atlas.json +246 -0
  63. package/examples/battle-benchmark-matterjs/assets/spritesheets/orc.png +0 -0
  64. package/examples/battle-benchmark-matterjs/assets/spritesheets/potion-atlas.json +68 -0
  65. package/examples/battle-benchmark-matterjs/assets/spritesheets/potion.png +0 -0
  66. package/examples/battle-benchmark-matterjs/dist/game.js +2 -0
  67. package/examples/battle-benchmark-matterjs/dist/game.js.LICENSE.txt +35 -0
  68. package/examples/battle-benchmark-matterjs/hud/damage-text.ts +46 -0
  69. package/examples/battle-benchmark-matterjs/hud/heal-text.ts +46 -0
  70. package/examples/battle-benchmark-matterjs/hud/hp-bar.ts +38 -0
  71. package/examples/battle-benchmark-matterjs/index.html +24 -0
  72. package/examples/battle-benchmark-matterjs/index.ts +41 -0
  73. package/examples/battle-benchmark-matterjs/objects/character.ts +95 -0
  74. package/examples/battle-benchmark-matterjs/objects/hero.ts +111 -0
  75. package/examples/battle-benchmark-matterjs/objects/orc.ts +107 -0
  76. package/examples/battle-benchmark-matterjs/objects/potion.ts +27 -0
  77. package/examples/battle-benchmark-matterjs/stage.ts +177 -0
  78. package/examples/battle-benchmark-separation/assets/bgm/battle.mp3 +0 -0
  79. package/examples/battle-benchmark-separation/assets/bitmap-fonts/white-peaberry.fnt +107 -0
  80. package/examples/battle-benchmark-separation/assets/bitmap-fonts/white-peaberry.png +0 -0
  81. package/examples/battle-benchmark-separation/assets/joystick/joystick.png +0 -0
  82. package/examples/battle-benchmark-separation/assets/joystick/knob.png +0 -0
  83. package/examples/battle-benchmark-separation/assets/sfx/hero/die/die.wav +0 -0
  84. package/examples/battle-benchmark-separation/assets/sfx/hero/heal/heal.wav +0 -0
  85. package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit1.wav +0 -0
  86. package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit2.wav +0 -0
  87. package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit3.wav +0 -0
  88. package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss1.wav +0 -0
  89. package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss2.wav +0 -0
  90. package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss3.wav +0 -0
  91. package/examples/battle-benchmark-separation/assets/sfx/orc/die/die.wav +0 -0
  92. package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit1.wav +0 -0
  93. package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit2.wav +0 -0
  94. package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit3.wav +0 -0
  95. package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss1.wav +0 -0
  96. package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss2.wav +0 -0
  97. package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss3.wav +0 -0
  98. package/examples/battle-benchmark-separation/assets/spritesheets/hero-atlas.json +246 -0
  99. package/examples/battle-benchmark-separation/assets/spritesheets/hero.png +0 -0
  100. package/examples/battle-benchmark-separation/assets/spritesheets/orc-atlas.json +246 -0
  101. package/examples/battle-benchmark-separation/assets/spritesheets/orc.png +0 -0
  102. package/examples/battle-benchmark-separation/assets/spritesheets/potion-atlas.json +68 -0
  103. package/examples/battle-benchmark-separation/assets/spritesheets/potion.png +0 -0
  104. package/examples/battle-benchmark-separation/dist/game.js +2 -0
  105. package/examples/battle-benchmark-separation/dist/game.js.LICENSE.txt +35 -0
  106. package/examples/battle-benchmark-separation/hud/damage-text.ts +46 -0
  107. package/examples/battle-benchmark-separation/hud/heal-text.ts +46 -0
  108. package/examples/battle-benchmark-separation/hud/hp-bar.ts +38 -0
  109. package/examples/battle-benchmark-separation/index.html +24 -0
  110. package/examples/battle-benchmark-separation/index.ts +41 -0
  111. package/examples/battle-benchmark-separation/objects/character.ts +225 -0
  112. package/examples/battle-benchmark-separation/objects/hero.ts +110 -0
  113. package/examples/battle-benchmark-separation/objects/orc.ts +213 -0
  114. package/examples/battle-benchmark-separation/objects/potion.ts +27 -0
  115. package/examples/battle-benchmark-separation/stage.ts +178 -0
  116. package/examples/battle-benchmark-separation2/assets/bgm/battle.mp3 +0 -0
  117. package/examples/battle-benchmark-separation2/assets/bitmap-fonts/white-peaberry.fnt +107 -0
  118. package/examples/battle-benchmark-separation2/assets/bitmap-fonts/white-peaberry.png +0 -0
  119. package/examples/battle-benchmark-separation2/assets/joystick/joystick.png +0 -0
  120. package/examples/battle-benchmark-separation2/assets/joystick/knob.png +0 -0
  121. package/examples/battle-benchmark-separation2/assets/sfx/hero/die/die.wav +0 -0
  122. package/examples/battle-benchmark-separation2/assets/sfx/hero/heal/heal.wav +0 -0
  123. package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit1.wav +0 -0
  124. package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit2.wav +0 -0
  125. package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit3.wav +0 -0
  126. package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss1.wav +0 -0
  127. package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss2.wav +0 -0
  128. package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss3.wav +0 -0
  129. package/examples/battle-benchmark-separation2/assets/sfx/orc/die/die.wav +0 -0
  130. package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit1.wav +0 -0
  131. package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit2.wav +0 -0
  132. package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit3.wav +0 -0
  133. package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss1.wav +0 -0
  134. package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss2.wav +0 -0
  135. package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss3.wav +0 -0
  136. package/examples/battle-benchmark-separation2/assets/spritesheets/hero-atlas.json +246 -0
  137. package/examples/battle-benchmark-separation2/assets/spritesheets/hero.png +0 -0
  138. package/examples/battle-benchmark-separation2/assets/spritesheets/orc-atlas.json +246 -0
  139. package/examples/battle-benchmark-separation2/assets/spritesheets/orc.png +0 -0
  140. package/examples/battle-benchmark-separation2/assets/spritesheets/potion-atlas.json +68 -0
  141. package/examples/battle-benchmark-separation2/assets/spritesheets/potion.png +0 -0
  142. package/examples/battle-benchmark-separation2/dist/game.js +2 -0
  143. package/examples/battle-benchmark-separation2/dist/game.js.LICENSE.txt +35 -0
  144. package/examples/battle-benchmark-separation2/hud/damage-text.ts +46 -0
  145. package/examples/battle-benchmark-separation2/hud/heal-text.ts +46 -0
  146. package/examples/battle-benchmark-separation2/hud/hp-bar.ts +38 -0
  147. package/examples/battle-benchmark-separation2/index.html +24 -0
  148. package/examples/battle-benchmark-separation2/index.ts +41 -0
  149. package/examples/battle-benchmark-separation2/objects/character.ts +195 -0
  150. package/examples/battle-benchmark-separation2/objects/hero.ts +110 -0
  151. package/examples/battle-benchmark-separation2/objects/orc.ts +213 -0
  152. package/examples/battle-benchmark-separation2/objects/potion.ts +27 -0
  153. package/examples/battle-benchmark-separation2/stage.ts +178 -0
  154. package/examples/dom-sprite-test/index.ts +6 -9
  155. package/examples/simple-battle/assets/spritesheets/hero-atlas.json +180 -223
  156. package/examples/simple-battle/assets/spritesheets/orc-atlas.json +180 -223
  157. package/examples/simple-battle/assets/spritesheets/potion-atlas.json +46 -61
  158. package/examples/simple-battle/hud/damage-text.ts +1 -0
  159. package/examples/simple-battle/hud/heal-text.ts +1 -0
  160. package/examples/simple-battle/objects/character.ts +3 -3
  161. package/examples/simple-battle/objects/hero.ts +3 -5
  162. package/examples/simple-battle/objects/orc.ts +3 -5
  163. package/examples/simple-battle/objects/potion.ts +0 -2
  164. package/examples/simple-battle/stage.ts +2 -4
  165. package/examples/sprite-test/index.ts +6 -9
  166. package/examples/webpack.config.js +4 -1
  167. package/lib/asset/loaders/audio.js +4 -1
  168. package/lib/asset/loaders/audio.js.map +1 -1
  169. package/lib/asset/loaders/binary.js +4 -1
  170. package/lib/asset/loaders/binary.js.map +1 -1
  171. package/lib/asset/loaders/bitmap-font.js +24 -21
  172. package/lib/asset/loaders/bitmap-font.js.map +1 -1
  173. package/lib/asset/loaders/font.js +3 -0
  174. package/lib/asset/loaders/font.js.map +1 -1
  175. package/lib/asset/loaders/spritesheet.js +12 -1
  176. package/lib/asset/loaders/spritesheet.js.map +1 -1
  177. package/lib/asset/loaders/text.js +3 -0
  178. package/lib/asset/loaders/text.js.map +1 -1
  179. package/lib/asset/loaders/texture.js +21 -26
  180. package/lib/asset/loaders/texture.js.map +1 -1
  181. package/lib/asset/preload.js.map +1 -1
  182. package/lib/collision/check-collision.js +16 -16
  183. package/lib/collision/check-collision.js.map +1 -1
  184. package/lib/dom/dom-animated-sprite.js +21 -36
  185. package/lib/dom/dom-animated-sprite.js.map +1 -1
  186. package/lib/dom/dom-game-object.js +9 -7
  187. package/lib/dom/dom-game-object.js.map +1 -1
  188. package/lib/dom/dom-particle.js.map +1 -1
  189. package/lib/index.js +1 -0
  190. package/lib/index.js.map +1 -1
  191. package/lib/node/core/dirty-number.js +0 -19
  192. package/lib/node/core/dirty-number.js.map +1 -1
  193. package/lib/node/core/renderable.js +7 -0
  194. package/lib/node/core/renderable.js.map +1 -1
  195. package/lib/node/core/transform.js +22 -11
  196. package/lib/node/core/transform.js.map +1 -1
  197. package/lib/node/ext/animated-sprite.js +3 -22
  198. package/lib/node/ext/animated-sprite.js.map +1 -1
  199. package/lib/node/ext/bitmap-text.js +7 -3
  200. package/lib/node/ext/bitmap-text.js.map +1 -1
  201. package/lib/node/ext/circle.js +18 -3
  202. package/lib/node/ext/circle.js.map +1 -1
  203. package/lib/node/ext/deplay.js +2 -0
  204. package/lib/node/ext/deplay.js.map +1 -1
  205. package/lib/node/ext/dom-container.js +2 -2
  206. package/lib/node/ext/dom-container.js.map +1 -1
  207. package/lib/node/ext/interval.js +2 -0
  208. package/lib/node/ext/interval.js.map +1 -1
  209. package/lib/node/ext/particle.js.map +1 -1
  210. package/lib/node/ext/rectangle.js +24 -4
  211. package/lib/node/ext/rectangle.js.map +1 -1
  212. package/lib/node/physics/physics-object.js +9 -29
  213. package/lib/node/physics/physics-object.js.map +1 -1
  214. package/lib/node/physics/physics-world.js +2 -0
  215. package/lib/node/physics/physics-world.js.map +1 -1
  216. package/lib/node/physics/rigidbodies.js +7 -0
  217. package/lib/node/physics/rigidbodies.js.map +1 -0
  218. package/lib/renderer/renderer.js +3 -2
  219. package/lib/renderer/renderer.js.map +1 -1
  220. package/lib/types/animation-atlas.js +2 -0
  221. package/lib/types/animation-atlas.js.map +1 -0
  222. package/lib/types/asset/loaders/audio.d.ts +1 -0
  223. package/lib/types/asset/loaders/audio.d.ts.map +1 -1
  224. package/lib/types/asset/loaders/binary.d.ts +1 -0
  225. package/lib/types/asset/loaders/binary.d.ts.map +1 -1
  226. package/lib/types/asset/loaders/bitmap-font.d.ts +1 -0
  227. package/lib/types/asset/loaders/bitmap-font.d.ts.map +1 -1
  228. package/lib/types/asset/loaders/font.d.ts +1 -0
  229. package/lib/types/asset/loaders/font.d.ts.map +1 -1
  230. package/lib/types/asset/loaders/spritesheet.d.ts +11 -3
  231. package/lib/types/asset/loaders/spritesheet.d.ts.map +1 -1
  232. package/lib/types/asset/loaders/text.d.ts +1 -0
  233. package/lib/types/asset/loaders/text.d.ts.map +1 -1
  234. package/lib/types/asset/loaders/texture.d.ts +1 -1
  235. package/lib/types/asset/loaders/texture.d.ts.map +1 -1
  236. package/lib/types/asset/preload.d.ts +2 -2
  237. package/lib/types/asset/preload.d.ts.map +1 -1
  238. package/lib/types/atlas copy.js +2 -0
  239. package/lib/types/atlas copy.js.map +1 -0
  240. package/lib/types/atlas.js +2 -0
  241. package/lib/types/atlas.js.map +1 -0
  242. package/lib/types/dom/dom-animated-sprite.d.ts +4 -10
  243. package/lib/types/dom/dom-animated-sprite.d.ts.map +1 -1
  244. package/lib/types/dom/dom-game-object.d.ts +1 -1
  245. package/lib/types/dom/dom-game-object.d.ts.map +1 -1
  246. package/lib/types/dom/dom-particle.d.ts.map +1 -1
  247. package/lib/types/index.d.ts +1 -0
  248. package/lib/types/index.d.ts.map +1 -1
  249. package/lib/types/node/core/dirty-number.d.ts +0 -8
  250. package/lib/types/node/core/dirty-number.d.ts.map +1 -1
  251. package/lib/types/node/core/renderable.d.ts +1 -0
  252. package/lib/types/node/core/renderable.d.ts.map +1 -1
  253. package/lib/types/node/core/transform.d.ts +4 -2
  254. package/lib/types/node/core/transform.d.ts.map +1 -1
  255. package/lib/types/node/ext/animated-sprite.d.ts +4 -10
  256. package/lib/types/node/ext/animated-sprite.d.ts.map +1 -1
  257. package/lib/types/node/ext/bitmap-text.d.ts.map +1 -1
  258. package/lib/types/node/ext/circle.d.ts +3 -3
  259. package/lib/types/node/ext/circle.d.ts.map +1 -1
  260. package/lib/types/node/ext/deplay.d.ts.map +1 -1
  261. package/lib/types/node/ext/dom-container.d.ts +1 -1
  262. package/lib/types/node/ext/dom-container.d.ts.map +1 -1
  263. package/lib/types/node/ext/interval.d.ts.map +1 -1
  264. package/lib/types/node/ext/particle.d.ts.map +1 -1
  265. package/lib/types/node/ext/rectangle.d.ts +4 -4
  266. package/lib/types/node/ext/rectangle.d.ts.map +1 -1
  267. package/lib/types/node/physics/physics-object.d.ts +2 -2
  268. package/lib/types/node/physics/physics-object.d.ts.map +1 -1
  269. package/lib/types/node/physics/physics-world.d.ts.map +1 -1
  270. package/lib/types/node/physics/rigidbodies.d.ts +23 -0
  271. package/lib/types/node/physics/rigidbodies.d.ts.map +1 -0
  272. package/lib/types/renderer/renderer.d.ts.map +1 -1
  273. package/lib/types/sprite-atlas.js +2 -0
  274. package/lib/types/sprite-atlas.js.map +1 -0
  275. package/lib/types/types/animation-atlas.d.ts +14 -0
  276. package/lib/types/types/animation-atlas.d.ts.map +1 -0
  277. package/lib/types/types/atlas copy.d.ts +12 -0
  278. package/lib/types/types/atlas copy.d.ts.map +1 -0
  279. package/lib/types/types/atlas.d.ts +16 -0
  280. package/lib/types/types/atlas.d.ts.map +1 -0
  281. package/lib/types/types/sprite-atlas.d.ts +13 -0
  282. package/lib/types/types/sprite-atlas.d.ts.map +1 -0
  283. package/package.json +1 -1
  284. package/src/asset/loaders/audio.ts +5 -2
  285. package/src/asset/loaders/binary.ts +5 -1
  286. package/src/asset/loaders/bitmap-font.ts +33 -27
  287. package/src/asset/loaders/font.ts +4 -0
  288. package/src/asset/loaders/spritesheet.ts +18 -5
  289. package/src/asset/loaders/text.ts +4 -0
  290. package/src/asset/loaders/texture.ts +19 -27
  291. package/src/asset/preload.ts +4 -8
  292. package/src/collision/check-collision.ts +16 -16
  293. package/src/dom/dom-animated-sprite.ts +24 -45
  294. package/src/dom/dom-game-object.ts +9 -6
  295. package/src/dom/dom-particle.ts +1 -1
  296. package/src/index.ts +1 -0
  297. package/src/node/core/dirty-number.ts +0 -24
  298. package/src/node/core/renderable.ts +7 -0
  299. package/src/node/core/transform.ts +23 -11
  300. package/src/node/ext/animated-sprite.ts +9 -29
  301. package/src/node/ext/bitmap-text.ts +7 -3
  302. package/src/node/ext/circle.ts +18 -3
  303. package/src/node/ext/deplay.ts +1 -0
  304. package/src/node/ext/dom-container.ts +2 -2
  305. package/src/node/ext/interval.ts +1 -0
  306. package/src/node/ext/particle.ts +1 -1
  307. package/src/node/ext/rectangle.ts +24 -4
  308. package/src/node/physics/physics-object.ts +11 -40
  309. package/src/node/physics/physics-world.ts +1 -0
  310. package/src/node/physics/rigidbodies.ts +14 -0
  311. package/src/renderer/renderer.ts +4 -3
  312. package/src/types/atlas.ts +17 -0
  313. package/examples/flappy-cat/assets/bgm/bgm.ogg +0 -0
  314. package/examples/flappy-cat/assets/images/base.png +0 -0
  315. package/examples/flappy-cat/assets/images/bg.png +0 -0
  316. package/examples/flappy-cat/assets/images/cat.png +0 -0
  317. package/examples/flappy-cat/assets/images/pipe-green.png +0 -0
  318. package/examples/flappy-cat/assets/images/pipe-red.png +0 -0
  319. package/examples/flappy-cat/assets/sfx/die.wav +0 -0
  320. package/examples/flappy-cat/assets/sfx/hit.wav +0 -0
  321. package/examples/flappy-cat/assets/sfx/point.wav +0 -0
  322. package/examples/flappy-cat/assets/sfx/wing.wav +0 -0
  323. package/examples/flappy-cat/dist/game.js +0 -0
  324. package/examples/flappy-cat/index.ts +0 -0
  325. /package/examples/{flappy-cat → auto-battle}/index.html +0 -0
@@ -1,289 +1,246 @@
1
1
  {
2
2
  "frames": {
3
3
  "idle-1": {
4
- "frame": {
5
- "x": 0,
6
- "y": 0,
7
- "w": 100,
8
- "h": 100
9
- }
4
+ "x": 0,
5
+ "y": 0,
6
+ "w": 100,
7
+ "h": 100
10
8
  },
11
9
  "idle-2": {
12
- "frame": {
13
- "x": 100,
14
- "y": 0,
15
- "w": 100,
16
- "h": 100
17
- }
10
+ "x": 100,
11
+ "y": 0,
12
+ "w": 100,
13
+ "h": 100
18
14
  },
19
15
  "idle-3": {
20
- "frame": {
21
- "x": 200,
22
- "y": 0,
23
- "w": 100,
24
- "h": 100
25
- }
16
+ "x": 200,
17
+ "y": 0,
18
+ "w": 100,
19
+ "h": 100
26
20
  },
27
21
  "idle-4": {
28
- "frame": {
29
- "x": 300,
30
- "y": 0,
31
- "w": 100,
32
- "h": 100
33
- }
22
+ "x": 300,
23
+ "y": 0,
24
+ "w": 100,
25
+ "h": 100
34
26
  },
35
27
  "idle-5": {
36
- "frame": {
37
- "x": 400,
38
- "y": 0,
39
- "w": 100,
40
- "h": 100
41
- }
28
+ "x": 400,
29
+ "y": 0,
30
+ "w": 100,
31
+ "h": 100
42
32
  },
43
33
  "idle-6": {
44
- "frame": {
45
- "x": 500,
46
- "y": 0,
47
- "w": 100,
48
- "h": 100
49
- }
34
+ "x": 500,
35
+ "y": 0,
36
+ "w": 100,
37
+ "h": 100
50
38
  },
51
39
  "walk-1": {
52
- "frame": {
53
- "x": 0,
54
- "y": 100,
55
- "w": 100,
56
- "h": 100
57
- }
40
+ "x": 0,
41
+ "y": 100,
42
+ "w": 100,
43
+ "h": 100
58
44
  },
59
45
  "walk-2": {
60
- "frame": {
61
- "x": 100,
62
- "y": 100,
63
- "w": 100,
64
- "h": 100
65
- }
46
+ "x": 100,
47
+ "y": 100,
48
+ "w": 100,
49
+ "h": 100
66
50
  },
67
51
  "walk-3": {
68
- "frame": {
69
- "x": 200,
70
- "y": 100,
71
- "w": 100,
72
- "h": 100
73
- }
52
+ "x": 200,
53
+ "y": 100,
54
+ "w": 100,
55
+ "h": 100
74
56
  },
75
57
  "walk-4": {
76
- "frame": {
77
- "x": 300,
78
- "y": 100,
79
- "w": 100,
80
- "h": 100
81
- }
58
+ "x": 300,
59
+ "y": 100,
60
+ "w": 100,
61
+ "h": 100
82
62
  },
83
63
  "walk-5": {
84
- "frame": {
85
- "x": 400,
86
- "y": 100,
87
- "w": 100,
88
- "h": 100
89
- }
64
+ "x": 400,
65
+ "y": 100,
66
+ "w": 100,
67
+ "h": 100
90
68
  },
91
69
  "walk-6": {
92
- "frame": {
93
- "x": 500,
94
- "y": 100,
95
- "w": 100,
96
- "h": 100
97
- }
70
+ "x": 500,
71
+ "y": 100,
72
+ "w": 100,
73
+ "h": 100
98
74
  },
99
75
  "walk-7": {
100
- "frame": {
101
- "x": 600,
102
- "y": 100,
103
- "w": 100,
104
- "h": 100
105
- }
76
+ "x": 600,
77
+ "y": 100,
78
+ "w": 100,
79
+ "h": 100
106
80
  },
107
81
  "walk-8": {
108
- "frame": {
109
- "x": 700,
110
- "y": 100,
111
- "w": 100,
112
- "h": 100
113
- }
82
+ "x": 700,
83
+ "y": 100,
84
+ "w": 100,
85
+ "h": 100
114
86
  },
115
87
  "attack1-1": {
116
- "frame": {
117
- "x": 0,
118
- "y": 200,
119
- "w": 100,
120
- "h": 100
121
- }
88
+ "x": 0,
89
+ "y": 200,
90
+ "w": 100,
91
+ "h": 100
122
92
  },
123
93
  "attack1-2": {
124
- "frame": {
125
- "x": 100,
126
- "y": 200,
127
- "w": 100,
128
- "h": 100
129
- }
94
+ "x": 100,
95
+ "y": 200,
96
+ "w": 100,
97
+ "h": 100
130
98
  },
131
99
  "attack1-3": {
132
- "frame": {
133
- "x": 200,
134
- "y": 200,
135
- "w": 100,
136
- "h": 100
137
- }
100
+ "x": 200,
101
+ "y": 200,
102
+ "w": 100,
103
+ "h": 100
138
104
  },
139
105
  "attack1-4": {
140
- "frame": {
141
- "x": 300,
142
- "y": 200,
143
- "w": 100,
144
- "h": 100
145
- }
106
+ "x": 300,
107
+ "y": 200,
108
+ "w": 100,
109
+ "h": 100
146
110
  },
147
111
  "attack1-5": {
148
- "frame": {
149
- "x": 400,
150
- "y": 200,
151
- "w": 100,
152
- "h": 100
153
- }
112
+ "x": 400,
113
+ "y": 200,
114
+ "w": 100,
115
+ "h": 100
154
116
  },
155
117
  "attack1-6": {
156
- "frame": {
157
- "x": 500,
158
- "y": 200,
159
- "w": 100,
160
- "h": 100
161
- }
118
+ "x": 500,
119
+ "y": 200,
120
+ "w": 100,
121
+ "h": 100
162
122
  },
163
123
  "attack2-1": {
164
- "frame": {
165
- "x": 0,
166
- "y": 300,
167
- "w": 100,
168
- "h": 100
169
- }
124
+ "x": 0,
125
+ "y": 300,
126
+ "w": 100,
127
+ "h": 100
170
128
  },
171
129
  "attack2-2": {
172
- "frame": {
173
- "x": 100,
174
- "y": 300,
175
- "w": 100,
176
- "h": 100
177
- }
130
+ "x": 100,
131
+ "y": 300,
132
+ "w": 100,
133
+ "h": 100
178
134
  },
179
135
  "attack2-3": {
180
- "frame": {
181
- "x": 200,
182
- "y": 300,
183
- "w": 100,
184
- "h": 100
185
- }
136
+ "x": 200,
137
+ "y": 300,
138
+ "w": 100,
139
+ "h": 100
186
140
  },
187
141
  "attack2-4": {
188
- "frame": {
189
- "x": 300,
190
- "y": 300,
191
- "w": 100,
192
- "h": 100
193
- }
142
+ "x": 300,
143
+ "y": 300,
144
+ "w": 100,
145
+ "h": 100
194
146
  },
195
147
  "attack2-5": {
196
- "frame": {
197
- "x": 400,
198
- "y": 300,
199
- "w": 100,
200
- "h": 100
201
- }
148
+ "x": 400,
149
+ "y": 300,
150
+ "w": 100,
151
+ "h": 100
202
152
  },
203
153
  "attack2-6": {
204
- "frame": {
205
- "x": 500,
206
- "y": 300,
207
- "w": 100,
208
- "h": 100
209
- }
154
+ "x": 500,
155
+ "y": 300,
156
+ "w": 100,
157
+ "h": 100
210
158
  },
211
159
  "die-1": {
212
- "frame": {
213
- "x": 0,
214
- "y": 500,
215
- "w": 100,
216
- "h": 100
217
- }
160
+ "x": 0,
161
+ "y": 500,
162
+ "w": 100,
163
+ "h": 100
218
164
  },
219
165
  "die-2": {
220
- "frame": {
221
- "x": 100,
222
- "y": 500,
223
- "w": 100,
224
- "h": 100
225
- }
166
+ "x": 100,
167
+ "y": 500,
168
+ "w": 100,
169
+ "h": 100
226
170
  },
227
171
  "die-3": {
228
- "frame": {
229
- "x": 200,
230
- "y": 500,
231
- "w": 100,
232
- "h": 100
233
- }
172
+ "x": 200,
173
+ "y": 500,
174
+ "w": 100,
175
+ "h": 100
234
176
  },
235
177
  "die-4": {
236
- "frame": {
237
- "x": 300,
238
- "y": 500,
239
- "w": 100,
240
- "h": 100
241
- }
178
+ "x": 300,
179
+ "y": 500,
180
+ "w": 100,
181
+ "h": 100
242
182
  }
243
183
  },
244
- "meta": {
245
- "scale": 1
246
- },
247
184
  "animations": {
248
- "idle": [
249
- "idle-1",
250
- "idle-2",
251
- "idle-3",
252
- "idle-4",
253
- "idle-5",
254
- "idle-6"
255
- ],
256
- "walk": [
257
- "walk-1",
258
- "walk-2",
259
- "walk-3",
260
- "walk-4",
261
- "walk-5",
262
- "walk-6",
263
- "walk-7",
264
- "walk-8"
265
- ],
266
- "attack1": [
267
- "attack1-1",
268
- "attack1-2",
269
- "attack1-3",
270
- "attack1-4",
271
- "attack1-5",
272
- "attack1-6"
273
- ],
274
- "attack2": [
275
- "attack2-1",
276
- "attack2-2",
277
- "attack2-3",
278
- "attack2-4",
279
- "attack2-5",
280
- "attack2-6"
281
- ],
282
- "die": [
283
- "die-1",
284
- "die-2",
285
- "die-3",
286
- "die-4"
287
- ]
185
+ "idle": {
186
+ "frames": [
187
+ "idle-1",
188
+ "idle-2",
189
+ "idle-3",
190
+ "idle-4",
191
+ "idle-5",
192
+ "idle-6"
193
+ ],
194
+ "fps": 10,
195
+ "loop": true
196
+ },
197
+ "walk": {
198
+ "frames": [
199
+ "walk-1",
200
+ "walk-2",
201
+ "walk-3",
202
+ "walk-4",
203
+ "walk-5",
204
+ "walk-6",
205
+ "walk-7",
206
+ "walk-8"
207
+ ],
208
+ "fps": 10,
209
+ "loop": true
210
+ },
211
+ "attack1": {
212
+ "frames": [
213
+ "attack1-1",
214
+ "attack1-2",
215
+ "attack1-3",
216
+ "attack1-4",
217
+ "attack1-5",
218
+ "attack1-6"
219
+ ],
220
+ "fps": 10,
221
+ "loop": false
222
+ },
223
+ "attack2": {
224
+ "frames": [
225
+ "attack2-1",
226
+ "attack2-2",
227
+ "attack2-3",
228
+ "attack2-4",
229
+ "attack2-5",
230
+ "attack2-6"
231
+ ],
232
+ "fps": 10,
233
+ "loop": false
234
+ },
235
+ "die": {
236
+ "frames": [
237
+ "die-1",
238
+ "die-2",
239
+ "die-3",
240
+ "die-4"
241
+ ],
242
+ "fps": 10,
243
+ "loop": false
244
+ }
288
245
  }
289
246
  }
@@ -1,83 +1,68 @@
1
1
  {
2
2
  "frames": {
3
3
  "frame-1": {
4
- "frame": {
5
- "x": 0,
6
- "y": 0,
7
- "w": 16,
8
- "h": 16
9
- }
4
+ "x": 0,
5
+ "y": 0,
6
+ "w": 16,
7
+ "h": 16
10
8
  },
11
9
  "frame-2": {
12
- "frame": {
13
- "x": 16,
14
- "y": 0,
15
- "w": 16,
16
- "h": 16
17
- }
10
+ "x": 16,
11
+ "y": 0,
12
+ "w": 16,
13
+ "h": 16
18
14
  },
19
15
  "frame-3": {
20
- "frame": {
21
- "x": 32,
22
- "y": 0,
23
- "w": 16,
24
- "h": 16
25
- }
16
+ "x": 32,
17
+ "y": 0,
18
+ "w": 16,
19
+ "h": 16
26
20
  },
27
21
  "frame-4": {
28
- "frame": {
29
- "x": 0,
30
- "y": 16,
31
- "w": 16,
32
- "h": 16
33
- }
22
+ "x": 0,
23
+ "y": 16,
24
+ "w": 16,
25
+ "h": 16
34
26
  },
35
27
  "frame-5": {
36
- "frame": {
37
- "x": 16,
38
- "y": 16,
39
- "w": 16,
40
- "h": 16
41
- }
28
+ "x": 16,
29
+ "y": 16,
30
+ "w": 16,
31
+ "h": 16
42
32
  },
43
33
  "frame-6": {
44
- "frame": {
45
- "x": 32,
46
- "y": 16,
47
- "w": 16,
48
- "h": 16
49
- }
34
+ "x": 32,
35
+ "y": 16,
36
+ "w": 16,
37
+ "h": 16
50
38
  },
51
39
  "frame-7": {
52
- "frame": {
53
- "x": 0,
54
- "y": 32,
55
- "w": 16,
56
- "h": 16
57
- }
40
+ "x": 0,
41
+ "y": 32,
42
+ "w": 16,
43
+ "h": 16
58
44
  },
59
45
  "frame-8": {
60
- "frame": {
61
- "x": 16,
62
- "y": 32,
63
- "w": 16,
64
- "h": 16
65
- }
46
+ "x": 16,
47
+ "y": 32,
48
+ "w": 16,
49
+ "h": 16
66
50
  }
67
51
  },
68
- "meta": {
69
- "scale": 1
70
- },
71
52
  "animations": {
72
- "animation": [
73
- "frame-1",
74
- "frame-2",
75
- "frame-3",
76
- "frame-4",
77
- "frame-5",
78
- "frame-6",
79
- "frame-7",
80
- "frame-8"
81
- ]
53
+ "animation": {
54
+ "frames": [
55
+ "frame-1",
56
+ "frame-2",
57
+ "frame-3",
58
+ "frame-4",
59
+ "frame-5",
60
+ "frame-6",
61
+ "frame-7",
62
+ "frame-8"
63
+ ],
64
+ "fps": 10,
65
+ "loop": true
66
+ }
82
67
  }
83
68
  }
@@ -23,6 +23,7 @@ export class DamageText extends BitmapTextNode {
23
23
  }
24
24
 
25
25
  protected override update(dt: number) {
26
+ if (this.paused) return
26
27
  super.update(dt)
27
28
 
28
29
  this.#elapsed += dt
@@ -23,6 +23,7 @@ export class HealText extends BitmapTextNode {
23
23
  }
24
24
 
25
25
  protected override update(dt: number) {
26
+ if (this.paused) return
26
27
  super.update(dt)
27
28
 
28
29
  this.#elapsed += dt
@@ -1,5 +1,5 @@
1
1
  import { EventMap } from '@webtaku/event-emitter'
2
- import { AnimatedSpriteNode, debugMode, DelayNode, PhysicsObject, PhysicsObjectOptions, RectangleCollider, RectangleNode } from '../../../src'
2
+ import { AnimatedSpriteNode, debugMode, DelayNode, PhysicsObject, PhysicsObjectOptions, RectangleCollider, RectangleNode, RectangleRigidbody } from '../../../src'
3
3
  import { DamageText } from '../hud/damage-text'
4
4
  import { HealText } from '../hud/heal-text'
5
5
  import { HpBar } from '../hud/hp-bar'
@@ -7,7 +7,7 @@ import { HpBar } from '../hud/hp-bar'
7
7
  export type CharacterOptions = {
8
8
  maxHp: number
9
9
  hp: number
10
- collider: RectangleCollider
10
+ rigidbody: RectangleRigidbody
11
11
  hitbox: RectangleCollider
12
12
  hurtbox: RectangleCollider
13
13
  } & PhysicsObjectOptions
@@ -39,7 +39,7 @@ export abstract class Character<E extends EventMap = EventMap> extends PhysicsOb
39
39
  this.add(this.#hpBar)
40
40
 
41
41
  if (debugMode) {
42
- this.add(new RectangleNode({ ...options.collider, stroke: 'yellow', alpha: 0.5, layer: 'hud' }))
42
+ this.add(new RectangleNode({ ...options.rigidbody, stroke: 'yellow', alpha: 0.5, layer: 'hud' }))
43
43
  this.#hitboxDebugNode = new RectangleNode({ ...this.hitbox, stroke: 'red', alpha: 0.5, layer: 'hud' })
44
44
  this.add(this.#hitboxDebugNode)
45
45
  this.add(new RectangleNode({ ...this.hurtbox, stroke: 'green', alpha: 0.5, layer: 'hud' }))