kiwiengine 0.5.2 → 0.5.4
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.
- package/README.ko.md +2 -2
- package/README.md +2 -2
- package/examples/auto-battle/assets/bgm/battle.mp3 +0 -0
- package/examples/auto-battle/assets/bitmap-fonts/white-peaberry.fnt +107 -0
- package/examples/auto-battle/assets/bitmap-fonts/white-peaberry.png +0 -0
- package/examples/auto-battle/assets/joystick/joystick.png +0 -0
- package/examples/auto-battle/assets/joystick/knob.png +0 -0
- package/examples/auto-battle/assets/sfx/hero/die/die.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/heal/heal.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/hit/hit1.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/hit/hit2.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/hit/hit3.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/miss/miss1.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/miss/miss2.wav +0 -0
- package/examples/auto-battle/assets/sfx/hero/miss/miss3.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/die/die.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/hit/hit1.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/hit/hit2.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/hit/hit3.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/miss/miss1.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/miss/miss2.wav +0 -0
- package/examples/auto-battle/assets/sfx/orc/miss/miss3.wav +0 -0
- package/examples/auto-battle/assets/spritesheets/hero-atlas.json +246 -0
- package/examples/auto-battle/assets/spritesheets/hero.png +0 -0
- package/examples/auto-battle/assets/spritesheets/orc-atlas.json +246 -0
- package/examples/auto-battle/assets/spritesheets/orc.png +0 -0
- package/examples/auto-battle/assets/spritesheets/potion-atlas.json +68 -0
- package/examples/auto-battle/assets/spritesheets/potion.png +0 -0
- package/examples/auto-battle/dist/game.js +2 -0
- package/examples/auto-battle/dist/game.js.LICENSE.txt +35 -0
- package/examples/auto-battle/hud/damage-text.ts +46 -0
- package/examples/auto-battle/hud/heal-text.ts +46 -0
- package/examples/auto-battle/hud/hp-bar.ts +38 -0
- package/examples/auto-battle/index.ts +41 -0
- package/examples/auto-battle/objects/character.ts +95 -0
- package/examples/auto-battle/objects/hero.ts +119 -0
- package/examples/auto-battle/objects/orc.ts +107 -0
- package/examples/auto-battle/objects/potion.ts +27 -0
- package/examples/auto-battle/stage.ts +366 -0
- package/examples/battle-benchmark-matterjs/assets/bgm/battle.mp3 +0 -0
- package/examples/battle-benchmark-matterjs/assets/bitmap-fonts/white-peaberry.fnt +107 -0
- package/examples/battle-benchmark-matterjs/assets/bitmap-fonts/white-peaberry.png +0 -0
- package/examples/battle-benchmark-matterjs/assets/joystick/joystick.png +0 -0
- package/examples/battle-benchmark-matterjs/assets/joystick/knob.png +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/die/die.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/heal/heal.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/hero/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/die/die.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/sfx/orc/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/hero-atlas.json +246 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/hero.png +0 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/orc-atlas.json +246 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/orc.png +0 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/potion-atlas.json +68 -0
- package/examples/battle-benchmark-matterjs/assets/spritesheets/potion.png +0 -0
- package/examples/battle-benchmark-matterjs/dist/game.js +2 -0
- package/examples/battle-benchmark-matterjs/dist/game.js.LICENSE.txt +35 -0
- package/examples/battle-benchmark-matterjs/hud/damage-text.ts +46 -0
- package/examples/battle-benchmark-matterjs/hud/heal-text.ts +46 -0
- package/examples/battle-benchmark-matterjs/hud/hp-bar.ts +38 -0
- package/examples/battle-benchmark-matterjs/index.html +24 -0
- package/examples/battle-benchmark-matterjs/index.ts +41 -0
- package/examples/battle-benchmark-matterjs/objects/character.ts +95 -0
- package/examples/battle-benchmark-matterjs/objects/hero.ts +111 -0
- package/examples/battle-benchmark-matterjs/objects/orc.ts +107 -0
- package/examples/battle-benchmark-matterjs/objects/potion.ts +27 -0
- package/examples/battle-benchmark-matterjs/stage.ts +177 -0
- package/examples/battle-benchmark-separation/assets/bgm/battle.mp3 +0 -0
- package/examples/battle-benchmark-separation/assets/bitmap-fonts/white-peaberry.fnt +107 -0
- package/examples/battle-benchmark-separation/assets/bitmap-fonts/white-peaberry.png +0 -0
- package/examples/battle-benchmark-separation/assets/joystick/joystick.png +0 -0
- package/examples/battle-benchmark-separation/assets/joystick/knob.png +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/die/die.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/heal/heal.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/hero/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/die/die.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-separation/assets/sfx/orc/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/hero-atlas.json +246 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/hero.png +0 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/orc-atlas.json +246 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/orc.png +0 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/potion-atlas.json +68 -0
- package/examples/battle-benchmark-separation/assets/spritesheets/potion.png +0 -0
- package/examples/battle-benchmark-separation/dist/game.js +2 -0
- package/examples/battle-benchmark-separation/dist/game.js.LICENSE.txt +35 -0
- package/examples/battle-benchmark-separation/hud/damage-text.ts +46 -0
- package/examples/battle-benchmark-separation/hud/heal-text.ts +46 -0
- package/examples/battle-benchmark-separation/hud/hp-bar.ts +38 -0
- package/examples/battle-benchmark-separation/index.html +24 -0
- package/examples/battle-benchmark-separation/index.ts +41 -0
- package/examples/battle-benchmark-separation/objects/character.ts +225 -0
- package/examples/battle-benchmark-separation/objects/hero.ts +110 -0
- package/examples/battle-benchmark-separation/objects/orc.ts +213 -0
- package/examples/battle-benchmark-separation/objects/potion.ts +27 -0
- package/examples/battle-benchmark-separation/stage.ts +178 -0
- package/examples/battle-benchmark-separation2/assets/bgm/battle.mp3 +0 -0
- package/examples/battle-benchmark-separation2/assets/bitmap-fonts/white-peaberry.fnt +107 -0
- package/examples/battle-benchmark-separation2/assets/bitmap-fonts/white-peaberry.png +0 -0
- package/examples/battle-benchmark-separation2/assets/joystick/joystick.png +0 -0
- package/examples/battle-benchmark-separation2/assets/joystick/knob.png +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/die/die.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/heal/heal.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/hero/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/die/die.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit1.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit2.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/hit/hit3.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss1.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss2.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/sfx/orc/miss/miss3.wav +0 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/hero-atlas.json +246 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/hero.png +0 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/orc-atlas.json +246 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/orc.png +0 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/potion-atlas.json +68 -0
- package/examples/battle-benchmark-separation2/assets/spritesheets/potion.png +0 -0
- package/examples/battle-benchmark-separation2/dist/game.js +2 -0
- package/examples/battle-benchmark-separation2/dist/game.js.LICENSE.txt +35 -0
- package/examples/battle-benchmark-separation2/hud/damage-text.ts +46 -0
- package/examples/battle-benchmark-separation2/hud/heal-text.ts +46 -0
- package/examples/battle-benchmark-separation2/hud/hp-bar.ts +38 -0
- package/examples/battle-benchmark-separation2/index.html +24 -0
- package/examples/battle-benchmark-separation2/index.ts +41 -0
- package/examples/battle-benchmark-separation2/objects/character.ts +195 -0
- package/examples/battle-benchmark-separation2/objects/hero.ts +110 -0
- package/examples/battle-benchmark-separation2/objects/orc.ts +213 -0
- package/examples/battle-benchmark-separation2/objects/potion.ts +27 -0
- package/examples/battle-benchmark-separation2/stage.ts +178 -0
- package/examples/dom-sprite-test/index.ts +6 -9
- package/examples/simple-battle/assets/spritesheets/hero-atlas.json +180 -223
- package/examples/simple-battle/assets/spritesheets/orc-atlas.json +180 -223
- package/examples/simple-battle/assets/spritesheets/potion-atlas.json +46 -61
- package/examples/simple-battle/hud/damage-text.ts +1 -0
- package/examples/simple-battle/hud/heal-text.ts +1 -0
- package/examples/simple-battle/objects/character.ts +3 -3
- package/examples/simple-battle/objects/hero.ts +3 -5
- package/examples/simple-battle/objects/orc.ts +3 -5
- package/examples/simple-battle/objects/potion.ts +0 -2
- package/examples/simple-battle/stage.ts +2 -4
- package/examples/sprite-test/index.ts +6 -9
- package/examples/webpack.config.js +4 -1
- package/lib/asset/loaders/audio.js +4 -1
- package/lib/asset/loaders/audio.js.map +1 -1
- package/lib/asset/loaders/binary.js +4 -1
- package/lib/asset/loaders/binary.js.map +1 -1
- package/lib/asset/loaders/bitmap-font.js +24 -21
- package/lib/asset/loaders/bitmap-font.js.map +1 -1
- package/lib/asset/loaders/font.js +3 -0
- package/lib/asset/loaders/font.js.map +1 -1
- package/lib/asset/loaders/spritesheet.js +12 -1
- package/lib/asset/loaders/spritesheet.js.map +1 -1
- package/lib/asset/loaders/text.js +3 -0
- package/lib/asset/loaders/text.js.map +1 -1
- package/lib/asset/loaders/texture.js +21 -26
- package/lib/asset/loaders/texture.js.map +1 -1
- package/lib/asset/preload.js.map +1 -1
- package/lib/collision/check-collision.js +16 -16
- package/lib/collision/check-collision.js.map +1 -1
- package/lib/dom/dom-animated-sprite.js +21 -36
- package/lib/dom/dom-animated-sprite.js.map +1 -1
- package/lib/dom/dom-game-object.js +9 -7
- package/lib/dom/dom-game-object.js.map +1 -1
- package/lib/dom/dom-particle.js.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/node/core/dirty-number.js +0 -19
- package/lib/node/core/dirty-number.js.map +1 -1
- package/lib/node/core/renderable.js +7 -0
- package/lib/node/core/renderable.js.map +1 -1
- package/lib/node/core/transform.js +22 -11
- package/lib/node/core/transform.js.map +1 -1
- package/lib/node/ext/animated-sprite.js +3 -22
- package/lib/node/ext/animated-sprite.js.map +1 -1
- package/lib/node/ext/bitmap-text.js +7 -3
- package/lib/node/ext/bitmap-text.js.map +1 -1
- package/lib/node/ext/circle.js +18 -3
- package/lib/node/ext/circle.js.map +1 -1
- package/lib/node/ext/deplay.js +2 -0
- package/lib/node/ext/deplay.js.map +1 -1
- package/lib/node/ext/dom-container.js +2 -2
- package/lib/node/ext/dom-container.js.map +1 -1
- package/lib/node/ext/interval.js +2 -0
- package/lib/node/ext/interval.js.map +1 -1
- package/lib/node/ext/particle.js.map +1 -1
- package/lib/node/ext/rectangle.js +24 -4
- package/lib/node/ext/rectangle.js.map +1 -1
- package/lib/node/physics/physics-object.js +9 -29
- package/lib/node/physics/physics-object.js.map +1 -1
- package/lib/node/physics/physics-world.js +2 -0
- package/lib/node/physics/physics-world.js.map +1 -1
- package/lib/node/physics/rigidbodies.js +7 -0
- package/lib/node/physics/rigidbodies.js.map +1 -0
- package/lib/renderer/renderer.js +3 -2
- package/lib/renderer/renderer.js.map +1 -1
- package/lib/types/animation-atlas.js +2 -0
- package/lib/types/animation-atlas.js.map +1 -0
- package/lib/types/asset/loaders/audio.d.ts +1 -0
- package/lib/types/asset/loaders/audio.d.ts.map +1 -1
- package/lib/types/asset/loaders/binary.d.ts +1 -0
- package/lib/types/asset/loaders/binary.d.ts.map +1 -1
- package/lib/types/asset/loaders/bitmap-font.d.ts +1 -0
- package/lib/types/asset/loaders/bitmap-font.d.ts.map +1 -1
- package/lib/types/asset/loaders/font.d.ts +1 -0
- package/lib/types/asset/loaders/font.d.ts.map +1 -1
- package/lib/types/asset/loaders/spritesheet.d.ts +11 -3
- package/lib/types/asset/loaders/spritesheet.d.ts.map +1 -1
- package/lib/types/asset/loaders/text.d.ts +1 -0
- package/lib/types/asset/loaders/text.d.ts.map +1 -1
- package/lib/types/asset/loaders/texture.d.ts +1 -1
- package/lib/types/asset/loaders/texture.d.ts.map +1 -1
- package/lib/types/asset/preload.d.ts +2 -2
- package/lib/types/asset/preload.d.ts.map +1 -1
- package/lib/types/atlas copy.js +2 -0
- package/lib/types/atlas copy.js.map +1 -0
- package/lib/types/atlas.js +2 -0
- package/lib/types/atlas.js.map +1 -0
- package/lib/types/dom/dom-animated-sprite.d.ts +4 -10
- package/lib/types/dom/dom-animated-sprite.d.ts.map +1 -1
- package/lib/types/dom/dom-game-object.d.ts +1 -1
- package/lib/types/dom/dom-game-object.d.ts.map +1 -1
- package/lib/types/dom/dom-particle.d.ts.map +1 -1
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/node/core/dirty-number.d.ts +0 -8
- package/lib/types/node/core/dirty-number.d.ts.map +1 -1
- package/lib/types/node/core/renderable.d.ts +1 -0
- package/lib/types/node/core/renderable.d.ts.map +1 -1
- package/lib/types/node/core/transform.d.ts +4 -2
- package/lib/types/node/core/transform.d.ts.map +1 -1
- package/lib/types/node/ext/animated-sprite.d.ts +4 -10
- package/lib/types/node/ext/animated-sprite.d.ts.map +1 -1
- package/lib/types/node/ext/bitmap-text.d.ts.map +1 -1
- package/lib/types/node/ext/circle.d.ts +3 -3
- package/lib/types/node/ext/circle.d.ts.map +1 -1
- package/lib/types/node/ext/deplay.d.ts.map +1 -1
- package/lib/types/node/ext/dom-container.d.ts +1 -1
- package/lib/types/node/ext/dom-container.d.ts.map +1 -1
- package/lib/types/node/ext/interval.d.ts.map +1 -1
- package/lib/types/node/ext/particle.d.ts.map +1 -1
- package/lib/types/node/ext/rectangle.d.ts +4 -4
- package/lib/types/node/ext/rectangle.d.ts.map +1 -1
- package/lib/types/node/physics/physics-object.d.ts +2 -2
- package/lib/types/node/physics/physics-object.d.ts.map +1 -1
- package/lib/types/node/physics/physics-world.d.ts.map +1 -1
- package/lib/types/node/physics/rigidbodies.d.ts +23 -0
- package/lib/types/node/physics/rigidbodies.d.ts.map +1 -0
- package/lib/types/renderer/renderer.d.ts.map +1 -1
- package/lib/types/sprite-atlas.js +2 -0
- package/lib/types/sprite-atlas.js.map +1 -0
- package/lib/types/types/animation-atlas.d.ts +14 -0
- package/lib/types/types/animation-atlas.d.ts.map +1 -0
- package/lib/types/types/atlas copy.d.ts +12 -0
- package/lib/types/types/atlas copy.d.ts.map +1 -0
- package/lib/types/types/atlas.d.ts +16 -0
- package/lib/types/types/atlas.d.ts.map +1 -0
- package/lib/types/types/sprite-atlas.d.ts +13 -0
- package/lib/types/types/sprite-atlas.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/asset/loaders/audio.ts +5 -2
- package/src/asset/loaders/binary.ts +5 -1
- package/src/asset/loaders/bitmap-font.ts +33 -27
- package/src/asset/loaders/font.ts +4 -0
- package/src/asset/loaders/spritesheet.ts +18 -5
- package/src/asset/loaders/text.ts +4 -0
- package/src/asset/loaders/texture.ts +19 -27
- package/src/asset/preload.ts +4 -8
- package/src/collision/check-collision.ts +16 -16
- package/src/dom/dom-animated-sprite.ts +24 -45
- package/src/dom/dom-game-object.ts +9 -6
- package/src/dom/dom-particle.ts +1 -1
- package/src/index.ts +2 -0
- package/src/node/core/dirty-number.ts +0 -24
- package/src/node/core/renderable.ts +7 -0
- package/src/node/core/transform.ts +23 -11
- package/src/node/ext/animated-sprite.ts +9 -29
- package/src/node/ext/bitmap-text.ts +7 -3
- package/src/node/ext/circle.ts +18 -3
- package/src/node/ext/deplay.ts +1 -0
- package/src/node/ext/dom-container.ts +2 -2
- package/src/node/ext/interval.ts +1 -0
- package/src/node/ext/particle.ts +1 -1
- package/src/node/ext/rectangle.ts +24 -4
- package/src/node/physics/physics-object.ts +11 -40
- package/src/node/physics/physics-world.ts +1 -0
- package/src/node/physics/rigidbodies.ts +14 -0
- package/src/renderer/renderer.ts +4 -3
- package/src/types/atlas.ts +17 -0
- package/examples/flappy-cat/assets/bgm/bgm.ogg +0 -0
- package/examples/flappy-cat/assets/images/base.png +0 -0
- package/examples/flappy-cat/assets/images/bg.png +0 -0
- package/examples/flappy-cat/assets/images/cat.png +0 -0
- package/examples/flappy-cat/assets/images/pipe-green.png +0 -0
- package/examples/flappy-cat/assets/images/pipe-red.png +0 -0
- package/examples/flappy-cat/assets/sfx/die.wav +0 -0
- package/examples/flappy-cat/assets/sfx/hit.wav +0 -0
- package/examples/flappy-cat/assets/sfx/point.wav +0 -0
- package/examples/flappy-cat/assets/sfx/wing.wav +0 -0
- package/examples/flappy-cat/dist/game.js +0 -0
- package/examples/flappy-cat/index.ts +0 -0
- /package/examples/{flappy-cat → auto-battle}/index.html +0 -0
package/src/node/ext/circle.ts
CHANGED
|
@@ -29,12 +29,27 @@ export class CircleNode extends TransformableNode<Graphics, EventMap> {
|
|
|
29
29
|
if (this.#stroke) this._pixiContainer.stroke(this.#stroke)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
set radius(v) {
|
|
33
|
+
if (v !== this.#radius) {
|
|
34
|
+
this.#radius = v
|
|
35
|
+
this.#draw()
|
|
36
|
+
}
|
|
37
|
+
}
|
|
32
38
|
get radius() { return this.#radius }
|
|
33
|
-
set radius(v) { this.#radius = v; this.#draw() }
|
|
34
39
|
|
|
40
|
+
set fill(v) {
|
|
41
|
+
if (v !== this.#fill) {
|
|
42
|
+
this.#fill = v
|
|
43
|
+
this.#draw()
|
|
44
|
+
}
|
|
45
|
+
}
|
|
35
46
|
get fill() { return this.#fill }
|
|
36
|
-
set fill(v) { this.#fill = v; this.#draw() }
|
|
37
47
|
|
|
48
|
+
set stroke(v) {
|
|
49
|
+
if (v !== this.#stroke) {
|
|
50
|
+
this.#stroke = v
|
|
51
|
+
this.#draw()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
38
54
|
get stroke() { return this.#stroke }
|
|
39
|
-
set stroke(v) { this.#stroke = v; this.#draw() }
|
|
40
55
|
}
|
package/src/node/ext/deplay.ts
CHANGED
|
@@ -45,8 +45,8 @@ export class DomContainerNode extends GameObject {
|
|
|
45
45
|
return super.renderer
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
super.
|
|
48
|
+
override _updateWorldTransform() {
|
|
49
|
+
super._updateWorldTransform()
|
|
50
50
|
|
|
51
51
|
const renderer = this.renderer
|
|
52
52
|
if (renderer && (renderer._isSizeDirty || this.worldTransform.dirty)) {
|
package/src/node/ext/interval.ts
CHANGED
package/src/node/ext/particle.ts
CHANGED
|
@@ -37,15 +37,35 @@ export class RectangleNode extends TransformableNode<Graphics, EventMap> {
|
|
|
37
37
|
if (this.#stroke) this._pixiContainer.stroke(this.#stroke)
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
set width(v) {
|
|
41
|
+
if (v !== this.#width) {
|
|
42
|
+
this.#width = v
|
|
43
|
+
this.#draw()
|
|
44
|
+
}
|
|
45
|
+
}
|
|
40
46
|
get width() { return this.#width }
|
|
41
|
-
set width(v) { this.#width = v; this.#draw() }
|
|
42
47
|
|
|
48
|
+
set height(v) {
|
|
49
|
+
if (v !== this.#height) {
|
|
50
|
+
this.#height = v
|
|
51
|
+
this.#draw()
|
|
52
|
+
}
|
|
53
|
+
}
|
|
43
54
|
get height() { return this.#height }
|
|
44
|
-
set height(v) { this.#height = v; this.#draw() }
|
|
45
55
|
|
|
56
|
+
set fill(v) {
|
|
57
|
+
if (v !== this.#fill) {
|
|
58
|
+
this.#fill = v
|
|
59
|
+
this.#draw()
|
|
60
|
+
}
|
|
61
|
+
}
|
|
46
62
|
get fill() { return this.#fill }
|
|
47
|
-
set fill(v) { this.#fill = v; this.#draw() }
|
|
48
63
|
|
|
64
|
+
set stroke(v) {
|
|
65
|
+
if (v !== this.#stroke) {
|
|
66
|
+
this.#stroke = v
|
|
67
|
+
this.#draw()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
49
70
|
get stroke() { return this.#stroke }
|
|
50
|
-
set stroke(v) { this.#stroke = v; this.#draw() }
|
|
51
71
|
}
|
|
@@ -1,39 +1,15 @@
|
|
|
1
1
|
import { EventMap } from '@webtaku/event-emitter'
|
|
2
2
|
import Matter, { IChamferableBodyDefinition } from 'matter-js'
|
|
3
3
|
import { Container as PixiContainer } from 'pixi.js'
|
|
4
|
-
import { Collider, ColliderType } from '../../collision/colliders'
|
|
5
4
|
import { GameNode } from '../core/game-node'
|
|
6
5
|
import { isRenderableNode, RenderableNode } from '../core/renderable'
|
|
7
6
|
import { LocalTransform } from '../core/transform'
|
|
8
7
|
import { PhysicsWorld } from './physics-world'
|
|
9
|
-
|
|
10
|
-
function createEllipseBody(
|
|
11
|
-
x: number,
|
|
12
|
-
y: number,
|
|
13
|
-
width: number,
|
|
14
|
-
height: number,
|
|
15
|
-
options: IChamferableBodyDefinition = {},
|
|
16
|
-
// segLen은 "인접 정점 사이의 목표 간격(px)" 정도로 생각하면 됩니다.
|
|
17
|
-
segLen = 6
|
|
18
|
-
): Matter.Body {
|
|
19
|
-
const rx = width / 2
|
|
20
|
-
const ry = height / 2
|
|
21
|
-
|
|
22
|
-
// 주변길이 ~ π(a+b) 근사 → 그 길이를 segLen 간격으로 쪼개서 정점 수 결정
|
|
23
|
-
const perimeterApprox = Math.PI * (rx + ry)
|
|
24
|
-
const segments = Math.max(12, Math.ceil(perimeterApprox / segLen))
|
|
25
|
-
|
|
26
|
-
const verts = Array.from({ length: segments }, (_, i) => {
|
|
27
|
-
const t = (i / segments) * Math.PI * 2
|
|
28
|
-
return { x: Math.cos(t) * rx, y: Math.sin(t) * ry }
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
// fromVertices는 로컬 기준이므로 x,y는 중심 위치로 넘깁니다.
|
|
32
|
-
return Matter.Bodies.fromVertices(x, y, [verts], options)
|
|
33
|
-
}
|
|
8
|
+
import { Rigidbody, RigidbodyType } from './rigidbodies'
|
|
34
9
|
|
|
35
10
|
export type PhysicsObjectOptions = {
|
|
36
|
-
|
|
11
|
+
rigidbody: Rigidbody
|
|
12
|
+
|
|
37
13
|
x?: number
|
|
38
14
|
y?: number
|
|
39
15
|
rotation?: number
|
|
@@ -54,7 +30,7 @@ export class PhysicsObject<E extends EventMap = EventMap> extends RenderableNode
|
|
|
54
30
|
constructor(options: PhysicsObjectOptions) {
|
|
55
31
|
super(new PixiContainer({ sortableChildren: true }))
|
|
56
32
|
|
|
57
|
-
const
|
|
33
|
+
const r = options.rigidbody
|
|
58
34
|
const x = options.x ?? 0
|
|
59
35
|
const y = options.y ?? 0
|
|
60
36
|
|
|
@@ -69,19 +45,14 @@ export class PhysicsObject<E extends EventMap = EventMap> extends RenderableNode
|
|
|
69
45
|
bodyOptions.angularVelocity = 0
|
|
70
46
|
}
|
|
71
47
|
|
|
72
|
-
if (
|
|
73
|
-
this.#matterBody = Matter.Bodies.rectangle(x, y,
|
|
74
|
-
} else if (
|
|
75
|
-
this.#matterBody = Matter.Bodies.circle(x, y,
|
|
76
|
-
} else if (
|
|
77
|
-
this.#matterBody =
|
|
78
|
-
x, y, c.width, c.height, bodyOptions,
|
|
79
|
-
/* segLen= */ 6 // 더 매끄럽게 하고 싶으면 더 작게
|
|
80
|
-
)
|
|
81
|
-
} else if (c.type === ColliderType.Polygon) {
|
|
82
|
-
this.#matterBody = Matter.Bodies.fromVertices(x, y, [c.vertices], bodyOptions)
|
|
48
|
+
if (r.type === RigidbodyType.Rectangle) {
|
|
49
|
+
this.#matterBody = Matter.Bodies.rectangle(x, y, r.width, r.height, bodyOptions)
|
|
50
|
+
} else if (r.type === RigidbodyType.Circle) {
|
|
51
|
+
this.#matterBody = Matter.Bodies.circle(x, y, r.radius, bodyOptions)
|
|
52
|
+
} else if (r.type === RigidbodyType.Polygon) {
|
|
53
|
+
this.#matterBody = Matter.Bodies.fromVertices(x, y, [r.vertices], bodyOptions)
|
|
83
54
|
} else {
|
|
84
|
-
throw new Error('Invalid
|
|
55
|
+
throw new Error('Invalid rigidbody type')
|
|
85
56
|
}
|
|
86
57
|
|
|
87
58
|
this.#useYSort = options.useYSort ?? false
|
|
@@ -27,6 +27,7 @@ export class PhysicsWorld<E extends EventMap = EventMap> extends RenderableNode<
|
|
|
27
27
|
removeBody(body: Matter.Body) { Matter.World.remove(this.#matterEngine.world, body) }
|
|
28
28
|
|
|
29
29
|
protected override update(dt: number) {
|
|
30
|
+
if (this.paused) return
|
|
30
31
|
super.update(dt)
|
|
31
32
|
|
|
32
33
|
const matterDt = dt * 1000
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export enum RigidbodyType {
|
|
2
|
+
Rectangle,
|
|
3
|
+
Circle,
|
|
4
|
+
Polygon,
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export type RectangleRigidbody = { type: RigidbodyType.Rectangle, width: number, height: number }
|
|
8
|
+
export type CircleRigidbody = { type: RigidbodyType.Circle, radius: number }
|
|
9
|
+
export type PolygonRigidbody = { type: RigidbodyType.Polygon, vertices: { x: number, y: number }[] }
|
|
10
|
+
|
|
11
|
+
export type Rigidbody =
|
|
12
|
+
| RectangleRigidbody
|
|
13
|
+
| CircleRigidbody
|
|
14
|
+
| PolygonRigidbody
|
package/src/renderer/renderer.ts
CHANGED
|
@@ -150,12 +150,13 @@ export class Renderer extends RenderableNode<PixiContainer, {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
#render(dt: number) {
|
|
153
|
-
this.
|
|
154
|
-
|
|
155
|
-
this.update(dt)
|
|
153
|
+
this.update(dt) // 로직 업데이트
|
|
156
154
|
this._updateWorldTransform()
|
|
155
|
+
this._resetWorldTransformDirty()
|
|
157
156
|
this.#pixiRenderer?.render(this._pixiContainer)
|
|
158
157
|
this.fpsDisplay?.update()
|
|
158
|
+
|
|
159
|
+
this._isSizeDirty = false
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
_addToLayer(node: RenderableNode<PixiContainer, EventMap>, layerName: string) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface Frame {
|
|
2
|
+
x: number
|
|
3
|
+
y: number
|
|
4
|
+
w: number
|
|
5
|
+
h: number
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type Animation = {
|
|
9
|
+
frames: string[],
|
|
10
|
+
fps: number,
|
|
11
|
+
loop: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type Atlas = {
|
|
15
|
+
frames: Record<string, Frame>
|
|
16
|
+
animations: Record<string, Animation>
|
|
17
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|