From 8f024ba8526fc581c4e16e11475d55ac3015d2d2 Mon Sep 17 00:00:00 2001 From: ajiemath Date: Fri, 8 Nov 2019 12:30:10 +0800 Subject: [PATCH] add proton-engine version v4.0.0 add proton-engine version v4.0.0 --- .babelrc | 0 .editorconfig | 14 + .eslintignore | 3 + .gitignore | 35 + .npmignore | 0 LICENSE | 21 + README.md | 92 +- bower.json | 0 build/proton.js | 7004 +++++++++-------- build/proton.js.map | 2 +- build/proton.min.js | 4 +- build/proton.min.js.map | 2 +- example/behaviour/attraction/attraction1.html | 314 +- example/behaviour/attraction/attraction2.html | 356 +- example/behaviour/collision/collision.html | 325 +- .../behaviour/collision/collisionBall.html | 226 +- example/behaviour/color/color.html | 180 +- example/behaviour/custom/circle.html | 400 +- example/behaviour/custom/js/color.min.js | 0 example/behaviour/force/force.html | 365 +- example/behaviour/force/image/star.png | Bin example/behaviour/force/image/star1.png | Bin example/behaviour/force/image/star2.png | Bin example/behaviour/force/image/star3.png | Bin example/behaviour/force/star.html | 0 example/behaviour/gravitywell/linebug.html | 0 example/behaviour/randomDirft/image/bone.png | Bin .../behaviour/randomDirft/randomdirft1.html | 0 .../behaviour/randomDirft/randomdirft2.html | 0 .../behaviour/randomDirft/randomdirft3.html | 0 example/behaviour/repulsion/fireflies.html | 0 example/behaviour/repulsion/image/bg.jpg | Bin example/behaviour/repulsion/image/star.gif | Bin example/behaviour/repulsion/repulsion.html | 0 example/behaviour/rotate/image/arrow.png | Bin example/behaviour/rotate/rotate.html | 0 .../emitter/followEmitter/followEmitter.html | 0 .../emitter/followEmitter/image/bubble.png | Bin example/emitter/followEmitter/mouseDown.html | 0 example/game/colliejs/collie.html | 0 example/game/colliejs/image/bird.png | Bin example/game/colliejs/image/blood.png | Bin example/game/colliejs/image/blood2.png | Bin example/game/colliejs/image/ground2.png | Bin example/game/colliejs/image/sky.png | Bin example/game/colliejs/image/yame_walk2.png | Bin example/game/colliejs/js/collie.min.js | 0 example/game/crafty/images/bomb.png | Bin example/game/crafty/images/fighter.png | Bin example/game/crafty/images/fire.png | Bin example/game/crafty/images/meteorolite.png | Bin example/game/crafty/js/crafty.js | 0 example/game/easeljs/easeljs.html | 0 example/game/easeljs/image/c1.png | Bin example/game/easeljs/image/c2.png | Bin example/game/easeljs/image/c3.png | Bin example/game/easeljs/image/c4.png | Bin example/game/easeljs/image/p1.png | Bin example/game/easeljs/image/p2.png | Bin example/game/easeljs/image/p3.png | Bin example/game/easeljs/image/p4.png | Bin example/game/easeljs/image/p5.png | Bin example/game/easeljs/image/sky.png | Bin .../game/easeljs/image/spritesheet_grant.png | Bin example/game/phaser/imgs/bg.jpg | Bin 0 -> 61945 bytes example/game/phaser/imgs/dot.png | Bin 0 -> 19778 bytes ...t\347\232\204\345\211\257\346\234\254.png" | Bin 0 -> 39605 bytes example/game/phaser/imgs/logo.png | Bin 0 -> 11503 bytes example/game/phaser/phaser.html | 122 + example/game/pixijs/assets/Pixie.png | Bin example/game/pixijs/assets/iP4_BGtile.jpg | Bin example/game/pixijs/assets/iP4_ground.png | Bin example/game/pixijs/pixi-game.html | 4 +- example/game/quarkjs/images/body_walk.png | Bin example/game/quarkjs/images/head_idle.png | Bin example/game/quarkjs/images/rain.png | Bin example/game/quarkjs/js/Rain.js | 0 example/game/quarkjs/js/Squirrel.js | 0 .../game/quarkjs/js/quark.base-1.0.0.min.js | 0 example/game/quarkjs/squirrel.html | 432 +- example/helloworld/emitter/emitter.html | 187 +- example/index.html | 0 example/initialize/imagetarget/Spitfire.html | 0 example/initialize/imagetarget/fire2.html | 0 example/initialize/imagetarget/image/pt.jpg | Bin example/initialize/imagetarget/image/rock.png | Bin .../initialize/imagetarget/imagetarget.html | 0 example/initialize/position/bg-particle.html | 0 example/lib/TweenLite.min.js | 0 example/lib/color.min.js | 0 example/lib/easeljs-0.8.2.min.js | 0 example/lib/jquery-1.9.1.min.js | 0 example/lib/phaser.min.js | 1 + example/lib/pixi.min.js | 0 example/lib/preloadjs-0.6.2.min.js | 0 example/lib/profiler.js | 0 example/lib/requestAnimationFrame.min.js | 0 example/lib/stats.min.js | 0 example/render/custom/custom-renderer.html | 0 example/render/custom/popup.html | 0 example/render/dom/canvasVSdom.html | 0 example/render/dom/domrender.html | 0 example/render/dom/image/8.png | Bin example/render/dom/image/chrome.png | Bin example/render/dom/image/fox.png | Bin example/render/dom/image/safari.png | Bin example/render/dom/jpgmove.html | 0 example/render/dom/webglVSdom.html | 0 example/render/easeljs/easeljs.html | 0 example/render/pixel/google.html | 14 +- example/render/pixel/google/logo1.png | Bin example/render/pixel/google/logo2.png | Bin example/render/pixel/image/glaxy.jpg | Bin example/render/pixel/image/logo1.png | Bin example/render/pixel/image/logo2.png | Bin example/render/pixel/image/logo3.png | Bin example/render/pixel/js/PxLoader.js | 0 example/render/pixel/js/PxLoaderImage.js | 0 example/render/pixel/js/PxLoaderSound.js | 0 example/render/pixel/pixelrender.html | 0 example/render/pixel/thousand.html | 0 example/render/pixi/image/bunny.png | Bin example/render/pixi/image/eggHead.png | Bin example/render/pixi/image/flowerTop.png | Bin example/render/pixi/image/helmlok.png | Bin example/render/pixi/pixi-mulirender.html | 3 +- example/render/pixi/pixirender.html | 248 +- example/render/webgl/webglrender.html | 0 example/sparks/bigfire/bigfire.html | 0 example/sparks/bigfire/image/fire.png | Bin example/sparks/bomb/bomb.html | 0 example/sparks/drugs/drugs.html | 0 .../sparks/eightDiagrams/eightDiagrams.html | 0 example/sparks/firework/bg.jpg | Bin example/sparks/firework/fireworks.html | 0 example/sparks/sun/fireball.html | 0 example/sparks/sun/sun.html | 0 example/zone/circlezone/circlezone.html | 0 example/zone/circlezone/image/n.png | Bin example/zone/circlezone/image/o.png | Bin example/zone/circlezone/image/p.png | Bin example/zone/circlezone/image/r.png | Bin example/zone/circlezone/image/t.png | Bin example/zone/imagezone/image/logo.png | Bin example/zone/imagezone/imagezone.html | 0 example/zone/linezone/bound.html | 0 example/zone/pointzone/js/color.min.js | 0 example/zone/pointzone/pointzone.html | 0 package.json | 6 +- rollup.config.js | 0 script/makeexamplepage.js | 0 src/behaviour/Alpha.js | 148 +- src/behaviour/Attraction.js | 0 src/behaviour/Behaviour.js | 2 +- src/behaviour/Collision.js | 0 src/behaviour/Color.js | 169 +- src/behaviour/CrossZone.js | 0 src/behaviour/Force.js | 0 src/behaviour/Gravity.js | 0 src/behaviour/GravityWell.js | 0 src/behaviour/RandomDrift.js | 131 +- src/behaviour/Repulsion.js | 0 src/behaviour/Rotate.js | 13 +- src/behaviour/Scale.js | 15 +- src/core/Particle.js | 261 +- src/core/Pool.js | 250 +- src/core/Proton.js | 407 +- src/debug/Debug.js | 118 +- src/debug/Stats.js | 218 +- src/emitter/BehaviourEmitter.js | 109 +- src/emitter/Emitter.js | 629 +- src/emitter/FollowEmitter.js | 128 +- src/events/EventDispatcher.js | 137 +- src/index.js | 120 +- src/initialize/Body.js | 51 +- src/initialize/Initialize.js | 25 +- src/initialize/InitializeUtil.js | 58 +- src/initialize/Life.js | 25 +- src/initialize/Mass.js | 23 +- src/initialize/Position.js | 37 +- src/initialize/Radius.js | 31 +- src/initialize/Rate.js | 92 +- src/initialize/Velocity.js | 77 +- src/math/ArraySpan.js | 60 +- src/math/Integration.js | 40 +- src/math/Mat3.js | 129 +- src/math/MathUtil.js | 45 + src/math/MathUtils.js | 37 - src/math/Polar2D.js | 119 +- src/math/Rectangle.js | 28 +- src/math/Span.js | 89 +- src/math/Vector2D.js | 238 +- src/math/ease.js | 224 +- src/render/BaseRenderer.js | 132 +- src/render/CanvasRenderer.js | 112 +- src/render/CustomRenderer.js | 14 +- src/render/DomRenderer.js | 189 +- src/render/EaselRenderer.js | 108 +- src/render/PixelRenderer.js | 137 +- src/render/PixiRenderer.js | 173 +- src/render/WebGLRenderer.js | 62 +- src/utils/ColorUtil.js | 81 +- src/utils/DomUtil.js | 141 +- src/utils/ImgUtil.js | 130 +- src/utils/MStack.js | 53 +- src/utils/PUID.js | 66 +- src/utils/Rgb.js | 13 + src/utils/Util.js | 386 +- src/utils/WebGLUtil.js | 251 +- src/zone/CircleZone.js | 98 +- src/zone/ImageZone.js | 122 +- src/zone/LineZone.js | 264 +- src/zone/PointZone.js | 36 +- src/zone/RectZone.js | 112 +- src/zone/Zone.js | 21 +- 215 files changed, 9049 insertions(+), 8295 deletions(-) mode change 100644 => 100755 .babelrc create mode 100755 .editorconfig create mode 100755 .eslintignore mode change 100644 => 100755 .npmignore create mode 100755 LICENSE mode change 100644 => 100755 README.md mode change 100644 => 100755 bower.json mode change 100644 => 100755 build/proton.js mode change 100644 => 100755 build/proton.js.map mode change 100644 => 100755 build/proton.min.js mode change 100644 => 100755 build/proton.min.js.map mode change 100644 => 100755 example/behaviour/attraction/attraction1.html mode change 100644 => 100755 example/behaviour/attraction/attraction2.html mode change 100644 => 100755 example/behaviour/collision/collision.html mode change 100644 => 100755 example/behaviour/collision/collisionBall.html mode change 100644 => 100755 example/behaviour/color/color.html mode change 100644 => 100755 example/behaviour/custom/circle.html mode change 100644 => 100755 example/behaviour/custom/js/color.min.js mode change 100644 => 100755 example/behaviour/force/force.html mode change 100644 => 100755 example/behaviour/force/image/star.png mode change 100644 => 100755 example/behaviour/force/image/star1.png mode change 100644 => 100755 example/behaviour/force/image/star2.png mode change 100644 => 100755 example/behaviour/force/image/star3.png mode change 100644 => 100755 example/behaviour/force/star.html mode change 100644 => 100755 example/behaviour/gravitywell/linebug.html mode change 100644 => 100755 example/behaviour/randomDirft/image/bone.png mode change 100644 => 100755 example/behaviour/randomDirft/randomdirft1.html mode change 100644 => 100755 example/behaviour/randomDirft/randomdirft2.html mode change 100644 => 100755 example/behaviour/randomDirft/randomdirft3.html mode change 100644 => 100755 example/behaviour/repulsion/fireflies.html mode change 100644 => 100755 example/behaviour/repulsion/image/bg.jpg mode change 100644 => 100755 example/behaviour/repulsion/image/star.gif mode change 100644 => 100755 example/behaviour/repulsion/repulsion.html mode change 100644 => 100755 example/behaviour/rotate/image/arrow.png mode change 100644 => 100755 example/behaviour/rotate/rotate.html mode change 100644 => 100755 example/emitter/followEmitter/followEmitter.html mode change 100644 => 100755 example/emitter/followEmitter/image/bubble.png mode change 100644 => 100755 example/emitter/followEmitter/mouseDown.html mode change 100644 => 100755 example/game/colliejs/collie.html mode change 100644 => 100755 example/game/colliejs/image/bird.png mode change 100644 => 100755 example/game/colliejs/image/blood.png mode change 100644 => 100755 example/game/colliejs/image/blood2.png mode change 100644 => 100755 example/game/colliejs/image/ground2.png mode change 100644 => 100755 example/game/colliejs/image/sky.png mode change 100644 => 100755 example/game/colliejs/image/yame_walk2.png mode change 100644 => 100755 example/game/colliejs/js/collie.min.js mode change 100644 => 100755 example/game/crafty/images/bomb.png mode change 100644 => 100755 example/game/crafty/images/fighter.png mode change 100644 => 100755 example/game/crafty/images/fire.png mode change 100644 => 100755 example/game/crafty/images/meteorolite.png mode change 100644 => 100755 example/game/crafty/js/crafty.js mode change 100644 => 100755 example/game/easeljs/easeljs.html mode change 100644 => 100755 example/game/easeljs/image/c1.png mode change 100644 => 100755 example/game/easeljs/image/c2.png mode change 100644 => 100755 example/game/easeljs/image/c3.png mode change 100644 => 100755 example/game/easeljs/image/c4.png mode change 100644 => 100755 example/game/easeljs/image/p1.png mode change 100644 => 100755 example/game/easeljs/image/p2.png mode change 100644 => 100755 example/game/easeljs/image/p3.png mode change 100644 => 100755 example/game/easeljs/image/p4.png mode change 100644 => 100755 example/game/easeljs/image/p5.png mode change 100644 => 100755 example/game/easeljs/image/sky.png mode change 100644 => 100755 example/game/easeljs/image/spritesheet_grant.png create mode 100755 example/game/phaser/imgs/bg.jpg create mode 100755 example/game/phaser/imgs/dot.png create mode 100755 "example/game/phaser/imgs/dot\347\232\204\345\211\257\346\234\254.png" create mode 100755 example/game/phaser/imgs/logo.png create mode 100755 example/game/phaser/phaser.html mode change 100644 => 100755 example/game/pixijs/assets/Pixie.png mode change 100644 => 100755 example/game/pixijs/assets/iP4_BGtile.jpg mode change 100644 => 100755 example/game/pixijs/assets/iP4_ground.png mode change 100644 => 100755 example/game/pixijs/pixi-game.html mode change 100644 => 100755 example/game/quarkjs/images/body_walk.png mode change 100644 => 100755 example/game/quarkjs/images/head_idle.png mode change 100644 => 100755 example/game/quarkjs/images/rain.png mode change 100644 => 100755 example/game/quarkjs/js/Rain.js mode change 100644 => 100755 example/game/quarkjs/js/Squirrel.js mode change 100644 => 100755 example/game/quarkjs/js/quark.base-1.0.0.min.js mode change 100644 => 100755 example/game/quarkjs/squirrel.html mode change 100644 => 100755 example/helloworld/emitter/emitter.html mode change 100644 => 100755 example/index.html mode change 100644 => 100755 example/initialize/imagetarget/Spitfire.html mode change 100644 => 100755 example/initialize/imagetarget/fire2.html mode change 100644 => 100755 example/initialize/imagetarget/image/pt.jpg mode change 100644 => 100755 example/initialize/imagetarget/image/rock.png mode change 100644 => 100755 example/initialize/imagetarget/imagetarget.html mode change 100644 => 100755 example/initialize/position/bg-particle.html mode change 100644 => 100755 example/lib/TweenLite.min.js mode change 100644 => 100755 example/lib/color.min.js mode change 100644 => 100755 example/lib/easeljs-0.8.2.min.js mode change 100644 => 100755 example/lib/jquery-1.9.1.min.js create mode 100755 example/lib/phaser.min.js mode change 100644 => 100755 example/lib/pixi.min.js mode change 100644 => 100755 example/lib/preloadjs-0.6.2.min.js mode change 100644 => 100755 example/lib/profiler.js mode change 100644 => 100755 example/lib/requestAnimationFrame.min.js mode change 100644 => 100755 example/lib/stats.min.js mode change 100644 => 100755 example/render/custom/custom-renderer.html mode change 100644 => 100755 example/render/custom/popup.html mode change 100644 => 100755 example/render/dom/canvasVSdom.html mode change 100644 => 100755 example/render/dom/domrender.html mode change 100644 => 100755 example/render/dom/image/8.png mode change 100644 => 100755 example/render/dom/image/chrome.png mode change 100644 => 100755 example/render/dom/image/fox.png mode change 100644 => 100755 example/render/dom/image/safari.png mode change 100644 => 100755 example/render/dom/jpgmove.html mode change 100644 => 100755 example/render/dom/webglVSdom.html mode change 100644 => 100755 example/render/easeljs/easeljs.html mode change 100644 => 100755 example/render/pixel/google.html mode change 100644 => 100755 example/render/pixel/google/logo1.png mode change 100644 => 100755 example/render/pixel/google/logo2.png mode change 100644 => 100755 example/render/pixel/image/glaxy.jpg mode change 100644 => 100755 example/render/pixel/image/logo1.png mode change 100644 => 100755 example/render/pixel/image/logo2.png mode change 100644 => 100755 example/render/pixel/image/logo3.png mode change 100644 => 100755 example/render/pixel/js/PxLoader.js mode change 100644 => 100755 example/render/pixel/js/PxLoaderImage.js mode change 100644 => 100755 example/render/pixel/js/PxLoaderSound.js mode change 100644 => 100755 example/render/pixel/pixelrender.html mode change 100644 => 100755 example/render/pixel/thousand.html mode change 100644 => 100755 example/render/pixi/image/bunny.png mode change 100644 => 100755 example/render/pixi/image/eggHead.png mode change 100644 => 100755 example/render/pixi/image/flowerTop.png mode change 100644 => 100755 example/render/pixi/image/helmlok.png mode change 100644 => 100755 example/render/pixi/pixi-mulirender.html mode change 100644 => 100755 example/render/pixi/pixirender.html mode change 100644 => 100755 example/render/webgl/webglrender.html mode change 100644 => 100755 example/sparks/bigfire/bigfire.html mode change 100644 => 100755 example/sparks/bigfire/image/fire.png mode change 100644 => 100755 example/sparks/bomb/bomb.html mode change 100644 => 100755 example/sparks/drugs/drugs.html mode change 100644 => 100755 example/sparks/eightDiagrams/eightDiagrams.html mode change 100644 => 100755 example/sparks/firework/bg.jpg mode change 100644 => 100755 example/sparks/firework/fireworks.html mode change 100644 => 100755 example/sparks/sun/fireball.html mode change 100644 => 100755 example/sparks/sun/sun.html mode change 100644 => 100755 example/zone/circlezone/circlezone.html mode change 100644 => 100755 example/zone/circlezone/image/n.png mode change 100644 => 100755 example/zone/circlezone/image/o.png mode change 100644 => 100755 example/zone/circlezone/image/p.png mode change 100644 => 100755 example/zone/circlezone/image/r.png mode change 100644 => 100755 example/zone/circlezone/image/t.png mode change 100644 => 100755 example/zone/imagezone/image/logo.png mode change 100644 => 100755 example/zone/imagezone/imagezone.html mode change 100644 => 100755 example/zone/linezone/bound.html mode change 100644 => 100755 example/zone/pointzone/js/color.min.js mode change 100644 => 100755 example/zone/pointzone/pointzone.html mode change 100644 => 100755 package.json mode change 100644 => 100755 rollup.config.js mode change 100644 => 100755 script/makeexamplepage.js mode change 100644 => 100755 src/behaviour/Alpha.js mode change 100644 => 100755 src/behaviour/Attraction.js mode change 100644 => 100755 src/behaviour/Behaviour.js mode change 100644 => 100755 src/behaviour/Collision.js mode change 100644 => 100755 src/behaviour/Color.js mode change 100644 => 100755 src/behaviour/CrossZone.js mode change 100644 => 100755 src/behaviour/Force.js mode change 100644 => 100755 src/behaviour/Gravity.js mode change 100644 => 100755 src/behaviour/GravityWell.js mode change 100644 => 100755 src/behaviour/RandomDrift.js mode change 100644 => 100755 src/behaviour/Repulsion.js mode change 100644 => 100755 src/behaviour/Rotate.js mode change 100644 => 100755 src/behaviour/Scale.js mode change 100644 => 100755 src/core/Particle.js mode change 100644 => 100755 src/core/Pool.js mode change 100644 => 100755 src/core/Proton.js mode change 100644 => 100755 src/debug/Debug.js mode change 100644 => 100755 src/debug/Stats.js mode change 100644 => 100755 src/emitter/BehaviourEmitter.js mode change 100644 => 100755 src/emitter/Emitter.js mode change 100644 => 100755 src/emitter/FollowEmitter.js mode change 100644 => 100755 src/events/EventDispatcher.js mode change 100644 => 100755 src/index.js mode change 100644 => 100755 src/initialize/Body.js mode change 100644 => 100755 src/initialize/Initialize.js mode change 100644 => 100755 src/initialize/InitializeUtil.js mode change 100644 => 100755 src/initialize/Life.js mode change 100644 => 100755 src/initialize/Mass.js mode change 100644 => 100755 src/initialize/Position.js mode change 100644 => 100755 src/initialize/Radius.js mode change 100644 => 100755 src/initialize/Rate.js mode change 100644 => 100755 src/initialize/Velocity.js mode change 100644 => 100755 src/math/ArraySpan.js mode change 100644 => 100755 src/math/Integration.js mode change 100644 => 100755 src/math/Mat3.js create mode 100755 src/math/MathUtil.js delete mode 100644 src/math/MathUtils.js mode change 100644 => 100755 src/math/Polar2D.js mode change 100644 => 100755 src/math/Rectangle.js mode change 100644 => 100755 src/math/Span.js mode change 100644 => 100755 src/math/Vector2D.js mode change 100644 => 100755 src/math/ease.js mode change 100644 => 100755 src/render/BaseRenderer.js mode change 100644 => 100755 src/render/CanvasRenderer.js mode change 100644 => 100755 src/render/CustomRenderer.js mode change 100644 => 100755 src/render/DomRenderer.js mode change 100644 => 100755 src/render/EaselRenderer.js mode change 100644 => 100755 src/render/PixelRenderer.js mode change 100644 => 100755 src/render/PixiRenderer.js mode change 100644 => 100755 src/render/WebGLRenderer.js mode change 100644 => 100755 src/utils/ColorUtil.js mode change 100644 => 100755 src/utils/DomUtil.js mode change 100644 => 100755 src/utils/ImgUtil.js mode change 100644 => 100755 src/utils/MStack.js mode change 100644 => 100755 src/utils/PUID.js create mode 100755 src/utils/Rgb.js mode change 100644 => 100755 src/utils/Util.js mode change 100644 => 100755 src/utils/WebGLUtil.js mode change 100644 => 100755 src/zone/CircleZone.js mode change 100644 => 100755 src/zone/ImageZone.js mode change 100644 => 100755 src/zone/LineZone.js mode change 100644 => 100755 src/zone/PointZone.js mode change 100644 => 100755 src/zone/RectZone.js mode change 100644 => 100755 src/zone/Zone.js diff --git a/.babelrc b/.babelrc old mode 100644 new mode 100755 diff --git a/.editorconfig b/.editorconfig new file mode 100755 index 0000000..3454886 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# https://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore new file mode 100755 index 0000000..92e6209 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +dist +build +example \ No newline at end of file diff --git a/.gitignore b/.gitignore index fce9b1a..969de9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,36 @@ +# IDEs and editors +.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# next.js build output +.next + +# Lerna +lerna-debug.log + +# System Files +.DS_Store +Thumbs.db + # node modules node_modules @@ -5,3 +38,5 @@ node_modules build/docs/ package-lock.json +.DS_Store +source/build/ diff --git a/.npmignore b/.npmignore old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..5e961ed --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright © 2010-2019 Proton authors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md old mode 100644 new mode 100755 index a3d10d3..967af10 --- a/README.md +++ b/README.md @@ -1,25 +1,48 @@ -# Proton +
-> See the detailed documentation please visit [here](https://projects.jpeer.at/proton/) +--- -Proton is a lightweight and powerful javascript particle engine. With it you can easily create countless cool effects. -#### Check out examples at: [http://a-jie.github.io/Proton/](http://a-jie.github.io/Proton/). Check out the tutorial at: [https://qiita.com/matsu7089/items/dcb7d326e4ec1340eba6](https://qiita.com/matsu7089/items/dcb7d326e4ec1340eba6) +
+ + npm version + + + + issues open + + + + license:MIT + + +
+ + +Proton is a lightweight and powerful Javascript particle animation library. Use it to easily create a variety of cool particle effects. + +Check out examples at [http://a-jie.github.io/Proton/](http://a-jie.github.io/Proton/). The **3D version** of the proton engine is here [https://a-jie.github.io/three.proton/](https://a-jie.github.io/three.proton/) ## Features -- Seven kinds of renderers - - canvas - CanvasRenderer - - dom - DomRenderer - - webgl - WebGLRenderer - - pixel - PixelRenderer - - easeljs - EaselRenderer - - pixi.js - PixiRenderer - - custom - CustomRenderer -- Create cool effects like the demo of [71squared's ParticleDesigner](https://www.71squared.com/particledesigner) in 10 lines of code. -- Integratable into any game engine. -- Veriety of behaviors which can simulate many different physical effects. -- Three kinds of emitters and can be easily expanded. -- The __3D version__ of the proton engine is here [https://a-jie.github.io/three.proton/](https://a-jie.github.io/three.proton/) +- **Easy to use** It takes only a dozen lines of code to create a particle animation effect. +- **Multiple effects** Use Proton to create flames, fireworks, bullets, explosions, and more. +- **Any scene** You can use it in frameworks such as `react`, `vue`, `angular`, and `pixi.js`, `Phaser`, etc. +- **Efficient rendering** Its rendering efficiency is very high, you can render tens of thousands of particles in the page. +- **Simulated physics** Proton can simulate various physical properties including gravity and Brownian motion. +- **Several renderers** Proton provides a variety of renderers, of course you can also customize your own renderer + - `CanvasRenderer` - Proton's canvas renderer + - `DomRenderer` - Proton's dom renderer, supporting hardware acceleration. + - `WebGLRenderer` - Proton's webgl renderer. + - `PixelRenderer` - Proton's pixel renderer, It can implement pixel animation. + - `EaselRenderer` - Easeljs proton renderer. + - `EaselRenderer` - Pixi.js proton renderer. + - `CustomRenderer` - Use a custom renderer that can be applied to any scene. + +## Documentation + +See detailed documentation please visit [https://projects.jpeer.at/proton/](https://projects.jpeer.at/proton/). +Thank you very much [@matsu7089](https://github.com/matsu7089) for writing a [good tutorial](https://qiita.com/matsu7089/items/dcb7d326e4ec1340eba6). + ## Installation @@ -28,9 +51,11 @@ Proton is a lightweight and powerful javascript particle engine. With it you can ##### Note: NPM package-name has been changed from `proton-js` to `proton-engine` -``` +```shell npm install proton-engine --save -... +``` + +```javascript import Proton from 'proton-engine'; ``` @@ -40,9 +65,12 @@ import Proton from 'proton-engine'; ``` ## Usage + +Proton is very simple to use, a dozen lines of code can create a particle animation. + ```javascript -var proton = new Proton(); -var emitter = new Proton.Emitter(); +const proton = new Proton(); +const emitter = new Proton.Emitter(); //set Rate emitter.rate = new Proton.Rate(Proton.getSpan(10, 20), 0.1); @@ -67,28 +95,32 @@ proton.addEmitter(emitter); // add canvas renderer var renderer = new Proton.CanvasRenderer(canvas); proton.addRenderer(renderer); - -//use Euler integration calculation is more accurate (default false) -Proton.USE_CLOCK = false or true; ``` -## Description -`Proton.Span (or Proton.getSpan)` is a very important concept of the Proton engine, it's everywhere. If you understand its usage, you can create almost any desired effect! - -Proton has now been upgraded to the __v3__ version. Performance has been greatly improved and api also has some improvements. For more details, please check [here](https://github.com/a-jie/Proton/releases). +## Remarks +* `Proton.Span (or Proton.getSpan)` is a very important concept of the Proton engine, it's everywhere. If you understand its usage, you can create almost any desired effect! + +* If you want to create wind, rain, or snow, etc, you can use the `emitter.preEmit` method to pre-render the scene. +* Use `Proton.Body` and `Proton.Color` at the same time. I suggest you'd better use the `WebGLRenderer` not `CanvasRenderer`. + +* Use Euler integration calculation is more accurate (default false) `Proton.USE_CLOCK = false or true;` + +Proton has now been upgraded to the __v4__ version. Performance has been greatly improved and api also has some improvements. For more details, please check [here](https://github.com/a-jie/Proton/releases). ## Building -Node is a dependency, use terminal to install it with: + +`node` is a dependency, use terminal to install it with: ```javascript git clone git://github.com/a-jie/Proton.git + ... npm install npm run build ``` -and run example +And run example ```javascript npm start diff --git a/bower.json b/bower.json old mode 100644 new mode 100755 diff --git a/build/proton.js b/build/proton.js old mode 100644 new mode 100755 index 1c20c14..77bf988 --- a/build/proton.js +++ b/build/proton.js @@ -5,30 +5,36 @@ }(this, (function () { 'use strict'; var PI = 3.1415926; +var INFINITY = Infinity; -var MathUtils = { - +var MathUtil = { PI: PI, PIx2: PI * 2, PI_2: PI / 2, PI_180: PI / 180, N180_PI: 180 / PI, + Infinity: -999, + + isInfinity: function isInfinity(num) { + return num === this.Infinity || num === INFINITY; + }, + randomAToB: function randomAToB(a, b) { + var isInt = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; - randomAToB: function randomAToB(a, b, INT) { - if (!INT) return a + Math.random() * (b - a);else return Math.floor(Math.random() * (b - a)) + a; + if (!isInt) return a + Math.random() * (b - a);else return Math.floor(Math.random() * (b - a)) + a; }, - randomFloating: function randomFloating(center, f, INT) { - return this.randomAToB(center - f, center + f, INT); + randomFloating: function randomFloating(center, f, isInt) { + return this.randomAToB(center - f, center + f, isInt); }, randomZone: function randomZone(display) {}, degreeTransform: function degreeTransform(a) { return a * PI / 180; }, toColor16: function toColor16(num) { - return '#' + num.toString(16); + return "#" + num.toString(16); }, randomColor: function randomColor() { - return '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6); + return "#" + ("00000" + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6); } }; @@ -138,850 +144,884 @@ var possibleConstructorReturn = function (self, call) { }; var Span = function () { - function Span(a, b, center) { - classCallCheck(this, Span); - - this.isArray = false; - - if (Util.isArray(a)) { - this.isArray = true; - this.a = a; - } else { - this.a = Util.initValue(a, 1); - this.b = Util.initValue(b, this.a); - this.center = Util.initValue(center, false); - } - } + function Span(a, b, center) { + classCallCheck(this, Span); - createClass(Span, [{ - key: 'getValue', - value: function getValue(INT) { - if (this.isArray) { - return this.a[Math.floor(this.a.length * Math.random())]; - } else { - if (!this.center) return MathUtils.randomAToB(this.a, this.b, INT);else return MathUtils.randomFloating(this.a, this.b, INT); - } - } - }]); - return Span; -}(); + if (Util.isArray(a)) { + this.isArray = true; + this.a = a; + } else { + this.isArray = false; + this.a = Util.initValue(a, 1); + this.b = Util.initValue(b, this.a); + this.center = Util.initValue(center, false); + } + } -var WebGLUtil = { + createClass(Span, [{ + key: "getValue", + value: function getValue() { + var isInt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (this.isArray) { + return Util.getRandFromArray(this.a); + } else { + if (!this.center) { + return MathUtil.randomAToB(this.a, this.b, isInt); + } else { + return MathUtil.randomFloating(this.a, this.b, isInt); + } + } + } /** - * @memberof Proton#Proton.WebGLUtil - * @method ipot + * Returns a new Span object * - * @todo add description - * @todo add length description + * @memberof Proton#Proton.Util + * @method setSpanValue + * + * @todo a, b and c should be 'Mixed' or 'Number'? * - * @param {Number} length + * @param {Mixed | Span} a + * @param {Mixed} b + * @param {Mixed} c * - * @return {Boolean} + * @return {Span} */ - ipot: function ipot(length) { - return (length & length - 1) === 0; - }, + }], [{ + key: "setSpanValue", + value: function setSpanValue(a, b, c) { + if (a instanceof Span) { + return a; + } else { + if (b === undefined) { + return new Span(a); + } else { + if (c === undefined) return new Span(a, b);else return new Span(a, b, c); + } + } + } /** - * @memberof Proton#Proton.WebGLUtil - * @method nhpot + * Returns the value from a Span, if the param is not a Span it will return the given parameter * - * @todo add description - * @todo add length description + * @memberof Proton#Proton.Util + * @method getValue * - * @param {Number} length + * @param {Mixed | Span} pan * - * @return {Number} + * @return {Mixed} the value of Span OR the parameter if it is not a Span */ - nhpot: function nhpot(length) { - --length; - for (var i = 1; i < 32; i <<= 1) { - length = length | length >> i; - } - return length + 1; - }, + }, { + key: "getSpanValue", + value: function getSpanValue(pan) { + return pan instanceof Span ? pan.getValue() : pan; + } + }]); + return Span; +}(); +var WebGLUtil = { + /** + * @memberof Proton#Proton.WebGLUtil + * @method ipot + * + * @todo add description + * @todo add length description + * + * @param {Number} length + * + * @return {Boolean} + */ + ipot: function ipot(length) { + return (length & length - 1) === 0; + }, - /** - * @memberof Proton#Proton.WebGLUtil - * @method makeTranslation - * - * @todo add description - * @todo add tx, ty description - * @todo add return description - * - * @param {Number} tx either 0 or 1 - * @param {Number} ty either 0 or 1 - * - * @return {Object} - */ - makeTranslation: function makeTranslation(tx, ty) { - return [1, 0, 0, 0, 1, 0, tx, ty, 1]; - }, + /** + * @memberof Proton#Proton.WebGLUtil + * @method nhpot + * + * @todo add description + * @todo add length description + * + * @param {Number} length + * + * @return {Number} + */ + nhpot: function nhpot(length) { + --length; + for (var i = 1; i < 32; i <<= 1) { + length = length | length >> i; + } - /** - * @memberof Proton#Proton.WebGLUtil - * @method makeRotation - * - * @todo add description - * @todo add return description - * - * @param {Number} angleInRadians - * - * @return {Object} - */ - makeRotation: function makeRotation(angleInRadians) { - var c = Math.cos(angleInRadians); - var s = Math.sin(angleInRadians); + return length + 1; + }, - return [c, -s, 0, s, c, 0, 0, 0, 1]; - }, + /** + * @memberof Proton#Proton.WebGLUtil + * @method makeTranslation + * + * @todo add description + * @todo add tx, ty description + * @todo add return description + * + * @param {Number} tx either 0 or 1 + * @param {Number} ty either 0 or 1 + * + * @return {Object} + */ + makeTranslation: function makeTranslation(tx, ty) { + return [1, 0, 0, 0, 1, 0, tx, ty, 1]; + }, - /** - * @memberof Proton#Proton.WebGLUtil - * @method makeScale - * - * @todo add description - * @todo add tx, ty description - * @todo add return description - * - * @param {Number} sx either 0 or 1 - * @param {Number} sy either 0 or 1 - * - * @return {Object} - */ - makeScale: function makeScale(sx, sy) { - return [sx, 0, 0, 0, sy, 0, 0, 0, 1]; - }, + /** + * @memberof Proton#Proton.WebGLUtil + * @method makeRotation + * + * @todo add description + * @todo add return description + * + * @param {Number} angleInRadians + * + * @return {Object} + */ + makeRotation: function makeRotation(angleInRadians) { + var c = Math.cos(angleInRadians); + var s = Math.sin(angleInRadians); + + return [c, -s, 0, s, c, 0, 0, 0, 1]; + }, - /** - * @memberof Proton#Proton.WebGLUtil - * @method matrixMultiply - * - * @todo add description - * @todo add a, b description - * @todo add return description - * - * @param {Object} a - * @param {Object} b - * - * @return {Object} - */ - matrixMultiply: function matrixMultiply(a, b) { - var a00 = a[0 * 3 + 0]; - var a01 = a[0 * 3 + 1]; - var a02 = a[0 * 3 + 2]; - var a10 = a[1 * 3 + 0]; - var a11 = a[1 * 3 + 1]; - var a12 = a[1 * 3 + 2]; - var a20 = a[2 * 3 + 0]; - var a21 = a[2 * 3 + 1]; - var a22 = a[2 * 3 + 2]; - var b00 = b[0 * 3 + 0]; - var b01 = b[0 * 3 + 1]; - var b02 = b[0 * 3 + 2]; - var b10 = b[1 * 3 + 0]; - var b11 = b[1 * 3 + 1]; - var b12 = b[1 * 3 + 2]; - var b20 = b[2 * 3 + 0]; - var b21 = b[2 * 3 + 1]; - var b22 = b[2 * 3 + 2]; - - return [a00 * b00 + a01 * b10 + a02 * b20, a00 * b01 + a01 * b11 + a02 * b21, a00 * b02 + a01 * b12 + a02 * b22, a10 * b00 + a11 * b10 + a12 * b20, a10 * b01 + a11 * b11 + a12 * b21, a10 * b02 + a11 * b12 + a12 * b22, a20 * b00 + a21 * b10 + a22 * b20, a20 * b01 + a21 * b11 + a22 * b21, a20 * b02 + a21 * b12 + a22 * b22]; - } + + /** + * @memberof Proton#Proton.WebGLUtil + * @method makeScale + * + * @todo add description + * @todo add tx, ty description + * @todo add return description + * + * @param {Number} sx either 0 or 1 + * @param {Number} sy either 0 or 1 + * + * @return {Object} + */ + makeScale: function makeScale(sx, sy) { + return [sx, 0, 0, 0, sy, 0, 0, 0, 1]; + }, + + + /** + * @memberof Proton#Proton.WebGLUtil + * @method matrixMultiply + * + * @todo add description + * @todo add a, b description + * @todo add return description + * + * @param {Object} a + * @param {Object} b + * + * @return {Object} + */ + matrixMultiply: function matrixMultiply(a, b) { + var a00 = a[0 * 3 + 0]; + var a01 = a[0 * 3 + 1]; + var a02 = a[0 * 3 + 2]; + var a10 = a[1 * 3 + 0]; + var a11 = a[1 * 3 + 1]; + var a12 = a[1 * 3 + 2]; + var a20 = a[2 * 3 + 0]; + var a21 = a[2 * 3 + 1]; + var a22 = a[2 * 3 + 2]; + var b00 = b[0 * 3 + 0]; + var b01 = b[0 * 3 + 1]; + var b02 = b[0 * 3 + 2]; + var b10 = b[1 * 3 + 0]; + var b11 = b[1 * 3 + 1]; + var b12 = b[1 * 3 + 2]; + var b20 = b[2 * 3 + 0]; + var b21 = b[2 * 3 + 1]; + var b22 = b[2 * 3 + 2]; + + return [a00 * b00 + a01 * b10 + a02 * b20, a00 * b01 + a01 * b11 + a02 * b21, a00 * b02 + a01 * b12 + a02 * b22, a10 * b00 + a11 * b10 + a12 * b20, a10 * b01 + a11 * b11 + a12 * b21, a10 * b02 + a11 * b12 + a12 * b22, a20 * b00 + a21 * b10 + a22 * b20, a20 * b01 + a21 * b11 + a22 * b21, a20 * b02 + a21 * b12 + a22 * b22]; + } }; var DomUtil = { + /** + * Creates and returns a new canvas. The opacity is by default set to 0 + * + * @memberof Proton#Proton.DomUtil + * @method createCanvas + * + * @param {String} $id the canvas' id + * @param {Number} $width the canvas' width + * @param {Number} $height the canvas' height + * @param {String} [$position=absolute] the canvas' position, default is 'absolute' + * + * @return {Object} + */ + createCanvas: function createCanvas(id, width, height) { + var position = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "absolute"; + + var dom = document.createElement("canvas"); + + dom.id = id; + dom.width = width; + dom.height = height; + dom.style.opacity = 0; + dom.style.position = position; + this.transform(dom, -500, -500, 0, 0); + + return dom; + }, + createDiv: function createDiv(id, width, height) { + var dom = document.createElement("div"); + + dom.id = id; + dom.style.position = "absolute"; + this.resize(dom, width, height); + + return dom; + }, + resize: function resize(dom, width, height) { + dom.style.width = width + "px"; + dom.style.height = height + "px"; + dom.style.marginLeft = -width / 2 + "px"; + dom.style.marginTop = -height / 2 + "px"; + }, + + + /** + * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers + * + * @memberof Proton#Proton.DomUtil + * @method transform + * + * @param {HTMLDivElement} div + * @param {Number} $x + * @param {Number} $y + * @param {Number} $scale + * @param {Number} $rotate + */ + transform: function transform(div, x, y, scale, rotate) { + div.style.willChange = "transform"; + var transform = "translate(" + x + "px, " + y + "px) scale(" + scale + ") rotate(" + rotate + "deg)"; + this.css3(div, "transform", transform); + }, + transform3d: function transform3d(div, x, y, scale, rotate) { + div.style.willChange = "transform"; + var transform = "translate3d(" + x + "px, " + y + "px, 0) scale(" + scale + ") rotate(" + rotate + "deg)"; + this.css3(div, "backfaceVisibility", "hidden"); + this.css3(div, "transform", transform); + }, + css3: function css3(div, key, val) { + var bkey = key.charAt(0).toUpperCase() + key.substr(1); + + div.style["Webkit" + bkey] = val; + div.style["Moz" + bkey] = val; + div.style["O" + bkey] = val; + div.style["ms" + bkey] = val; + div.style["" + key] = val; + } +}; - /** - * Creates and returns a new canvas. The opacity is by default set to 0 - * - * @memberof Proton#Proton.DomUtil - * @method createCanvas - * - * @param {String} $id the canvas' id - * @param {Number} $width the canvas' width - * @param {Number} $height the canvas' height - * @param {String} [$position=absolute] the canvas' position, default is 'absolute' - * - * @return {Object} - */ - createCanvas: function createCanvas(id, width, height, position) { - var dom = document.createElement('canvas'); - position = position || 'absolute'; - - dom.id = id; - dom.width = width; - dom.height = height; - dom.style.opacity = 0; - dom.style.position = position; +var imgsCache = {}; +var canvasCache = {}; +var canvasId = 0; - this.transform(dom, -500, -500, 0, 0); +var ImgUtil = { + /** + * This will get the image data. It could be necessary to create a Proton.Zone. + * + * @memberof Proton#Proton.Util + * @method getImageData + * + * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')' + * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag'); + * @param {Proton.Rectangle} rect + */ + getImageData: function getImageData(context, image, rect) { + context.drawImage(image, rect.x, rect.y); + var imagedata = context.getImageData(rect.x, rect.y, rect.width, rect.height); + context.clearRect(rect.x, rect.y, rect.width, rect.height); - return dom; - }, - createDiv: function createDiv(id, width, height) { - var dom = document.createElement('div'); + return imagedata; + }, - dom.id = id; - dom.style.position = 'absolute'; - this.resize(dom, width, height); - return dom; - }, - resize: function resize(dom, width, height) { - dom.style.width = width + 'px'; - dom.style.height = height + 'px'; - dom.style.marginLeft = -width / 2 + 'px'; - dom.style.marginTop = -height / 2 + 'px'; - }, + /** + * @memberof Proton#Proton.Util + * @method getImgFromCache + * + * @todo add description + * @todo describe func + * + * @param {Mixed} img + * @param {Proton.Particle} particle + * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.data.canvas + * @param {Boolean} func + */ + getImgFromCache: function getImgFromCache(img, callback, param) { + var src = typeof img === "string" ? img : img.src; + if (imgsCache[src]) { + callback(imgsCache[src], param); + } else { + var image = new Image(); + image.onload = function (e) { + imgsCache[src] = e.target; + callback(imgsCache[src], param); + }; - /** - * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers - * - * @memberof Proton#Proton.DomUtil - * @method transform - * - * @param {HTMLDivElement} div - * @param {Number} $x - * @param {Number} $y - * @param {Number} $scale - * @param {Number} $rotate - */ - transform: function transform(div, x, y, scale, rotate) { - var transform = 'translate(' + x + 'px, ' + y + 'px) scale(' + scale + ') rotate(' + rotate + 'deg)'; + image.src = src; + } + }, + getCanvasFromCache: function getCanvasFromCache(img, callback, param) { + var src = img.src; - div.style.willChange = 'transform'; - this.css3(div, 'transform', transform); - }, - transform3d: function transform3d(div, x, y, scale, rotate) { - var transform = 'translate3d(' + x + 'px, ' + y + 'px, 0) scale(' + scale + ') rotate(' + rotate + 'deg)'; + if (!canvasCache[src]) { + var width = WebGLUtil.nhpot(img.width); + var height = WebGLUtil.nhpot(img.height); - div.style.willChange = 'transform'; - this.css3(div, 'backfaceVisibility', 'hidden'); - this.css3(div, 'transform', transform); - }, - css3: function css3(div, key, val) { - var bkey = key.charAt(0).toUpperCase() + key.substr(1); + var canvas = DomUtil.createCanvas("proton_canvas_cache_" + ++canvasId, width, height); + var context = canvas.getContext("2d"); + context.drawImage(img, 0, 0, img.width, img.height); - div.style['Webkit' + bkey] = val; - div.style['Moz' + bkey] = val; - div.style['O' + bkey] = val; - div.style['ms' + bkey] = val; - div.style['' + key] = val; + canvasCache[src] = canvas; } + + callback && callback(canvasCache[src], param); + + return canvasCache[src]; + } }; -var IMG_CACHE = {}; -var CANVAS_CACHE = {}; -var canvasID = 0; +var Util = { + /** + * Returns the default if the value is null or undefined + * + * @memberof Proton#Proton.Util + * @method initValue + * + * @param {Mixed} value a specific value, could be everything but null or undefined + * @param {Mixed} defaults the default if the value is null or undefined + */ + initValue: function initValue(value, defaults) { + value = value !== null && value !== undefined ? value : defaults; + return value; + }, -var ImgUtil = { - /** - * This will get the image data. It could be necessary to create a Proton.Zone. - * - * @memberof Proton#Proton.Util - * @method getImageData - * - * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')' - * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag'); - * @param {Proton.Rectangle} rect - */ - getImageData: function getImageData(context, image, rect) { - context.drawImage(image, rect.x, rect.y); - var imagedata = context.getImageData(rect.x, rect.y, rect.width, rect.height); - context.clearRect(rect.x, rect.y, rect.width, rect.height); + /** + * Checks if the value is a valid array + * + * @memberof Proton#Proton.Util + * @method isArray + * + * @param {Array} value Any array + * + * @returns {Boolean} + */ + isArray: function isArray(value) { + return Object.prototype.toString.call(value) === "[object Array]"; + }, - return imagedata; - }, + /** + * Destroyes the given array + * + * @memberof Proton#Proton.Util + * @method emptyArray + * + * @param {Array} array Any array + */ + emptyArray: function emptyArray(arr) { + if (arr) arr.length = 0; + }, + toArray: function toArray(arr) { + return this.isArray(arr) ? arr : [arr]; + }, + getRandFromArray: function getRandFromArray(arr) { + if (!arr) return null; + return arr[Math.floor(arr.length * Math.random())]; + }, + + + /** + * Destroyes the given object + * + * @memberof Proton#Proton.Util + * @method emptyObject + * + * @param {Object} obj Any object + */ + emptyObject: function emptyObject(obj) { + var ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - /** - * @memberof Proton#Proton.Util - * @method getImgFromCache - * - * @todo add description - * @todo describe func - * - * @param {Mixed} img - * @param {Proton.Particle} particle - * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.transform.canvas - * @param {Boolean} func - */ - getImgFromCache: function getImgFromCache(img, callback, param) { - var src = typeof img === 'string' ? img : img.src; + for (var key in obj) { + if (ignore && ignore.indexOf(key) > -1) continue; + delete obj[key]; + } + }, - if (IMG_CACHE[src]) { - callback(IMG_CACHE[src], param); - } else { - var image = new Image(); - image.onload = function (e) { - IMG_CACHE[src] = e.target; - callback(IMG_CACHE[src], param); - }; - image.src = src; - } - }, - getCanvasFromCache: function getCanvasFromCache(img, callback, param) { - var src = img.src; + /** + * Makes an instance of a class and binds the given array + * + * @memberof Proton#Proton.Util + * @method classApply + * + * @param {Function} constructor A class to make an instance from + * @param {Array} [args] Any array to bind it to the constructor + * + * @return {Object} The instance of constructor, optionally bind with args + */ + classApply: function classApply(constructor) { + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - if (!CANVAS_CACHE[src]) { - var width = WebGLUtil.nhpot(img.width); - var height = WebGLUtil.nhpot(img.height); + if (!args) { + return new constructor(); + } else { + var FactoryFunc = constructor.bind.apply(constructor, [null].concat(args)); + return new FactoryFunc(); + } + }, - var canvas = DomUtil.createCanvas('canvas_cache_' + canvasID, width, height); - var context = canvas.getContext('2d'); - context.drawImage(img, 0, 0, img.width, img.height); - CANVAS_CACHE[src] = canvas; - } + /** + * @memberof Proton#Proton.Util + * @method setVectorVal + * + * @todo add description for param `target` + * @todo add description for param `conf` + * @todo add description for function + * + * @param {Object} target + * @param {Object} conf + */ + setVectorVal: function setVectorVal(particle) { + var conf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - callback && callback(CANVAS_CACHE[src], param); + if (!conf) return; - return CANVAS_CACHE[src]; - } -}; + if (this.hasProp(conf, "x")) particle.p.x = conf["x"]; + if (this.hasProp(conf, "y")) particle.p.y = conf["y"]; -var Util = { + if (this.hasProp(conf, "vx")) particle.v.x = conf["vx"]; + if (this.hasProp(conf, "vy")) particle.v.y = conf["vy"]; - /** - * Returns the default if the value is null or undefined - * - * @memberof Proton#Proton.Util - * @method initValue - * - * @param {Mixed} value a specific value, could be everything but null or undefined - * @param {Mixed} defaults the default if the value is null or undefined - */ - initValue: function initValue(value, defaults) { - value = value !== null && value !== undefined ? value : defaults; - return value; - }, + if (this.hasProp(conf, "ax")) particle.a.x = conf["ax"]; + if (this.hasProp(conf, "ay")) particle.a.y = conf["ay"]; + if (this.hasProp(conf, "p")) particle.p.copy(conf["p"]); + if (this.hasProp(conf, "v")) particle.v.copy(conf["v"]); + if (this.hasProp(conf, "a")) particle.a.copy(conf["a"]); - /** - * Checks if the value is a valid array - * - * @memberof Proton#Proton.Util - * @method isArray - * - * @param {Array} value Any array - * - * @returns {Boolean} - */ - isArray: function isArray(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }, + if (this.hasProp(conf, "position")) particle.p.copy(conf["position"]); + if (this.hasProp(conf, "velocity")) particle.v.copy(conf["velocity"]); + if (this.hasProp(conf, "accelerate")) particle.a.copy(conf["accelerate"]); + }, + hasProp: function hasProp(target, key) { + if (!target) return false; + return target[key] !== undefined; + // return obj.hasOwnProperty(key); + }, - /** - * Destroyes the given array - * - * @memberof Proton#Proton.Util - * @method destroyArray - * - * @param {Array} array Any array - */ - destroyArray: function destroyArray(array) { - if (array) array.length = 0; - }, + /** + * set the prototype in a given prototypeObject + * + * @memberof Proton#Proton.Util + * @method setProp + * + * @todo add description for param `target` + * @todo translate desription from chinese to english + * + * @param {Object} target + * @param {Object} prototypeObject An object of single prototypes + * + * @return {Object} target + */ + setProp: function setProp(target, props) { + for (var prop in props) { + if (target.hasOwnProperty(prop)) { + target[prop] = Span.getSpanValue(props[prop]); + } + } + return target; + }, - /** - * Destroyes the given object - * - * @memberof Proton#Proton.Util - * @method destroyObject - * - * @param {Object} obj Any object - */ - destroyObject: function destroyObject(obj, ignore) { - for (var o in obj) { - if (ignore && ignore.indexOf(o) > -1) continue; - delete obj[o]; - } - }, + /** + * This will get the image data. It could be necessary to create a Proton.Zone. + * + * @memberof Proton#Proton.Util + * @method getImageData + * + * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')' + * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag'); + * @param {Proton.Rectangle} rect + */ + getImageData: function getImageData(context, image, rect) { + return ImgUtil.getImageData(context, image, rect); + }, + destroyAll: function destroyAll(arr) { + var param = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; - /** - * Makes an instance of a class and binds the given array - * - * @memberof Proton#Proton.Util - * @method classApply - * - * @param {Function} constructor A class to make an instance from - * @param {Array} [args] Any array to bind it to the constructor - * - * @return {Object} The instance of constructor, optionally bind with args - */ - classApply: function classApply(constructor, args) { - if (!args) return new constructor(); + var i = arr.length; - args = [null].concat(args); - var FactoryFunc = constructor.bind.apply(constructor, args); - return new FactoryFunc(); - }, + while (i--) { + try { + arr[i].destroy(param); + } catch (e) {} + delete arr[i]; + } - /** - * @memberof Proton#Proton.Util - * @method setVector2DByObject - * - * @todo add description for param `target` - * @todo add description for param `pOBJ` - * @todo add description for function - * - * @param {Object} target - * @param {Object} pOBJ - */ - setVector2DByObject: function setVector2DByObject(target, pOBJ) { - if (this.hasProp(pOBJ, 'x')) target.p.x = pOBJ['x']; - if (this.hasProp(pOBJ, 'y')) target.p.y = pOBJ['y']; + arr.length = 0; + } +}; - if (this.hasProp(pOBJ, 'vx')) target.v.x = pOBJ['vx']; - if (this.hasProp(pOBJ, 'vy')) target.v.y = pOBJ['vy']; +var IdsMap = {}; - if (this.hasProp(pOBJ, 'ax')) target.a.x = pOBJ['ax']; - if (this.hasProp(pOBJ, 'ay')) target.a.y = pOBJ['ay']; +var Puid = { + _index: 0, + _cache: {}, - if (this.hasProp(pOBJ, 'p')) target.p.copy(pOBJ['p']); - if (this.hasProp(pOBJ, 'v')) target.v.copy(pOBJ['v']); - if (this.hasProp(pOBJ, 'a')) target.a.copy(pOBJ['a']); + id: function id(type) { + if (IdsMap[type] === undefined || IdsMap[type] === null) IdsMap[type] = 0; + return type + "_" + IdsMap[type]++; + }, + getId: function getId(target) { + var uid = this.getIdFromCache(target); + if (uid) return uid; - if (this.hasProp(pOBJ, 'position')) target.p.copy(pOBJ['position']); - if (this.hasProp(pOBJ, 'velocity')) target.v.copy(pOBJ['velocity']); - if (this.hasProp(pOBJ, 'accelerate')) target.a.copy(pOBJ['accelerate']); - }, - hasProp: function hasProp(obj, key) { - if (!obj) return false; - return obj[key] !== undefined; - // return obj.hasOwnProperty(key); - }, + uid = "PUID_" + this._index++; + this._cache[uid] = target; + return uid; + }, + getIdFromCache: function getIdFromCache(target) { + var obj = void 0, + id = void 0; - /** - * set the prototype in a given prototypeObject - * - * @memberof Proton#Proton.Util - * @method setPrototypeByObject - * - * @todo add description for param `target` - * @todo add description for param `filters` - * @todo translate desription from chinese to english - * - * @param {Object} target - * @param {Object} prototypeObject An object of single prototypes - * @param {Object} filters - * - * @return {Object} target - */ - setPrototypeByObject: function setPrototypeByObject(target, prototypeObject, filters) { - for (var singleProp in prototypeObject) { - if (target.hasOwnProperty(singleProp)) { - if (filters) { - if (filters.indexOf(singleProp) < 0) target[singleProp] = this.getSpanValue(prototypeObject[singleProp]); - } else { - target[singleProp] = this.getSpanValue(prototypeObject[singleProp]); - } - } - } + for (id in this._cache) { + obj = this._cache[id]; - return target; - }, + if (obj === target) return id; + if (this.isBody(obj, target) && obj.src === target.src) return id; + } + return null; + }, + isBody: function isBody(obj, target) { + return (typeof obj === "undefined" ? "undefined" : _typeof(obj)) === "object" && (typeof target === "undefined" ? "undefined" : _typeof(target)) === "object" && obj.isInner && target.isInner; + }, + getTarget: function getTarget(uid) { + return this._cache[uid]; + } +}; - /** - * Returns a new Span object - * - * @memberof Proton#Proton.Util - * @method setSpanValue +/** + * Pool is the cache pool of the proton engine, it is very important. + * + * get(target, params, uid) + * Class + * uid = Puid.getId -> Puid save target cache + * target.__puid = uid + * + * body + * uid = Puid.getId -> Puid save target cache + * + * + * expire(target) + * cache[target.__puid] push target + * + */ +var Pool = function () { + /** + * @memberof! Proton# + * @constructor + * @alias Proton.Pool + * + * @todo add description + * @todo add description of properties + * + * @property {Number} total + * @property {Object} cache + */ + function Pool(num) { + classCallCheck(this, Pool); + + this.total = 0; + this.cache = {}; + } + + /** + * @todo add description + * + * @method get + * @memberof Proton#Proton.Pool + * + * @param {Object|Function} target + * @param {Object} [params] just add if `target` is a function + * + * @return {Object} + */ + + + createClass(Pool, [{ + key: "get", + value: function get$$1(target, params, uid) { + var p = void 0; + uid = uid || target.__puid || Puid.getId(target); + + if (this.cache[uid] && this.cache[uid].length > 0) { + p = this.cache[uid].pop(); + } else { + p = this.createOrClone(target, params); + } + + p.__puid = target.__puid || uid; + return p; + } + + /** + * @todo add description * - * @todo a, b and c should be 'Mixed' or 'Number'? + * @method set + * @memberof Proton#Proton.Pool * - * @param {Mixed | Span} a - * @param {Mixed} b - * @param {Mixed} c + * @param {Object} target * - * @return {Span} + * @return {Object} */ - setSpanValue: function setSpanValue(a, b, c) { - if (a instanceof Span) { - return a; - } else { - if (!b) { - return new Span(a); - } else { - if (!c) return new Span(a, b);else return new Span(a, b, c); - } - } - }, + }, { + key: "expire", + value: function expire(target) { + return this.getCache(target.__puid).push(target); + } /** - * Returns the value from a Span, if the param is not a Span it will return the given parameter + * Creates a new class instance * - * @memberof Proton#Proton.Util - * @method getSpanValue + * @todo add more documentation * - * @param {Mixed | Span} pan + * @method create + * @memberof Proton#Proton.Pool * - * @return {Mixed} the value of Span OR the parameter if it is not a Span + * @param {Object|Function} target any Object or Function + * @param {Object} [params] just add if `target` is a function + * + * @return {Object} */ - getSpanValue: function getSpanValue(pan) { - return pan instanceof Span ? pan.getValue() : pan; - }, + }, { + key: "createOrClone", + value: function createOrClone(target, params) { + this.total++; + + if (this.create) { + return this.create(target, params); + } else if (typeof target === "function") { + return Util.classApply(target, params); + } else { + return target.clone(); + } + } /** - * This will get the image data. It could be necessary to create a Proton.Zone. + * @todo add description - what is in the cache? * - * @memberof Proton#Proton.Util - * @method getImageData + * @method getCount + * @memberof Proton#Proton.Pool * - * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')' - * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag'); - * @param {Proton.Rectangle} rect + * @return {Number} */ - getImageData: function getImageData(context, image, rect) { - return ImgUtil.getImageData(context, image, rect); - }, - destroy: function destroy(arr, param) { - var i = arr.length; - - while (i--) { - try { - arr[i].destroy(param); - } catch (e) {} - delete arr[i]; - } - arr.length = 0; + }, { + key: "getCount", + value: function getCount() { + var count = 0; + for (var id in this.cache) { + count += this.cache[id].length; + }return count++; } -}; - -var PUID = { - id: 0, - cache: {}, - - getID: function getID(target) { - var uid = this.getCacheID(target); - if (uid) return uid; - - uid = 'PUID_' + this.id++; - this.cache[uid] = target; - - return uid; - }, - getCacheID: function getCacheID(target) { - var obj = void 0; - for (var id in this.cache) { - obj = this.cache[id]; - - if (obj === target) return id; - if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && obj.isInner && target.isInner) { - if (obj.src === target.src) return id; - } - } - - return null; - }, - getTarget: function getTarget(uid) { - return this.cache[uid]; - } -}; - -/** - * get -> PUID :: uid-> Body - * -> cache[abc]. -> cache[abc] .pop() - * -> create [new Body| clone] - * -> return p1: { __pid: abc } - * - * expire -> cache[abc]= [p0, p1]; - * - */ -var Pool = function () { /** - * @memberof! Proton# - * @constructor - * @alias Proton.Pool + * Destroyes all items from Pool.cache * - * @todo add description - * @todo add description of properties - * - * @property {Number} total - * @property {Object} cache + * @method destroy + * @memberof Proton#Proton.Pool */ - function Pool(num) { - classCallCheck(this, Pool); - this.total = 0; - this.cache = {}; + }, { + key: "destroy", + value: function destroy() { + for (var id in this.cache) { + this.cache[id].length = 0; + delete this.cache[id]; + } } /** - * @todo add description + * Returns Pool.cache * - * @method get + * @method getCache * @memberof Proton#Proton.Pool + * @private * - * @param {Object|Function} target - * @param {Object} [params] just add if `target` is a function + * @param {Number} uid the unique id * * @return {Object} */ + }, { + key: "getCache", + value: function getCache() { + var uid = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "default"; - createClass(Pool, [{ - key: 'get', - value: function get$$1(target, params, uid) { - var p = void 0; - uid = uid || target.__puid || PUID.getID(target); - - if (this.cache[uid] && this.cache[uid].length > 0) p = this.cache[uid].pop();else p = this.createOrClone(target, params); - - p.__puid = target.__puid || uid; - return p; - } - - /** - * @todo add description - * - * @method set - * @memberof Proton#Proton.Pool - * - * @param {Object} target - * - * @return {Object} - */ - - }, { - key: 'expire', - value: function expire(target) { - return this.getCache(target.__puid).push(target); - } - - /** - * Creates a new class instance - * - * @todo add more documentation - * - * @method create - * @memberof Proton#Proton.Pool - * - * @param {Object|Function} target any Object or Function - * @param {Object} [params] just add if `target` is a function - * - * @return {Object} - */ - - }, { - key: 'createOrClone', - value: function createOrClone(target, params) { - this.total++; - - if (this.create) { - return this.create(target, params); - } else if (typeof target === 'function') { - return Util.classApply(target, params); - } else { - return target.clone(); - } - } - - /** - * @todo add description - what is in the cache? - * - * @method getCount - * @memberof Proton#Proton.Pool - * - * @return {Number} - */ - - }, { - key: 'getCount', - value: function getCount() { - var count = 0; + if (!this.cache[uid]) this.cache[uid] = []; + return this.cache[uid]; + } + }]); + return Pool; +}(); - for (var id in this.cache) { - count += this.cache[id].length; - }return count++; - } +var Stats = function () { + function Stats(proton) { + classCallCheck(this, Stats); - /** - * Destroyes all items from Pool.cache - * - * @method destroy - * @memberof Proton#Proton.Pool - */ + this.proton = proton; + this.container = null; + this.type = 1; - }, { - key: 'destroy', - value: function destroy() { - for (var id in this.cache) { - this.cache[id].length = 0; - delete this.cache[id]; - } - } + this.emitterIndex = 0; + this.rendererIndex = 0; + } - /** - * Returns Pool.cache - * - * @method getCache - * @memberof Proton#Proton.Pool - * @private - * - * @param {Number} uid the unique id - * - * @return {Object} - */ + createClass(Stats, [{ + key: "update", + value: function update(style, body) { + this.add(style, body); + + var emitter = this.getEmitter(); + var renderer = this.getRenderer(); + var str = ""; + + switch (this.type) { + case 2: + str += "emitter:" + this.proton.emitters.length + "
"; + if (emitter) str += "em speed:" + emitter.emitSpeed + "
"; + if (emitter) str += "pos:" + this.getEmitterPos(emitter); + break; + + case 3: + if (emitter) str += "initializes:" + emitter.initializes.length + "
"; + if (emitter) str += '' + this.concatArr(emitter.initializes) + "
"; + if (emitter) str += "behaviours:" + emitter.behaviours.length + "
"; + if (emitter) str += '' + this.concatArr(emitter.behaviours) + "
"; + break; + + case 4: + if (renderer) str += renderer.name + "
"; + if (renderer) str += "body:" + this.getCreatedNumber(renderer) + "
"; + break; + + default: + str += "particles:" + this.proton.getCount() + "
"; + str += "pool:" + this.proton.pool.getCount() + "
"; + str += "total:" + this.proton.pool.total; + } + + this.container.innerHTML = str; + } + }, { + key: "add", + value: function add(style, body) { + var _this = this; - }, { - key: 'getCache', - value: function getCache(uid) { - uid = uid || 'default'; + if (!this.container) { + this.type = 1; - if (!this.cache[uid]) this.cache[uid] = []; - return this.cache[uid]; - } - }]); - return Pool; -}(); + this.container = document.createElement("div"); + this.container.style.cssText = ["position:absolute;bottom:0px;left:0;cursor:pointer;", "opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;", "width:120px;height:50px;background-color:#002;color:#0ff;"].join(""); -var Stats = function () { - function Stats(proton) { - classCallCheck(this, Stats); + this.container.addEventListener("click", function (e) { + _this.type++; + if (_this.type > 4) _this.type = 1; + }, false); - this.proton = proton; - this.container = null; - this.type = 1; + var bg = void 0, + color = void 0; + switch (style) { + case 2: + bg = "#201"; + color = "#f08"; + break; - this.emitterIndex = 0; - this.rendererIndex = 0; - } - - createClass(Stats, [{ - key: 'update', - value: function update(style, body) { - this.add(style, body); - - var emitter = this.getEmitter(); - var renderer = this.getRenderer(); - var str = ''; - - switch (this.type) { - case 2: - str += 'emitter:' + this.proton.emitters.length + '
'; - if (emitter) str += 'em speed:' + emitter.emitSpeed + '
'; - if (emitter) str += 'pos:' + this.getEmitterPos(emitter); - break; - - case 3: - if (emitter) str += 'initializes:' + emitter.initializes.length + '
'; - if (emitter) str += '' + this.concatArr(emitter.initializes) + '
'; - if (emitter) str += 'behaviours:' + emitter.behaviours.length + '
'; - if (emitter) str += '' + this.concatArr(emitter.behaviours) + '
'; - break; - - case 4: - if (renderer) str += renderer.name + '
'; - if (renderer) str += 'body:' + this.getCreatedNumber(renderer) + '
'; - break; - - default: - str += 'particles:' + this.proton.getCount() + '
'; - str += 'pool:' + this.proton.pool.getCount() + '
'; - str += 'total:' + this.proton.pool.total; - } + case 3: + bg = "#020"; + color = "#0f0"; + break; - this.container.innerHTML = str; + default: + bg = "#002"; + color = "#0ff"; } - }, { - key: 'add', - value: function add(style, body) { - var _this = this; - if (!this.container) { - this.type = 1; - - this.container = document.createElement('div'); - this.container.style.cssText = ['position:absolute;bottom:0px;left:0;cursor:pointer;', 'opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;', 'width:120px;height:50px;background-color:#002;color:#0ff;'].join(''); - - this.container.addEventListener('click', function (e) { - _this.type++; - if (_this.type > 4) _this.type = 1; - }, false); - - var bg = void 0, - color = void 0; - switch (style) { - case 2: - bg = '#201'; - color = '#f08'; - break; - - case 3: - bg = '#020'; - color = '#0f0'; - break; - - default: - bg = '#002'; - color = '#0ff'; - } - - this.container.style['background-color'] = bg; - this.container.style['color'] = color; - } + this.container.style["background-color"] = bg; + this.container.style["color"] = color; + } - if (!this.container.parentNode) { - body = body || this.body || document.body; - body.appendChild(this.container); - } - } - }, { - key: 'getEmitter', - value: function getEmitter() { - return this.proton.emitters[this.emitterIndex]; - } - }, { - key: 'getRenderer', - value: function getRenderer() { - return this.proton.renderers[this.rendererIndex]; - } - }, { - key: 'concatArr', - value: function concatArr(arr) { - var result = ''; - if (!arr || !arr.length) return result; + if (!this.container.parentNode) { + body = body || this.body || document.body; + body.appendChild(this.container); + } + } + }, { + key: "getEmitter", + value: function getEmitter() { + return this.proton.emitters[this.emitterIndex]; + } + }, { + key: "getRenderer", + value: function getRenderer() { + return this.proton.renderers[this.rendererIndex]; + } + }, { + key: "concatArr", + value: function concatArr(arr) { + var result = ""; + if (!arr || !arr.length) return result; - for (var i = 0; i < arr.length; i++) { - result += (arr[i].name || '').substr(0, 1) + '.'; - } + for (var i = 0; i < arr.length; i++) { + result += (arr[i].name || "").substr(0, 1) + "."; + } - return result; - } - }, { - key: 'getCreatedNumber', - value: function getCreatedNumber(renderer) { - return renderer.pool.total || renderer.cpool && renderer.cpool.total || 0; - } - }, { - key: 'getEmitterPos', - value: function getEmitterPos(e) { - return Math.round(e.p.x) + ',' + Math.round(e.p.y); - } - }]); - return Stats; + return result; + } + }, { + key: "getCreatedNumber", + value: function getCreatedNumber(renderer) { + return renderer.pool.total || renderer.cpool && renderer.cpool.total || 0; + } + }, { + key: "getEmitterPos", + value: function getEmitterPos(e) { + return Math.round(e.p.x) + "," + Math.round(e.p.y); + } + }]); + return Stats; }(); /* @@ -991,1381 +1031,1411 @@ var Stats = function () { **/ var EventDispatcher = function () { - function EventDispatcher() { - classCallCheck(this, EventDispatcher); + function EventDispatcher() { + classCallCheck(this, EventDispatcher); - this._listeners = null; - } + this._listeners = null; + } - createClass(EventDispatcher, [{ - key: "addEventListener", - value: function addEventListener(type, listener) { - if (!this._listeners) { - this._listeners = {}; - } else { - this.removeEventListener(type, listener); - } + createClass(EventDispatcher, [{ + key: "addEventListener", + value: function addEventListener(type, listener) { + if (!this._listeners) { + this._listeners = {}; + } else { + this.removeEventListener(type, listener); + } - if (!this._listeners[type]) this._listeners[type] = []; - this._listeners[type].push(listener); + if (!this._listeners[type]) this._listeners[type] = []; + this._listeners[type].push(listener); - return listener; - } - }, { - key: "removeEventListener", - value: function removeEventListener(type, listener) { - if (!this._listeners) return; - if (!this._listeners[type]) return; - - var arr = this._listeners[type]; - var length = arr.length; - - for (var i = 0; i < length; i++) { - if (arr[i] === listener) { - if (length === 1) { - delete this._listeners[type]; - } - - // allows for faster checks. - else { - arr.splice(i, 1); - } - - break; - } - } - } - }, { - key: "removeAllEventListeners", - value: function removeAllEventListeners(type) { - if (!type) this._listeners = null;else if (this._listeners) delete this._listeners[type]; - } - }, { - key: "dispatchEvent", - value: function dispatchEvent(type, args) { - var result = false; - var listeners = this._listeners; - - if (type && listeners) { - var arr = listeners[type]; - if (!arr) return result; - - // arr = arr.slice(); - // to avoid issues with items being removed or added during the dispatch - - var handler = void 0; - var i = arr.length; - while (i--) { - handler = arr[i]; - result = result || handler(args); - } + return listener; + } + }, { + key: "removeEventListener", + value: function removeEventListener(type, listener) { + if (!this._listeners) return; + if (!this._listeners[type]) return; + + var arr = this._listeners[type]; + var length = arr.length; + + for (var i = 0; i < length; i++) { + if (arr[i] === listener) { + if (length === 1) { + delete this._listeners[type]; + } + + // allows for faster checks. + else { + arr.splice(i, 1); } - return !!result; - } - }, { - key: "hasEventListener", - value: function hasEventListener(type) { - var listeners = this._listeners; - return !!(listeners && listeners[type]); - } - }], [{ - key: "bind", - value: function bind(TargetClass) { - TargetClass.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent; - TargetClass.prototype.hasEventListener = EventDispatcher.prototype.hasEventListener; - TargetClass.prototype.addEventListener = EventDispatcher.prototype.addEventListener; - TargetClass.prototype.removeEventListener = EventDispatcher.prototype.removeEventListener; - TargetClass.prototype.removeAllEventListeners = EventDispatcher.prototype.removeAllEventListeners; + break; } - }]); - return EventDispatcher; -}(); + } + } + }, { + key: "removeAllEventListeners", + value: function removeAllEventListeners(type) { + if (!type) this._listeners = null;else if (this._listeners) delete this._listeners[type]; + } + }, { + key: "dispatchEvent", + value: function dispatchEvent(type, args) { + var result = false; + var listeners = this._listeners; -var Integration = function () { - function Integration(type) { - classCallCheck(this, Integration); + if (type && listeners) { + var arr = listeners[type]; + if (!arr) return result; - this.type = type; - } + // arr = arr.slice(); + // to avoid issues with items being removed or added during the dispatch - createClass(Integration, [{ - key: "calculate", - value: function calculate(particles, time, damping) { - this.eulerIntegrate(particles, time, damping); - } + var handler = void 0; + var i = arr.length; + while (i--) { + handler = arr[i]; + result = result || handler(args); + } + } - // Euler Integrate + return !!result; + } + }, { + key: "hasEventListener", + value: function hasEventListener(type) { + var listeners = this._listeners; + return !!(listeners && listeners[type]); + } + }], [{ + key: "bind", + value: function bind(target) { + target.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent; - }, { - key: "eulerIntegrate", - value: function eulerIntegrate(particle, time, damping) { - if (!particle.sleep) { - particle.old.p.copy(particle.p); - particle.old.v.copy(particle.v); + target.prototype.hasEventListener = EventDispatcher.prototype.hasEventListener; - particle.a.multiplyScalar(1 / particle.mass); - particle.v.add(particle.a.multiplyScalar(time)); - particle.p.add(particle.old.v.multiplyScalar(time)); + target.prototype.addEventListener = EventDispatcher.prototype.addEventListener; - if (damping) particle.v.multiplyScalar(damping); + target.prototype.removeEventListener = EventDispatcher.prototype.removeEventListener; - particle.a.clear(); - } - } - }]); - return Integration; + target.prototype.removeAllEventListeners = EventDispatcher.prototype.removeAllEventListeners; + } + }]); + return EventDispatcher; }(); -var Proton = function () { - - /** - * The constructor to add emitters - * - * @constructor Proton - * - * @todo proParticleCount is not in use - * @todo add more documentation of the single properties and parameters - * - * @param {Number} [proParticleCount] not in use? - * @param {Number} [integrationType=Proton.EULER] - * - * @property {String} [integrationType=Proton.EULER] - * @property {Array} emitters All added emitter - * @property {Array} renderers All added renderer - * @property {Number} time The active time - * @property {Number} oldtime The old time - */ - - - // 1:100 - function Proton(integrationType) { - classCallCheck(this, Proton); - - - this.emitters = []; - this.renderers = []; - - this.time = 0; - this.oldTime = 0; - this.elapsed = 0; +var Integration = function () { + function Integration(type) { + classCallCheck(this, Integration); - this.stats = new Stats(this); - this.pool = new Pool(80); + this.type = type; + } - this.integrationType = Util.initValue(integrationType, Proton.EULER); - this.integrator = new Integration(this.integrationType); + createClass(Integration, [{ + key: "calculate", + value: function calculate(particles, time, damping) { + this.eulerIntegrate(particles, time, damping); } - /** - * add a type of Renderer - * - * @method addRenderer - * @memberof Proton - * @instance - * - * @param {Renderer} render - */ - - - createClass(Proton, [{ - key: 'addRenderer', - value: function addRenderer(render) { - render.init(this); - this.renderers.push(render); - } - - /** - * @name add a type of Renderer - * - * @method addRenderer - * @param {Renderer} render - */ + // Euler Integrate + // https://rosettacode.org/wiki/Euler_method - }, { - key: 'removeRenderer', - value: function removeRenderer(render) { - var index = this.renderers.indexOf(render); - this.renderers.splice(index, 1); - render.remove(this); - } + }, { + key: "eulerIntegrate", + value: function eulerIntegrate(particle, time, damping) { + if (!particle.sleep) { + particle.old.p.copy(particle.p); + particle.old.v.copy(particle.v); - /** - * add the Emitter - * - * @method addEmitter - * @memberof Proton - * @instance - * - * @param {Emitter} emitter - */ + particle.a.multiplyScalar(1 / particle.mass); + particle.v.add(particle.a.multiplyScalar(time)); + particle.p.add(particle.old.v.multiplyScalar(time)); - }, { - key: 'addEmitter', - value: function addEmitter(emitter) { - this.emitters.push(emitter); - emitter.parent = this; + if (damping) particle.v.multiplyScalar(damping); - this.dispatchEvent(Proton.EMITTER_ADDED, emitter); - } - - /** - * Removes an Emitter - * - * @method removeEmitter - * @memberof Proton - * @instance - * - * @param {Proton.Emitter} emitter - */ - - }, { - key: 'removeEmitter', - value: function removeEmitter(emitter) { - var index = this.emitters.indexOf(emitter); - this.emitters.splice(index, 1); - emitter.parent = null; + particle.a.clear(); + } + } + }]); + return Integration; +}(); - this.dispatchEvent(Proton.EMITTER_REMOVED, emitter); - } +var Proton = function () { - /** - * Updates all added emitters - * - * @method update - * @memberof Proton - * @instance - */ + /** + * The constructor to add emitters + * + * @constructor Proton + * + * @todo proParticleCount is not in use + * @todo add more documentation of the single properties and parameters + * + * @param {Number} [proParticleCount] not in use? + * @param {Number} [integrationType=Proton.EULER] + * + * @property {String} [integrationType=Proton.EULER] + * @property {Array} emitters All added emitter + * @property {Array} renderers All added renderer + * @property {Number} time The active time + * @property {Number} oldtime The old time + */ - }, { - key: 'update', - value: function update() { - this.dispatchEvent(Proton.PROTON_UPDATE); - if (Proton.USE_CLOCK) { - if (!this.oldTime) this.oldTime = new Date().getTime(); + // 1:100 + function Proton(integrationType) { + classCallCheck(this, Proton); - var time = new Date().getTime(); - this.elapsed = (time - this.oldTime) / 1000; - Proton.amendChangeTabsBug && this.amendChangeTabsBug(); + this.emitters = []; + this.renderers = []; - this.oldTime = time; - } else { - this.elapsed = 0.0167; - } + this.time = 0; + this.oldTime = 0; + this.elapsed = 0; - // emitter update - if (this.elapsed > 0) this.emittersUpdate(this.elapsed); + this.stats = new Stats(this); + this.pool = new Pool(80); - this.dispatchEvent(Proton.PROTON_UPDATE_AFTER); - } - }, { - key: 'emittersUpdate', - value: function emittersUpdate(elapsed) { - var i = this.emitters.length; - while (i--) { - this.emitters[i].update(elapsed); - } - } + this.integrationType = Util.initValue(integrationType, Proton.EULER); + this.integrator = new Integration(this.integrationType); + } - /** - * @todo add description - * - * @method amendChangeTabsBug - * @memberof Proton - * @instance - */ + /** + * add a type of Renderer + * + * @method addRenderer + * @memberof Proton + * @instance + * + * @param {Renderer} render + */ - }, { - key: 'amendChangeTabsBug', - value: function amendChangeTabsBug() { - if (this.elapsed > 0.5) { - this.oldTime = new Date().getTime(); - this.elapsed = 0; - } - } - /** - * Counts all particles from all emitters - * - * @method getCount - * @memberof Proton - * @instance - */ + createClass(Proton, [{ + key: "addRenderer", + value: function addRenderer(render) { + render.init(this); + this.renderers.push(render); + } - }, { - key: 'getCount', - value: function getCount() { - var total = 0; - var i = this.emitters.length; + /** + * @name add a type of Renderer + * + * @method addRenderer + * @param {Renderer} render + */ - while (i--) { - total += this.emitters[i].particles.length; - }return total; - } - }, { - key: 'getAllParticles', - value: function getAllParticles() { - var particles = []; - var i = this.emitters.length; + }, { + key: "removeRenderer", + value: function removeRenderer(render) { + var index = this.renderers.indexOf(render); + this.renderers.splice(index, 1); + render.remove(this); + } - while (i--) { - particles = particles.concat(this.emitters[i].particles); - }return particles; - } + /** + * add the Emitter + * + * @method addEmitter + * @memberof Proton + * @instance + * + * @param {Emitter} emitter + */ - /** - * Destroys everything related to this Proton instance. This includes all emitters, and all properties - * - * @method destroy - * @memberof Proton - * @instance - */ + }, { + key: "addEmitter", + value: function addEmitter(emitter) { + this.emitters.push(emitter); + emitter.parent = this; - }, { - key: 'destroy', - value: function destroy() { - Util.destroy(this.renderers, this.getAllParticles()); - Util.destroy(this.emitters); + this.dispatchEvent(Proton.EMITTER_ADDED, emitter); + } - this.time = 0; - this.oldTime = 0; + /** + * Removes an Emitter + * + * @method removeEmitter + * @memberof Proton + * @instance + * + * @param {Proton.Emitter} emitter + */ - this.pool.destroy(); - } - }]); - return Proton; -}(); + }, { + key: "removeEmitter", + value: function removeEmitter(emitter) { + var index = this.emitters.indexOf(emitter); + this.emitters.splice(index, 1); + emitter.parent = null; -Proton.USE_CLOCK = false; -Proton.MEASURE = 100; -Proton.EULER = 'euler'; -Proton.RK2 = 'runge-kutta2'; -Proton.PARTICLE_CREATED = 'PARTICLE_CREATED'; -Proton.PARTICLE_UPDATE = 'PARTICLE_UPDATE'; -Proton.PARTICLE_SLEEP = 'PARTICLE_SLEEP'; -Proton.PARTICLE_DEAD = 'PARTICLE_DEAD'; -Proton.PROTON_UPDATE = 'PROTON_UPDATE'; -Proton.PROTON_UPDATE_AFTER = 'PROTON_UPDATE_AFTER'; -Proton.EMITTER_ADDED = 'EMITTER_ADDED'; -Proton.EMITTER_REMOVED = 'EMITTER_REMOVED'; -Proton.amendChangeTabsBug = true; -EventDispatcher.bind(Proton); + this.dispatchEvent(Proton.EMITTER_REMOVED, emitter); + } -var ease = { - easeLinear: function easeLinear(value) { - return value; - }, - easeInQuad: function easeInQuad(value) { - return Math.pow(value, 2); - }, - easeOutQuad: function easeOutQuad(value) { - return -(Math.pow(value - 1, 2) - 1); - }, - easeInOutQuad: function easeInOutQuad(value) { - if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 2); + /** + * Updates all added emitters + * + * @method update + * @memberof Proton + * @instance + */ - return -0.5 * ((value -= 2) * value - 2); - }, - easeInCubic: function easeInCubic(value) { - return Math.pow(value, 3); - }, - easeOutCubic: function easeOutCubic(value) { - return Math.pow(value - 1, 3) + 1; - }, - easeInOutCubic: function easeInOutCubic(value) { - if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 3); + }, { + key: "update", + value: function update() { + this.dispatchEvent(Proton.PROTON_UPDATE); - return 0.5 * (Math.pow(value - 2, 3) + 2); - }, - easeInQuart: function easeInQuart(value) { - return Math.pow(value, 4); - }, - easeOutQuart: function easeOutQuart(value) { - return -(Math.pow(value - 1, 4) - 1); - }, - easeInOutQuart: function easeInOutQuart(value) { - if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 4); + if (Proton.USE_CLOCK) { + if (!this.oldTime) this.oldTime = new Date().getTime(); - return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2); - }, - easeInSine: function easeInSine(value) { - return -Math.cos(value * MathUtils.PI_2) + 1; - }, - easeOutSine: function easeOutSine(value) { - return Math.sin(value * MathUtils.PI_2); - }, - easeInOutSine: function easeInOutSine(value) { - return -0.5 * (Math.cos(MathUtils.PI * value) - 1); - }, - easeInExpo: function easeInExpo(value) { - return value === 0 ? 0 : Math.pow(2, 10 * (value - 1)); - }, - easeOutExpo: function easeOutExpo(value) { - return value === 1 ? 1 : -Math.pow(2, -10 * value) + 1; - }, - easeInOutExpo: function easeInOutExpo(value) { - if (value === 0) return 0; + var time = new Date().getTime(); + this.elapsed = (time - this.oldTime) / 1000; + Proton.amendChangeTabsBug && this.amendChangeTabsBug(); - if (value === 1) return 1; + this.oldTime = time; + } else { + this.elapsed = 0.0167; + } - if ((value /= 0.5) < 1) return 0.5 * Math.pow(2, 10 * (value - 1)); + // emitter update + if (this.elapsed > 0) this.emittersUpdate(this.elapsed); - return 0.5 * (-Math.pow(2, -10 * --value) + 2); - }, - easeInCirc: function easeInCirc(value) { - return -(Math.sqrt(1 - value * value) - 1); - }, - easeOutCirc: function easeOutCirc(value) { - return Math.sqrt(1 - Math.pow(value - 1, 2)); - }, - easeInOutCirc: function easeInOutCirc(value) { - if ((value /= 0.5) < 1) return -0.5 * (Math.sqrt(1 - value * value) - 1); - return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1); - }, - easeInBack: function easeInBack(value) { - var s = 1.70158; - return value * value * ((s + 1) * value - s); - }, - easeOutBack: function easeOutBack(value) { - var s = 1.70158; - return (value = value - 1) * value * ((s + 1) * value + s) + 1; - }, - easeInOutBack: function easeInOutBack(value) { - var s = 1.70158; - if ((value /= 0.5) < 1) return 0.5 * (value * value * (((s *= 1.525) + 1) * value - s)); - return 0.5 * ((value -= 2) * value * (((s *= 1.525) + 1) * value + s) + 2); - }, - getEasing: function getEasing(ease) { - if (typeof ease === 'function') return ease;else return this[ease] || this.easeLinear; + this.dispatchEvent(Proton.PROTON_UPDATE_AFTER); } -}; - -var Vector2D = function () { - function Vector2D(x, y) { - classCallCheck(this, Vector2D); - - this.x = x || 0; - this.y = y || 0; + }, { + key: "emittersUpdate", + value: function emittersUpdate(elapsed) { + var i = this.emitters.length; + while (i--) { + this.emitters[i].update(elapsed); + } } - createClass(Vector2D, [{ - key: 'set', - value: function set$$1(x, y) { - this.x = x; - this.y = y; - return this; - } - }, { - key: 'setX', - value: function setX(x) { - this.x = x; - return this; - } - }, { - key: 'setY', - value: function setY(y) { - this.y = y; - return this; - } - }, { - key: 'getGradient', - value: function getGradient() { - if (this.x !== 0) return Math.atan2(this.y, this.x);else if (this.y > 0) return MathUtils.PI_2;else if (this.y < 0) return -MathUtils.PI_2; - } - }, { - key: 'copy', - value: function copy(v) { - this.x = v.x; - this.y = v.y; - - return this; - } - }, { - key: 'add', - value: function add(v, w) { - if (w !== undefined) { - return this.addVectors(v, w); - } - - this.x += v.x; - this.y += v.y; - - return this; - } - }, { - key: 'addXY', - value: function addXY(a, b) { - this.x += a; - this.y += b; - - return this; - } - }, { - key: 'addVectors', - value: function addVectors(a, b) { - this.x = a.x + b.x; - this.y = a.y + b.y; + /** + * @todo add description + * + * @method amendChangeTabsBug + * @memberof Proton + * @instance + */ - return this; - } - }, { - key: 'sub', - value: function sub(v, w) { - if (w !== undefined) { - return this.subVectors(v, w); - } + }, { + key: "amendChangeTabsBug", + value: function amendChangeTabsBug() { + if (this.elapsed > 0.5) { + this.oldTime = new Date().getTime(); + this.elapsed = 0; + } + } - this.x -= v.x; - this.y -= v.y; + /** + * Counts all particles from all emitters + * + * @method getCount + * @memberof Proton + * @instance + */ - return this; - } - }, { - key: 'subVectors', - value: function subVectors(a, b) { - this.x = a.x - b.x; - this.y = a.y - b.y; + }, { + key: "getCount", + value: function getCount() { + var total = 0; + var i = this.emitters.length; - return this; - } - }, { - key: 'divideScalar', - value: function divideScalar(s) { - if (s !== 0) { - this.x /= s; - this.y /= s; - } else { - this.set(0, 0); - } + while (i--) { + total += this.emitters[i].particles.length; + }return total; + } + }, { + key: "getAllParticles", + value: function getAllParticles() { + var particles = []; + var i = this.emitters.length; + + while (i--) { + particles = particles.concat(this.emitters[i].particles); + }return particles; + } + }, { + key: "destroyAllEmitters", + value: function destroyAllEmitters() { + Util.destroyAll(this.emitters); + } - return this; - } - }, { - key: 'multiplyScalar', - value: function multiplyScalar(s) { - this.x *= s; - this.y *= s; + /** + * Destroys everything related to this Proton instance. This includes all emitters, and all properties + * + * @method destroy + * @memberof Proton + * @instance + */ - return this; - } - }, { - key: 'negate', - value: function negate() { - return this.multiplyScalar(-1); - } - }, { - key: 'dot', - value: function dot(v) { - return this.x * v.x + this.y * v.y; - } - }, { - key: 'lengthSq', - value: function lengthSq() { - return this.x * this.x + this.y * this.y; - } - }, { - key: 'length', - value: function length() { - return Math.sqrt(this.x * this.x + this.y * this.y); - } - }, { - key: 'normalize', - value: function normalize() { - return this.divideScalar(this.length()); - } - }, { - key: 'distanceTo', - value: function distanceTo(v) { - return Math.sqrt(this.distanceToSquared(v)); - } - }, { - key: 'rotate', - value: function rotate(tha) { - var x = this.x; - var y = this.y; + }, { + key: "destroy", + value: function destroy() { + var _this = this; - this.x = x * Math.cos(tha) + y * Math.sin(tha); - this.y = -x * Math.sin(tha) + y * Math.cos(tha); + var remove = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; - return this; - } - }, { - key: 'distanceToSquared', - value: function distanceToSquared(v) { - var dx = this.x - v.x; - var dy = this.y - v.y; + var destroyOther = function destroyOther() { + _this.time = 0; + _this.oldTime = 0; + _this.pool.destroy(); - return dx * dx + dy * dy; - } - }, { - key: 'lerp', - value: function lerp(v, alpha) { - this.x += (v.x - this.x) * alpha; - this.y += (v.y - this.y) * alpha; + Util.destroyAll(_this.emitters); + Util.destroyAll(_this.renderers, _this.getAllParticles()); + }; - return this; - } - }, { - key: 'equals', - value: function equals(v) { - return v.x === this.x && v.y === this.y; - } - }, { - key: 'clear', - value: function clear() { - this.x = 0.0; - this.y = 0.0; - return this; - } - }, { - key: 'clone', - value: function clone() { - return new Vector2D(this.x, this.y); - } - }]); - return Vector2D; + if (remove) { + setTimeout(destroyOther, 200); + } else { + destroyOther(); + } + } + }]); + return Proton; }(); -var Particle = function () { +Proton.USE_CLOCK = false; +Proton.MEASURE = 100; +Proton.EULER = "euler"; +Proton.RK2 = "runge-kutta2"; +Proton.PARTICLE_CREATED = "PARTICLE_CREATED"; +Proton.PARTICLE_UPDATE = "PARTICLE_UPDATE"; +Proton.PARTICLE_SLEEP = "PARTICLE_SLEEP"; +Proton.PARTICLE_DEAD = "PARTICLE_DEAD"; +Proton.PROTON_UPDATE = "PROTON_UPDATE"; +Proton.PROTON_UPDATE_AFTER = "PROTON_UPDATE_AFTER"; +Proton.EMITTER_ADDED = "EMITTER_ADDED"; +Proton.EMITTER_REMOVED = "EMITTER_REMOVED"; +Proton.amendChangeTabsBug = true; +EventDispatcher.bind(Proton); - /** - * the Particle class - * - * @class Proton.Particle - * @constructor - * @param {Object} pObj the parameters object; - * for example {life:3,dead:false} - */ - function Particle(pOBJ) { - classCallCheck(this, Particle); +var Rgb = function () { + function Rgb() { + var r = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 255; + var g = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 255; + var b = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 255; + classCallCheck(this, Rgb); - /** - * The particle's id; - * @property id - * @type {string} - */ - this.id = 'particle_' + Particle.ID++; - this.reset('init'); + this.r = r; + this.g = g; + this.b = b; + } - pOBJ && Util.setPrototypeByObject(this, pOBJ); + createClass(Rgb, [{ + key: "reset", + value: function reset() { + this.r = 255; + this.g = 255; + this.b = 255; } + }]); + return Rgb; +}(); - createClass(Particle, [{ - key: 'getDirection', - value: function getDirection() { - return Math.atan2(this.v.x, -this.v.y) * MathUtils.N180_PI; - } - }, { - key: 'reset', - value: function reset(init) { - this.life = Infinity; - this.age = 0; - - // Energy loss - this.energy = 1; - this.dead = false; - this.sleep = false; - this.body = null; - this.sprite = null; - this.parent = null; - - this.mass = 1; - this.radius = 10; - this.alpha = 1; - this.scale = 1; - this.rotation = 0; - this.color = null; +var ease = { + easeLinear: function easeLinear(value) { + return value; + }, + easeInQuad: function easeInQuad(value) { + return Math.pow(value, 2); + }, + easeOutQuad: function easeOutQuad(value) { + return -(Math.pow(value - 1, 2) - 1); + }, + easeInOutQuad: function easeInOutQuad(value) { + if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 2); + + return -0.5 * ((value -= 2) * value - 2); + }, + easeInCubic: function easeInCubic(value) { + return Math.pow(value, 3); + }, + easeOutCubic: function easeOutCubic(value) { + return Math.pow(value - 1, 3) + 1; + }, + easeInOutCubic: function easeInOutCubic(value) { + if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 3); + + return 0.5 * (Math.pow(value - 2, 3) + 2); + }, + easeInQuart: function easeInQuart(value) { + return Math.pow(value, 4); + }, + easeOutQuart: function easeOutQuart(value) { + return -(Math.pow(value - 1, 4) - 1); + }, + easeInOutQuart: function easeInOutQuart(value) { + if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 4); + + return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2); + }, + easeInSine: function easeInSine(value) { + return -Math.cos(value * MathUtil.PI_2) + 1; + }, + easeOutSine: function easeOutSine(value) { + return Math.sin(value * MathUtil.PI_2); + }, + easeInOutSine: function easeInOutSine(value) { + return -0.5 * (Math.cos(Math.PI * value) - 1); + }, + easeInExpo: function easeInExpo(value) { + return value === 0 ? 0 : Math.pow(2, 10 * (value - 1)); + }, + easeOutExpo: function easeOutExpo(value) { + return value === 1 ? 1 : -Math.pow(2, -10 * value) + 1; + }, + easeInOutExpo: function easeInOutExpo(value) { + if (value === 0) return 0; + + if (value === 1) return 1; + + if ((value /= 0.5) < 1) return 0.5 * Math.pow(2, 10 * (value - 1)); + + return 0.5 * (-Math.pow(2, -10 * --value) + 2); + }, + easeInCirc: function easeInCirc(value) { + return -(Math.sqrt(1 - value * value) - 1); + }, + easeOutCirc: function easeOutCirc(value) { + return Math.sqrt(1 - Math.pow(value - 1, 2)); + }, + easeInOutCirc: function easeInOutCirc(value) { + if ((value /= 0.5) < 1) return -0.5 * (Math.sqrt(1 - value * value) - 1); + return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1); + }, + easeInBack: function easeInBack(value) { + var s = 1.70158; + return value * value * ((s + 1) * value - s); + }, + easeOutBack: function easeOutBack(value) { + var s = 1.70158; + return (value = value - 1) * value * ((s + 1) * value + s) + 1; + }, + easeInOutBack: function easeInOutBack(value) { + var s = 1.70158; + if ((value /= 0.5) < 1) return 0.5 * (value * value * (((s *= 1.525) + 1) * value - s)); + return 0.5 * ((value -= 2) * value * (((s *= 1.525) + 1) * value + s) + 2); + }, + getEasing: function getEasing(ease) { + if (typeof ease === "function") return ease;else return this[ease] || this.easeLinear; + } +}; - this.easing = ease.easeLinear; +var Vector2D = function () { + function Vector2D(x, y) { + classCallCheck(this, Vector2D); - if (init === 'init') { - this.transform = {}; - this.p = new Vector2D(); - this.v = new Vector2D(); - this.a = new Vector2D(); + this.x = x || 0; + this.y = y || 0; + } - this.old = { - p: new Vector2D(), - v: new Vector2D(), - a: new Vector2D() - }; + createClass(Vector2D, [{ + key: "set", + value: function set$$1(x, y) { + this.x = x; + this.y = y; + return this; + } + }, { + key: "setX", + value: function setX(x) { + this.x = x; + return this; + } + }, { + key: "setY", + value: function setY(y) { + this.y = y; + return this; + } + }, { + key: "getGradient", + value: function getGradient() { + if (this.x !== 0) return Math.atan2(this.y, this.x);else if (this.y > 0) return MathUtil.PI_2;else if (this.y < 0) return -MathUtil.PI_2; + } + }, { + key: "copy", + value: function copy(v) { + this.x = v.x; + this.y = v.y; - this.behaviours = []; - } else { - Util.destroyObject(this.transform, 'rgb'); + return this; + } + }, { + key: "add", + value: function add(v, w) { + if (w !== undefined) { + return this.addVectors(v, w); + } - this.p.set(0, 0); - this.v.set(0, 0); - this.a.set(0, 0); + this.x += v.x; + this.y += v.y; - this.old.p.set(0, 0); - this.old.v.set(0, 0); - this.old.a.set(0, 0); + return this; + } + }, { + key: "addXY", + value: function addXY(a, b) { + this.x += a; + this.y += b; - this.removeAllBehaviours(); - } + return this; + } + }, { + key: "addVectors", + value: function addVectors(a, b) { + this.x = a.x + b.x; + this.y = a.y + b.y; - if (!this.transform.rgb) { - this.transform.rgb = { r: 255, g: 255, b: 255 }; - } else { - this.transform.rgb.r = 255; - this.transform.rgb.g = 255; - this.transform.rgb.b = 255; - } + return this; + } + }, { + key: "sub", + value: function sub(v, w) { + if (w !== undefined) { + return this.subVectors(v, w); + } - return this; - } - }, { - key: 'update', - value: function update(time, index) { - if (!this.sleep) { - this.age += time; - this.applyBehaviours(time, index); - } + this.x -= v.x; + this.y -= v.y; - if (this.age < this.life) { - var scale = this.easing(this.age / this.life); - this.energy = Math.max(1 - scale, 0); - } else { - this.destroy(); - } - } - }, { - key: 'applyBehaviours', - value: function applyBehaviours(time, index) { - var length = this.behaviours.length; - var i = void 0; + return this; + } + }, { + key: "subVectors", + value: function subVectors(a, b) { + this.x = a.x - b.x; + this.y = a.y - b.y; - for (i = 0; i < length; i++) { - this.behaviours[i] && this.behaviours[i].applyBehaviour(this, time, index); - } - } - }, { - key: 'addBehaviour', - value: function addBehaviour(behaviour) { - this.behaviours.push(behaviour); + return this; + } + }, { + key: "divideScalar", + value: function divideScalar(s) { + if (s !== 0) { + this.x /= s; + this.y /= s; + } else { + this.set(0, 0); + } + + return this; + } + }, { + key: "multiplyScalar", + value: function multiplyScalar(s) { + this.x *= s; + this.y *= s; - if (behaviour.hasOwnProperty('parents')) behaviour.parents.push(this); - behaviour.initialize(this); - } - }, { - key: 'addBehaviours', - value: function addBehaviours(behaviours) { - var length = behaviours.length; - var i = void 0; + return this; + } + }, { + key: "negate", + value: function negate() { + return this.multiplyScalar(-1); + } + }, { + key: "dot", + value: function dot(v) { + return this.x * v.x + this.y * v.y; + } + }, { + key: "lengthSq", + value: function lengthSq() { + return this.x * this.x + this.y * this.y; + } + }, { + key: "length", + value: function length() { + return Math.sqrt(this.x * this.x + this.y * this.y); + } + }, { + key: "normalize", + value: function normalize() { + return this.divideScalar(this.length()); + } + }, { + key: "distanceTo", + value: function distanceTo(v) { + return Math.sqrt(this.distanceToSquared(v)); + } + }, { + key: "rotate", + value: function rotate(tha) { + var x = this.x; + var y = this.y; - for (i = 0; i < length; i++) { - this.addBehaviour(behaviours[i]); - } - } - }, { - key: 'removeBehaviour', - value: function removeBehaviour(behaviour) { - var index = this.behaviours.indexOf(behaviour); + this.x = x * Math.cos(tha) + y * Math.sin(tha); + this.y = -x * Math.sin(tha) + y * Math.cos(tha); - if (index > -1) { - var _behaviour = this.behaviours.splice(index, 1); - _behaviour.parents = null; - } - } - }, { - key: 'removeAllBehaviours', - value: function removeAllBehaviours() { - Util.destroyArray(this.behaviours); - } + return this; + } + }, { + key: "distanceToSquared", + value: function distanceToSquared(v) { + var dx = this.x - v.x; + var dy = this.y - v.y; - /** - * Destory this particle - * @method destroy - */ + return dx * dx + dy * dy; + } + }, { + key: "lerp", + value: function lerp(v, alpha) { + this.x += (v.x - this.x) * alpha; + this.y += (v.y - this.y) * alpha; - }, { - key: 'destroy', - value: function destroy() { - this.removeAllBehaviours(); - this.energy = 0; - this.dead = true; - this.parent = null; - } - }]); - return Particle; + return this; + } + }, { + key: "equals", + value: function equals(v) { + return v.x === this.x && v.y === this.y; + } + }, { + key: "clear", + value: function clear() { + this.x = 0.0; + this.y = 0.0; + return this; + } + }, { + key: "clone", + value: function clone() { + return new Vector2D(this.x, this.y); + } + }]); + return Vector2D; }(); -Particle.ID = 0; - -var ColorUtil = { +var Particle = function () { + /** + * the Particle class + * + * @class Proton.Particle + * @constructor + * @param {Object} pObj the parameters object; + * for example {life:3,dead:false} + */ + function Particle(conf) { + classCallCheck(this, Particle); /** - * @typedef {Object} rgbObject - * @property {Number} r red value - * @property {Number} g green value - * @property {Number} b blue value - */ - /** - * converts a hex value to a rgb object - * - * @memberof Proton#Proton.Util - * @method hexToRGB - * - * @param {String} h any hex value, e.g. #000000 or 000000 for black - * - * @return {rgbObject} + * The particle's id; + * @property id + * @type {string} */ - hexToRGB: function hexToRGB(h) { - var hex16 = h.charAt(0) === '#' ? h.substring(1, 7) : h; - var r = parseInt(hex16.substring(0, 2), 16); - var g = parseInt(hex16.substring(2, 4), 16); - var b = parseInt(hex16.substring(4, 6), 16); + this.name = "Particle"; + this.id = Puid.id(this.name); + this.old = {}; + this.data = {}; + this.behaviours = []; + + this.p = new Vector2D(); + this.v = new Vector2D(); + this.a = new Vector2D(); + this.old.p = new Vector2D(); + this.old.v = new Vector2D(); + this.old.a = new Vector2D(); + + this.rgb = new Rgb(); + this.reset(); + conf && Util.setProp(this, conf); + } - return { r: r, g: g, b: b }; - }, + createClass(Particle, [{ + key: "getDirection", + value: function getDirection() { + return Math.atan2(this.v.x, -this.v.y) * MathUtil.N180_PI; + } + }, { + key: "reset", + value: function reset() { + this.life = Infinity; + this.age = 0; + + this.dead = false; + this.sleep = false; + this.body = null; + this.sprite = null; + this.parent = null; + + this.energy = 1; // Energy Loss + this.mass = 1; + this.radius = 10; + this.alpha = 1; + this.scale = 1; + this.rotation = 0; + this.color = null; + + this.p.set(0, 0); + this.v.set(0, 0); + this.a.set(0, 0); + this.old.p.set(0, 0); + this.old.v.set(0, 0); + this.old.a.set(0, 0); + this.easing = ease.easeLinear; + + this.rgb.reset(); + Util.emptyObject(this.data); + this.removeAllBehaviours(); + + return this; + } + }, { + key: "update", + value: function update(time, index) { + if (!this.sleep) { + this.age += time; + this.applyBehaviours(time, index); + } + + if (this.age < this.life) { + var scale = this.easing(this.age / this.life); + this.energy = Math.max(1 - scale, 0); + } else { + this.destroy(); + } + } + }, { + key: "applyBehaviours", + value: function applyBehaviours(time, index) { + var length = this.behaviours.length; + var i = void 0; + + for (i = 0; i < length; i++) { + this.behaviours[i] && this.behaviours[i].applyBehaviour(this, time, index); + } + } + }, { + key: "addBehaviour", + value: function addBehaviour(behaviour) { + this.behaviours.push(behaviour); + if (behaviour.hasOwnProperty("parents")) behaviour.parents.push(this); + behaviour.initialize(this); + } + }, { + key: "addBehaviours", + value: function addBehaviours(behaviours) { + var length = behaviours.length; + var i = void 0; + + for (i = 0; i < length; i++) { + this.addBehaviour(behaviours[i]); + } + } + }, { + key: "removeBehaviour", + value: function removeBehaviour(behaviour) { + var index = this.behaviours.indexOf(behaviour); + + if (index > -1) { + var _behaviour = this.behaviours.splice(index, 1); + _behaviour.parents = null; + } + } + }, { + key: "removeAllBehaviours", + value: function removeAllBehaviours() { + Util.emptyArray(this.behaviours); + } /** - * converts a rgb value to a rgb string - * - * @memberof Proton#Proton.Util - * @method rgbToHex - * - * @param {Object | Proton.hexToRGB} rgb a rgb object like in {@link Proton#Proton.} - * - * @return {String} rgb() + * Destory this particle + * @method destroy */ - rgbToHex: function rgbToHex(rbg) { - return 'rgb(' + rbg.r + ', ' + rbg.g + ', ' + rbg.b + ')'; - }, - getHex16FromParticle: function getHex16FromParticle(p) { - return Number(p.transform.rgb.r) * 65536 + Number(p.transform.rgb.g) * 256 + Number(p.transform.rgb.b); + + }, { + key: "destroy", + value: function destroy() { + this.removeAllBehaviours(); + this.energy = 0; + this.dead = true; + this.parent = null; } + }]); + return Particle; +}(); + +var ColorUtil = { + /** + * @typedef {Object} rgbObject + * @property {Number} r red value + * @property {Number} g green value + * @property {Number} b blue value + */ + /** + * converts a hex value to a rgb object + * + * @memberof Proton#Proton.Util + * @method hexToRgb + * + * @param {String} h any hex value, e.g. #000000 or 000000 for black + * + * @return {rgbObject} + */ + hexToRgb: function hexToRgb(h) { + var hex16 = h.charAt(0) === "#" ? h.substring(1, 7) : h; + var r = parseInt(hex16.substring(0, 2), 16); + var g = parseInt(hex16.substring(2, 4), 16); + var b = parseInt(hex16.substring(4, 6), 16); + + return { r: r, g: g, b: b }; + }, + + + /** + * converts a rgb value to a rgb string + * + * @memberof Proton#Proton.Util + * @method rgbToHex + * + * @param {Object | Proton.hexToRgb} rgb a rgb object like in {@link Proton#Proton.} + * + * @return {String} rgb() + */ + rgbToHex: function rgbToHex(rbg) { + return "rgb(" + rbg.r + ", " + rbg.g + ", " + rbg.b + ")"; + }, + getHex16FromParticle: function getHex16FromParticle(p) { + return Number(p.rgb.r) * 65536 + Number(p.rgb.g) * 256 + Number(p.rgb.b); + } }; var Polar2D = function () { - function Polar2D(r, tha) { - classCallCheck(this, Polar2D); + function Polar2D(r, tha) { + classCallCheck(this, Polar2D); - this.r = Math.abs(r) || 0; - this.tha = tha || 0; - } + this.r = Math.abs(r) || 0; + this.tha = tha || 0; + } - createClass(Polar2D, [{ - key: 'set', - value: function set$$1(r, tha) { - this.r = r; - this.tha = tha; - return this; - } - }, { - key: 'setR', - value: function setR(r) { - this.r = r; - return this; - } - }, { - key: 'setTha', - value: function setTha(tha) { - this.tha = tha; - return this; - } - }, { - key: 'copy', - value: function copy(p) { - this.r = p.r; - this.tha = p.tha; - return this; - } - }, { - key: 'toVector', - value: function toVector() { - return new Vector2D(this.getX(), this.getY()); - } - }, { - key: 'getX', - value: function getX() { - return this.r * Math.sin(this.tha); - } - }, { - key: 'getY', - value: function getY() { - return -this.r * Math.cos(this.tha); - } - }, { - key: 'normalize', - value: function normalize() { - this.r = 1; - return this; - } - }, { - key: 'equals', - value: function equals(v) { - return v.r === this.r && v.tha === this.tha; - } - }, { - key: 'clear', - value: function clear() { - this.r = 0.0; - this.tha = 0.0; - return this; - } - }, { - key: 'clone', - value: function clone() { - return new Polar2D(this.r, this.tha); - } - }]); - return Polar2D; + createClass(Polar2D, [{ + key: "set", + value: function set$$1(r, tha) { + this.r = r; + this.tha = tha; + return this; + } + }, { + key: "setR", + value: function setR(r) { + this.r = r; + return this; + } + }, { + key: "setTha", + value: function setTha(tha) { + this.tha = tha; + return this; + } + }, { + key: "copy", + value: function copy(p) { + this.r = p.r; + this.tha = p.tha; + return this; + } + }, { + key: "toVector", + value: function toVector() { + return new Vector2D(this.getX(), this.getY()); + } + }, { + key: "getX", + value: function getX() { + return this.r * Math.sin(this.tha); + } + }, { + key: "getY", + value: function getY() { + return -this.r * Math.cos(this.tha); + } + }, { + key: "normalize", + value: function normalize() { + this.r = 1; + return this; + } + }, { + key: "equals", + value: function equals(v) { + return v.r === this.r && v.tha === this.tha; + } + }, { + key: "clear", + value: function clear() { + this.r = 0.0; + this.tha = 0.0; + return this; + } + }, { + key: "clone", + value: function clone() { + return new Polar2D(this.r, this.tha); + } + }]); + return Polar2D; }(); var Mat3 = { - create: function create(mat3) { - var mat = new Float32Array(9); - if (mat3) this.set(mat3, mat); - - return mat; - }, - set: function set(mat1, mat2) { - for (var i = 0; i < 9; i++) { - mat2[i] = mat1[i]; - }return mat2; - }, - multiply: function multiply(mat, mat2, mat3) { - var a00 = mat[0], - a01 = mat[1], - a02 = mat[2], - a10 = mat[3], - a11 = mat[4], - a20 = mat[6], - a21 = mat[7], - b00 = mat2[0], - b01 = mat2[1], - b02 = mat2[2], - b10 = mat2[3], - b11 = mat2[4], - b20 = mat2[6], - b21 = mat2[7]; - - mat3[0] = b00 * a00 + b01 * a10; - mat3[1] = b00 * a01 + b01 * a11; - mat3[2] = a02 * b02; - mat3[3] = b10 * a00 + b11 * a10; - mat3[4] = b10 * a01 + b11 * a11; - mat3[6] = b20 * a00 + b21 * a10 + a20; - mat3[7] = b20 * a01 + b21 * a11 + a21; - - return mat3; - }, - inverse: function inverse(mat, mat3) { - var a00 = mat[0], - a01 = mat[1], - a10 = mat[3], - a11 = mat[4], - a20 = mat[6], - a21 = mat[7], - b01 = a11, - b11 = -a10, - b21 = a21 * a10 - a11 * a20, - d = a00 * b01 + a01 * b11, - id = void 0; - - id = 1 / d; - mat3[0] = b01 * id; - mat3[1] = -a01 * id; - mat3[3] = b11 * id; - mat3[4] = a00 * id; - mat3[6] = b21 * id; - mat3[7] = (-a21 * a00 + a01 * a20) * id; - - return mat3; - }, - multiplyVec2: function multiplyVec2(m, vec, mat3) { - var x = vec[0], - y = vec[1]; - - mat3[0] = x * m[0] + y * m[3] + m[6]; - mat3[1] = x * m[1] + y * m[4] + m[7]; - - return mat3; - } + create: function create(mat3) { + var mat = new Float32Array(9); + if (mat3) this.set(mat3, mat); + + return mat; + }, + set: function set(mat1, mat2) { + for (var i = 0; i < 9; i++) { + mat2[i] = mat1[i]; + }return mat2; + }, + multiply: function multiply(mat, mat2, mat3) { + var a00 = mat[0], + a01 = mat[1], + a02 = mat[2], + a10 = mat[3], + a11 = mat[4], + a20 = mat[6], + a21 = mat[7], + b00 = mat2[0], + b01 = mat2[1], + b02 = mat2[2], + b10 = mat2[3], + b11 = mat2[4], + b20 = mat2[6], + b21 = mat2[7]; + + mat3[0] = b00 * a00 + b01 * a10; + mat3[1] = b00 * a01 + b01 * a11; + mat3[2] = a02 * b02; + mat3[3] = b10 * a00 + b11 * a10; + mat3[4] = b10 * a01 + b11 * a11; + mat3[6] = b20 * a00 + b21 * a10 + a20; + mat3[7] = b20 * a01 + b21 * a11 + a21; + + return mat3; + }, + inverse: function inverse(mat, mat3) { + var a00 = mat[0], + a01 = mat[1], + a10 = mat[3], + a11 = mat[4], + a20 = mat[6], + a21 = mat[7], + b01 = a11, + b11 = -a10, + b21 = a21 * a10 - a11 * a20, + d = a00 * b01 + a01 * b11, + id = void 0; + + id = 1 / d; + mat3[0] = b01 * id; + mat3[1] = -a01 * id; + mat3[3] = b11 * id; + mat3[4] = a00 * id; + mat3[6] = b21 * id; + mat3[7] = (-a21 * a00 + a01 * a20) * id; + + return mat3; + }, + multiplyVec2: function multiplyVec2(m, vec, mat3) { + var x = vec[0], + y = vec[1]; + + mat3[0] = x * m[0] + y * m[3] + m[6]; + mat3[1] = x * m[1] + y * m[4] + m[7]; + + return mat3; + } }; var ArraySpan = function (_Span) { - inherits(ArraySpan, _Span); + inherits(ArraySpan, _Span); - function ArraySpan(color) { - classCallCheck(this, ArraySpan); + function ArraySpan(color) { + classCallCheck(this, ArraySpan); - var _this = possibleConstructorReturn(this, (ArraySpan.__proto__ || Object.getPrototypeOf(ArraySpan)).call(this)); + var _this = possibleConstructorReturn(this, (ArraySpan.__proto__ || Object.getPrototypeOf(ArraySpan)).call(this)); - _this._arr = Util.isArray(color) ? color : [color]; - return _this; - } + _this._arr = Util.toArray(color); + return _this; + } - createClass(ArraySpan, [{ - key: 'getValue', - value: function getValue() { - var color = this._arr[Math.floor(this._arr.length * Math.random())]; - return color === 'random' || color === 'Random' ? MathUtils.randomColor() : color; - } + createClass(ArraySpan, [{ + key: "getValue", + value: function getValue() { + var val = Util.getRandFromArray(this._arr); + return val === "random" || val === "Random" ? MathUtil.randomColor() : val; + } - /** - * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance - * - * @method setSpanValue - * @memberof Proton#Proton.Color - * @instance - * - * @param {Proton.Particle} particle - * @param {Number} the integrate time 1/ms - * @param {Int} the particle index - */ + /** + * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance + * + * @method setSpanValue + * @memberof Proton#Proton.Color + * @instance + * + * @param {Proton.Particle} particle + * @param {Number} the integrate time 1/ms + * @param {Int} the particle index + */ - }], [{ - key: 'createArraySpan', - value: function createArraySpan(arr) { - if (!arr) return null; + }], [{ + key: "createArraySpan", + value: function createArraySpan(arr) { + if (!arr) return null; - if (arr instanceof ArraySpan) return arr;else return new ArraySpan(arr); - } - }]); - return ArraySpan; + if (arr instanceof ArraySpan) return arr;else return new ArraySpan(arr); + } + }]); + return ArraySpan; }(Span); var Rectangle = function () { - function Rectangle(x, y, w, h) { - classCallCheck(this, Rectangle); + function Rectangle(x, y, w, h) { + classCallCheck(this, Rectangle); - this.x = x; - this.y = y; + this.x = x; + this.y = y; - this.width = w; - this.height = h; + this.width = w; + this.height = h; - this.bottom = this.y + this.height; - this.right = this.x + this.width; - } + this.bottom = this.y + this.height; + this.right = this.x + this.width; + } - createClass(Rectangle, [{ - key: "contains", - value: function contains(x, y) { - if (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y) return true;else return false; - } - }]); - return Rectangle; + createClass(Rectangle, [{ + key: "contains", + value: function contains(x, y) { + if (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y) return true;else return false; + } + }]); + return Rectangle; }(); var Rate = function () { + /** + * The number of particles per second emission (a [particle]/b [s]); + * @namespace + * @memberof! Proton# + * @constructor + * @alias Rate + * + * @param {Array | Number | Span} numpan the number of each emission; + * @param {Array | Number | Span} timepan the time of each emission; + * for example: new Rate(new Span(10, 20), new Span(.1, .25)); + */ + function Rate(numpan, timepan) { + classCallCheck(this, Rate); - /** - * The number of particles per second emission (a [particle]/b [s]); - * @namespace - * @memberof! Proton# - * @constructor - * @alias Rate - * - * @param {Array | Number | Span} numpan the number of each emission; - * @param {Array | Number | Span} timepan the time of each emission; - * for example: new Rate(new Span(10, 20), new Span(.1, .25)); - */ - function Rate(numpan, timepan) { - classCallCheck(this, Rate); - - this.numPan = Util.setSpanValue(Util.initValue(numpan, 1)); - this.timePan = Util.setSpanValue(Util.initValue(timepan, 1)); + this.numPan = Span.setSpanValue(Util.initValue(numpan, 1)); + this.timePan = Span.setSpanValue(Util.initValue(timepan, 1)); - this.startTime = 0; - this.nextTime = 0; - this.init(); - } + this.startTime = 0; + this.nextTime = 0; + this.init(); + } - createClass(Rate, [{ - key: 'init', - value: function init() { - this.startTime = 0; - this.nextTime = this.timePan.getValue(); - } - }, { - key: 'getValue', - value: function getValue(time) { - this.startTime += time; + createClass(Rate, [{ + key: "init", + value: function init() { + this.startTime = 0; + this.nextTime = this.timePan.getValue(); + } + }, { + key: "getValue", + value: function getValue(time) { + this.startTime += time; - if (this.startTime >= this.nextTime) { - this.startTime = 0; - this.nextTime = this.timePan.getValue(); + if (this.startTime >= this.nextTime) { + this.startTime = 0; + this.nextTime = this.timePan.getValue(); - if (this.numPan.b === 1) { - if (this.numPan.getValue(false) > 0.5) return 1;else return 0; - } else { - return this.numPan.getValue(true); - } - } + if (this.numPan.b === 1) { + if (this.numPan.getValue(false) > 0.5) return 1;else return 0; + } else { + return this.numPan.getValue(true); + } + } - return 0; - } - }]); - return Rate; + return 0; + } + }]); + return Rate; }(); var Initialize = function () { - function Initialize() { - classCallCheck(this, Initialize); - } + function Initialize() { + classCallCheck(this, Initialize); + } - createClass(Initialize, [{ - key: "reset", - value: function reset() {} - }, { - key: "init", - value: function init(emitter, particle) { - if (particle) { - this.initialize(particle); - } else { - this.initialize(emitter); - } - } - }, { - key: "initialize", + createClass(Initialize, [{ + key: "reset", + value: function reset() {} + }, { + key: "init", + value: function init(emitter, particle) { + if (particle) { + this.initialize(particle); + } else { + this.initialize(emitter); + } + } + // sub class init - // sub class init - value: function initialize(target) {} - }]); - return Initialize; + }, { + key: "initialize", + value: function initialize(target) {} + }]); + return Initialize; }(); var Life = function (_Initialize) { - inherits(Life, _Initialize); + inherits(Life, _Initialize); - function Life(a, b, c) { - classCallCheck(this, Life); + function Life(a, b, c) { + classCallCheck(this, Life); - var _this = possibleConstructorReturn(this, (Life.__proto__ || Object.getPrototypeOf(Life)).call(this)); + var _this = possibleConstructorReturn(this, (Life.__proto__ || Object.getPrototypeOf(Life)).call(this)); - _this.lifePan = Util.setSpanValue(a, b, c); - _this.name = 'Life'; - return _this; - } + _this.lifePan = Span.setSpanValue(a, b, c); + _this.name = "Life"; + return _this; + } - createClass(Life, [{ - key: 'initialize', - value: function initialize(target) { - if (this.lifePan.a === Infinity) target.life = Infinity;else target.life = this.lifePan.getValue(); - } - }]); - return Life; + createClass(Life, [{ + key: "initialize", + value: function initialize(target) { + if (this.lifePan.a === Infinity) target.life = Infinity;else target.life = this.lifePan.getValue(); + } + }]); + return Life; }(Initialize); var Zone = function () { - function Zone() { - classCallCheck(this, Zone); + function Zone() { + classCallCheck(this, Zone); - this.vector = new Vector2D(0, 0); - this.random = 0; - this.crossType = 'dead'; - this.alert = true; - } + this.vector = new Vector2D(0, 0); + this.random = 0; + this.crossType = "dead"; + this.alert = true; + } - createClass(Zone, [{ - key: 'getPosition', - value: function getPosition() {} - }, { - key: 'crossing', - value: function crossing(particle) {} - }]); - return Zone; + createClass(Zone, [{ + key: "getPosition", + value: function getPosition() {} + }, { + key: "crossing", + value: function crossing(particle) {} + }]); + return Zone; }(); var PointZone = function (_Zone) { - inherits(PointZone, _Zone); + inherits(PointZone, _Zone); - function PointZone(x, y) { - classCallCheck(this, PointZone); + function PointZone(x, y) { + classCallCheck(this, PointZone); - var _this = possibleConstructorReturn(this, (PointZone.__proto__ || Object.getPrototypeOf(PointZone)).call(this)); + var _this = possibleConstructorReturn(this, (PointZone.__proto__ || Object.getPrototypeOf(PointZone)).call(this)); - _this.x = x; - _this.y = y; - return _this; - } + _this.x = x; + _this.y = y; + return _this; + } - createClass(PointZone, [{ - key: 'getPosition', - value: function getPosition() { - this.vector.x = this.x; - this.vector.y = this.y; - return this.vector; - } - }, { - key: 'crossing', - value: function crossing(particle) { - if (this.alert) { - alert('Sorry PointZone does not support crossing method'); - this.alert = false; - } - } - }]); - return PointZone; + createClass(PointZone, [{ + key: "getPosition", + value: function getPosition() { + this.vector.x = this.x; + this.vector.y = this.y; + + return this.vector; + } + }, { + key: "crossing", + value: function crossing(particle) { + if (this.alert) { + console.error("Sorry, PointZone does not support crossing method!"); + this.alert = false; + } + } + }]); + return PointZone; }(Zone); var Position = function (_Initialize) { - inherits(Position, _Initialize); - - function Position(zone) { - classCallCheck(this, Position); + inherits(Position, _Initialize); - var _this = possibleConstructorReturn(this, (Position.__proto__ || Object.getPrototypeOf(Position)).call(this)); + function Position(zone) { + classCallCheck(this, Position); - _this.zone = Util.initValue(zone, new PointZone()); + var _this = possibleConstructorReturn(this, (Position.__proto__ || Object.getPrototypeOf(Position)).call(this)); - _this.name = 'Position'; - return _this; - } + _this.zone = Util.initValue(zone, new PointZone()); + _this.name = "Position"; + return _this; + } - createClass(Position, [{ - key: 'reset', - value: function reset(zone) { - this.zone = Util.initValue(zone, new PointZone()); - } - }, { - key: 'initialize', - value: function initialize(target) { - this.zone.getPosition(); + createClass(Position, [{ + key: "reset", + value: function reset(zone) { + this.zone = Util.initValue(zone, new PointZone()); + } + }, { + key: "initialize", + value: function initialize(target) { + this.zone.getPosition(); - target.p.x = this.zone.vector.x; - target.p.y = this.zone.vector.y; - } - }]); - return Position; + target.p.x = this.zone.vector.x; + target.p.y = this.zone.vector.y; + } + }]); + return Position; }(Initialize); var Velocity = function (_Initialize) { - inherits(Velocity, _Initialize); - - function Velocity(rpan, thapan, type) { - classCallCheck(this, Velocity); + inherits(Velocity, _Initialize); - var _this = possibleConstructorReturn(this, (Velocity.__proto__ || Object.getPrototypeOf(Velocity)).call(this)); + function Velocity(rpan, thapan, type) { + classCallCheck(this, Velocity); - _this.rPan = Util.setSpanValue(rpan); - _this.thaPan = Util.setSpanValue(thapan); - _this.type = Util.initValue(type, 'vector'); + var _this = possibleConstructorReturn(this, (Velocity.__proto__ || Object.getPrototypeOf(Velocity)).call(this)); - _this.name = 'Velocity'; - return _this; - } + _this.rPan = Span.setSpanValue(rpan); + _this.thaPan = Span.setSpanValue(thapan); + _this.type = Util.initValue(type, "vector"); - createClass(Velocity, [{ - key: 'reset', - value: function reset(rpan, thapan, type) { - this.rPan = Util.setSpanValue(rpan); - this.thaPan = Util.setSpanValue(thapan); - this.type = Util.initValue(type, 'vector'); - } - }, { - key: 'normalizeVelocity', - value: function normalizeVelocity(vr) { - return vr * Proton.MEASURE; - } - }, { - key: 'initialize', - value: function initialize(target) { - if (this.type === 'p' || this.type === 'P' || this.type === 'polar') { - var polar2d = new Polar2D(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtils.PI_180); + _this.name = "Velocity"; + return _this; + } - target.v.x = polar2d.getX(); - target.v.y = polar2d.getY(); - } else { - target.v.x = this.normalizeVelocity(this.rPan.getValue()); - target.v.y = this.normalizeVelocity(this.thaPan.getValue()); - } - } - }]); - return Velocity; + createClass(Velocity, [{ + key: "reset", + value: function reset(rpan, thapan, type) { + this.rPan = Span.setSpanValue(rpan); + this.thaPan = Span.setSpanValue(thapan); + this.type = Util.initValue(type, "vector"); + } + }, { + key: "normalizeVelocity", + value: function normalizeVelocity(vr) { + return vr * Proton.MEASURE; + } + }, { + key: "initialize", + value: function initialize(target) { + if (this.type === "p" || this.type === "P" || this.type === "polar") { + var polar2d = new Polar2D(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtil.PI_180); + + target.v.x = polar2d.getX(); + target.v.y = polar2d.getY(); + } else { + target.v.x = this.normalizeVelocity(this.rPan.getValue()); + target.v.y = this.normalizeVelocity(this.thaPan.getValue()); + } + } + }]); + return Velocity; }(Initialize); var Mass = function (_Initialize) { - inherits(Mass, _Initialize); + inherits(Mass, _Initialize); - function Mass(a, b, c) { - classCallCheck(this, Mass); + function Mass(a, b, c) { + classCallCheck(this, Mass); - var _this = possibleConstructorReturn(this, (Mass.__proto__ || Object.getPrototypeOf(Mass)).call(this)); + var _this = possibleConstructorReturn(this, (Mass.__proto__ || Object.getPrototypeOf(Mass)).call(this)); - _this.massPan = Util.setSpanValue(a, b, c); - _this.name = 'Mass'; - return _this; - } + _this.massPan = Span.setSpanValue(a, b, c); + _this.name = "Mass"; + return _this; + } - createClass(Mass, [{ - key: 'initialize', - value: function initialize(target) { - target.mass = this.massPan.getValue(); - } - }]); - return Mass; + createClass(Mass, [{ + key: "initialize", + value: function initialize(target) { + target.mass = this.massPan.getValue(); + } + }]); + return Mass; }(Initialize); var Radius = function (_Initialize) { - inherits(Radius, _Initialize); + inherits(Radius, _Initialize); - function Radius(a, b, c) { - classCallCheck(this, Radius); + function Radius(a, b, c) { + classCallCheck(this, Radius); - var _this = possibleConstructorReturn(this, (Radius.__proto__ || Object.getPrototypeOf(Radius)).call(this)); + var _this = possibleConstructorReturn(this, (Radius.__proto__ || Object.getPrototypeOf(Radius)).call(this)); - _this.radius = Util.setSpanValue(a, b, c); + _this.radius = Span.setSpanValue(a, b, c); - _this.name = 'Radius'; - return _this; - } + _this.name = "Radius"; + return _this; + } - createClass(Radius, [{ - key: 'reset', - value: function reset(a, b, c) { - this.radius = Util.setSpanValue(a, b, c); - } - }, { - key: 'initialize', - value: function initialize(particle) { - particle.radius = this.radius.getValue(); - particle.transform.oldRadius = particle.radius; - } - }]); - return Radius; + createClass(Radius, [{ + key: "reset", + value: function reset(a, b, c) { + this.radius = Span.setSpanValue(a, b, c); + } + }, { + key: "initialize", + value: function initialize(particle) { + particle.radius = this.radius.getValue(); + particle.data.oldRadius = particle.radius; + } + }]); + return Radius; }(Initialize); var Body = function (_Initialize) { - inherits(Body, _Initialize); - - function Body(image, w, h) { - classCallCheck(this, Body); + inherits(Body, _Initialize); - var _this = possibleConstructorReturn(this, (Body.__proto__ || Object.getPrototypeOf(Body)).call(this)); + function Body(image, w, h) { + classCallCheck(this, Body); - _this.image = _this.setSpanValue(image); - _this.w = Util.initValue(w, 20); - _this.h = Util.initValue(h, _this.w); - _this.name = 'Body'; - return _this; - } + var _this = possibleConstructorReturn(this, (Body.__proto__ || Object.getPrototypeOf(Body)).call(this)); - createClass(Body, [{ - key: 'initialize', - value: function initialize(particle) { - var imagetarget = this.image.getValue(); + _this.image = _this.setSpanValue(image); + _this.w = Util.initValue(w, 20); + _this.h = Util.initValue(h, _this.w); + _this.name = "Body"; + return _this; + } - if (typeof imagetarget === 'string') { - particle.body = { width: this.w, height: this.h, src: imagetarget, isInner: true, inner: true }; - } else { - particle.body = imagetarget; - } - } - }, { - key: 'setSpanValue', - value: function setSpanValue(color) { - return color instanceof ArraySpan ? color : new ArraySpan(color); - } - }]); - return Body; + createClass(Body, [{ + key: "initialize", + value: function initialize(particle) { + var imageTarget = this.image.getValue(); + + if (typeof imageTarget === "string") { + particle.body = { + width: this.w, + height: this.h, + src: imageTarget, + isInner: true, + inner: true + }; + } else { + particle.body = imageTarget; + } + } + }, { + key: "setSpanValue", + value: function setSpanValue(image) { + return image instanceof ArraySpan ? image : new ArraySpan(image); + } + }]); + return Body; }(Initialize); var Behaviour = function () { @@ -2700,84 +2770,90 @@ var Attraction = function (_Behaviour) { }(Behaviour); var RandomDrift = function (_Behaviour) { - inherits(RandomDrift, _Behaviour); - - /** - * @memberof! Proton# - * @augments Behaviour - * @constructor - * @alias RandomDrift - * - * @param {Number} driftX X value of the new Vector2D - * @param {Number} driftY Y value of the new Vector2D - * @param {Number} delay How much delay the drift should have - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=easeLinear] this behaviour's easing - * - * @property {Number} time The time of the drift - * @property {String} name The Behaviour name - */ - function RandomDrift(driftX, driftY, delay, life, easing) { - classCallCheck(this, RandomDrift); - - var _this = possibleConstructorReturn(this, (RandomDrift.__proto__ || Object.getPrototypeOf(RandomDrift)).call(this, life, easing)); - - _this.reset(driftX, driftY, delay); - _this.time = 0; - _this.name = 'RandomDrift'; - return _this; - } - - /** - * Reset this behaviour's parameters - * - * @method reset - * @memberof Proton#RandomDrift - * @instance - * - * @param {Number} driftX X value of the new Vector2D - * @param {Number} driftY Y value of the new Vector2D - * @param {Number} delay How much delay the drift should have - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=easeLinear] this behaviour's easing - */ + inherits(RandomDrift, _Behaviour); + /** + * @memberof! Proton# + * @augments Behaviour + * @constructor + * @alias RandomDrift + * + * @param {Number} driftX X value of the new Vector2D + * @param {Number} driftY Y value of the new Vector2D + * @param {Number} delay How much delay the drift should have + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=easeLinear] this behaviour's easing + * + * @property {Number} time The time of the drift + * @property {String} name The Behaviour name + */ + function RandomDrift(driftX, driftY, delay, life, easing) { + classCallCheck(this, RandomDrift); - createClass(RandomDrift, [{ - key: 'reset', - value: function reset(driftX, driftY, delay, life, easing) { - this.panFoce = new Vector2D(driftX, driftY); - this.panFoce = this.normalizeForce(this.panFoce); - this.delay = delay; + var _this = possibleConstructorReturn(this, (RandomDrift.__proto__ || Object.getPrototypeOf(RandomDrift)).call(this, life, easing)); - life && get(RandomDrift.prototype.__proto__ || Object.getPrototypeOf(RandomDrift.prototype), 'reset', this).call(this, life, easing); - } + _this.reset(driftX, driftY, delay); + _this.time = 0; + _this.name = "RandomDrift"; + return _this; + } - /** - * Apply this behaviour for all particles every time + /** + * Reset this behaviour's parameters * - * @method applyBehaviour + * @method reset * @memberof Proton#RandomDrift * @instance * - * @param {Particle} particle - * @param {Number} time the integrate time 1/ms - * @param {Int} index the particle index + * @param {Number} driftX X value of the new Vector2D + * @param {Number} driftY Y value of the new Vector2D + * @param {Number} delay How much delay the drift should have + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=easeLinear] this behaviour's easing */ - }, { - key: 'applyBehaviour', - value: function applyBehaviour(particle, time, index) { - this.calculate(particle, time, index); - this.time += time; - if (this.time >= this.delay) { - particle.a.addXY(MathUtils.randomAToB(-this.panFoce.x, this.panFoce.x), MathUtils.randomAToB(-this.panFoce.y, this.panFoce.y)); - this.time = 0; - } - } - }]); - return RandomDrift; + createClass(RandomDrift, [{ + key: "reset", + value: function reset(driftX, driftY, delay, life, easing) { + this.panFoce = new Vector2D(driftX, driftY); + this.panFoce = this.normalizeForce(this.panFoce); + this.delay = delay; + + life && get(RandomDrift.prototype.__proto__ || Object.getPrototypeOf(RandomDrift.prototype), "reset", this).call(this, life, easing); + } + }, { + key: "initialize", + value: function initialize(particle) { + particle.data.time = 0; + } + + /** + * Apply this behaviour for all particles every time + * + * @method applyBehaviour + * @memberof Proton#RandomDrift + * @instance + * + * @param {Particle} particle + * @param {Number} time the integrate time 1/ms + * @param {Int} index the particle index + */ + + }, { + key: "applyBehaviour", + value: function applyBehaviour(particle, time, index) { + this.calculate(particle, time, index); + particle.data.time += time; + + if (particle.data.time >= this.delay) { + particle.a.addXY(MathUtil.randomAToB(-this.panFoce.x, this.panFoce.x), MathUtil.randomAToB(-this.panFoce.y, this.panFoce.y)); + + particle.data.time = 0; + } + } + }]); + return RandomDrift; }(Behaviour); var Gravity = function (_Force) { @@ -3023,96 +3099,98 @@ var CrossZone = function (_Behaviour) { }(Behaviour); var Alpha = function (_Behaviour) { - inherits(Alpha, _Behaviour); - - /** - * @memberof! Proton# - * @augments Proton.Behaviour - * @constructor - * @alias Proton.Alpha - * - * @todo add description for 'a' and 'b' - * - * @param {Number} a - * @param {String} b - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=ease.easeLinear] this behaviour's easing - * - * @property {String} name The Behaviour name - */ - function Alpha(a, b, life, easing) { - classCallCheck(this, Alpha); - - var _this = possibleConstructorReturn(this, (Alpha.__proto__ || Object.getPrototypeOf(Alpha)).call(this, life, easing)); - - _this.reset(a, b); - _this.name = 'Alpha'; - return _this; - } - - /** - * Reset this behaviour's parameters - * - * @method reset - * @memberof Proton#Proton.Alpha - * @instance - * - * @todo add description for 'a' and 'b' - * - * @param {Number} a - * @param {String} b - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=ease.easeLinear] this behaviour's easing - */ + inherits(Alpha, _Behaviour); + /** + * @memberof! Proton# + * @augments Proton.Behaviour + * @constructor + * @alias Proton.Alpha + * + * @todo add description for 'a' and 'b' + * + * @param {Number} a + * @param {String} b + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=ease.easeLinear] this behaviour's easing + * + * @property {String} name The Behaviour name + */ + function Alpha(a, b, life, easing) { + classCallCheck(this, Alpha); - createClass(Alpha, [{ - key: 'reset', - value: function reset(a, b, life, easing) { - this.same = b === null || b === undefined ? true : false; - this.a = Util.setSpanValue(Util.initValue(a, 1)); - this.b = Util.setSpanValue(b); + var _this = possibleConstructorReturn(this, (Alpha.__proto__ || Object.getPrototypeOf(Alpha)).call(this, life, easing)); - life && get(Alpha.prototype.__proto__ || Object.getPrototypeOf(Alpha.prototype), 'reset', this).call(this, life, easing); - } + _this.reset(a, b); + _this.name = "Alpha"; + return _this; + } - /** - * Sets the new alpha value of the particle + /** + * Reset this behaviour's parameters * - * @method initialize + * @method reset * @memberof Proton#Proton.Alpha * @instance * - * @param {Proton.Particle} particle A single Proton generated particle + * @todo add description for 'a' and 'b' + * + * @param {Number} a + * @param {String} b + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=ease.easeLinear] this behaviour's easing */ - }, { - key: 'initialize', - value: function initialize(particle) { - particle.transform.alphaA = this.a.getValue(); - if (this.same) particle.transform.alphaB = particle.transform.alphaA;else particle.transform.alphaB = this.b.getValue(); - } + createClass(Alpha, [{ + key: "reset", + value: function reset(a, b, life, easing) { + this.same = b === null || b === undefined ? true : false; + this.a = Span.setSpanValue(Util.initValue(a, 1)); + this.b = Span.setSpanValue(b); - /** - * @method applyBehaviour - * @memberof Proton#Proton.Alpha - * @instance - * - * @param {Proton.Particle} particle - * @param {Number} time the integrate time 1/ms - * @param {Int} index the particle index - */ + life && get(Alpha.prototype.__proto__ || Object.getPrototypeOf(Alpha.prototype), "reset", this).call(this, life, easing); + } - }, { - key: 'applyBehaviour', - value: function applyBehaviour(particle, time, index) { - this.calculate(particle, time, index); - particle.alpha = particle.transform.alphaB + (particle.transform.alphaA - particle.transform.alphaB) * this.energy; - if (particle.alpha < 0.001) particle.alpha = 0; - } - }]); - return Alpha; + /** + * Sets the new alpha value of the particle + * + * @method initialize + * @memberof Proton#Proton.Alpha + * @instance + * + * @param {Proton.Particle} particle A single Proton generated particle + */ + + }, { + key: "initialize", + value: function initialize(particle) { + particle.data.alphaA = this.a.getValue(); + + if (this.same) particle.data.alphaB = particle.data.alphaA;else particle.data.alphaB = this.b.getValue(); + } + + /** + * @method applyBehaviour + * @memberof Proton#Proton.Alpha + * @instance + * + * @param {Proton.Particle} particle + * @param {Number} time the integrate time 1/ms + * @param {Int} index the particle index + */ + + }, { + key: "applyBehaviour", + value: function applyBehaviour(particle, time, index) { + this.calculate(particle, time, index); + + particle.alpha = particle.data.alphaB + (particle.data.alphaA - particle.data.alphaB) * this.energy; + + if (particle.alpha < 0.001) particle.alpha = 0; + } + }]); + return Alpha; }(Behaviour); var Scale = function (_Behaviour) { @@ -3161,8 +3239,8 @@ var Scale = function (_Behaviour) { key: 'reset', value: function reset(a, b, life, easing) { this.same = b === null || b === undefined ? true : false; - this.a = Util.setSpanValue(Util.initValue(a, 1)); - this.b = Util.setSpanValue(b); + this.a = Span.setSpanValue(Util.initValue(a, 1)); + this.b = Span.setSpanValue(b); life && get(Scale.prototype.__proto__ || Object.getPrototypeOf(Scale.prototype), 'reset', this).call(this, life, easing); } @@ -3180,9 +3258,9 @@ var Scale = function (_Behaviour) { }, { key: 'initialize', value: function initialize(particle) { - particle.transform.scaleA = this.a.getValue(); - particle.transform.oldRadius = particle.radius; - particle.transform.scaleB = this.same ? particle.transform.scaleA : this.b.getValue(); + particle.data.scaleA = this.a.getValue(); + particle.data.oldRadius = particle.radius; + particle.data.scaleB = this.same ? particle.data.scaleA : this.b.getValue(); } }, { key: 'applyBehaviour', @@ -3201,10 +3279,10 @@ var Scale = function (_Behaviour) { */ value: function applyBehaviour(particle, time, index) { this.calculate(particle, time, index); - particle.scale = particle.transform.scaleB + (particle.transform.scaleA - particle.transform.scaleB) * this.energy; + particle.scale = particle.data.scaleB + (particle.data.scaleA - particle.data.scaleB) * this.energy; if (particle.scale < 0.0001) particle.scale = 0; - particle.radius = particle.transform.oldRadius * particle.scale; + particle.radius = particle.data.oldRadius * particle.scale; } }]); return Scale; @@ -3261,8 +3339,8 @@ var Rotate = function (_Behaviour) { value: function reset(a, b, style, life, easing) { this.same = b === null || b === undefined ? true : false; - this.a = Util.setSpanValue(Util.initValue(a, 'Velocity')); - this.b = Util.setSpanValue(Util.initValue(b, 0)); + this.a = Span.setSpanValue(Util.initValue(a, 'Velocity')); + this.b = Span.setSpanValue(Util.initValue(b, 0)); this.style = Util.initValue(style, 'to'); life && get(Rotate.prototype.__proto__ || Object.getPrototypeOf(Rotate.prototype), 'reset', this).call(this, life, easing); @@ -3282,9 +3360,9 @@ var Rotate = function (_Behaviour) { key: 'initialize', value: function initialize(particle) { particle.rotation = this.a.getValue(); - particle.transform.rotationA = this.a.getValue(); + particle.data.rotationA = this.a.getValue(); - if (!this.same) particle.transform.rotationB = this.b.getValue(); + if (!this.same) particle.data.rotationB = this.b.getValue(); } }, { key: 'applyBehaviour', @@ -3306,9 +3384,9 @@ var Rotate = function (_Behaviour) { if (!this.same) { if (this.style === 'to' || this.style === 'TO' || this.style === '_') { - particle.rotation += particle.transform.rotationB + (particle.transform.rotationA - particle.transform.rotationB) * this.energy; + particle.rotation += particle.data.rotationB + (particle.data.rotationA - particle.data.rotationB) * this.energy; } else { - particle.rotation += particle.transform.rotationB; + particle.rotation += particle.data.rotationB; } } else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') { // beta... @@ -3320,106 +3398,105 @@ var Rotate = function (_Behaviour) { }(Behaviour); var Color = function (_Behaviour) { - inherits(Color, _Behaviour); + inherits(Color, _Behaviour); + + /** + * @memberof! Proton# + * @augments Proton.Behaviour + * @constructor + * @alias Proton.Color + * + * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black + * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=easeLinear] this behaviour's easing + * + * @property {String} name The Behaviour name + */ + function Color(a, b, life, easing) { + classCallCheck(this, Color); + + var _this = possibleConstructorReturn(this, (Color.__proto__ || Object.getPrototypeOf(Color)).call(this, life, easing)); + + _this.reset(a, b); + _this.name = "Color"; + return _this; + } + + /** + * Reset this behaviour's parameters + * + * @method reset + * @memberof Proton#Proton.Color + * @instance + * + * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black + * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=easeLinear] this behaviour's easing + */ + + + createClass(Color, [{ + key: "reset", + value: function reset(a, b, life, easing) { + this.a = ArraySpan.createArraySpan(a); + this.b = ArraySpan.createArraySpan(b); + life && get(Color.prototype.__proto__ || Object.getPrototypeOf(Color.prototype), "reset", this).call(this, life, easing); + } /** - * @memberof! Proton# - * @augments Proton.Behaviour - * @constructor - * @alias Proton.Color + * Initialize the behaviour's parameters for all particles * - * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black - * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=easeLinear] this behaviour's easing + * @method initialize + * @memberof Proton#Proton.Color + * @instance * - * @property {String} name The Behaviour name + * @param {Proton.Particle} particle */ - function Color(a, b, life, easing) { - classCallCheck(this, Color); - var _this = possibleConstructorReturn(this, (Color.__proto__ || Object.getPrototypeOf(Color)).call(this, life, easing)); + }, { + key: "initialize", + value: function initialize(particle) { + particle.color = this.a.getValue(); + particle.data.colorA = ColorUtil.hexToRgb(particle.color); - _this.reset(a, b); - _this.name = 'Color'; - return _this; + if (this.b) particle.data.colorB = ColorUtil.hexToRgb(this.b.getValue()); } /** - * Reset this behaviour's parameters + * Apply this behaviour for all particles every time * - * @method reset + * @method applyBehaviour * @memberof Proton#Proton.Color * @instance * - * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black - * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=easeLinear] this behaviour's easing + * @param {Proton.Particle} particle + * @param {Number} the integrate time 1/ms + * @param {Int} the particle index */ - - createClass(Color, [{ - key: 'reset', - value: function reset(a, b, life, easing) { - this.a = ArraySpan.createArraySpan(a); - this.b = ArraySpan.createArraySpan(b); - - life && get(Color.prototype.__proto__ || Object.getPrototypeOf(Color.prototype), 'reset', this).call(this, life, easing); - } - - /** - * Initialize the behaviour's parameters for all particles - * - * @method initialize - * @memberof Proton#Proton.Color - * @instance - * - * @param {Proton.Particle} particle - */ - - }, { - key: 'initialize', - value: function initialize(particle) { - particle.color = this.a.getValue(); - particle.transform.colorA = ColorUtil.hexToRGB(particle.color); - - if (this.b) particle.transform.colorB = ColorUtil.hexToRGB(this.b.getValue()); - } - }, { - key: 'applyBehaviour', - - - /** - * Apply this behaviour for all particles every time - * - * @method applyBehaviour - * @memberof Proton#Proton.Color - * @instance - * - * @param {Proton.Particle} particle - * @param {Number} the integrate time 1/ms - * @param {Int} the particle index - */ - value: function applyBehaviour(particle, time, index) { - if (this.b) { - this.calculate(particle, time, index); - - particle.transform.rgb.r = particle.transform.colorB.r + (particle.transform.colorA.r - particle.transform.colorB.r) * this.energy; - particle.transform.rgb.g = particle.transform.colorB.g + (particle.transform.colorA.g - particle.transform.colorB.g) * this.energy; - particle.transform.rgb.b = particle.transform.colorB.b + (particle.transform.colorA.b - particle.transform.colorB.b) * this.energy; - - particle.transform.rgb.r = Math.floor(particle.transform.rgb.r); - particle.transform.rgb.g = Math.floor(particle.transform.rgb.g); - particle.transform.rgb.b = Math.floor(particle.transform.rgb.b); - } else { - particle.transform.rgb.r = particle.transform.colorA.r; - particle.transform.rgb.g = particle.transform.colorA.g; - particle.transform.rgb.b = particle.transform.colorA.b; - } - } - }]); - return Color; + }, { + key: "applyBehaviour", + value: function applyBehaviour(particle, time, index) { + if (this.b) { + this.calculate(particle, time, index); + + particle.rgb.r = particle.data.colorB.r + (particle.data.colorA.r - particle.data.colorB.r) * this.energy; + particle.rgb.g = particle.data.colorB.g + (particle.data.colorA.g - particle.data.colorB.g) * this.energy; + particle.rgb.b = particle.data.colorB.b + (particle.data.colorA.b - particle.data.colorB.b) * this.energy; + + particle.rgb.r = Math.floor(particle.rgb.r); + particle.rgb.g = Math.floor(particle.rgb.g); + particle.rgb.b = Math.floor(particle.rgb.b); + } else { + particle.rgb.r = particle.data.colorA.r; + particle.rgb.g = particle.data.colorA.g; + particle.rgb.b = particle.data.colorA.b; + } + } + }]); + return Color; }(Behaviour); var Repulsion = function (_Attraction) { @@ -3573,693 +3650,697 @@ var GravityWell = function (_Behaviour) { }(Behaviour); var InitializeUtil = { - initialize: function initialize(emitter, particle, initializes) { - var length = initializes.length; - var i = void 0; - - for (i = 0; i < length; i++) { - if (initializes[i] instanceof Initialize) initializes[i].init(emitter, particle);else this.init(emitter, particle, initializes[i]); - } + initialize: function initialize(emitter, particle, initializes) { + var length = initializes.length; + var i = void 0; + + for (i = 0; i < length; i++) { + if (initializes[i] instanceof Initialize) { + initializes[i].init(emitter, particle); + } else { + this.init(emitter, particle, initializes[i]); + } + } - this.bindEmitter(emitter, particle); - }, + this.bindEmitter(emitter, particle); + }, - // init - init: function init(emitter, particle, initialize) { - Util.setPrototypeByObject(particle, initialize); - Util.setVector2DByObject(particle, initialize); - }, - bindEmitter: function bindEmitter(emitter, particle) { - if (emitter.bindEmitter) { - particle.p.add(emitter.p); - particle.v.add(emitter.v); - particle.a.add(emitter.a); + // init + init: function init(emitter, particle, initialize) { + Util.setProp(particle, initialize); + Util.setVectorVal(particle, initialize); + }, + bindEmitter: function bindEmitter(emitter, particle) { + if (emitter.bindEmitter) { + particle.p.add(emitter.p); + particle.v.add(emitter.v); + particle.a.add(emitter.a); - particle.v.rotate(MathUtils.degreeTransform(emitter.rotation)); - } - } + particle.v.rotate(MathUtil.degreeTransform(emitter.rotation)); + } + } }; var Emitter = function (_Particle) { - inherits(Emitter, _Particle); - - /** - * You can use this emit particles. - * - * It will dispatch follow events: - * PARTICLE_CREATED - * PARTICLE_UPDATA - * PARTICLE_DEAD - * - * @class Emitter - * @constructor - * @param {Object} pObj the parameters object; - * for example {damping:0.01,bindEmitter:false} - */ - function Emitter(pObj) { - classCallCheck(this, Emitter); - - var _this = possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this, pObj)); - - _this.initializes = []; - _this.particles = []; - _this.behaviours = []; - - _this.emitSpeed = 0; - _this.emitTime = 0; - _this.totalTime = -1; + inherits(Emitter, _Particle); - /** - * The friction coefficient for all particle emit by This; - * @property damping - * @type {Number} - * @default 0.006 - */ - _this.damping = .006; - - /** - * If bindEmitter the particles can bind this emitter's property; - * @property bindEmitter - * @type {Boolean} - * @default true + /** + * You can use this emit particles. + * + * It will dispatch follow events: + * PARTICLE_CREATED + * PARTICLE_UPDATA + * PARTICLE_DEAD + * + * @class Emitter + * @constructor + * @param {Object} conf the parameters object; + * for example {damping:0.01,bindEmitter:false} */ - _this.bindEmitter = true; + function Emitter() { + var conf = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + classCallCheck(this, Emitter); - /** - * The number of particles per second emit (a [particle]/b [s]); - * @property rate - * @type {Rate} - * @default Rate(1, .1) - */ - _this.rate = new Rate(1, .1); + var _this = possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this, conf)); - _this.id = 'emitter_' + Emitter.ID++; - _this.name = 'Emitter'; - return _this; - } + _this.particles = []; + _this.behaviours = []; + _this.initializes = []; - /** - * start emit particle - * @method emit - * @param {Number} emitTime begin emit time; - * @param {String} life the life of this emitter - */ + _this.emitTime = 0; + _this.emitSpeed = 0; + _this.totalTime = -1; + /** + * The friction coefficient for all particle emit by This; + * @property damping + * @type {Number} + * @default 0.006 + */ + _this.damping = 0.006; - createClass(Emitter, [{ - key: 'emit', - value: function emit(totalTime, life) { - this.stoped = false; - this.emitTime = 0; - this.totalTime = Util.initValue(totalTime, Infinity); + /** + * If bindEmitter the particles can bind this emitter's property; + * @property bindEmitter + * @type {Boolean} + * @default true + */ + _this.bindEmitter = true; - if (life === true || life === 'life' || life === 'destroy') { - this.life = totalTime === 'once' ? 1 : this.totalTime; - } else if (!isNaN(life)) { - this.life = life; - } + /** + * The number of particles per second emit (a [particle]/b [s]); + * @property rate + * @type {Rate} + * @default Rate(1, .1) + */ + _this.rate = new Rate(1, 0.1); - this.rate.init(); - } + _this.name = "Emitter"; + _this.id = Puid.id(_this.name); + return _this; + } - /** - * stop emiting - * @method stop + /** + * start emit particle + * @method emit + * @param {Number} emitTime begin emit time; + * @param {String} life the life of this emitter */ - }, { - key: 'stop', - value: function stop() { - this.totalTime = -1; - this.emitTime = 0; - this.stoped = true; - } - }, { - key: 'preEmit', - value: function preEmit(time) { - var oldStoped = this.stoped; - var oldEmitTime = this.emitTime; - var oldTotalTime = this.totalTime; - - this.stoped = false; - this.emitTime = 0; - this.totalTime = time; - this.rate.init(); - - var step = 0.0167; - while (time > step) { - time -= step; - this.update(step); - } - this.stoped = oldStoped; - this.emitTime = oldEmitTime + Math.max(time, 0); - this.totalTime = oldTotalTime; - } + createClass(Emitter, [{ + key: "emit", + value: function emit(totalTime, life) { + this.stoped = false; + this.emitTime = 0; + this.totalTime = Util.initValue(totalTime, Infinity); - /** - * remove current all particles - * @method removeAllParticles - */ + if (life === true || life === "life" || life === "destroy") { + this.life = totalTime === "once" ? 1 : this.totalTime; + } else if (!isNaN(life)) { + this.life = life; + } - }, { - key: 'removeAllParticles', - value: function removeAllParticles() { - var i = this.particles.length; - while (i--) { - this.particles[i].dead = true; - } - } + this.rate.init(); + } - /** - * add initialize to this emitter - * @method addSelfInitialize - */ + /** + * stop emiting + * @method stop + */ - }, { - key: 'addSelfInitialize', - value: function addSelfInitialize(pObj) { - if (pObj['init']) { - pObj.init(this); - } else { - this.initAll(); - } - } + }, { + key: "stop", + value: function stop() { + this.totalTime = -1; + this.emitTime = 0; + this.stoped = true; + } + }, { + key: "preEmit", + value: function preEmit(time) { + var oldStoped = this.stoped; + var oldEmitTime = this.emitTime; + var oldTotalTime = this.totalTime; + + this.stoped = false; + this.emitTime = 0; + this.totalTime = time; + this.rate.init(); + + var step = 0.0167; + while (time > step) { + time -= step; + this.update(step); + } + + this.stoped = oldStoped; + this.emitTime = oldEmitTime + Math.max(time, 0); + this.totalTime = oldTotalTime; + } - /** - * add the Initialize to particles; - * - * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3); - * @method addInitialize - * @param {Initialize} initialize like this new Radius(1, 12) - */ + /** + * remove current all particles + * @method removeAllParticles + */ - }, { - key: 'addInitialize', - value: function addInitialize() { - for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) { - rest[_key] = arguments[_key]; - } + }, { + key: "removeAllParticles", + value: function removeAllParticles() { + var i = this.particles.length; + while (i--) { + this.particles[i].dead = true; + } + } - var i = rest.length; - while (i--) { - this.initializes.push(rest[i]); - } - } + /** + * add initialize to this emitter + * @method addSelfInitialize + */ - /** - * remove the Initialize - * @method removeInitialize - * @param {Initialize} initialize a initialize - */ + }, { + key: "addSelfInitialize", + value: function addSelfInitialize(initialize) { + if (initialize["init"]) { + initialize.init(this); + } else { + this.initAll(); + } + } + + /** + * add the Initialize to particles; + * + * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3); + * @method addInitialize + * @param {Initialize} initialize like this new Radius(1, 12) + */ + + }, { + key: "addInitialize", + value: function addInitialize() { + for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) { + rest[_key] = arguments[_key]; + } + + var i = rest.length; + while (i--) { + this.initializes.push(rest[i]); + } + } - }, { - key: 'removeInitialize', - value: function removeInitialize(initializer) { - var index = this.initializes.indexOf(initializer); - if (index > -1) this.initializes.splice(index, 1); - } + /** + * remove the Initialize + * @method removeInitialize + * @param {Initialize} initialize a initialize + */ - /** - * remove all Initializes - * @method removeInitializers - */ + }, { + key: "removeInitialize", + value: function removeInitialize(initializer) { + var index = this.initializes.indexOf(initializer); + if (index > -1) this.initializes.splice(index, 1); + } - }, { - key: 'removeAllInitializers', - value: function removeAllInitializers() { - Util.destroyArray(this.initializes); - } + /** + * remove all Initializes + * @method removeInitializers + */ - /** - * add the Behaviour to particles; - * - * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3); - * @method addBehaviour - * @param {Behaviour} behaviour like this new Color('random') - */ + }, { + key: "removeAllInitializers", + value: function removeAllInitializers() { + Util.emptyArray(this.initializes); + } - }, { - key: 'addBehaviour', - value: function addBehaviour() { - for (var _len2 = arguments.length, rest = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - rest[_key2] = arguments[_key2]; - } + /** + * add the Behaviour to particles; + * + * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3); + * @method addBehaviour + * @param {Behaviour} behaviour like this new Color('random') + */ - var i = arguments.length; - while (i--) { - var behaviour = rest[i]; - this.behaviours.push(behaviour); - if (behaviour.parents) behaviour.parents.push(this); - } - } + }, { + key: "addBehaviour", + value: function addBehaviour() { + for (var _len2 = arguments.length, rest = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + rest[_key2] = arguments[_key2]; + } + + var i = arguments.length; + while (i--) { + var behaviour = rest[i]; + this.behaviours.push(behaviour); + if (behaviour.parents) behaviour.parents.push(this); + } + } - /** - * remove the Behaviour - * @method removeBehaviour - * @param {Behaviour} behaviour a behaviour - */ + /** + * remove the Behaviour + * @method removeBehaviour + * @param {Behaviour} behaviour a behaviour + */ - }, { - key: 'removeBehaviour', - value: function removeBehaviour(behaviour) { - var index = this.behaviours.indexOf(behaviour); - this.behaviours.splice(index, 1); - - if (behaviour.parents) { - index = behaviour.parents.indexOf(behaviour); - behaviour.parents.splice(index, 1); - } + }, { + key: "removeBehaviour", + value: function removeBehaviour(behaviour) { + var index = this.behaviours.indexOf(behaviour); + this.behaviours.splice(index, 1); - return index; - } + if (behaviour.parents) { + index = behaviour.parents.indexOf(behaviour); + behaviour.parents.splice(index, 1); + } - /** - * remove all behaviours - * @method removeAllBehaviours - */ + return index; + } - }, { - key: 'removeAllBehaviours', - value: function removeAllBehaviours() { - Util.destroyArray(this.behaviours); - } + /** + * remove all behaviours + * @method removeAllBehaviours + */ - // emitter update + }, { + key: "removeAllBehaviours", + value: function removeAllBehaviours() { + Util.emptyArray(this.behaviours); + } - }, { - key: 'update', - value: function update(time) { - this.age += time; - if (this.age >= this.life || this.dead) this.destroy(); + // emitter update - this.emitting(time); - this.integrate(time); - } - }, { - key: 'integrate', - value: function integrate(time) { - if (!this.parent) return; + }, { + key: "update", + value: function update(time) { + this.age += time; + if (this.age >= this.life || this.dead) this.destroy(); - var damping = 1 - this.damping; - this.parent.integrator.calculate(this, time, damping); + this.emitting(time); + this.integrate(time); + } + }, { + key: "integrate", + value: function integrate(time) { + if (!this.parent) return; - var length = this.particles.length; - var i = void 0, - particle = void 0; + var damping = 1 - this.damping; + this.parent.integrator.calculate(this, time, damping); - for (i = length - 1; i >= 0; i--) { - particle = this.particles[i]; + var length = this.particles.length; + var i = void 0, + particle = void 0; - // particle update - particle.update(time, i); - this.parent.integrator.calculate(particle, time, damping); - this.dispatch('PARTICLE_UPDATE', particle); + for (i = length - 1; i >= 0; i--) { + particle = this.particles[i]; - // check dead - if (particle.dead) { - this.dispatch('PARTICLE_DEAD', particle); + // particle update + particle.update(time, i); + this.parent.integrator.calculate(particle, time, damping); + this.dispatch("PARTICLE_UPDATE", particle); - this.parent.pool.expire(particle); - this.particles.splice(i, 1); - } - } - } - }, { - key: 'dispatch', - value: function dispatch(event, target) { - this.parent && this.parent.dispatchEvent(event, target); - this.bindEvent && this.dispatchEvent(event, target); - } - }, { - key: 'emitting', - value: function emitting(time) { - if (this.totalTime === 'once') { - var i = void 0; - var length = this.rate.getValue(99999); - - if (length > 0) this.emitSpeed = length; - for (i = 0; i < length; i++) { - this.createParticle(); - }this.totalTime = 'none'; - } else { - this.emitTime += time; - - if (this.emitTime < this.totalTime) { - var _length = this.rate.getValue(time); - var _i = void 0; - - if (_length > 0) this.emitSpeed = _length; - for (_i = 0; _i < _length; _i++) { - this.createParticle(); - } - } - } - } + // check dead + if (particle.dead) { + this.dispatch("PARTICLE_DEAD", particle); - /** - * create single particle; - * - * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun}) - * @method removeAllParticles - */ + this.parent.pool.expire(particle); + this.particles.splice(i, 1); + } + } + } + }, { + key: "dispatch", + value: function dispatch(event, target) { + this.parent && this.parent.dispatchEvent(event, target); + this.bindEvent && this.dispatchEvent(event, target); + } + }, { + key: "emitting", + value: function emitting(time) { + if (this.totalTime === "once") { + var i = void 0; + var length = this.rate.getValue(99999); + + if (length > 0) this.emitSpeed = length; + for (i = 0; i < length; i++) { + this.createParticle(); + }this.totalTime = "none"; + } else { + this.emitTime += time; + + if (this.emitTime < this.totalTime) { + var _length = this.rate.getValue(time); + var _i = void 0; + + if (_length > 0) this.emitSpeed = _length; + for (_i = 0; _i < _length; _i++) { + this.createParticle(); + } + } + } + } - }, { - key: 'createParticle', - value: function createParticle(initialize, behaviour) { - var particle = this.parent.pool.get(Particle); - this.setupParticle(particle, initialize, behaviour); - this.dispatch('PARTICLE_CREATED', particle); + /** + * create single particle; + * + * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun}) + * @method removeAllParticles + */ - return particle; - } - }, { - key: 'setupParticle', - value: function setupParticle(particle, initialize, behaviour) { - var initializes = this.initializes; - var behaviours = this.behaviours; + }, { + key: "createParticle", + value: function createParticle(initialize, behaviour) { + var particle = this.parent.pool.get(Particle); + this.setupParticle(particle, initialize, behaviour); + this.dispatch("PARTICLE_CREATED", particle); - if (initialize) { - initializes = Util.isArray(initialize) ? initialize : [initialize]; - } + return particle; + } + }, { + key: "setupParticle", + value: function setupParticle(particle, initialize, behaviour) { + var initializes = this.initializes; + var behaviours = this.behaviours; - if (behaviour) { - behaviour = Util.isArray(behaviour) ? behaviour : [behaviour]; - } + if (initialize) initializes = Util.toArray(initialize); + if (behaviour) behaviours = Util.toArray(behaviour); - particle.reset(); - InitializeUtil.initialize(this, particle, initializes); - particle.addBehaviours(behaviours); - particle.parent = this; + particle.reset(); + InitializeUtil.initialize(this, particle, initializes); + particle.addBehaviours(behaviours); + particle.parent = this; - this.particles.push(particle); - } - }, { - key: 'remove', - value: function remove() { - this.stop(); - Util.destroy(this.particles); - } + this.particles.push(particle); + } + }, { + key: "remove", + value: function remove() { + this.stop(); + Util.destroyAll(this.particles); + } - /** - * Destory this Emitter - * @method destroy - */ + /** + * Destory this Emitter + * @method destroy + */ - }, { - key: 'destroy', - value: function destroy(slow) { - this.dead = true; - this.remove(); - this.removeAllInitializers(); - this.removeAllBehaviours(); - this.parent && this.parent.removeEmitter(this); - } - }]); - return Emitter; + }, { + key: "destroy", + value: function destroy() { + this.dead = true; + this.remove(); + this.removeAllInitializers(); + this.removeAllBehaviours(); + this.parent && this.parent.removeEmitter(this); + } + }]); + return Emitter; }(Particle); -Emitter.ID = 0; EventDispatcher.bind(Emitter); var BehaviourEmitter = function (_Emitter) { - inherits(BehaviourEmitter, _Emitter); - - /** - * The BehaviourEmitter class inherits from Proton.Emitter - * - * use the BehaviourEmitter you can add behaviours to self; - * @class Proton.BehaviourEmitter - * @constructor - * @param {Object} pObj the parameters object; - */ - function BehaviourEmitter(pObj) { - classCallCheck(this, BehaviourEmitter); - - var _this = possibleConstructorReturn(this, (BehaviourEmitter.__proto__ || Object.getPrototypeOf(BehaviourEmitter)).call(this, pObj)); + inherits(BehaviourEmitter, _Emitter); - _this.selfBehaviours = []; - return _this; - } + /** + * The BehaviourEmitter class inherits from Proton.Emitter + * + * use the BehaviourEmitter you can add behaviours to self; + * @class Proton.BehaviourEmitter + * @constructor + * @param {Object} conf the parameters object; + */ + function BehaviourEmitter(conf) { + classCallCheck(this, BehaviourEmitter); - createClass(BehaviourEmitter, [{ - key: 'addSelfBehaviour', + var _this = possibleConstructorReturn(this, (BehaviourEmitter.__proto__ || Object.getPrototypeOf(BehaviourEmitter)).call(this, conf)); + _this.selfBehaviours = []; + return _this; + } - /** + /** * add the Behaviour to emitter; * * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3); * @method addSelfBehaviour * @param {Proton.Behaviour} behaviour like this new Proton.Color('random') */ - value: function addSelfBehaviour() { - for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) { - rest[_key] = arguments[_key]; - } - var length = rest.length; - var i = void 0; - for (i = 0; i < length; i++) { - this.selfBehaviours.push(rest[i]); - } - } - }, { - key: 'removeSelfBehaviour', + createClass(BehaviourEmitter, [{ + key: "addSelfBehaviour", + value: function addSelfBehaviour() { + for (var _len = arguments.length, rest = Array(_len), _key = 0; _key < _len; _key++) { + rest[_key] = arguments[_key]; + } + var i = void 0, + length = rest.length; - /** - * remove the Behaviour for self - * @method removeSelfBehaviour - * @param {Proton.Behaviour} behaviour a behaviour - */ - value: function removeSelfBehaviour(behaviour) { - var index = this.selfBehaviours.indexOf(behaviour); - if (index > -1) this.selfBehaviours.splice(index, 1); - } - }, { - key: 'update', - value: function update(time) { - get(BehaviourEmitter.prototype.__proto__ || Object.getPrototypeOf(BehaviourEmitter.prototype), 'update', this).call(this, time); + for (i = 0; i < length; i++) { + this.selfBehaviours.push(rest[i]); + } + } - if (!this.sleep) { - var length = this.selfBehaviours.length; - var i = void 0; + /** + * remove the Behaviour for self + * @method removeSelfBehaviour + * @param {Proton.Behaviour} behaviour a behaviour + */ - for (i = 0; i < length; i++) { - this.selfBehaviours[i].applyBehaviour(this, time, i); - } - } - } - }]); - return BehaviourEmitter; + }, { + key: "removeSelfBehaviour", + value: function removeSelfBehaviour(behaviour) { + var index = this.selfBehaviours.indexOf(behaviour); + if (index > -1) this.selfBehaviours.splice(index, 1); + } + }, { + key: "update", + value: function update(time) { + get(BehaviourEmitter.prototype.__proto__ || Object.getPrototypeOf(BehaviourEmitter.prototype), "update", this).call(this, time); + + if (!this.sleep) { + var length = this.selfBehaviours.length; + var i = void 0; + + for (i = 0; i < length; i++) { + this.selfBehaviours[i].applyBehaviour(this, time, i); + } + } + } + }]); + return BehaviourEmitter; }(Emitter); var FollowEmitter = function (_Emitter) { - inherits(FollowEmitter, _Emitter); - - /** - * The FollowEmitter class inherits from Proton.Emitter - * - * use the FollowEmitter will emit particle when mousemoving - * - * @class Proton.FollowEmitter - * @constructor - * @param {Element} mouseTarget mouseevent's target; - * @param {Number} ease the easing of following speed; - * @default 0.7 - * @param {Object} pObj the parameters object; - */ - function FollowEmitter(mouseTarget, ease, pObj) { - classCallCheck(this, FollowEmitter); + inherits(FollowEmitter, _Emitter); - var _this = possibleConstructorReturn(this, (FollowEmitter.__proto__ || Object.getPrototypeOf(FollowEmitter)).call(this, pObj)); + /** + * The FollowEmitter class inherits from Proton.Emitter + * + * use the FollowEmitter will emit particle when mousemoving + * + * @class Proton.FollowEmitter + * @constructor + * @param {Element} mouseTarget mouseevent's target; + * @param {Number} ease the easing of following speed; + * @default 0.7 + * @param {Object} conf the parameters object; + */ + function FollowEmitter(mouseTarget, ease, conf) { + classCallCheck(this, FollowEmitter); - _this.mouseTarget = Util.initValue(mouseTarget, window); - _this.ease = Util.initValue(ease, 0.7); + var _this = possibleConstructorReturn(this, (FollowEmitter.__proto__ || Object.getPrototypeOf(FollowEmitter)).call(this, conf)); - _this._allowEmitting = false; - _this.initEventHandler(); - return _this; - } + _this.mouseTarget = Util.initValue(mouseTarget, window); + _this.ease = Util.initValue(ease, 0.7); - createClass(FollowEmitter, [{ - key: 'initEventHandler', - value: function initEventHandler() { - var _this2 = this; - - this.mousemoveHandler = function (e) { - return _this2.mousemove.call(_this2, e); - }; - this.mousedownHandler = function (e) { - return _this2.mousedown.call(_this2, e); - }; - this.mouseupHandler = function (e) { - return _this2.mouseup.call(_this2, e); - }; - - this.mouseTarget.addEventListener('mousemove', this.mousemoveHandler, false); - } + _this._allowEmitting = false; + _this.initEventHandler(); + return _this; + } - /** - * start emit particle - * @method emit - */ + createClass(FollowEmitter, [{ + key: "initEventHandler", + value: function initEventHandler() { + var _this2 = this; + + this.mousemoveHandler = function (e) { + return _this2.mousemove.call(_this2, e); + }; + this.mousedownHandler = function (e) { + return _this2.mousedown.call(_this2, e); + }; + this.mouseupHandler = function (e) { + return _this2.mouseup.call(_this2, e); + }; + + this.mouseTarget.addEventListener("mousemove", this.mousemoveHandler, false); + } - }, { - key: 'emit', - value: function emit() { - this._allowEmitting = true; - } + /** + * start emit particle + * @method emit + */ - /** - * stop emiting - * @method stop - */ + }, { + key: "emit", + value: function emit() { + this._allowEmitting = true; + } - }, { - key: 'stop', - value: function stop() { - this._allowEmitting = false; - } - }, { - key: 'mousemove', - value: function mousemove(e) { - if (e.layerX || e.layerX === 0) { - this.p.x += (e.layerX - this.p.x) * this.ease; - this.p.y += (e.layerY - this.p.y) * this.ease; - } else if (e.offsetX || e.offsetX === 0) { - this.p.x += (e.offsetX - this.p.x) * this.ease; - this.p.y += (e.offsetY - this.p.y) * this.ease; - } + /** + * stop emiting + * @method stop + */ - if (this._allowEmitting) get(FollowEmitter.prototype.__proto__ || Object.getPrototypeOf(FollowEmitter.prototype), 'emit', this).call(this, 'once'); - } - }, { - key: 'destroy', + }, { + key: "stop", + value: function stop() { + this._allowEmitting = false; + } + }, { + key: "mousemove", + value: function mousemove(e) { + if (e.layerX || e.layerX === 0) { + this.p.x += (e.layerX - this.p.x) * this.ease; + this.p.y += (e.layerY - this.p.y) * this.ease; + } else if (e.offsetX || e.offsetX === 0) { + this.p.x += (e.offsetX - this.p.x) * this.ease; + this.p.y += (e.offsetY - this.p.y) * this.ease; + } + + if (this._allowEmitting) get(FollowEmitter.prototype.__proto__ || Object.getPrototypeOf(FollowEmitter.prototype), "emit", this).call(this, "once"); + } + /** + * Destory this Emitter + * @method destroy + */ - /** - * Destory this Emitter - * @method destroy - */ - value: function destroy() { - get(FollowEmitter.prototype.__proto__ || Object.getPrototypeOf(FollowEmitter.prototype), 'destroy', this).call(this); - this.mouseTarget.removeEventListener('mousemove', this.mousemoveHandler, false); - } - }]); - return FollowEmitter; + }, { + key: "destroy", + value: function destroy() { + get(FollowEmitter.prototype.__proto__ || Object.getPrototypeOf(FollowEmitter.prototype), "destroy", this).call(this); + this.mouseTarget.removeEventListener("mousemove", this.mousemoveHandler, false); + } + }]); + return FollowEmitter; }(Emitter); var BaseRenderer = function () { function BaseRenderer(element, stroke) { classCallCheck(this, BaseRenderer); + this.pool = new Pool(); this.element = element; this.stroke = stroke; + this.circleConf = { isCircle: true }; this.initHandler(); - - this.circleConf = { isCircle: true }; - this.pool = new Pool(); - this.name = 'BaseRenderer'; + this.name = "BaseRenderer"; } createClass(BaseRenderer, [{ - key: 'setStroke', - value: function setStroke(color, thinkness) { - color = Util.initValue(color, '#000000'); - thinkness = Util.initValue(thinkness, 1); + key: "setStroke", + value: function setStroke() { + var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "#000000"; + var thinkness = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; this.stroke = { color: color, thinkness: thinkness }; } }, { - key: 'initHandler', + key: "initHandler", value: function initHandler() { var _this = this; this._protonUpdateHandler = function () { _this.onProtonUpdate.call(_this); }; + this._protonUpdateAfterHandler = function () { _this.onProtonUpdateAfter.call(_this); }; + this._emitterAddedHandler = function (emitter) { _this.onEmitterAdded.call(_this, emitter); }; + this._emitterRemovedHandler = function (emitter) { _this.onEmitterRemoved.call(_this, emitter); }; + this._particleCreatedHandler = function (particle) { _this.onParticleCreated.call(_this, particle); }; + this._particleUpdateHandler = function (particle) { _this.onParticleUpdate.call(_this, particle); }; + this._particleDeadHandler = function (particle) { _this.onParticleDead.call(_this, particle); }; } }, { - key: 'init', + key: "init", value: function init(proton) { this.parent = proton; - proton.addEventListener('PROTON_UPDATE', this._protonUpdateHandler); - proton.addEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler); + proton.addEventListener("PROTON_UPDATE", this._protonUpdateHandler); + proton.addEventListener("PROTON_UPDATE_AFTER", this._protonUpdateAfterHandler); - proton.addEventListener('EMITTER_ADDED', this._emitterAddedHandler); - proton.addEventListener('EMITTER_REMOVED', this._emitterRemovedHandler); + proton.addEventListener("EMITTER_ADDED", this._emitterAddedHandler); + proton.addEventListener("EMITTER_REMOVED", this._emitterRemovedHandler); - proton.addEventListener('PARTICLE_CREATED', this._particleCreatedHandler); - proton.addEventListener('PARTICLE_UPDATE', this._particleUpdateHandler); - proton.addEventListener('PARTICLE_DEAD', this._particleDeadHandler); + proton.addEventListener("PARTICLE_CREATED", this._particleCreatedHandler); + proton.addEventListener("PARTICLE_UPDATE", this._particleUpdateHandler); + proton.addEventListener("PARTICLE_DEAD", this._particleDeadHandler); } }, { - key: 'resize', + key: "resize", value: function resize(width, height) {} }, { - key: 'destroy', + key: "destroy", value: function destroy() { this.remove(); } }, { - key: 'remove', + key: "remove", value: function remove(proton) { - this.parent.removeEventListener('PROTON_UPDATE', this._protonUpdateHandler); - this.parent.removeEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler); + this.parent.removeEventListener("PROTON_UPDATE", this._protonUpdateHandler); + this.parent.removeEventListener("PROTON_UPDATE_AFTER", this._protonUpdateAfterHandler); - this.parent.removeEventListener('EMITTER_ADDED', this._emitterAddedHandler); - this.parent.removeEventListener('EMITTER_REMOVED', this._emitterRemovedHandler); + this.parent.removeEventListener("EMITTER_ADDED", this._emitterAddedHandler); + this.parent.removeEventListener("EMITTER_REMOVED", this._emitterRemovedHandler); - this.parent.removeEventListener('PARTICLE_CREATED', this._particleCreatedHandler); - this.parent.removeEventListener('PARTICLE_UPDATE', this._particleUpdateHandler); - this.parent.removeEventListener('PARTICLE_DEAD', this._particleDeadHandler); + this.parent.removeEventListener("PARTICLE_CREATED", this._particleCreatedHandler); + this.parent.removeEventListener("PARTICLE_UPDATE", this._particleUpdateHandler); + this.parent.removeEventListener("PARTICLE_DEAD", this._particleDeadHandler); this.parent = null; } }, { - key: 'onProtonUpdate', + key: "onProtonUpdate", value: function onProtonUpdate() {} }, { - key: 'onProtonUpdateAfter', + key: "onProtonUpdateAfter", value: function onProtonUpdateAfter() {} }, { - key: 'onEmitterAdded', + key: "onEmitterAdded", value: function onEmitterAdded(emitter) {} }, { - key: 'onEmitterRemoved', + key: "onEmitterRemoved", value: function onEmitterRemoved(emitter) {} }, { - key: 'onParticleCreated', + key: "onParticleCreated", value: function onParticleCreated(particle) {} }, { - key: 'onParticleUpdate', + key: "onParticleUpdate", value: function onParticleUpdate(particle) {} }, { - key: 'onParticleDead', + key: "onParticleDead", value: function onParticleDead(particle) {} }]); return BaseRenderer; @@ -4274,31 +4355,34 @@ var CanvasRenderer = function (_BaseRenderer) { var _this = possibleConstructorReturn(this, (CanvasRenderer.__proto__ || Object.getPrototypeOf(CanvasRenderer)).call(this, element)); _this.stroke = null; - _this.context = _this.element.getContext('2d'); + _this.context = _this.element.getContext("2d"); _this.bufferCache = {}; - - _this.name = 'CanvasRenderer'; + _this.name = "CanvasRenderer"; return _this; } createClass(CanvasRenderer, [{ - key: 'resize', + key: "resize", value: function resize(width, height) { this.element.width = width; this.element.height = height; } }, { - key: 'onProtonUpdate', + key: "onProtonUpdate", value: function onProtonUpdate() { this.context.clearRect(0, 0, this.element.width, this.element.height); } }, { - key: 'onParticleCreated', + key: "onParticleCreated", value: function onParticleCreated(particle) { - if (particle.body) ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);else particle.color = particle.color || '#ff0000'; + if (particle.body) { + ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle); + } else { + particle.color = particle.color || "#ff0000"; + } } }, { - key: 'onParticleUpdate', + key: "onParticleUpdate", value: function onParticleUpdate(particle) { if (particle.body) { if (particle.body instanceof Image) this.drawImage(particle); @@ -4307,7 +4391,7 @@ var CanvasRenderer = function (_BaseRenderer) { } } }, { - key: 'onParticleDead', + key: "onParticleDead", value: function onParticleDead(particle) { particle.body = null; } @@ -4315,7 +4399,7 @@ var CanvasRenderer = function (_BaseRenderer) { // private }, { - key: 'addImg2Body', + key: "addImg2Body", value: function addImg2Body(img, particle) { particle.body = img; } @@ -4323,7 +4407,7 @@ var CanvasRenderer = function (_BaseRenderer) { // private drawCircle }, { - key: 'drawImage', + key: "drawImage", value: function drawImage(particle) { var w = particle.body.width * particle.scale | 0; var h = particle.body.height * particle.scale | 0; @@ -4331,26 +4415,26 @@ var CanvasRenderer = function (_BaseRenderer) { var y = particle.p.y - h / 2; if (!!particle.color) { - if (!particle.transform['buffer']) particle.transform.buffer = this.createBuffer(particle.body); + if (!particle.data["buffer"]) particle.data.buffer = this.createBuffer(particle.body); - var bufferContext = particle.transform.buffer.getContext('2d'); - bufferContext.clearRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height); - bufferContext.globalAlpha = particle.alpha; - bufferContext.drawImage(particle.body, 0, 0); + var bufContext = particle.data.buffer.getContext("2d"); + bufContext.clearRect(0, 0, particle.data.buffer.width, particle.data.buffer.height); + bufContext.globalAlpha = particle.alpha; + bufContext.drawImage(particle.body, 0, 0); - bufferContext.globalCompositeOperation = 'source-atop'; - bufferContext.fillStyle = ColorUtil.rgbToHex(particle.transform.rgb); - bufferContext.fillRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height); - bufferContext.globalCompositeOperation = 'source-over'; - bufferContext.globalAlpha = 1; + bufContext.globalCompositeOperation = "source-atop"; + bufContext.fillStyle = ColorUtil.rgbToHex(particle.rgb); + bufContext.fillRect(0, 0, particle.data.buffer.width, particle.data.buffer.height); + bufContext.globalCompositeOperation = "source-over"; + bufContext.globalAlpha = 1; - this.context.drawImage(particle.transform.buffer, 0, 0, particle.transform.buffer.width, particle.transform.buffer.height, x, y, w, h); + this.context.drawImage(particle.data.buffer, 0, 0, particle.data.buffer.width, particle.data.buffer.height, x, y, w, h); } else { this.context.save(); this.context.globalAlpha = particle.alpha; this.context.translate(particle.p.x, particle.p.y); - this.context.rotate(MathUtils.degreeTransform(particle.rotation)); + this.context.rotate(MathUtil.degreeTransform(particle.rotation)); this.context.translate(-particle.p.x, -particle.p.y); this.context.drawImage(particle.body, 0, 0, particle.body.width, particle.body.height, x, y, w, h); @@ -4362,9 +4446,13 @@ var CanvasRenderer = function (_BaseRenderer) { // private drawCircle -- }, { - key: 'drawCircle', + key: "drawCircle", value: function drawCircle(particle) { - if (particle.transform['rgb']) this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')';else this.context.fillStyle = particle.color; + if (particle.rgb) { + this.context.fillStyle = "rgba(" + particle.rgb.r + "," + particle.rgb.g + "," + particle.rgb.b + "," + particle.alpha + ")"; + } else { + this.context.fillStyle = particle.color; + } // draw circle this.context.beginPath(); @@ -4380,17 +4468,17 @@ var CanvasRenderer = function (_BaseRenderer) { this.context.fill(); } - // private createBuffer -- + // private createBuffer }, { - key: 'createBuffer', + key: "createBuffer", value: function createBuffer(image) { if (image instanceof Image) { - var size = image.width + '_' + image.height; + var size = image.width + "_" + image.height; var canvas = this.bufferCache[size]; if (!canvas) { - canvas = document.createElement('canvas'); + canvas = document.createElement("canvas"); canvas.width = image.width; canvas.height = image.height; this.bufferCache[size] = canvas; @@ -4404,420 +4492,421 @@ var CanvasRenderer = function (_BaseRenderer) { }(BaseRenderer); var DomRenderer = function (_BaseRenderer) { - inherits(DomRenderer, _BaseRenderer); + inherits(DomRenderer, _BaseRenderer); - function DomRenderer(element) { - classCallCheck(this, DomRenderer); + function DomRenderer(element) { + classCallCheck(this, DomRenderer); - var _this = possibleConstructorReturn(this, (DomRenderer.__proto__ || Object.getPrototypeOf(DomRenderer)).call(this, element)); + var _this = possibleConstructorReturn(this, (DomRenderer.__proto__ || Object.getPrototypeOf(DomRenderer)).call(this, element)); - _this.stroke = null; - _this.pool.create = function (body, particle) { - return _this.createBody(body, particle); - }; - _this.addImg2Body = _this.addImg2Body.bind(_this); + _this.stroke = null; + _this.pool.create = function (body, particle) { + return _this.createBody(body, particle); + }; + _this.addImg2Body = _this.addImg2Body.bind(_this); - _this.transform3d = false; + _this.transform3d = false; + _this.name = "DomRenderer"; + return _this; + } - _this.name = 'DomRenderer'; - return _this; + createClass(DomRenderer, [{ + key: "onParticleCreated", + value: function onParticleCreated(particle) { + if (particle.body) { + ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle); + } else { + particle.body = this.pool.get(this.circleConf, particle); + this.element.appendChild(particle.body); + } } + }, { + key: "onParticleUpdate", + value: function onParticleUpdate(particle) { + if (this.bodyReady(particle)) { + if (this.transform3d) DomUtil.transform3d(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);else DomUtil.transform(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation); - createClass(DomRenderer, [{ - key: 'onParticleCreated', - value: function onParticleCreated(particle) { - if (particle.body) { - ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle); - } else { - particle.body = this.pool.get(this.circleConf, particle); - this.element.appendChild(particle.body); - } - } - }, { - key: 'onParticleUpdate', - value: function onParticleUpdate(particle) { - if (this.bodyReady(particle)) { - if (this.transform3d) DomUtil.transform3d(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);else DomUtil.transform(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation); - - particle.body.style.opacity = particle.alpha; - if (particle.body.isCircle) { - particle.body.style.backgroundColor = particle.color || '#ff0000'; - } - } - } - }, { - key: 'onParticleDead', - value: function onParticleDead(particle) { - if (this.bodyReady(particle)) { - this.element.removeChild(particle.body); - this.pool.expire(particle.body); - particle.body = null; - } - } - }, { - key: 'bodyReady', - value: function bodyReady(particle) { - return _typeof(particle.body) === 'object' && particle.body && !particle.body.isInner; - } - - // private - - }, { - key: 'addImg2Body', - value: function addImg2Body(img, particle) { - if (particle.dead) return; - particle.body = this.pool.get(img, particle); - DomUtil.resize(particle.body, img.width, img.height); - - this.element.appendChild(particle.body); - } - }, { - key: 'createBody', - value: function createBody(body, particle) { - if (body.isCircle) return this.createCircle(particle);else return this.createSprite(body, particle); + particle.body.style.opacity = particle.alpha; + if (particle.body.isCircle) { + particle.body.style.backgroundColor = particle.color || "#ff0000"; } + } + } + }, { + key: "onParticleDead", + value: function onParticleDead(particle) { + if (this.bodyReady(particle)) { + this.element.removeChild(particle.body); + this.pool.expire(particle.body); + particle.body = null; + } + } + }, { + key: "bodyReady", + value: function bodyReady(particle) { + return _typeof(particle.body) === "object" && particle.body && !particle.body.isInner; + } - // private -- - - }, { - key: 'createCircle', - value: function createCircle(particle) { - var dom = DomUtil.createDiv(particle.id + '_dom', 2 * particle.radius, 2 * particle.radius); - dom.style.borderRadius = particle.radius + 'px'; - - if (this.stroke) { - dom.style.borderColor = this.stroke.color; - dom.style.borderWidth = this.stroke.thinkness + 'px'; - } - dom.isCircle = true; + // private - return dom; - } - }, { - key: 'createSprite', - value: function createSprite(body, particle) { - var url = typeof body === 'string' ? body : body.src; - var dom = DomUtil.createDiv(particle.id + '_dom', body.width, body.height); - dom.style.backgroundImage = 'url(' + url + ')'; + }, { + key: "addImg2Body", + value: function addImg2Body(img, particle) { + if (particle.dead) return; + particle.body = this.pool.get(img, particle); + DomUtil.resize(particle.body, img.width, img.height); - return dom; - } - }]); - return DomRenderer; -}(BaseRenderer); + this.element.appendChild(particle.body); + } + }, { + key: "createBody", + value: function createBody(body, particle) { + if (body.isCircle) return this.createCircle(particle);else return this.createSprite(body, particle); + } -var EaselRenderer = function (_BaseRenderer) { - inherits(EaselRenderer, _BaseRenderer); + // private -- - function EaselRenderer(element, stroke) { - classCallCheck(this, EaselRenderer); + }, { + key: "createCircle", + value: function createCircle(particle) { + var dom = DomUtil.createDiv(particle.id + "_dom", 2 * particle.radius, 2 * particle.radius); + dom.style.borderRadius = particle.radius + "px"; - var _this = possibleConstructorReturn(this, (EaselRenderer.__proto__ || Object.getPrototypeOf(EaselRenderer)).call(this, element)); + if (this.stroke) { + dom.style.borderColor = this.stroke.color; + dom.style.borderWidth = this.stroke.thinkness + "px"; + } + dom.isCircle = true; - _this.stroke = stroke; - _this.name = 'EaselRenderer'; - return _this; + return dom; } + }, { + key: "createSprite", + value: function createSprite(body, particle) { + var url = typeof body === "string" ? body : body.src; + var dom = DomUtil.createDiv(particle.id + "_dom", body.width, body.height); + dom.style.backgroundImage = "url(" + url + ")"; + + return dom; + } + }]); + return DomRenderer; +}(BaseRenderer); - createClass(EaselRenderer, [{ - key: 'onParticleCreated', - value: function onParticleCreated(particle) { - if (particle.body) { - this.createSprite(particle); - } else { - this.createCircle(particle); - } - - this.element.addChild(particle.body); - } - }, { - key: 'onParticleUpdate', - value: function onParticleUpdate(particle) { - if (particle.body) { - particle.body.x = particle.p.x; - particle.body.y = particle.p.y; - - particle.body.alpha = particle.alpha; - particle.body.scaleX = particle.body.scaleY = particle.scale; - particle.body.rotation = particle.rotation; - } - } - }, { - key: 'onParticleDead', - value: function onParticleDead(particle) { - if (particle.body) { - particle.body.parent && particle.body.parent.removeChild(particle.body); - this.pool.expire(particle.body); - particle.body = null; - } +var EaselRenderer = function (_BaseRenderer) { + inherits(EaselRenderer, _BaseRenderer); - if (particle.graphics) this.pool.expire(particle.graphics); - } + function EaselRenderer(element, stroke) { + classCallCheck(this, EaselRenderer); - // private + var _this = possibleConstructorReturn(this, (EaselRenderer.__proto__ || Object.getPrototypeOf(EaselRenderer)).call(this, element)); - }, { - key: 'createSprite', - value: function createSprite(particle) { - particle.body = this.pool.get(particle.body); - - if (particle.body.parent) return; - if (particle.body['image']) { - particle.body.regX = particle.body.image.width / 2; - particle.body.regY = particle.body.image.height / 2; - } - } - }, { - key: 'createCircle', - value: function createCircle(particle) { - var graphics = this.pool.get(createjs.Graphics); + _this.stroke = stroke; + _this.name = "EaselRenderer"; + return _this; + } - if (this.stroke) { - if (this.stroke instanceof String) graphics.beginStroke(this.stroke);else graphics.beginStroke('#000000'); - } - graphics.beginFill(particle.color || '#ff0000').drawCircle(0, 0, particle.radius); + createClass(EaselRenderer, [{ + key: "onParticleCreated", + value: function onParticleCreated(particle) { + if (particle.body) { + this.createSprite(particle); + } else { + this.createCircle(particle); + } - var shape = this.pool.get(createjs.Shape, [graphics]); + this.element.addChild(particle.body); + } + }, { + key: "onParticleUpdate", + value: function onParticleUpdate(particle) { + if (particle.body) { + particle.body.x = particle.p.x; + particle.body.y = particle.p.y; + + particle.body.alpha = particle.alpha; + particle.body.scaleX = particle.body.scaleY = particle.scale; + particle.body.rotation = particle.rotation; + } + } + }, { + key: "onParticleDead", + value: function onParticleDead(particle) { + if (particle.body) { + particle.body.parent && particle.body.parent.removeChild(particle.body); + this.pool.expire(particle.body); + particle.body = null; + } + + if (particle.graphics) this.pool.expire(particle.graphics); + } - particle.body = shape; - particle.graphics = graphics; - } - }]); - return EaselRenderer; -}(BaseRenderer); + // private -var PixelRenderer = function (_BaseRenderer) { - inherits(PixelRenderer, _BaseRenderer); + }, { + key: "createSprite", + value: function createSprite(particle) { + particle.body = this.pool.get(particle.body); - function PixelRenderer(element, rectangle) { - classCallCheck(this, PixelRenderer); + if (particle.body.parent) return; + if (particle.body["image"]) { + particle.body.regX = particle.body.image.width / 2; + particle.body.regY = particle.body.image.height / 2; + } + } + }, { + key: "createCircle", + value: function createCircle(particle) { + var graphics = this.pool.get(createjs.Graphics); - var _this = possibleConstructorReturn(this, (PixelRenderer.__proto__ || Object.getPrototypeOf(PixelRenderer)).call(this, element)); + if (this.stroke) { + if (this.stroke instanceof String) graphics.beginStroke(this.stroke);else graphics.beginStroke("#000000"); + } + graphics.beginFill(particle.color || "#ff0000").drawCircle(0, 0, particle.radius); - _this.context = _this.element.getContext('2d'); - _this.imageData = null; - _this.rectangle = null; - _this.rectangle = rectangle; - _this.createImageData(rectangle); + var shape = this.pool.get(createjs.Shape, [graphics]); - _this.name = 'PixelRenderer'; - return _this; + particle.body = shape; + particle.graphics = graphics; } + }]); + return EaselRenderer; +}(BaseRenderer); - createClass(PixelRenderer, [{ - key: 'resize', - value: function resize(width, height) { - this.element.width = width; - this.element.height = height; - } - }, { - key: 'createImageData', - value: function createImageData(rectangle) { - this.rectangle = rectangle ? rectangle : new Rectangle(0, 0, this.element.width, this.element.height); - this.imageData = this.context.createImageData(this.rectangle.width, this.rectangle.height); - this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y); - } - }, { - key: 'onProtonUpdate', - value: function onProtonUpdate() { - this.context.clearRect(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height); - this.imageData = this.context.getImageData(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height); - } - }, { - key: 'onProtonUpdateAfter', - value: function onProtonUpdateAfter() { - this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y); - } - }, { - key: 'onParticleCreated', - value: function onParticleCreated(particle) {} - }, { - key: 'onParticleUpdate', - value: function onParticleUpdate(particle) { - if (this.imageData) { - this.setPixel(this.imageData, Math.floor(particle.p.x - this.rectangle.x), Math.floor(particle.p.y - this.rectangle.y), particle); - } - } - }, { - key: 'setPixel', - value: function setPixel(imagedata, x, y, particle) { - var rgb = particle.transform.rgb; +var PixelRenderer = function (_BaseRenderer) { + inherits(PixelRenderer, _BaseRenderer); - if (x < 0 || x > this.element.width || y < 0 || y > this.elementwidth) return; + function PixelRenderer(element, rectangle) { + classCallCheck(this, PixelRenderer); - var i = ((y >> 0) * imagedata.width + (x >> 0)) * 4; + var _this = possibleConstructorReturn(this, (PixelRenderer.__proto__ || Object.getPrototypeOf(PixelRenderer)).call(this, element)); - imagedata.data[i] = rgb.r; - imagedata.data[i + 1] = rgb.g; - imagedata.data[i + 2] = rgb.b; - imagedata.data[i + 3] = particle.alpha * 255; - } - }, { - key: 'onParticleDead', - value: function onParticleDead(particle) {} - }]); - return PixelRenderer; + _this.context = _this.element.getContext("2d"); + _this.imageData = null; + _this.rectangle = null; + _this.rectangle = rectangle; + _this.createImageData(rectangle); + + _this.name = "PixelRenderer"; + return _this; + } + + createClass(PixelRenderer, [{ + key: "resize", + value: function resize(width, height) { + this.element.width = width; + this.element.height = height; + } + }, { + key: "createImageData", + value: function createImageData(rectangle) { + this.rectangle = rectangle ? rectangle : new Rectangle(0, 0, this.element.width, this.element.height); + this.imageData = this.context.createImageData(this.rectangle.width, this.rectangle.height); + this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y); + } + }, { + key: "onProtonUpdate", + value: function onProtonUpdate() { + this.context.clearRect(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height); + this.imageData = this.context.getImageData(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height); + } + }, { + key: "onProtonUpdateAfter", + value: function onProtonUpdateAfter() { + this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y); + } + }, { + key: "onParticleCreated", + value: function onParticleCreated(particle) {} + }, { + key: "onParticleUpdate", + value: function onParticleUpdate(particle) { + if (this.imageData) { + this.setPixel(this.imageData, Math.floor(particle.p.x - this.rectangle.x), Math.floor(particle.p.y - this.rectangle.y), particle); + } + } + }, { + key: "setPixel", + value: function setPixel(imagedata, x, y, particle) { + var rgb = particle.rgb; + if (x < 0 || x > this.element.width || y < 0 || y > this.elementwidth) return; + + var i = ((y >> 0) * imagedata.width + (x >> 0)) * 4; + + imagedata.data[i] = rgb.r; + imagedata.data[i + 1] = rgb.g; + imagedata.data[i + 2] = rgb.b; + imagedata.data[i + 3] = particle.alpha * 255; + } + }, { + key: "onParticleDead", + value: function onParticleDead(particle) {} + }]); + return PixelRenderer; }(BaseRenderer); var PixiRenderer = function (_BaseRenderer) { - inherits(PixiRenderer, _BaseRenderer); + inherits(PixiRenderer, _BaseRenderer); - function PixiRenderer(element, stroke) { - classCallCheck(this, PixiRenderer); + function PixiRenderer(element, stroke) { + classCallCheck(this, PixiRenderer); - var _this = possibleConstructorReturn(this, (PixiRenderer.__proto__ || Object.getPrototypeOf(PixiRenderer)).call(this, element)); + var _this = possibleConstructorReturn(this, (PixiRenderer.__proto__ || Object.getPrototypeOf(PixiRenderer)).call(this, element)); - _this.stroke = stroke; - _this.setColor = false; - _this.pool.create = function (body, particle) { - return _this.createBody(body, particle); - }; - _this.name = 'PixiRenderer'; - return _this; - } + _this.stroke = stroke; + _this.setColor = false; + _this.pool.create = function (body, particle) { + return _this.createBody(body, particle); + }; + _this.createFromImage = PIXI.Sprite.from || PIXI.Sprite.fromImage; - createClass(PixiRenderer, [{ - key: 'onProtonUpdate', - value: function onProtonUpdate() {} + _this.name = "PixiRenderer"; + return _this; + } - /** - * @param particle - */ + createClass(PixiRenderer, [{ + key: "onProtonUpdate", + value: function onProtonUpdate() {} - }, { - key: 'onParticleCreated', - value: function onParticleCreated(particle) { - if (particle.body) { - particle.body = this.pool.get(particle.body, particle); - } else { - particle.body = this.pool.get(this.circleConf, particle); - } + /** + * @param particle + */ - this.element.addChild(particle.body); - } + }, { + key: "onParticleCreated", + value: function onParticleCreated(particle) { + if (particle.body) { + particle.body = this.pool.get(particle.body, particle); + } else { + particle.body = this.pool.get(this.circleConf, particle); + } - /** - * @param particle - */ + this.element.addChild(particle.body); + } - }, { - key: 'onParticleUpdate', - value: function onParticleUpdate(particle) { - this.transform(particle, particle.body); - if (this.setColor) particle.body.tint = ColorUtil.getHex16FromParticle(particle); - } + /** + * @param particle + */ - /** - * @param particle - */ + }, { + key: "onParticleUpdate", + value: function onParticleUpdate(particle) { + this.transform(particle, particle.body); + if (this.setColor) particle.body.tint = ColorUtil.getHex16FromParticle(particle); + } - }, { - key: 'onParticleDead', - value: function onParticleDead(particle) { - this.element.removeChild(particle.body); - this.pool.expire(particle.body); - particle.body = null; - } - }, { - key: 'destroy', - value: function destroy(particles) { - get(PixiRenderer.prototype.__proto__ || Object.getPrototypeOf(PixiRenderer.prototype), 'destroy', this).call(this); - this.pool.destroy(); + /** + * @param particle + */ - var i = particles.length; - while (i--) { - var particle = particles[i]; - if (particle.body) { - this.element.removeChild(particle.body); - } - } - } - }, { - key: 'transform', - value: function transform(particle, target) { - target.x = particle.p.x; - target.y = particle.p.y; + }, { + key: "onParticleDead", + value: function onParticleDead(particle) { + this.element.removeChild(particle.body); + this.pool.expire(particle.body); + particle.body = null; + } + }, { + key: "destroy", + value: function destroy(particles) { + get(PixiRenderer.prototype.__proto__ || Object.getPrototypeOf(PixiRenderer.prototype), "destroy", this).call(this); + this.pool.destroy(); + + var i = particles.length; + while (i--) { + var particle = particles[i]; + if (particle.body) { + this.element.removeChild(particle.body); + } + } + } + }, { + key: "transform", + value: function transform(particle, target) { + target.x = particle.p.x; + target.y = particle.p.y; - target.alpha = particle.alpha; + target.alpha = particle.alpha; - target.scale.x = particle.scale; - target.scale.y = particle.scale; + target.scale.x = particle.scale; + target.scale.y = particle.scale; - // using cached version of MathUtils.PI_180 for slight performance increase. - target.rotation = particle.rotation * MathUtils.PI_180; // MathUtils.PI_180; - } - }, { - key: 'createBody', - value: function createBody(body, particle) { - if (body.isCircle) return this.createCircle(particle);else return this.createSprite(body); - } - }, { - key: 'createSprite', - value: function createSprite(body) { - var sprite = body.isInner ? PIXI.Sprite.fromImage(body.src) : new PIXI.Sprite(body); - sprite.anchor.x = 0.5; - sprite.anchor.y = 0.5; + // using cached version of MathUtil.PI_180 for slight performance increase. + target.rotation = particle.rotation * MathUtil.PI_180; // MathUtil.PI_180; + } + }, { + key: "createBody", + value: function createBody(body, particle) { + if (body.isCircle) return this.createCircle(particle);else return this.createSprite(body); + } + }, { + key: "createSprite", + value: function createSprite(body) { + var sprite = body.isInner ? this.createFromImage(body.src) : new PIXI.Sprite(body); - return sprite; - } - }, { - key: 'createCircle', - value: function createCircle(particle) { - var graphics = new PIXI.Graphics(); + sprite.anchor.x = 0.5; + sprite.anchor.y = 0.5; - if (this.stroke) { - var stroke = this.stroke instanceof String ? this.stroke : 0x000000; - graphics.beginStroke(stroke); - } + return sprite; + } + }, { + key: "createCircle", + value: function createCircle(particle) { + var graphics = new PIXI.Graphics(); - graphics.beginFill(particle.color || 0x008ced); - graphics.drawCircle(0, 0, particle.radius); - graphics.endFill(); + if (this.stroke) { + var stroke = this.stroke instanceof String ? this.stroke : 0x000000; + graphics.beginStroke(stroke); + } - return graphics; - } - }]); - return PixiRenderer; + graphics.beginFill(particle.color || 0x008ced); + graphics.drawCircle(0, 0, particle.radius); + graphics.endFill(); + + return graphics; + } + }]); + return PixiRenderer; }(BaseRenderer); var MStack = function () { - function MStack() { - classCallCheck(this, MStack); + function MStack() { + classCallCheck(this, MStack); - this.mats = []; - this.size = 0; + this.mats = []; + this.size = 0; - for (var i = 0; i < 20; i++) { - this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0])); - } - } + for (var i = 0; i < 20; i++) { + this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0])); + } + } - createClass(MStack, [{ - key: 'set', - value: function set$$1(m, i) { - if (i === 0) Mat3.set(m, this.mats[0]);else Mat3.multiply(this.mats[i - 1], m, this.mats[i]); + createClass(MStack, [{ + key: "set", + value: function set$$1(m, i) { + if (i === 0) Mat3.set(m, this.mats[0]);else Mat3.multiply(this.mats[i - 1], m, this.mats[i]); - this.size = Math.max(this.size, i + 1); - } - }, { - key: 'push', - value: function push(m) { - if (this.size === 0) Mat3.set(m, this.mats[0]);else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]); + this.size = Math.max(this.size, i + 1); + } + }, { + key: "push", + value: function push(m) { + if (this.size === 0) Mat3.set(m, this.mats[0]);else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]); - this.size++; - } - }, { - key: 'pop', - value: function pop() { - if (this.size > 0) this.size--; - } - }, { - key: 'top', - value: function top() { - return this.mats[this.size - 1]; - } - }]); - return MStack; + this.size++; + } + }, { + key: "pop", + value: function pop() { + if (this.size > 0) this.size--; + } + }, { + key: "top", + value: function top() { + return this.mats[this.size - 1]; + } + }]); + return MStack; }(); var WebGLRenderer = function (_BaseRenderer) { @@ -4999,29 +5088,29 @@ var WebGLRenderer = function (_BaseRenderer) { var _scaleX = particle.body.width / _width; var _scaleY = particle.body.height / _height; - if (!this.texturebuffers[particle.transform.src]) this.texturebuffers[particle.transform.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()]; + if (!this.texturebuffers[particle.data.src]) this.texturebuffers[particle.data.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()]; - particle.transform.texture = this.texturebuffers[particle.transform.src][0]; - particle.transform.vcBuffer = this.texturebuffers[particle.transform.src][1]; - particle.transform.tcBuffer = this.texturebuffers[particle.transform.src][2]; + particle.data.texture = this.texturebuffers[particle.data.src][0]; + particle.data.vcBuffer = this.texturebuffers[particle.data.src][1]; + particle.data.tcBuffer = this.texturebuffers[particle.data.src][2]; - this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer); + this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer); this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _scaleX, 0.0, 0.0, _scaleY, _scaleY, _scaleY]), this.gl.STATIC_DRAW); - this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer); + this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer); this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _w, 0.0, 0.0, _h, _w, _h]), this.gl.STATIC_DRAW); - var context = particle.transform.canvas.getContext('2d'); + var context = particle.data.canvas.getContext('2d'); var data = context.getImageData(0, 0, _width, _height); - this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture); + this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture); this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data); this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR); this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST); this.gl.generateMipmap(this.gl.TEXTURE_2D); - particle.transform.textureLoaded = true; - particle.transform.textureWidth = _w; - particle.transform.textureHeight = _h; + particle.data.textureLoaded = true; + particle.data.textureWidth = _w; + particle.data.textureHeight = _h; } }, { key: 'onProtonUpdate', @@ -5032,17 +5121,17 @@ var WebGLRenderer = function (_BaseRenderer) { }, { key: 'onParticleCreated', value: function onParticleCreated(particle) { - particle.transform.textureLoaded = false; - particle.transform.tmat = Mat3.create(); - particle.transform.tmat[8] = 1; - particle.transform.imat = Mat3.create(); - particle.transform.imat[8] = 1; + particle.data.textureLoaded = false; + particle.data.tmat = Mat3.create(); + particle.data.tmat[8] = 1; + particle.data.imat = Mat3.create(); + particle.data.imat[8] = 1; if (particle.body) { ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle); } else { ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle); - particle.transform.oldScale = particle.radius / this.circleCanvasRadius; + particle.data.oldScale = particle.radius / this.circleCanvasRadius; } } @@ -5053,26 +5142,26 @@ var WebGLRenderer = function (_BaseRenderer) { value: function addImg2Body(img, particle) { if (particle.dead) return; particle.body = img; - particle.transform.src = img.src; - particle.transform.canvas = ImgUtil.getCanvasFromCache(img); - particle.transform.oldScale = 1; + particle.data.src = img.src; + particle.data.canvas = ImgUtil.getCanvasFromCache(img); + particle.data.oldScale = 1; this.drawImg2Canvas(particle); } }, { key: 'onParticleUpdate', value: function onParticleUpdate(particle) { - if (particle.transform.textureLoaded) { + if (particle.data.textureLoaded) { this.updateMatrix(particle); - this.gl.uniform3f(this.sprogram.color, particle.transform.rgb.r / 255, particle.transform.rgb.g / 255, particle.transform.rgb.b / 255); + this.gl.uniform3f(this.sprogram.color, particle.rgb.r / 255, particle.rgb.g / 255, particle.rgb.b / 255); this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top()); - this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer); + this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer); this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0); - this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer); + this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer); this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0); - this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture); + this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture); this.gl.uniform1i(this.sprogram.samplerUniform, 0); this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer); @@ -5087,20 +5176,20 @@ var WebGLRenderer = function (_BaseRenderer) { }, { key: 'updateMatrix', value: function updateMatrix(particle) { - var moveOriginMatrix = WebGLUtil.makeTranslation(-particle.transform.textureWidth / 2, -particle.transform.textureHeight / 2); + var moveOriginMatrix = WebGLUtil.makeTranslation(-particle.data.textureWidth / 2, -particle.data.textureHeight / 2); var translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y); - var angel = particle.rotation * MathUtils.PI_180; + var angel = particle.rotation * MathUtil.PI_180; var rotationMatrix = WebGLUtil.makeRotation(angel); - var scale = particle.scale * particle.transform.oldScale; + var scale = particle.scale * particle.data.oldScale; var scaleMatrix = WebGLUtil.makeScale(scale, scale); var matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix); matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix); matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix); - Mat3.inverse(matrix, particle.transform.imat); + Mat3.inverse(matrix, particle.data.imat); matrix[2] = particle.alpha; this.mstack.push(matrix); @@ -5110,426 +5199,437 @@ var WebGLRenderer = function (_BaseRenderer) { }(BaseRenderer); var CustomRenderer = function (_BaseRenderer) { - inherits(CustomRenderer, _BaseRenderer); + inherits(CustomRenderer, _BaseRenderer); - function CustomRenderer(element) { - classCallCheck(this, CustomRenderer); + function CustomRenderer(element) { + classCallCheck(this, CustomRenderer); - var _this = possibleConstructorReturn(this, (CustomRenderer.__proto__ || Object.getPrototypeOf(CustomRenderer)).call(this, element)); + var _this = possibleConstructorReturn(this, (CustomRenderer.__proto__ || Object.getPrototypeOf(CustomRenderer)).call(this, element)); - _this.name = 'CustomRenderer'; - return _this; - } + _this.name = "CustomRenderer"; + return _this; + } - return CustomRenderer; + return CustomRenderer; }(BaseRenderer); var LineZone = function (_Zone) { - inherits(LineZone, _Zone); - - function LineZone(x1, y1, x2, y2, direction) { - classCallCheck(this, LineZone); - - var _this = possibleConstructorReturn(this, (LineZone.__proto__ || Object.getPrototypeOf(LineZone)).call(this)); - - if (x2 - x1 >= 0) { - _this.x1 = x1; - _this.y1 = y1; - _this.x2 = x2; - _this.y2 = y2; - } else { - _this.x1 = x2; - _this.y1 = y2; - _this.x2 = x1; - _this.y2 = y1; - } + inherits(LineZone, _Zone); - _this.dx = _this.x2 - _this.x1; - _this.dy = _this.y2 - _this.y1; + function LineZone(x1, y1, x2, y2, direction) { + classCallCheck(this, LineZone); - _this.minx = Math.min(_this.x1, _this.x2); - _this.miny = Math.min(_this.y1, _this.y2); - _this.maxx = Math.max(_this.x1, _this.x2); - _this.maxy = Math.max(_this.y1, _this.y2); + var _this = possibleConstructorReturn(this, (LineZone.__proto__ || Object.getPrototypeOf(LineZone)).call(this)); - _this.dot = _this.x2 * _this.y1 - _this.x1 * _this.y2; - _this.xxyy = _this.dx * _this.dx + _this.dy * _this.dy; + if (x2 - x1 >= 0) { + _this.x1 = x1; + _this.y1 = y1; + _this.x2 = x2; + _this.y2 = y2; + } else { + _this.x1 = x2; + _this.y1 = y2; + _this.x2 = x1; + _this.y2 = y1; + } - _this.gradient = _this.getGradient(); - _this.length = _this.getLength(); - _this.direction = Util.initValue(direction, '>'); - return _this; - } + _this.dx = _this.x2 - _this.x1; + _this.dy = _this.y2 - _this.y1; - createClass(LineZone, [{ - key: 'getPosition', - value: function getPosition() { - this.random = Math.random(); - this.vector.x = this.x1 + this.random * this.length * Math.cos(this.gradient); - this.vector.y = this.y1 + this.random * this.length * Math.sin(this.gradient); + _this.minx = Math.min(_this.x1, _this.x2); + _this.miny = Math.min(_this.y1, _this.y2); + _this.maxx = Math.max(_this.x1, _this.x2); + _this.maxy = Math.max(_this.y1, _this.y2); - return this.vector; - } - }, { - key: 'getDirection', - value: function getDirection(x, y) { - var A = this.dy; - var B = -this.dx; - var C = this.dot; - var D = B === 0 ? 1 : B; - - if ((A * x + B * y + C) * D > 0) return true;else return false; - } - }, { - key: 'getDistance', - value: function getDistance(x, y) { - var A = this.dy; - var B = -this.dx; - var C = this.dot; - var D = A * x + B * y + C; - - return D / Math.sqrt(this.xxyy); - } - }, { - key: 'getSymmetric', - value: function getSymmetric(v) { - var tha2 = v.getGradient(); - var tha1 = this.getGradient(); - var tha = 2 * (tha1 - tha2); + _this.dot = _this.x2 * _this.y1 - _this.x1 * _this.y2; + _this.xxyy = _this.dx * _this.dx + _this.dy * _this.dy; - var oldx = v.x; - var oldy = v.y; + _this.gradient = _this.getGradient(); + _this.length = _this.getLength(); + _this.direction = Util.initValue(direction, ">"); + return _this; + } - v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha); - v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha); + createClass(LineZone, [{ + key: "getPosition", + value: function getPosition() { + this.random = Math.random(); - return v; - } - }, { - key: 'getGradient', - value: function getGradient() { - return Math.atan2(this.dy, this.dx); - } - }, { - key: 'rangeOut', - value: function rangeOut(particle) { - var angle = Math.abs(this.getGradient()); - - if (angle <= MathUtils.PI / 4) { - if (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true; - } else { - if (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true; - } + this.vector.x = this.x1 + this.random * this.length * Math.cos(this.gradient); + this.vector.y = this.y1 + this.random * this.length * Math.sin(this.gradient); - return false; - } - }, { - key: 'getLength', - value: function getLength() { - return Math.sqrt(this.dx * this.dx + this.dy * this.dy); - } - }, { - key: 'crossing', - value: function crossing(particle) { - if (this.crossType === 'dead') { - if (this.direction === '>' || this.direction === 'R' || this.direction === 'right' || this.direction === 'down') { - if (!this.rangeOut(particle)) return; - if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true; - } else { - if (!this.rangeOut(particle)) return; - if (!this.getDirection(particle.p.x, particle.p.y)) particle.dead = true; - } - } else if (this.crossType === 'bound') { - if (!this.rangeOut(particle)) return; - - if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) { - if (this.dx === 0) { - particle.v.x *= -1; - } else if (this.dy === 0) { - particle.v.y *= -1; - } else { - this.getSymmetric(particle.v); - } - } - } else if (this.crossType === 'cross') { - if (this.alert) { - console.error('Sorry lineZone does not support cross method'); - this.alert = false; - } - } - } - }]); - return LineZone; -}(Zone); + return this.vector; + } + }, { + key: "getDirection", + value: function getDirection(x, y) { + var A = this.dy; + var B = -this.dx; + var C = this.dot; + var D = B === 0 ? 1 : B; + + if ((A * x + B * y + C) * D > 0) return true;else return false; + } + }, { + key: "getDistance", + value: function getDistance(x, y) { + var A = this.dy; + var B = -this.dx; + var C = this.dot; + var D = A * x + B * y + C; + + return D / Math.sqrt(this.xxyy); + } + }, { + key: "getSymmetric", + value: function getSymmetric(v) { + var tha2 = v.getGradient(); + var tha1 = this.getGradient(); + var tha = 2 * (tha1 - tha2); -var CircleZone = function (_Zone) { - inherits(CircleZone, _Zone); + var oldx = v.x; + var oldy = v.y; - function CircleZone(x, y, radius) { - classCallCheck(this, CircleZone); + v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha); + v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha); - var _this = possibleConstructorReturn(this, (CircleZone.__proto__ || Object.getPrototypeOf(CircleZone)).call(this)); + return v; + } + }, { + key: "getGradient", + value: function getGradient() { + return Math.atan2(this.dy, this.dx); + } + }, { + key: "rangeOut", + value: function rangeOut(particle) { + var angle = Math.abs(this.getGradient()); + + if (angle <= MathUtil.PI / 4) { + if (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true; + } else { + if (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true; + } + + return false; + } + }, { + key: "getLength", + value: function getLength() { + return Math.sqrt(this.dx * this.dx + this.dy * this.dy); + } + }, { + key: "crossing", + value: function crossing(particle) { + if (this.crossType === "dead") { + if (this.direction === ">" || this.direction === "R" || this.direction === "right" || this.direction === "down") { + if (!this.rangeOut(particle)) return; + if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true; + } else { + if (!this.rangeOut(particle)) return; + if (!this.getDirection(particle.p.x, particle.p.y)) particle.dead = true; + } + } else if (this.crossType === "bound") { + if (!this.rangeOut(particle)) return; + + if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) { + if (this.dx === 0) { + particle.v.x *= -1; + } else if (this.dy === 0) { + particle.v.y *= -1; + } else { + this.getSymmetric(particle.v); + } + } + } else if (this.crossType === "cross") { + if (this.alert) { + console.error("Sorry, LineZone does not support cross method!"); + this.alert = false; + } + } + } + }]); + return LineZone; +}(Zone); - _this.x = x; - _this.y = y; - _this.radius = radius; +var CircleZone = function (_Zone) { + inherits(CircleZone, _Zone); - _this.angle = 0; - _this.center = { x: x, y: y }; - return _this; - } + function CircleZone(x, y, radius) { + classCallCheck(this, CircleZone); - createClass(CircleZone, [{ - key: 'getPosition', - value: function getPosition() { - this.random = Math.random(); - this.angle = MathUtils.PIx2 * Math.random(); + var _this = possibleConstructorReturn(this, (CircleZone.__proto__ || Object.getPrototypeOf(CircleZone)).call(this)); - this.vector.x = this.x + this.random * this.radius * Math.cos(this.angle); - this.vector.y = this.y + this.random * this.radius * Math.sin(this.angle); + _this.x = x; + _this.y = y; + _this.radius = radius; - return this.vector; - } - }, { - key: 'setCenter', - value: function setCenter(x, y) { - this.center.x = x; - this.center.y = y; - } - }, { - key: 'crossing', - value: function crossing(particle) { - var d = particle.p.distanceTo(this.center); - - if (this.crossType === 'dead') { - if (d - particle.radius > this.radius) particle.dead = true; - } else if (this.crossType === 'bound') { - if (d + particle.radius >= this.radius) this.getSymmetric(particle); - } else if (this.crossType === 'cross') { - if (this.alert) { - alert('Sorry CircleZone does not support cross method'); - this.alert = false; - } - } - } - }, { - key: 'getSymmetric', - value: function getSymmetric(particle) { - var tha2 = particle.v.getGradient(); - var tha1 = this.getGradient(particle); + _this.angle = 0; + _this.center = { x: x, y: y }; + return _this; + } - var tha = 2 * (tha1 - tha2); - var oldx = particle.v.x; - var oldy = particle.v.y; + createClass(CircleZone, [{ + key: "getPosition", + value: function getPosition() { + this.angle = MathUtil.PIx2 * Math.random(); + this.randomRadius = Math.random() * this.radius; - particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha); - particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha); - } - }, { - key: 'getGradient', - value: function getGradient(particle) { - return -MathUtils.PI_2 + Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x); - } - }]); - return CircleZone; + this.vector.x = this.x + this.randomRadius * Math.cos(this.angle); + this.vector.y = this.y + this.randomRadius * Math.sin(this.angle); + + return this.vector; + } + }, { + key: "setCenter", + value: function setCenter(x, y) { + this.center.x = x; + this.center.y = y; + } + }, { + key: "crossing", + value: function crossing(particle) { + var d = particle.p.distanceTo(this.center); + + if (this.crossType === "dead") { + if (d - particle.radius > this.radius) particle.dead = true; + } else if (this.crossType === "bound") { + if (d + particle.radius >= this.radius) this.getSymmetric(particle); + } else if (this.crossType === "cross") { + if (this.alert) { + console.error("Sorry, CircleZone does not support cross method!"); + this.alert = false; + } + } + } + }, { + key: "getSymmetric", + value: function getSymmetric(particle) { + var tha2 = particle.v.getGradient(); + var tha1 = this.getGradient(particle); + + var tha = 2 * (tha1 - tha2); + var oldx = particle.v.x; + var oldy = particle.v.y; + + particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha); + particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha); + } + }, { + key: "getGradient", + value: function getGradient(particle) { + return -MathUtil.PI_2 + Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x); + } + }]); + return CircleZone; }(Zone); var RectZone = function (_Zone) { - inherits(RectZone, _Zone); - - function RectZone(x, y, width, height) { - classCallCheck(this, RectZone); + inherits(RectZone, _Zone); - var _this = possibleConstructorReturn(this, (RectZone.__proto__ || Object.getPrototypeOf(RectZone)).call(this)); - - _this.x = x; - _this.y = y; - _this.width = width; - _this.height = height; - return _this; - } + function RectZone(x, y, width, height) { + classCallCheck(this, RectZone); - createClass(RectZone, [{ - key: 'getPosition', - value: function getPosition() { - this.vector.x = this.x + Math.random() * this.width; - this.vector.y = this.y + Math.random() * this.height; + var _this = possibleConstructorReturn(this, (RectZone.__proto__ || Object.getPrototypeOf(RectZone)).call(this)); - return this.vector; - } - }, { - key: 'crossing', - value: function crossing(particle) { - if (this.crossType === 'dead') { - if (particle.p.x + particle.radius < this.x) particle.dead = true;else if (particle.p.x - particle.radius > this.x + this.width) particle.dead = true; - - if (particle.p.y + particle.radius < this.y) particle.dead = true;else if (particle.p.y - particle.radius > this.y + this.height) particle.dead = true; - } else if (this.crossType === 'bound') { - if (particle.p.x - particle.radius < this.x) { - particle.p.x = this.x + particle.radius; - particle.v.x *= -1; - } else if (particle.p.x + particle.radius > this.x + this.width) { - particle.p.x = this.x + this.width - particle.radius; - particle.v.x *= -1; - } + _this.x = x; + _this.y = y; + _this.width = width; + _this.height = height; + return _this; + } - if (particle.p.y - particle.radius < this.y) { - particle.p.y = this.y + particle.radius; - particle.v.y *= -1; - } else if (particle.p.y + particle.radius > this.y + this.height) { - particle.p.y = this.y + this.height - particle.radius; - particle.v.y *= -1; - } - } else if (this.crossType === 'cross') { - if (particle.p.x + particle.radius < this.x && particle.v.x <= 0) particle.p.x = this.x + this.width + particle.radius;else if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0) particle.p.x = this.x - particle.radius; + createClass(RectZone, [{ + key: "getPosition", + value: function getPosition() { + this.vector.x = this.x + Math.random() * this.width; + this.vector.y = this.y + Math.random() * this.height; - if (particle.p.y + particle.radius < this.y && particle.v.y <= 0) particle.p.y = this.y + this.height + particle.radius;else if (particle.p.y - particle.radius > this.y + this.height && particle.v.y >= 0) particle.p.y = this.y - particle.radius; - } - } - }]); - return RectZone; + return this.vector; + } + }, { + key: "crossing", + value: function crossing(particle) { + // particle dead zone + if (this.crossType === "dead") { + if (particle.p.x + particle.radius < this.x) particle.dead = true;else if (particle.p.x - particle.radius > this.x + this.width) particle.dead = true; + + if (particle.p.y + particle.radius < this.y) particle.dead = true;else if (particle.p.y - particle.radius > this.y + this.height) particle.dead = true; + } + + // particle bound zone + else if (this.crossType === "bound") { + if (particle.p.x - particle.radius < this.x) { + particle.p.x = this.x + particle.radius; + particle.v.x *= -1; + } else if (particle.p.x + particle.radius > this.x + this.width) { + particle.p.x = this.x + this.width - particle.radius; + particle.v.x *= -1; + } + + if (particle.p.y - particle.radius < this.y) { + particle.p.y = this.y + particle.radius; + particle.v.y *= -1; + } else if (particle.p.y + particle.radius > this.y + this.height) { + particle.p.y = this.y + this.height - particle.radius; + particle.v.y *= -1; + } + } + + // particle cross zone + else if (this.crossType === "cross") { + if (particle.p.x + particle.radius < this.x && particle.v.x <= 0) particle.p.x = this.x + this.width + particle.radius;else if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0) particle.p.x = this.x - particle.radius; + + if (particle.p.y + particle.radius < this.y && particle.v.y <= 0) particle.p.y = this.y + this.height + particle.radius;else if (particle.p.y - particle.radius > this.y + this.height && particle.v.y >= 0) particle.p.y = this.y - particle.radius; + } + } + }]); + return RectZone; }(Zone); var ImageZone = function (_Zone) { - inherits(ImageZone, _Zone); + inherits(ImageZone, _Zone); - function ImageZone(imageData, x, y, d) { - classCallCheck(this, ImageZone); + function ImageZone(imageData, x, y, d) { + classCallCheck(this, ImageZone); - var _this = possibleConstructorReturn(this, (ImageZone.__proto__ || Object.getPrototypeOf(ImageZone)).call(this)); + var _this = possibleConstructorReturn(this, (ImageZone.__proto__ || Object.getPrototypeOf(ImageZone)).call(this)); - _this.reset(imageData, x, y, d); - return _this; - } + _this.reset(imageData, x, y, d); + return _this; + } - createClass(ImageZone, [{ - key: 'reset', - value: function reset(imageData, x, y, d) { - this.imageData = imageData; - this.x = Util.initValue(x, 0); - this.y = Util.initValue(y, 0); - this.d = Util.initValue(d, 2); - - this.vectors = []; - this.setVectors(); - } - }, { - key: 'setVectors', - value: function setVectors() { - var i = void 0, - j = void 0; - var length1 = this.imageData.width; - var length2 = this.imageData.height; - - for (i = 0; i < length1; i += this.d) { - for (j = 0; j < length2; j += this.d) { - var index = ((j >> 0) * length1 + (i >> 0)) * 4; - - if (this.imageData.data[index + 3] > 0) { - this.vectors.push({ x: i + this.x, y: j + this.y }); - } - } - } + createClass(ImageZone, [{ + key: "reset", + value: function reset(imageData, x, y, d) { + this.imageData = imageData; + this.x = Util.initValue(x, 0); + this.y = Util.initValue(y, 0); + this.d = Util.initValue(d, 2); - return this.vector; - } - }, { - key: 'getBound', - value: function getBound(x, y) { - var index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4; - if (this.imageData.data[index + 3] > 0) return true;else return false; - } - }, { - key: 'getPosition', - value: function getPosition() { - return this.vector.copy(this.vectors[Math.floor(Math.random() * this.vectors.length)]); - } - }, { - key: 'getColor', - value: function getColor(x, y) { - x -= this.x; - y -= this.y; - var i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4; - - return { - r: this.imageData.data[i], - g: this.imageData.data[i + 1], - b: this.imageData.data[i + 2], - a: this.imageData.data[i + 3] - }; - } - }, { - key: 'crossing', - value: function crossing(particle) { - if (this.crossType === 'dead') { - if (this.getBound(particle.p.x - this.x, particle.p.y - this.y)) particle.dead = true;else particle.dead = false; - } else if (this.crossType === 'bound') { - if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y)) particle.v.negate(); - } - } - }]); - return ImageZone; + this.vectors = []; + this.setVectors(); + } + }, { + key: "setVectors", + value: function setVectors() { + var i = void 0, + j = void 0; + var length1 = this.imageData.width; + var length2 = this.imageData.height; + + for (i = 0; i < length1; i += this.d) { + for (j = 0; j < length2; j += this.d) { + var index = ((j >> 0) * length1 + (i >> 0)) * 4; + + if (this.imageData.data[index + 3] > 0) { + this.vectors.push({ x: i + this.x, y: j + this.y }); + } + } + } + + return this.vector; + } + }, { + key: "getBound", + value: function getBound(x, y) { + var index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4; + if (this.imageData.data[index + 3] > 0) return true;else return false; + } + }, { + key: "getPosition", + value: function getPosition() { + var vector = Util.getRandFromArray(this.vectors); + return this.vector.copy(vector); + } + }, { + key: "getColor", + value: function getColor(x, y) { + x -= this.x; + y -= this.y; + var i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4; + + return { + r: this.imageData.data[i], + g: this.imageData.data[i + 1], + b: this.imageData.data[i + 2], + a: this.imageData.data[i + 3] + }; + } + }, { + key: "crossing", + value: function crossing(particle) { + if (this.crossType === "dead") { + if (this.getBound(particle.p.x - this.x, particle.p.y - this.y)) particle.dead = true;else particle.dead = false; + } else if (this.crossType === "bound") { + if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y)) particle.v.negate(); + } + } + }]); + return ImageZone; }(Zone); var Debug = { - addEventListener: function addEventListener(proton, fun) { - proton.addEventListener('PROTON_UPDATE_AFTER', function () { - return fun(); - }); - }, - getStyle: function getStyle(color) { - var rgb = ColorUtil.hexToRGB(color || '#ff0000'); - return 'rgba(' + rgb.r + ', ' + rgb.g + ', ' + rgb.b + ', 0.5)'; - }, - drawZone: function drawZone(proton, canvas, zone, clear) { - var context = canvas.getContext('2d'); - var style = this.getStyle(); - - this.addEventListener(proton, function () { - if (clear) context.clearRect(0, 0, canvas.width, canvas.height); - - if (zone instanceof PointZone) { - context.beginPath(); - context.fillStyle = style; - context.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true); - context.fill(); - context.closePath(); - } else if (zone instanceof LineZone) { - context.beginPath(); - context.strokeStyle = style; - context.moveTo(zone.x1, zone.y1); - context.lineTo(zone.x2, zone.y2); - context.stroke(); - context.closePath(); - } else if (zone instanceof RectZone) { - context.beginPath(); - context.strokeStyle = style; - context.drawRect(zone.x, zone.y, zone.width, zone.height); - context.stroke(); - context.closePath(); - } else if (zone instanceof CircleZone) { - context.beginPath(); - context.strokeStyle = style; - context.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true); - context.stroke(); - context.closePath(); - } - }); - }, - drawEmitter: function drawEmitter(proton, canvas, emitter, clear) { - var context = canvas.getContext('2d'); - var style = this.getStyle(); - - this.addEventListener(proton, function () { - if (clear) context.clearRect(0, 0, canvas.width, canvas.height); - - context.beginPath(); - context.fillStyle = style; - context.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true); - context.fill(); - context.closePath(); - }); - } + addEventListener: function addEventListener(proton, func) { + proton.addEventListener("PROTON_UPDATE_AFTER", function () { + return func(); + }); + }, + getStyle: function getStyle() { + var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "#ff0000"; + + var rgb = ColorUtil.hexToRgb(color); + return "rgba(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ", 0.5)"; + }, + drawZone: function drawZone(proton, canvas, zone, clear) { + var context = canvas.getContext("2d"); + var style = this.getStyle(); + + this.addEventListener(proton, function () { + if (clear) context.clearRect(0, 0, canvas.width, canvas.height); + + if (zone instanceof PointZone) { + context.beginPath(); + context.fillStyle = style; + context.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true); + context.fill(); + context.closePath(); + } else if (zone instanceof LineZone) { + context.beginPath(); + context.strokeStyle = style; + context.moveTo(zone.x1, zone.y1); + context.lineTo(zone.x2, zone.y2); + context.stroke(); + context.closePath(); + } else if (zone instanceof RectZone) { + context.beginPath(); + context.strokeStyle = style; + context.drawRect(zone.x, zone.y, zone.width, zone.height); + context.stroke(); + context.closePath(); + } else if (zone instanceof CircleZone) { + context.beginPath(); + context.strokeStyle = style; + context.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true); + context.stroke(); + context.closePath(); + } + }); + }, + drawEmitter: function drawEmitter(proton, canvas, emitter, clear) { + var context = canvas.getContext("2d"); + var style = this.getStyle(); + + this.addEventListener(proton, function () { + if (clear) context.clearRect(0, 0, canvas.width, canvas.height); + + context.beginPath(); + context.fillStyle = style; + context.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true); + context.fill(); + context.closePath(); + }); + } }; // namespace @@ -5538,7 +5638,7 @@ Proton.Pool = Pool; Proton.Util = Util; Proton.ColorUtil = ColorUtil; -Proton.MathUtils = MathUtils; +Proton.MathUtil = MathUtil; Proton.Vector2D = Proton.Vector = Vector2D; Proton.Polar2D = Proton.Polar = Polar2D; Proton.ArraySpan = ArraySpan; diff --git a/build/proton.js.map b/build/proton.js.map old mode 100644 new mode 100755 index 37bbb19..a9a2121 --- a/build/proton.js.map +++ b/build/proton.js.map @@ -1 +1 @@ -{"version":3,"file":"proton.js","sources":["../src/math/MathUtils.js","../src/math/Span.js","../src/utils/WebGLUtil.js","../src/utils/DomUtil.js","../src/utils/ImgUtil.js","../src/utils/Util.js","../src/utils/PUID.js","../src/core/Pool.js","../src/debug/Stats.js","../src/events/EventDispatcher.js","../src/math/Integration.js","../src/core/Proton.js","../src/math/ease.js","../src/math/Vector2D.js","../src/core/Particle.js","../src/utils/ColorUtil.js","../src/math/Polar2D.js","../src/math/Mat3.js","../src/math/ArraySpan.js","../src/math/Rectangle.js","../src/initialize/Rate.js","../src/initialize/Initialize.js","../src/initialize/Life.js","../src/zone/Zone.js","../src/zone/PointZone.js","../src/initialize/Position.js","../src/initialize/Velocity.js","../src/initialize/Mass.js","../src/initialize/Radius.js","../src/initialize/Body.js","../src/behaviour/Behaviour.js","../src/behaviour/Force.js","../src/behaviour/Attraction.js","../src/behaviour/RandomDrift.js","../src/behaviour/Gravity.js","../src/behaviour/Collision.js","../src/behaviour/CrossZone.js","../src/behaviour/Alpha.js","../src/behaviour/Scale.js","../src/behaviour/Rotate.js","../src/behaviour/Color.js","../src/behaviour/Repulsion.js","../src/behaviour/GravityWell.js","../src/initialize/InitializeUtil.js","../src/emitter/Emitter.js","../src/emitter/BehaviourEmitter.js","../src/emitter/FollowEmitter.js","../src/render/BaseRenderer.js","../src/render/CanvasRenderer.js","../src/render/DomRenderer.js","../src/render/EaselRenderer.js","../src/render/PixelRenderer.js","../src/render/PixiRenderer.js","../src/utils/MStack.js","../src/render/WebGLRenderer.js","../src/render/CustomRenderer.js","../src/zone/LineZone.js","../src/zone/CircleZone.js","../src/zone/RectZone.js","../src/zone/ImageZone.js","../src/debug/Debug.js","../src/index.js"],"sourcesContent":["const PI = 3.1415926;\n\nconst MathUtils = {\n\n PI: PI,\n PIx2: PI * 2,\n PI_2: PI / 2,\n PI_180: PI / 180,\n N180_PI: 180 / PI,\n\n randomAToB(a, b, INT) {\n if (!INT)\n return a + Math.random() * (b - a);\n else\n return Math.floor(Math.random() * (b - a)) + a;\n },\n\n randomFloating(center, f, INT) {\n return this.randomAToB(center - f, center + f, INT);\n },\n\n randomZone(display) {},\n\n degreeTransform(a) {\n return a * PI / 180;\n },\n\n toColor16(num) {\n return '#' + num.toString(16);\n },\n\n randomColor() {\n return '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6);\n }\n}\n\nexport default MathUtils;","import Util from '../utils/Util';\nimport MathUtils from '../math/MathUtils';\n\nexport default class Span {\n\n\tconstructor(a, b, center) {\n\t\tthis.isArray = false;\n\n\t\tif (Util.isArray(a)) {\n\t\t\tthis.isArray = true;\n\t\t\tthis.a = a;\n\t\t} else {\n\t\t\tthis.a = Util.initValue(a, 1);\n\t\t\tthis.b = Util.initValue(b, this.a);\n\t\t\tthis.center = Util.initValue(center, false);\n\t\t}\n\n\t}\n\n\tgetValue(INT) {\n\t\tif (this.isArray) {\n\t\t\treturn this.a[Math.floor(this.a.length * Math.random())];\n\t\t} else {\n\t\t\tif (!this.center)\n\t\t\t\treturn MathUtils.randomAToB(this.a, this.b, INT);\n\t\t\telse\n\t\t\t\treturn MathUtils.randomFloating(this.a, this.b, INT);\n\t\t}\n\t}\n}","export default {\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method ipot\n *\n * @todo add description\n * @todo add length description\n *\n * @param {Number} length\n *\n * @return {Boolean}\n */\n ipot(length) {\n return (length & (length - 1)) === 0;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method nhpot\n *\n * @todo add description\n * @todo add length description\n *\n * @param {Number} length\n *\n * @return {Number}\n */\n nhpot(length) {\n --length;\n for (let i = 1; i < 32; i <<= 1) {\n length = length | length >> i;\n }\n\n return length + 1;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeTranslation\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} tx either 0 or 1\n * @param {Number} ty either 0 or 1\n *\n * @return {Object}\n */\n makeTranslation(tx, ty) {\n return [1, 0, 0, 0, 1, 0, tx, ty, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeRotation\n *\n * @todo add description\n * @todo add return description\n *\n * @param {Number} angleInRadians\n *\n * @return {Object}\n */\n makeRotation(angleInRadians) {\n let c = Math.cos(angleInRadians);\n let s = Math.sin(angleInRadians);\n\n return [c, -s, 0, s, c, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeScale\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} sx either 0 or 1\n * @param {Number} sy either 0 or 1\n *\n * @return {Object}\n */\n makeScale(sx, sy) {\n return [sx, 0, 0, 0, sy, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method matrixMultiply\n *\n * @todo add description\n * @todo add a, b description\n * @todo add return description\n *\n * @param {Object} a\n * @param {Object} b\n *\n * @return {Object}\n */\n matrixMultiply(a, b) {\n let a00 = a[0 * 3 + 0];\n let a01 = a[0 * 3 + 1];\n let a02 = a[0 * 3 + 2];\n let a10 = a[1 * 3 + 0];\n let a11 = a[1 * 3 + 1];\n let a12 = a[1 * 3 + 2];\n let a20 = a[2 * 3 + 0];\n let a21 = a[2 * 3 + 1];\n let a22 = a[2 * 3 + 2];\n let b00 = b[0 * 3 + 0];\n let b01 = b[0 * 3 + 1];\n let b02 = b[0 * 3 + 2];\n let b10 = b[1 * 3 + 0];\n let b11 = b[1 * 3 + 1];\n let b12 = b[1 * 3 + 2];\n let b20 = b[2 * 3 + 0];\n let b21 = b[2 * 3 + 1];\n let b22 = b[2 * 3 + 2];\n\n return [\n a00 * b00 + a01 * b10 + a02 * b20,\n a00 * b01 + a01 * b11 + a02 * b21,\n a00 * b02 + a01 * b12 + a02 * b22,\n a10 * b00 + a11 * b10 + a12 * b20,\n a10 * b01 + a11 * b11 + a12 * b21,\n a10 * b02 + a11 * b12 + a12 * b22,\n a20 * b00 + a21 * b10 + a22 * b20,\n a20 * b01 + a21 * b11 + a22 * b21,\n a20 * b02 + a21 * b12 + a22 * b22\n ];\n }\n}","export default {\n\n /**\n * Creates and returns a new canvas. The opacity is by default set to 0\n *\n * @memberof Proton#Proton.DomUtil\n * @method createCanvas\n *\n * @param {String} $id the canvas' id\n * @param {Number} $width the canvas' width\n * @param {Number} $height the canvas' height\n * @param {String} [$position=absolute] the canvas' position, default is 'absolute'\n *\n * @return {Object}\n */\n createCanvas(id, width, height, position) {\n const dom = document.createElement('canvas');\n position = position || 'absolute';\n\n dom.id = id;\n dom.width = width;\n dom.height = height;\n dom.style.opacity = 0;\n dom.style.position = position;\n\n this.transform(dom, -500, -500, 0, 0);\n\n return dom;\n },\n\n createDiv(id, width, height) {\n const dom = document.createElement('div');\n\n dom.id = id;\n dom.style.position = 'absolute';\n this.resize(dom, width, height);\n\n return dom;\n },\n\n resize(dom, width, height) {\n dom.style.width = width + 'px';\n dom.style.height = height + 'px';\n dom.style.marginLeft = -width / 2 + 'px';\n dom.style.marginTop = -height / 2 + 'px';\n },\n\n /**\n * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers\n *\n * @memberof Proton#Proton.DomUtil\n * @method transform\n *\n * @param {HTMLDivElement} div\n * @param {Number} $x\n * @param {Number} $y\n * @param {Number} $scale\n * @param {Number} $rotate\n */\n transform(div, x, y, scale, rotate) {\n const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\n\n div.style.willChange = 'transform';\n this.css3(div, 'transform', transform);\n },\n\n transform3d(div, x, y, scale, rotate) {\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\n\n div.style.willChange = 'transform';\n this.css3(div, 'backfaceVisibility', 'hidden');\n this.css3(div, 'transform', transform);\n },\n\n css3(div, key, val) {\n const bkey = key.charAt(0).toUpperCase() + key.substr(1);\n\n div.style[`Webkit${bkey}`] = val;\n div.style[`Moz${bkey}`] = val;\n div.style[`O${bkey}`] = val;\n div.style[`ms${bkey}`] = val;\n div.style[`${key}`] = val;\n }\n}","import WebGLUtil from './WebGLUtil';\nimport DomUtil from './DomUtil';\n\nconst IMG_CACHE = {};\nconst CANVAS_CACHE = {};\nlet canvasID = 0;\n\nexport default {\n\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n context.drawImage(image, rect.x, rect.y);\n const imagedata = context.getImageData(rect.x, rect.y, rect.width, rect.height);\n context.clearRect(rect.x, rect.y, rect.width, rect.height);\n\n return imagedata;\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method getImgFromCache\n *\n * @todo add description\n * @todo describe func\n *\n * @param {Mixed} img\n * @param {Proton.Particle} particle\n * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.transform.canvas\n * @param {Boolean} func\n */\n getImgFromCache(img, callback, param) {\n const src = typeof (img) === 'string' ? img : img.src;\n\n if (IMG_CACHE[src]) {\n callback(IMG_CACHE[src], param);\n } else {\n const image = new Image();\n image.onload = e => {\n IMG_CACHE[src] = e.target;\n callback(IMG_CACHE[src], param);\n }\n\n image.src = src;\n }\n },\n\n getCanvasFromCache(img, callback, param) {\n const src = img.src;\n\n if (!CANVAS_CACHE[src]) {\n const width = WebGLUtil.nhpot(img.width);\n const height = WebGLUtil.nhpot(img.height);\n\n const canvas = DomUtil.createCanvas(`canvas_cache_${canvasID}`, width, height);\n const context = canvas.getContext('2d');\n context.drawImage(img, 0, 0, img.width, img.height);\n\n CANVAS_CACHE[src] = canvas;\n }\n\n callback && callback(CANVAS_CACHE[src], param);\n\n return CANVAS_CACHE[src];\n }\n}","import Span from '../math/Span';\nimport ImgUtil from './ImgUtil';\n\nexport default {\n\n /**\n * Returns the default if the value is null or undefined\n *\n * @memberof Proton#Proton.Util\n * @method initValue\n *\n * @param {Mixed} value a specific value, could be everything but null or undefined\n * @param {Mixed} defaults the default if the value is null or undefined\n */\n initValue(value, defaults) {\n value = (value !== null && value !== undefined) ? value : defaults;\n return value;\n },\n\n /**\n * Checks if the value is a valid array\n *\n * @memberof Proton#Proton.Util\n * @method isArray\n *\n * @param {Array} value Any array\n *\n * @returns {Boolean}\n */\n isArray(value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n },\n\n /**\n * Destroyes the given array\n *\n * @memberof Proton#Proton.Util\n * @method destroyArray\n *\n * @param {Array} array Any array\n */\n destroyArray(array) {\n if (array) array.length = 0;\n },\n\n /**\n * Destroyes the given object\n *\n * @memberof Proton#Proton.Util\n * @method destroyObject\n *\n * @param {Object} obj Any object\n */\n destroyObject(obj, ignore) {\n for (let o in obj) {\n if (ignore && ignore.indexOf(o) > -1) continue;\n delete obj[o];\n }\n },\n\n /**\n * Makes an instance of a class and binds the given array\n *\n * @memberof Proton#Proton.Util\n * @method classApply\n *\n * @param {Function} constructor A class to make an instance from\n * @param {Array} [args] Any array to bind it to the constructor\n *\n * @return {Object} The instance of constructor, optionally bind with args\n */\n classApply(constructor, args) {\n if (!args) return new constructor;\n\n args = [null].concat(args);\n const FactoryFunc = constructor.bind.apply(constructor, args);\n return new FactoryFunc();\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method setVector2DByObject\n *\n * @todo add description for param `target`\n * @todo add description for param `pOBJ`\n * @todo add description for function\n *\n * @param {Object} target\n * @param {Object} pOBJ\n */\n setVector2DByObject(target, pOBJ) {\n if (this.hasProp(pOBJ, 'x')) target.p.x = pOBJ['x'];\n if (this.hasProp(pOBJ, 'y')) target.p.y = pOBJ['y'];\n\n if (this.hasProp(pOBJ, 'vx')) target.v.x = pOBJ['vx'];\n if (this.hasProp(pOBJ, 'vy')) target.v.y = pOBJ['vy'];\n\n if (this.hasProp(pOBJ, 'ax')) target.a.x = pOBJ['ax'];\n if (this.hasProp(pOBJ, 'ay')) target.a.y = pOBJ['ay'];\n\n if (this.hasProp(pOBJ, 'p')) target.p.copy(pOBJ['p']);\n if (this.hasProp(pOBJ, 'v')) target.v.copy(pOBJ['v']);\n if (this.hasProp(pOBJ, 'a')) target.a.copy(pOBJ['a']);\n\n if (this.hasProp(pOBJ, 'position')) target.p.copy(pOBJ['position']);\n if (this.hasProp(pOBJ, 'velocity')) target.v.copy(pOBJ['velocity']);\n if (this.hasProp(pOBJ, 'accelerate')) target.a.copy(pOBJ['accelerate']);\n },\n\n hasProp(obj, key) {\n if (!obj) return false;\n return obj[key] !== undefined;\n // return obj.hasOwnProperty(key);\n },\n\n /**\n * set the prototype in a given prototypeObject\n *\n * @memberof Proton#Proton.Util\n * @method setPrototypeByObject\n *\n * @todo add description for param `target`\n * @todo add description for param `filters`\n * @todo translate desription from chinese to english\n *\n * @param {Object} target\n * @param {Object} prototypeObject An object of single prototypes\n * @param {Object} filters\n *\n * @return {Object} target\n */\n setPrototypeByObject(target, prototypeObject, filters) {\n for (let singleProp in prototypeObject) {\n if (target.hasOwnProperty(singleProp)) {\n if (filters) {\n if (filters.indexOf(singleProp) < 0)\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\n } else {\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\n }\n }\n }\n\n return target;\n },\n\n /**\n * Returns a new Span object\n *\n * @memberof Proton#Proton.Util\n * @method setSpanValue\n *\n * @todo a, b and c should be 'Mixed' or 'Number'?\n *\n * @param {Mixed | Span} a\n * @param {Mixed} b\n * @param {Mixed} c\n *\n * @return {Span}\n */\n setSpanValue(a, b, c) {\n if (a instanceof Span) {\n return a;\n } else {\n if (!b) {\n return new Span(a);\n } else {\n if (!c)\n return new Span(a, b);\n else\n return new Span(a, b, c);\n }\n }\n },\n\n /**\n * Returns the value from a Span, if the param is not a Span it will return the given parameter\n *\n * @memberof Proton#Proton.Util\n * @method getSpanValue\n *\n * @param {Mixed | Span} pan\n *\n * @return {Mixed} the value of Span OR the parameter if it is not a Span\n */\n getSpanValue(pan) {\n return pan instanceof Span ? pan.getValue() : pan;\n },\n\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n return ImgUtil.getImageData(context, image, rect);\n },\n\n destroy(arr, param) {\n let i = arr.length;\n\n while (i--) {\n try { arr[i].destroy(param); } catch (e) { }\n delete arr[i];\n }\n\n arr.length = 0;\n }\n\n}","export default {\n id: 0,\n cache: {},\n\n getID(target) {\n let uid = this.getCacheID(target);\n if (uid) return uid;\n\n uid = `PUID_${this.id++}`;\n this.cache[uid] = target;\n\n return uid;\n },\n\n getCacheID(target) {\n let obj;\n for (let id in this.cache) {\n obj = this.cache[id];\n\n if (obj === target) return id;\n if (typeof obj === 'object' && typeof target === 'object' && obj.isInner && target.isInner) {\n if (obj.src === target.src)\n return id;\n }\n }\n\n return null;\n },\n\n getTarget(uid) {\n return this.cache[uid];\n }\n}","/**\n * get -> PUID :: uid-> Body\n * -> cache[abc]. -> cache[abc] .pop()\n * -> create [new Body| clone]\n * -> return p1: { __pid: abc }\n *\n * expire -> cache[abc]= [p0, p1];\n *\n */\nimport Util from '../utils/Util';\nimport PUID from '../utils/PUID';\n\nexport default class Pool {\n\n /**\n * @memberof! Proton#\n * @constructor\n * @alias Proton.Pool\n *\n * @todo add description\n * @todo add description of properties\n *\n * @property {Number} total\n * @property {Object} cache\n */\n constructor(num) {\n this.total = 0;\n this.cache = {};\n }\n\n /**\n * @todo add description\n *\n * @method get\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n get(target, params, uid) {\n let p;\n uid = uid || target.__puid || PUID.getID(target);\n\n if (this.cache[uid] && this.cache[uid].length > 0)\n p = this.cache[uid].pop();\n else\n p = this.createOrClone(target, params);\n\n p.__puid = target.__puid || uid;\n return p;\n }\n\n /**\n * @todo add description\n *\n * @method set\n * @memberof Proton#Proton.Pool\n *\n * @param {Object} target\n *\n * @return {Object}\n */\n expire(target) {\n return this.getCache(target.__puid).push(target);\n }\n\n /**\n * Creates a new class instance\n *\n * @todo add more documentation\n *\n * @method create\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target any Object or Function\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n createOrClone(target, params) {\n this.total++;\n\n if (this.create) {\n return this.create(target, params);\n } else if (typeof target === 'function') {\n return Util.classApply(target, params);\n } else {\n return target.clone();\n }\n }\n\n /**\n * @todo add description - what is in the cache?\n *\n * @method getCount\n * @memberof Proton#Proton.Pool\n *\n * @return {Number}\n */\n getCount() {\n let count = 0;\n\n for (let id in this.cache)\n count += this.cache[id].length;\n\n return count++;\n }\n\n /**\n * Destroyes all items from Pool.cache\n *\n * @method destroy\n * @memberof Proton#Proton.Pool\n */\n destroy() {\n for (let id in this.cache) {\n this.cache[id].length = 0;\n delete this.cache[id];\n }\n }\n\n /**\n * Returns Pool.cache\n *\n * @method getCache\n * @memberof Proton#Proton.Pool\n * @private\n *\n * @param {Number} uid the unique id\n *\n * @return {Object}\n */\n getCache(uid) {\n uid = uid || 'default';\n\n if (!this.cache[uid]) this.cache[uid] = [];\n return this.cache[uid];\n }\n}","export default class Stats {\n\n constructor(proton) {\n this.proton = proton;\n this.container = null;\n this.type = 1;\n\n this.emitterIndex = 0;\n this.rendererIndex = 0;\n }\n\n update(style, body) {\n this.add(style, body);\n\n const emitter = this.getEmitter();\n const renderer = this.getRenderer();\n let str = '';\n\n switch (this.type) {\n case 2:\n str += 'emitter:' + this.proton.emitters.length + '
';\n if (emitter) str += 'em speed:' + emitter.emitSpeed + '
';\n if (emitter) str += 'pos:' + this.getEmitterPos(emitter);\n break;\n\n case 3:\n if (emitter) str += 'initializes:' + emitter.initializes.length + '
';\n if (emitter) str += '' + this.concatArr(emitter.initializes) + '
';\n if (emitter) str += 'behaviours:' + emitter.behaviours.length + '
';\n if (emitter) str += '' + this.concatArr(emitter.behaviours) + '
';\n break;\n\n case 4:\n if (renderer) str += renderer.name + '
';\n if (renderer) str += 'body:' + this.getCreatedNumber(renderer) + '
';\n break;\n\n default:\n str += 'particles:' + this.proton.getCount() + '
';\n str += 'pool:' + this.proton.pool.getCount() + '
';\n str += 'total:' + this.proton.pool.total;\n }\n\n this.container.innerHTML = str;\n }\n\n add(style, body) {\n if (!this.container) {\n this.type = 1;\n\n this.container = document.createElement('div');\n this.container.style.cssText = [\n 'position:absolute;bottom:0px;left:0;cursor:pointer;',\n 'opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;',\n 'width:120px;height:50px;background-color:#002;color:#0ff;'\n ].join('');\n\n this.container.addEventListener('click', e => {\n this.type++;\n if (this.type > 4) this.type = 1;\n }, false);\n\n let bg, color;\n switch (style) {\n case 2:\n bg = '#201';\n color = '#f08';\n break;\n\n case 3:\n bg = '#020';\n color = '#0f0';\n break;\n\n default:\n bg = '#002';\n color = '#0ff';\n }\n\n this.container.style['background-color'] = bg;\n this.container.style['color'] = color;\n }\n\n if (!this.container.parentNode) {\n body = body || this.body || document.body;\n body.appendChild(this.container);\n }\n }\n\n getEmitter() {\n return this.proton.emitters[this.emitterIndex];\n }\n\n getRenderer() {\n return this.proton.renderers[this.rendererIndex];\n }\n\n concatArr(arr) {\n let result = '';\n if (!arr || !arr.length) return result;\n\n for (let i = 0; i < arr.length; i++) {\n result += (arr[i].name || '').substr(0, 1) + '.';\n }\n\n return result;\n }\n\n getCreatedNumber(renderer) {\n return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0;\n }\n\n getEmitterPos(e) {\n return Math.round(e.p.x) + ',' + Math.round(e.p.y);\n }\n}","/*\n * EventDispatcher\n * This code reference since http://createjs.com/.\n *\n **/\n\nexport default class EventDispatcher {\n\n constructor() {\n this._listeners = null;\n }\n\n static bind(TargetClass) {\n TargetClass.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\n TargetClass.prototype.hasEventListener = EventDispatcher.prototype.hasEventListener;\n TargetClass.prototype.addEventListener = EventDispatcher.prototype.addEventListener;\n TargetClass.prototype.removeEventListener = EventDispatcher.prototype.removeEventListener;\n TargetClass.prototype.removeAllEventListeners = EventDispatcher.prototype.removeAllEventListeners;\n }\n\n addEventListener(type, listener) {\n if (!this._listeners) {\n this._listeners = {};\n } else {\n this.removeEventListener(type, listener);\n }\n\n if (!this._listeners[type]) this._listeners[type] = [];\n this._listeners[type].push(listener);\n\n return listener;\n }\n\n removeEventListener(type, listener) {\n if (!this._listeners) return;\n if (!this._listeners[type]) return;\n\n const arr = this._listeners[type];\n const length = arr.length;\n\n for (let i = 0; i < length; i++) {\n if (arr[i] === listener) {\n if (length === 1) {\n delete (this._listeners[type]);\n }\n\n // allows for faster checks.\n else {\n arr.splice(i, 1);\n }\n\n break;\n }\n }\n }\n\n removeAllEventListeners(type) {\n if (!type)\n this._listeners = null;\n else if (this._listeners)\n delete (this._listeners[type]);\n }\n\n dispatchEvent(type, args) {\n let result = false;\n const listeners = this._listeners;\n\n if (type && listeners) {\n let arr = listeners[type];\n if (!arr) return result;\n\n // arr = arr.slice();\n // to avoid issues with items being removed or added during the dispatch\n\n let handler;\n let i = arr.length;\n while (i--) {\n handler = arr[i];\n result = result || handler(args);\n }\n\n }\n\n return !!result;\n }\n\n hasEventListener(type) {\n const listeners = this._listeners;\n return !!(listeners && listeners[type]);\n }\n\n}","export default class Integration {\n\n\tconstructor(type) {\n\t\tthis.type = type;\n\t}\n\n\tcalculate(particles, time, damping) {\n\t\tthis.eulerIntegrate(particles, time, damping);\n\t}\n\n\t// Euler Integrate\n\teulerIntegrate(particle, time, damping) {\n\t\tif (!particle.sleep) {\n\t\t\tparticle.old.p.copy(particle.p);\n\t\t\tparticle.old.v.copy(particle.v);\n\n\t\t\tparticle.a.multiplyScalar(1 / particle.mass);\n\t\t\tparticle.v.add(particle.a.multiplyScalar(time));\n\t\t\tparticle.p.add(particle.old.v.multiplyScalar(time));\n\n\t\t\tif (damping) particle.v.multiplyScalar(damping);\n\n\t\t\tparticle.a.clear();\n\t\t}\n\t}\n}","import Pool from './Pool';\nimport Util from '../utils/Util';\nimport Stats from '../debug/Stats';\nimport EventDispatcher from '../events/EventDispatcher';\nimport Integration from '../math/Integration';\n\nexport default class Proton {\n\n static USE_CLOCK = false;\n\n // 1:100\n static MEASURE = 100;\n static EULER = 'euler';\n static RK2 = 'runge-kutta2';\n\n static PARTICLE_CREATED = 'PARTICLE_CREATED';\n static PARTICLE_UPDATE = 'PARTICLE_UPDATE';\n static PARTICLE_SLEEP = 'PARTICLE_SLEEP';\n static PARTICLE_DEAD = 'PARTICLE_DEAD';\n static PROTON_UPDATE = 'PROTON_UPDATE';\n static PROTON_UPDATE_AFTER = 'PROTON_UPDATE_AFTER';\n static EMITTER_ADDED = 'EMITTER_ADDED';\n static EMITTER_REMOVED = 'EMITTER_REMOVED';\n\n static amendChangeTabsBug = true;\n\n /**\n * The constructor to add emitters\n *\n * @constructor Proton\n *\n * @todo proParticleCount is not in use\n * @todo add more documentation of the single properties and parameters\n *\n * @param {Number} [proParticleCount] not in use?\n * @param {Number} [integrationType=Proton.EULER]\n *\n * @property {String} [integrationType=Proton.EULER]\n * @property {Array} emitters All added emitter\n * @property {Array} renderers All added renderer\n * @property {Number} time The active time\n * @property {Number} oldtime The old time\n */\n constructor(integrationType) {\n\n this.emitters = [];\n this.renderers = [];\n\n this.time = 0;\n this.oldTime = 0;\n this.elapsed = 0;\n\n this.stats = new Stats(this);\n this.pool = new Pool(80);\n\n this.integrationType = Util.initValue(integrationType, Proton.EULER);\n this.integrator = new Integration(this.integrationType);\n }\n\n /**\n * add a type of Renderer\n *\n * @method addRenderer\n * @memberof Proton\n * @instance\n *\n * @param {Renderer} render\n */\n addRenderer(render) {\n render.init(this);\n this.renderers.push(render);\n }\n\n /**\n * @name add a type of Renderer\n *\n * @method addRenderer\n * @param {Renderer} render\n */\n removeRenderer(render) {\n const index = this.renderers.indexOf(render);\n this.renderers.splice(index, 1);\n render.remove(this);\n }\n\n /**\n * add the Emitter\n *\n * @method addEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Emitter} emitter\n */\n addEmitter(emitter) {\n this.emitters.push(emitter);\n emitter.parent = this;\n\n this.dispatchEvent(Proton.EMITTER_ADDED, emitter);\n }\n\n /**\n * Removes an Emitter\n *\n * @method removeEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Proton.Emitter} emitter\n */\n removeEmitter(emitter) {\n const index = this.emitters.indexOf(emitter);\n this.emitters.splice(index, 1);\n emitter.parent = null;\n\n this.dispatchEvent(Proton.EMITTER_REMOVED, emitter);\n }\n\n /**\n * Updates all added emitters\n *\n * @method update\n * @memberof Proton\n * @instance\n */\n update() {\n this.dispatchEvent(Proton.PROTON_UPDATE);\n\n if (Proton.USE_CLOCK) {\n if (!this.oldTime) this.oldTime = (new Date()).getTime();\n\n let time = new Date().getTime();\n this.elapsed = (time - this.oldTime) / 1000;\n Proton.amendChangeTabsBug && this.amendChangeTabsBug();\n\n this.oldTime = time;\n } else {\n this.elapsed = 0.0167;\n }\n\n // emitter update\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\n\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\n }\n\n emittersUpdate(elapsed) {\n let i = this.emitters.length;\n while (i--) this.emitters[i].update(elapsed);\n }\n\n /**\n * @todo add description\n *\n * @method amendChangeTabsBug\n * @memberof Proton\n * @instance\n */\n amendChangeTabsBug() {\n if (this.elapsed > 0.5) {\n this.oldTime = (new Date()).getTime();\n this.elapsed = 0;\n }\n }\n\n /**\n * Counts all particles from all emitters\n *\n * @method getCount\n * @memberof Proton\n * @instance\n */\n getCount() {\n let total = 0;\n let i = this.emitters.length;\n\n while (i--) total += this.emitters[i].particles.length;\n return total;\n }\n\n getAllParticles() {\n let particles = [];\n let i = this.emitters.length;\n\n while (i--) particles = particles.concat(this.emitters[i].particles);\n return particles;\n }\n\n /**\n * Destroys everything related to this Proton instance. This includes all emitters, and all properties\n *\n * @method destroy\n * @memberof Proton\n * @instance\n */\n destroy() {\n Util.destroy(this.renderers, this.getAllParticles());\n Util.destroy(this.emitters);\n\n this.time = 0;\n this.oldTime = 0;\n\n this.pool.destroy();\n }\n}\n\nEventDispatcher.bind(Proton);","import MathUtils from './MathUtils';\n\nexport default {\n\n easeLinear(value) {\n return value;\n },\n\n easeInQuad(value) {\n return Math.pow(value, 2);\n },\n\n easeOutQuad(value) {\n return -(Math.pow((value - 1), 2) - 1);\n },\n\n easeInOutQuad(value) {\n if ((value /= 0.5) < 1)\n return 0.5 * Math.pow(value, 2);\n\n return -0.5 * ((value -= 2) * value - 2);\n },\n\n easeInCubic(value) {\n return Math.pow(value, 3);\n },\n\n easeOutCubic(value) {\n return (Math.pow((value - 1), 3) + 1);\n },\n\n easeInOutCubic(value) {\n if ((value /= 0.5) < 1)\n return 0.5 * Math.pow(value, 3);\n\n return 0.5 * (Math.pow((value - 2), 3) + 2);\n },\n\n easeInQuart(value) {\n return Math.pow(value, 4);\n },\n\n easeOutQuart(value) {\n return -(Math.pow((value - 1), 4) - 1);\n },\n\n easeInOutQuart(value) {\n if ((value /= 0.5) < 1)\n return 0.5 * Math.pow(value, 4);\n\n return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2);\n },\n\n easeInSine(value) {\n return -Math.cos(value * (MathUtils.PI_2)) + 1;\n },\n\n easeOutSine(value) {\n return Math.sin(value * (MathUtils.PI_2));\n },\n\n easeInOutSine(value) {\n return (-0.5 * (Math.cos(MathUtils.PI * value) - 1));\n },\n\n easeInExpo(value) {\n return (value === 0) ? 0 : Math.pow(2, 10 * (value - 1));\n },\n\n easeOutExpo(value) {\n return (value === 1) ? 1 : -Math.pow(2, -10 * value) + 1;\n },\n\n easeInOutExpo(value) {\n if (value === 0)\n return 0;\n\n if (value === 1)\n return 1;\n\n if ((value /= 0.5) < 1)\n return 0.5 * Math.pow(2, 10 * (value - 1));\n\n return 0.5 * (-Math.pow(2, -10 * --value) + 2);\n },\n\n easeInCirc(value) {\n return -(Math.sqrt(1 - (value * value)) - 1);\n },\n\n easeOutCirc(value) {\n return Math.sqrt(1 - Math.pow((value - 1), 2));\n },\n\n easeInOutCirc(value) {\n if ((value /= 0.5) < 1)\n return -0.5 * (Math.sqrt(1 - value * value) - 1);\n return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1);\n },\n\n easeInBack(value) {\n let s = 1.70158;\n return (value) * value * ((s + 1) * value - s);\n },\n\n easeOutBack(value) {\n let s = 1.70158;\n return (value = value - 1) * value * ((s + 1) * value + s) + 1;\n },\n\n easeInOutBack(value) {\n let s = 1.70158;\n if ((value /= 0.5) < 1)\n return 0.5 * (value * value * (((s *= (1.525)) + 1) * value - s));\n return 0.5 * ((value -= 2) * value * (((s *= (1.525)) + 1) * value + s) + 2);\n },\n\n getEasing(ease) {\n if (typeof ease === 'function')\n return ease;\n else\n return this[ease] || this.easeLinear;\n }\n};","import MathUtils from '../math/MathUtils';\n\nexport default class Vector2D {\n\n constructor(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n\n set(x, y) {\n this.x = x;\n this.y = y;\n return this;\n }\n\n setX(x) {\n this.x = x;\n return this;\n }\n\n setY(y) {\n this.y = y;\n return this;\n }\n\n getGradient() {\n if (this.x !== 0)\n return Math.atan2(this.y, this.x);\n else if (this.y > 0)\n return MathUtils.PI_2;\n else if (this.y < 0)\n return -MathUtils.PI_2;\n }\n\n copy(v) {\n this.x = v.x;\n this.y = v.y;\n\n return this;\n }\n\n add(v, w) {\n if (w !== undefined) {\n return this.addVectors(v, w);\n }\n\n this.x += v.x;\n this.y += v.y;\n\n return this;\n }\n\n addXY(a, b) {\n this.x += a;\n this.y += b;\n\n return this;\n }\n\n addVectors(a, b) {\n this.x = a.x + b.x;\n this.y = a.y + b.y;\n\n return this;\n }\n\n sub(v, w) {\n if (w !== undefined) {\n return this.subVectors(v, w);\n }\n\n this.x -= v.x;\n this.y -= v.y;\n\n return this;\n }\n\n subVectors(a, b) {\n this.x = a.x - b.x;\n this.y = a.y - b.y;\n\n return this;\n }\n\n divideScalar(s) {\n if (s !== 0) {\n this.x /= s;\n this.y /= s;\n } else {\n this.set(0, 0);\n }\n\n return this;\n }\n\n multiplyScalar(s) {\n this.x *= s;\n this.y *= s;\n\n return this;\n }\n\n negate() {\n return this.multiplyScalar(-1);\n }\n\n dot(v) {\n return this.x * v.x + this.y * v.y;\n }\n\n lengthSq() {\n return this.x * this.x + this.y * this.y;\n }\n\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n\n normalize() {\n return this.divideScalar(this.length());\n }\n\n distanceTo(v) {\n return Math.sqrt(this.distanceToSquared(v));\n }\n\n rotate(tha) {\n const x = this.x;\n const y = this.y;\n\n this.x = x * Math.cos(tha) + y * Math.sin(tha);\n this.y = -x * Math.sin(tha) + y * Math.cos(tha);\n\n return this;\n }\n\n distanceToSquared(v) {\n const dx = this.x - v.x;\n const dy = this.y - v.y;\n\n return dx * dx + dy * dy;\n }\n\n lerp(v, alpha) {\n this.x += (v.x - this.x) * alpha;\n this.y += (v.y - this.y) * alpha;\n\n return this;\n }\n\n equals(v) {\n return ((v.x === this.x) && (v.y === this.y));\n }\n\n clear() {\n this.x = 0.0;\n this.y = 0.0;\n return this;\n }\n\n clone() {\n return new Vector2D(this.x, this.y);\n }\n}","import Util from '../utils/Util';\nimport ease from '../math/ease';\nimport Vector2D from '../math/Vector2D';\nimport MathUtils from '../math/MathUtils';\n\nexport default class Particle {\n\n static ID = 0;\n\n /**\n * the Particle class\n *\n * @class Proton.Particle\n * @constructor\n * @param {Object} pObj the parameters object;\n * for example {life:3,dead:false}\n */\n constructor(pOBJ) {\n /**\n * The particle's id;\n * @property id\n * @type {string}\n */\n this.id = `particle_${Particle.ID++}`;\n this.reset('init');\n\n pOBJ && Util.setPrototypeByObject(this, pOBJ);\n }\n\n getDirection() {\n return Math.atan2(this.v.x, -this.v.y) * MathUtils.N180_PI;\n }\n\n reset(init) {\n this.life = Infinity;\n this.age = 0;\n\n // Energy loss\n this.energy = 1;\n this.dead = false;\n this.sleep = false;\n this.body = null;\n this.sprite = null;\n this.parent = null;\n\n this.mass = 1;\n this.radius = 10;\n this.alpha = 1;\n this.scale = 1;\n this.rotation = 0;\n this.color = null;\n\n this.easing = ease.easeLinear;\n\n if (init === 'init') {\n this.transform = {};\n this.p = new Vector2D();\n this.v = new Vector2D();\n this.a = new Vector2D();\n\n this.old = {\n p: new Vector2D(),\n v: new Vector2D(),\n a: new Vector2D()\n };\n\n this.behaviours = [];\n } else {\n Util.destroyObject(this.transform, 'rgb');\n\n this.p.set(0, 0);\n this.v.set(0, 0);\n this.a.set(0, 0);\n\n this.old.p.set(0, 0);\n this.old.v.set(0, 0);\n this.old.a.set(0, 0);\n\n this.removeAllBehaviours();\n }\n\n if (!this.transform.rgb) {\n this.transform.rgb = { r: 255, g: 255, b: 255 };\n } else {\n this.transform.rgb.r = 255;\n this.transform.rgb.g = 255;\n this.transform.rgb.b = 255;\n }\n\n return this;\n }\n\n update(time, index) {\n if (!this.sleep) {\n this.age += time;\n this.applyBehaviours(time, index);\n }\n\n if (this.age < this.life) {\n const scale = this.easing(this.age / this.life);\n this.energy = Math.max(1 - scale, 0);\n } else {\n this.destroy();\n }\n }\n\n applyBehaviours(time, index) {\n const length = this.behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.behaviours[i] && this.behaviours[i].applyBehaviour(this, time, index)\n }\n }\n\n addBehaviour(behaviour) {\n this.behaviours.push(behaviour);\n\n if (behaviour.hasOwnProperty('parents')) behaviour.parents.push(this);\n behaviour.initialize(this);\n }\n\n addBehaviours(behaviours) {\n const length = behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.addBehaviour(behaviours[i]);\n }\n }\n\n removeBehaviour(behaviour) {\n const index = this.behaviours.indexOf(behaviour);\n\n if (index > -1) {\n const behaviour = this.behaviours.splice(index, 1);\n behaviour.parents = null;\n }\n }\n\n removeAllBehaviours() {\n Util.destroyArray(this.behaviours);\n }\n\n /**\n * Destory this particle\n * @method destroy\n */\n destroy() {\n this.removeAllBehaviours();\n this.energy = 0;\n this.dead = true;\n this.parent = null;\n }\n\n}","export default {\n\n /**\n * @typedef {Object} rgbObject\n * @property {Number} r red value\n * @property {Number} g green value\n * @property {Number} b blue value\n */\n /**\n * converts a hex value to a rgb object\n *\n * @memberof Proton#Proton.Util\n * @method hexToRGB\n *\n * @param {String} h any hex value, e.g. #000000 or 000000 for black\n *\n * @return {rgbObject}\n */\n hexToRGB(h) {\n const hex16 = (h.charAt(0) === '#') ? h.substring(1, 7) : h;\n const r = parseInt(hex16.substring(0, 2), 16);\n const g = parseInt(hex16.substring(2, 4), 16);\n const b = parseInt(hex16.substring(4, 6), 16);\n\n return { r, g, b };\n },\n\n /**\n * converts a rgb value to a rgb string\n *\n * @memberof Proton#Proton.Util\n * @method rgbToHex\n *\n * @param {Object | Proton.hexToRGB} rgb a rgb object like in {@link Proton#Proton.}\n *\n * @return {String} rgb()\n */\n rgbToHex(rbg) {\n return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`;\n },\n\n getHex16FromParticle(p) {\n return Number(p.transform.rgb.r) * 65536 + Number(p.transform.rgb.g) * 256 + Number(p.transform.rgb.b);\n }\n}","import Vector2D from './Vector2D';\n\nexport default class Polar2D {\n\n\tconstructor(r, tha) {\n\t\tthis.r = Math.abs(r) || 0;\n\t\tthis.tha = tha || 0;\n\t}\n\n\tset(r, tha) {\n\t\tthis.r = r;\n\t\tthis.tha = tha;\n\t\treturn this;\n\t}\n\n\tsetR(r) {\n\t\tthis.r = r;\n\t\treturn this;\n\t}\n\n\tsetTha(tha) {\n\t\tthis.tha = tha;\n\t\treturn this;\n\t}\n\n\tcopy(p) {\n\t\tthis.r = p.r;\n\t\tthis.tha = p.tha;\n\t\treturn this;\n\t}\n\n\ttoVector() {\n\t\treturn new Vector2D(this.getX(), this.getY());\n\t}\n\n\tgetX() {\n\t\treturn this.r * Math.sin(this.tha);\n\t}\n\n\tgetY() {\n\t\treturn -this.r * Math.cos(this.tha);\n\t}\n\n\tnormalize() {\n\t\tthis.r = 1;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn ((v.r === this.r) && (v.tha === this.tha));\n\t}\n\n\tclear() {\n\t\tthis.r = 0.0;\n\t\tthis.tha = 0.0;\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new Polar2D(this.r, this.tha);\n\t}\n}","export default {\n\tcreate(mat3) {\n\t\tconst mat = new Float32Array(9);\n\t\tif (mat3) this.set(mat3, mat);\n\n\t\treturn mat;\n\t},\n\n\tset(mat1, mat2) {\n\t\tfor (let i = 0; i < 9; i++)\n\t\t\tmat2[i] = mat1[i];\n\n\t\treturn mat2;\n\t},\n\n\tmultiply(mat, mat2, mat3) {\n\t\tlet a00 = mat[0], a01 = mat[1], a02 = mat[2], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b00 = mat2[0], b01 = mat2[1], b02 = mat2[2], b10 = mat2[3], b11 = mat2[4], b20 = mat2[6], b21 = mat2[7];\n\n\t\tmat3[0] = b00 * a00 + b01 * a10;\n\t\tmat3[1] = b00 * a01 + b01 * a11;\n\t\tmat3[2] = a02 * b02;\n\t\tmat3[3] = b10 * a00 + b11 * a10;\n\t\tmat3[4] = b10 * a01 + b11 * a11;\n\t\tmat3[6] = b20 * a00 + b21 * a10 + a20;\n\t\tmat3[7] = b20 * a01 + b21 * a11 + a21;\n\n\t\treturn mat3;\n\t},\n\n\tinverse(mat, mat3) {\n\t\tlet a00 = mat[0], a01 = mat[1], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b01 = a11, b11 = -a10, b21 = a21 * a10 - a11 * a20, d = a00 * b01 + a01 * b11, id;\n\n\t\tid = 1 / d;\n\t\tmat3[0] = b01 * id;\n\t\tmat3[1] = (-a01) * id;\n\t\tmat3[3] = b11 * id;\n\t\tmat3[4] = a00 * id;\n\t\tmat3[6] = b21 * id;\n\t\tmat3[7] = (-a21 * a00 + a01 * a20) * id;\n\n\t\treturn mat3;\n\t},\n\n\tmultiplyVec2(m, vec, mat3) {\n\t\tlet x = vec[0], y = vec[1];\n\n\t\tmat3[0] = x * m[0] + y * m[3] + m[6];\n\t\tmat3[1] = x * m[1] + y * m[4] + m[7];\n\n\t\treturn mat3;\n\t}\n}","import Span from './Span';\nimport Util from '../utils/Util';\nimport MathUtils from './MathUtils';\n\nexport default class ArraySpan extends Span {\n\n constructor(color) {\n super();\n this._arr = Util.isArray(color) ? color : [color];\n }\n\n getValue() {\n const color = this._arr[Math.floor(this._arr.length * Math.random())];\n return color === 'random' || color === 'Random' ? MathUtils.randomColor() : color;\n }\n\n /**\n * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance\n *\n * @method setSpanValue\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n static createArraySpan(arr) {\n if (!arr) return null;\n\n if (arr instanceof ArraySpan)\n return arr;\n else\n return new ArraySpan(arr);\n }\n\n}","export default class Rectangle {\n\n\tconstructor(x, y, w, h) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\tthis.width = w;\n\t\tthis.height = h;\n\n\t\tthis.bottom = this.y + this.height;\n\t\tthis.right = this.x + this.width;\n\t}\n\n\tcontains(x, y) {\n\t\tif (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n}\n","import Util from '../utils/Util';\n\nexport default class Rate {\n\n\t/**\n\t * The number of particles per second emission (a [particle]/b [s]);\n\t * @namespace\n\t * @memberof! Proton#\n\t * @constructor\n\t * @alias Rate\n\t *\n\t * @param {Array | Number | Span} numpan the number of each emission;\n\t * @param {Array | Number | Span} timepan the time of each emission;\n\t * for example: new Rate(new Span(10, 20), new Span(.1, .25));\n\t */\n\tconstructor(numpan, timepan) {\n\t\tthis.numPan = Util.setSpanValue(Util.initValue(numpan, 1));\n\t\tthis.timePan = Util.setSpanValue(Util.initValue(timepan, 1));\n\n\t\tthis.startTime = 0;\n\t\tthis.nextTime = 0;\n\t\tthis.init();\n\t}\n\n\tinit() {\n\t\tthis.startTime = 0;\n\t\tthis.nextTime = this.timePan.getValue();\n\t}\n\n\tgetValue(time) {\n\t\tthis.startTime += time;\n\n\t\tif (this.startTime >= this.nextTime) {\n\t\t\tthis.startTime = 0;\n\t\t\tthis.nextTime = this.timePan.getValue();\n\n\t\t\tif (this.numPan.b === 1) {\n\t\t\t\tif (this.numPan.getValue(false) > 0.5)\n\t\t\t\t\treturn 1;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn this.numPan.getValue(true);\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n}","export default class Initialize {\n\n\treset() {\n\t}\n\n\tinit(emitter, particle) {\n\t\tif (particle) {\n\t\t\tthis.initialize(particle);\n\t\t} else {\n\t\t\tthis.initialize(emitter);\n\t\t}\n\t};\n\n\t// sub class init\n\tinitialize(target) {\n\t};\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Life extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\n\t\tthis.lifePan = Util.setSpanValue(a, b, c);\n\t\tthis.name = 'Life';\n\t}\n\n\tinitialize(target) {\n\t\tif (this.lifePan.a === Infinity)\n\t\t\ttarget.life = Infinity;\n\t\telse\n\t\t\ttarget.life = this.lifePan.getValue();\n\t}\n}\n","import Vector2D from '../math/Vector2D';\n\nexport default class Zone {\n\n\tconstructor() {\n\t\tthis.vector = new Vector2D(0, 0);\n\t\tthis.random = 0;\n\t\tthis.crossType = 'dead';\n\t\tthis.alert = true;\n\t}\n\n\tgetPosition() {\n\t}\n\n\tcrossing(particle) {\n\t}\n}\n","import Zone from './Zone';\n\nexport default class PointZone extends Zone {\n\n\tconstructor(x, y) {\n\t\tsuper();\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tgetPosition() {\n\t\tthis.vector.x = this.x;\n\t\tthis.vector.y = this.y;\n\t\treturn this.vector;\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.alert) {\n\t\t\talert('Sorry PointZone does not support crossing method');\n\t\t\tthis.alert = false;\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport PointZone from '../zone/PointZone';\nimport Initialize from './Initialize';\n\nexport default class Position extends Initialize {\n\n\tconstructor(zone) {\n\t\tsuper();\n\t\tthis.zone = Util.initValue(zone, new PointZone());\n\n\t\tthis.name = 'Position';\n\t}\n\n\treset(zone) {\n\t\tthis.zone = Util.initValue(zone, new PointZone());\n\t}\n\n\tinitialize(target) {\n\t\tthis.zone.getPosition();\n\n\t\ttarget.p.x = this.zone.vector.x;\n\t\ttarget.p.y = this.zone.vector.y;\n\t};\n\n}\n","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport Polar2D from '../math/Polar2D';\nimport MathUtils from '../math/MathUtils';\nimport Initialize from './Initialize';\n\nexport default class Velocity extends Initialize {\n\n constructor(rpan, thapan, type) {\n super();\n\n this.rPan = Util.setSpanValue(rpan);\n this.thaPan = Util.setSpanValue(thapan);\n this.type = Util.initValue(type, 'vector');\n\n this.name = 'Velocity';\n }\n\n reset(rpan, thapan, type) {\n this.rPan = Util.setSpanValue(rpan);\n this.thaPan = Util.setSpanValue(thapan);\n this.type = Util.initValue(type, 'vector');\n };\n\n normalizeVelocity(vr) {\n return vr * Proton.MEASURE;\n }\n\n initialize(target) {\n if (this.type === 'p' || this.type === 'P' || this.type === 'polar') {\n const polar2d = new Polar2D(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtils.PI_180);\n\n target.v.x = polar2d.getX();\n target.v.y = polar2d.getY();\n } else {\n target.v.x = this.normalizeVelocity(this.rPan.getValue());\n target.v.y = this.normalizeVelocity(this.thaPan.getValue());\n }\n };\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Mass extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\t\tthis.massPan = Util.setSpanValue(a, b, c);\n\t\tthis.name = 'Mass';\n\t}\n\n\tinitialize(target) {\n\t\ttarget.mass = this.massPan.getValue();\n\t}\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Radius extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\t\tthis.radius = Util.setSpanValue(a, b, c);\n\n\t\tthis.name = 'Radius';\n\t}\n\n\treset(a, b, c) {\n\t\tthis.radius = Util.setSpanValue(a, b, c);\n\t};\n\n\tinitialize(particle) {\n\t\tparticle.radius = this.radius.getValue();\n\t\tparticle.transform.oldRadius = particle.radius;\n\t};\n}","import Util from '../utils/Util';\nimport ArraySpan from '../math/ArraySpan';\nimport Initialize from './Initialize';\n\nexport default class Body extends Initialize {\n\n constructor(image, w, h) {\n super();\n\n this.image = this.setSpanValue(image);\n this.w = Util.initValue(w, 20);\n this.h = Util.initValue(h, this.w);\n this.name = 'Body';\n }\n\n initialize(particle) {\n const imagetarget = this.image.getValue();\n\n if (typeof (imagetarget) === 'string') {\n particle.body = { width: this.w, height: this.h, src: imagetarget, isInner: true, inner: true };\n } else {\n particle.body = imagetarget;\n }\n };\n\n setSpanValue(color) {\n return color instanceof ArraySpan ? color : new ArraySpan(color);\n }\n}","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport ease from '../math/ease';\n\nexport default class Behaviour {\n static id = 0;\n\n /**\n * The Behaviour class is the base for the other Behaviour\n *\n * @memberof! -\n * @interface\n * @alias Proton.Behaviour\n *\n * @param {Number} life \tthe behaviours life\n * @param {String} easing \tThe behaviour's decaying trend, for example ease.easeOutQuart\n *\n * @property {String} id \t\tThe behaviours id\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n * @property {Number} age=0 \tHow long the particle should be 'alife'\n * @property {Number} energy=1\n * @property {Boolean} dead=false The particle is dead at first\n * @property {Array} parents \tThe behaviour's parents array\n * @property {String} name \tThe behaviour name\n */\n constructor(life, easing) {\n\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n\n this.age = 0;\n this.energy = 1;\n this.dead = false;\n this.parents = [];\n\n this.id = `Behaviour_${Behaviour.id++}`;\n this.name = 'Behaviour';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(life, easing) {\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n }\n\n /**\n * Normalize a force by 1:100;\n *\n * @method normalizeForce\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Vector2D} force\n */\n normalizeForce(force) {\n return force.multiplyScalar(Proton.MEASURE);\n }\n\n /**\n * Normalize a value by 1:100;\n *\n * @method normalizeValue\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} value\n */\n normalizeValue(value) {\n return value * Proton.MEASURE;\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {}\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n calculate(particle, time, index) {\n this.age += time;\n\n if (this.age >= this.life || this.dead) {\n this.energy = 0;\n this.dead = true;\n this.destroy();\n } else {\n const scale = this.easing(particle.age / particle.life);\n this.energy = Math.max(1 - scale, 0);\n }\n }\n\n /**\n * Destory this behaviour\n *\n * @method destroy\n * @memberof Proton.Behaviour\n * @instance\n */\n destroy() {\n let i = this.parents.length;\n while (i--) {\n this.parents[i].removeBehaviour(this);\n }\n\n this.parents.length = 0;\n }\n}","import Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Force extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Force\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(fx, fy, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\t\tthis.name = 'Force';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(fx, fy, life, easing) {\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.a.add(this.force);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Attraction extends Behaviour {\n\n\t/**\n\t * This behaviour let the particles follow one specific Proton.Vector2D\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Attraction\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Proton.Vector2D} targetPosition\n\t * @property {Number} radius\n\t * @property {Number} force\n\t * @property {Number} radiusSq\n\t * @property {Proton.Vector2D} attractionForce\n\t * @property {Number} lengthSq\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tthis.name = 'Attraction';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Attraction\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Attraction\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tthis.attractionForce.copy(this.targetPosition);\n\t\tthis.attractionForce.sub(particle.p);\n\t\tthis.lengthSq = this.attractionForce.lengthSq();\n\n\t\tif (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) {\n\t\t\tthis.attractionForce.normalize();\n\t\t\tthis.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\n\t\t\tthis.attractionForce.multiplyScalar(this.force);\n\n\t\t\tparticle.a.add(this.attractionForce);\n\t\t}\n\t}\n}","import Vector2D from '../math/Vector2D';\nimport MathUtils from '../math/MathUtils';\nimport Behaviour from './Behaviour';\n\nexport default class RandomDrift extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias RandomDrift\n\t *\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} time The time of the drift\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(driftX, driftY, delay, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(driftX, driftY, delay);\n\t\tthis.time = 0;\n\t\tthis.name = 'RandomDrift';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#RandomDrift\n\t * @instance\n\t *\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\n\t */\n\treset(driftX, driftY, delay, life, easing) {\n\t\tthis.panFoce = new Vector2D(driftX, driftY);\n\t\tthis.panFoce = this.normalizeForce(this.panFoce);\n\t\tthis.delay = delay;\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#RandomDrift\n\t * @instance\n\t *\n\t * @param {Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tthis.time += time;\n\n\t\tif (this.time >= this.delay) {\n\t\t\tparticle.a.addXY(MathUtils.randomAToB(-this.panFoce.x, this.panFoce.x), MathUtils.randomAToB(-this.panFoce.y, this.panFoce.y));\n\t\t\tthis.time = 0;\n\t\t};\n\t}\n}\n","import Force from './Force';\n\nexport default class Gravity extends Force {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Force\n\t * @constructor\n\t * @alias Proton.Gravity\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(g, life, easing) {\n\t\tsuper(0, g, life, easing);\n\t\tthis.name = 'Gravity';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Gravity\n\t * @instance\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(g, life, easing) {\n\t\tsuper.reset(0, g, life, easing);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Collision extends Behaviour {\n\n\t/**\n\t * The callback after collision\n\t *\n\t * @callback Callback\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Proton.Paritcle} otherParticle\n\t */\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Collision\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(emitter, mass, callback, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(emitter, mass, callback);\n\t\tthis.name = 'Collision';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method reset\n\t * @instance\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} \t\t\t[life=Infinity] \tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(emitter, mass, callback, life, easing) {\n\t\tthis.emitter = Util.initValue(emitter, null);\n\t\tthis.mass = Util.initValue(mass, true);\n\t\tthis.callback = Util.initValue(callback, null);\n\n\t\tthis.collisionPool = [];\n\t\tthis.delta = new Vector2D();\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tconst newPool = this.emitter ? this.emitter.particles.slice(index) : this.pool.slice(index);\n\t\tconst length = newPool.length;\n\n\t\tlet otherParticle;\n\t\tlet lengthSq;\n\t\tlet overlap;\n\t\tlet totalMass;\n\t\tlet averageMass1, averageMass2;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\totherParticle = newPool[i];\n\n\t\t\tif (otherParticle !== particle) {\n\t\t\t\tthis.delta.copy(otherParticle.p);\n\t\t\t\tthis.delta.sub(particle.p);\n\n\t\t\t\tlengthSq = this.delta.lengthSq();\n\t\t\t\tconst distance = particle.radius + otherParticle.radius;\n\n\t\t\t\tif (lengthSq <= distance * distance) {\n\t\t\t\t\toverlap = distance - Math.sqrt(lengthSq);\n\t\t\t\t\toverlap += 0.5;\n\n\t\t\t\t\ttotalMass = particle.mass + otherParticle.mass;\n\t\t\t\t\taverageMass1 = this.mass ? otherParticle.mass / totalMass : 0.5;\n\t\t\t\t\taverageMass2 = this.mass ? particle.mass / totalMass : 0.5;\n\n\t\t\t\t\tparticle.p.add(this.delta.clone().normalize().multiplyScalar(overlap * -averageMass1));\n\t\t\t\t\totherParticle.p.add(this.delta.normalize().multiplyScalar(overlap * averageMass2));\n\n\t\t\t\t\tthis.callback && this.callback(particle, otherParticle);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class CrossZone extends Behaviour {\n\n /**\n * Defines what happens if the particles come to the end of the specified zone\n *\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.CrossZone\n *\n * @param {Proton.Zone} zone \t\t\t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \t\t\twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \t\t\tthis behaviour's life\n * @param {String} \t\t[easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(zone, crossType, life, easing) {\n super(life, easing);\n\n this.reset(zone, crossType);\n this.name = 'CrossZone';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Zone} zone \t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \tthis behaviour's life\n * @param {String} \t\t[easing=easeLinear]\tthis behaviour's easing\n */\n reset(zone, crossType, life, easing) {\n this.zone = zone;\n this.zone.crossType = Util.initValue(crossType, 'dead');\n\n life && super.reset(life, easing);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n this.zone.crossing(particle);\n };\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Alpha extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Alpha\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(a, b, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(a, b);\n\t\tthis.name = 'Alpha';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Alpha\n\t * @instance\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Util.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Sets the new alpha value of the particle\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Alpha\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle A single Proton generated particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.transform.alphaA = this.a.getValue();\n\n\t\tif (this.same)\n\t\t\tparticle.transform.alphaB = particle.transform.alphaA;\n\t\telse\n\t\t\tparticle.transform.alphaB = this.b.getValue();\n\t}\n\n\t/**\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Alpha\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n \t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.alpha = particle.transform.alphaB + (particle.transform.alphaA - particle.transform.alphaB) * this.energy;\n\t\tif (particle.alpha < 0.001) particle.alpha = 0;\n\t}\n}\n","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Scale extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Scale\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(a, b, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(a, b);\n\t\tthis.name = 'Scale';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Util.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.transform.scaleA = this.a.getValue();\n\t\tparticle.transform.oldRadius = particle.radius;\n\t\tparticle.transform.scaleB = this.same ? particle.transform.scaleA : this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.scale = particle.transform.scaleB + (particle.transform.scaleA - particle.transform.scaleB) * this.energy;\n\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\n\t\tparticle.radius = particle.transform.oldRadius * particle.scale;\n\t}\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Rotate extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Rotate\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} [influence=Velocity] The rotation's influence\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(influence, b, style, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(influence, b, style);\n\t\tthis.name = 'Rotate';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} a\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, style, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 'Velocity'));\n\t\tthis.b = Util.setSpanValue(Util.initValue(b, 0));\n\t\tthis.style = Util.initValue(style, 'to');\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.rotation = this.a.getValue();\n\t\tparticle.transform.rotationA = this.a.getValue();\n\n\t\tif (!this.same) particle.transform.rotationB = this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tif (!this.same) {\n\t\t\tif (this.style === 'to' || this.style === 'TO' || this.style === '_') {\n\t\t\t\tparticle.rotation += particle.transform.rotationB + (particle.transform.rotationA - particle.transform.rotationB) * this.energy\n\t\t\t} else {\n\t\t\t\tparticle.rotation += particle.transform.rotationB;\n\t\t\t}\n\t\t} else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') {\n\t\t\t// beta...\n\t\t\tparticle.rotation = particle.getDirection();\n\t\t}\n\t}\n\n}\n","import ColorUtil from '../utils/ColorUtil';\nimport ArraySpan from '../math/ArraySpan';\nimport Behaviour from './Behaviour';\n\nexport default class Color extends Behaviour {\n\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Color\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = 'Color';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.a = ArraySpan.createArraySpan(a);\n this.b = ArraySpan.createArraySpan(b);\n\n life && super.reset(life, easing);\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {\n particle.color = this.a.getValue();\n particle.transform.colorA = ColorUtil.hexToRGB(particle.color);\n\n if (this.b)\n particle.transform.colorB = ColorUtil.hexToRGB(this.b.getValue());\n };\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n if (this.b) {\n this.calculate(particle, time, index);\n\n particle.transform.rgb.r = particle.transform.colorB.r + (particle.transform.colorA.r - particle.transform.colorB.r) * this.energy;\n particle.transform.rgb.g = particle.transform.colorB.g + (particle.transform.colorA.g - particle.transform.colorB.g) * this.energy;\n particle.transform.rgb.b = particle.transform.colorB.b + (particle.transform.colorA.b - particle.transform.colorB.b) * this.energy;\n\n particle.transform.rgb.r = Math.floor(particle.transform.rgb.r);\n particle.transform.rgb.g = Math.floor(particle.transform.rgb.g);\n particle.transform.rgb.b = Math.floor(particle.transform.rgb.b);\n\n } else {\n particle.transform.rgb.r = particle.transform.colorA.r;\n particle.transform.rgb.g = particle.transform.colorA.g;\n particle.transform.rgb.b = particle.transform.colorA.b;\n }\n };\n\n}","import Attraction from './Attraction';\n\nexport default class Repulsion extends Attraction {\n\n\t/**\n\t * The oppisite of Proton.Attraction - turns the force\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Attraction\n\t * @constructor\n\t * @alias Proton.Repulsion\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} force\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(targetPosition, force, radius, life, easing);\n\n\t\tthis.force *= -1;\n\t\tthis.name = 'Repulsion';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Repulsion\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tsuper.reset(targetPosition, force, radius, life, easing);\n\t\tthis.force *= -1;\n\t}\n}\n","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class GravityWell extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias GravityWell\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(centerPoint, force, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.name = 'GravityWell';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t */\n\treset(centerPoint, force, life, easing) {\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tlife && super.reset(life, easing);\n\t};\n\n\t/**\n\t * @inheritdoc\n\t */\n\tinitialize(particle) {\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y);\n\t\tconst distanceSq = this.distanceVec.lengthSq();\n\n\t\tif (distanceSq !== 0) {\n\t\t\tconst distance = this.distanceVec.length();\n\t\t\tconst factor = (this.force * time) / (distanceSq * distance);\n\n\t\t\tparticle.v.x += factor * this.distanceVec.x;\n\t\t\tparticle.v.y += factor * this.distanceVec.y;\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\nimport MathUtils from '../math/MathUtils';\n\nexport default {\n\n\tinitialize(emitter, particle, initializes) {\n\t\tconst length = initializes.length;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tif (initializes[i] instanceof Initialize)\n\t\t\t\tinitializes[i].init(emitter, particle);\n\t\t\telse\n\t\t\t\tthis.init(emitter, particle, initializes[i]);\n\t\t}\n\n\t\tthis.bindEmitter(emitter, particle);\n\t},\n\n\t// init\n\tinit(emitter, particle, initialize) {\n\t\tUtil.setPrototypeByObject(particle, initialize);\n\t\tUtil.setVector2DByObject(particle, initialize);\n\t},\n\n\tbindEmitter(emitter, particle) {\n\t\tif (emitter.bindEmitter) {\n\t\t\tparticle.p.add(emitter.p);\n\t\t\tparticle.v.add(emitter.v);\n\t\t\tparticle.a.add(emitter.a);\n\n\t\t\tparticle.v.rotate(MathUtils.degreeTransform(emitter.rotation));\n\t\t}\n\t}\n}\n","import Util from '../utils/Util';\nimport Particle from '../core/Particle';\nimport EventDispatcher from '../events/EventDispatcher';\n\nimport Rate from '../initialize/Rate';\nimport InitializeUtil from '../initialize/InitializeUtil';\n\nexport default class Emitter extends Particle {\n\n\tstatic ID = 0;\n\n\t/**\n\t * You can use this emit particles.\n\t *\n\t * It will dispatch follow events:\n\t * PARTICLE_CREATED\n\t * PARTICLE_UPDATA\n\t * PARTICLE_DEAD\n\t *\n\t * @class Emitter\n\t * @constructor\n\t * @param {Object} pObj the parameters object;\n\t * for example {damping:0.01,bindEmitter:false}\n\t */\n\tconstructor(pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.initializes = [];\n\t\tthis.particles = [];\n\t\tthis.behaviours = [];\n\n\t\tthis.emitSpeed = 0;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = -1;\n\n\t\t/**\n\t\t * The friction coefficient for all particle emit by This;\n\t\t * @property damping\n\t\t * @type {Number}\n\t\t * @default 0.006\n\t\t */\n\t\tthis.damping = .006;\n\n\t\t/**\n\t\t * If bindEmitter the particles can bind this emitter's property;\n\t\t * @property bindEmitter\n\t\t * @type {Boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.bindEmitter = true;\n\n\t\t/**\n\t\t * The number of particles per second emit (a [particle]/b [s]);\n\t\t * @property rate\n\t\t * @type {Rate}\n\t\t * @default Rate(1, .1)\n\t\t */\n\t\tthis.rate = new Rate(1, .1);\n\n\t\tthis.id = `emitter_${Emitter.ID++}`;\n\t\tthis.name = 'Emitter';\n\t}\n\n\t/**\n\t * start emit particle\n\t * @method emit\n\t * @param {Number} emitTime begin emit time;\n\t * @param {String} life the life of this emitter\n\t */\n\temit(totalTime, life) {\n\t\tthis.stoped = false;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = Util.initValue(totalTime, Infinity);\n\n\t\tif (life === true || life === 'life' || life === 'destroy') {\n\t\t\tthis.life = totalTime === 'once' ? 1 : this.totalTime;\n\t\t} else if (!isNaN(life)) {\n\t\t\tthis.life = life;\n\t\t}\n\n\t\tthis.rate.init();\n\t}\n\n\t/**\n\t * stop emiting\n\t * @method stop\n\t */\n\tstop() {\n\t\tthis.totalTime = -1;\n\t\tthis.emitTime = 0;\n\t\tthis.stoped = true;\n\t}\n\n\tpreEmit(time) {\n\t\tlet oldStoped = this.stoped;\n\t\tlet oldEmitTime = this.emitTime;\n\t\tlet oldTotalTime = this.totalTime;\n\n\t\tthis.stoped = false;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = time;\n\t\tthis.rate.init();\n\n\t\tconst step = 0.0167;\n\t\twhile (time > step) {\n\t\t\ttime -= step;\n\t\t\tthis.update(step);\n\t\t}\n\n\t\tthis.stoped = oldStoped;\n\t\tthis.emitTime = oldEmitTime + Math.max(time, 0);\n\t\tthis.totalTime = oldTotalTime;\n\t}\n\n\t/**\n\t * remove current all particles\n\t * @method removeAllParticles\n\t */\n\tremoveAllParticles() {\n\t\tlet i = this.particles.length;\n\t\twhile (i--) this.particles[i].dead = true;\n\t}\n\n\t/**\n\t * add initialize to this emitter\n\t * @method addSelfInitialize\n\t */\n\taddSelfInitialize(pObj) {\n\t\tif (pObj['init']) {\n\t\t\tpObj.init(this);\n\t\t} else {\n\t\t\tthis.initAll();\n\t\t}\n\t}\n\n\t/**\n\t * add the Initialize to particles;\n\t *\n\t * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\n\t * @method addInitialize\n\t * @param {Initialize} initialize like this new Radius(1, 12)\n\t */\n\taddInitialize(...rest) {\n\t\tlet i = rest.length;\n\t\twhile (i--)\n\t\t\tthis.initializes.push(rest[i]);\n\t}\n\n\t/**\n\t * remove the Initialize\n\t * @method removeInitialize\n\t * @param {Initialize} initialize a initialize\n\t */\n\tremoveInitialize(initializer) {\n\t\tconst index = this.initializes.indexOf(initializer);\n\t\tif (index > -1) this.initializes.splice(index, 1);\n\t}\n\n\t/**\n\t * remove all Initializes\n\t * @method removeInitializers\n\t */\n\tremoveAllInitializers() {\n\t\tUtil.destroyArray(this.initializes);\n\t}\n\n\t/**\n\t * add the Behaviour to particles;\n\t *\n\t * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\n\t * @method addBehaviour\n\t * @param {Behaviour} behaviour like this new Color('random')\n\t */\n\taddBehaviour(...rest) {\n\t\tlet i = arguments.length;\n\t\twhile (i--) {\n\t\t\tlet behaviour = rest[i];\n\t\t\tthis.behaviours.push(behaviour);\n\t\t\tif (behaviour.parents) behaviour.parents.push(this);\n\t\t}\n\t}\n\n\t/**\n\t * remove the Behaviour\n\t * @method removeBehaviour\n\t * @param {Behaviour} behaviour a behaviour\n\t */\n\tremoveBehaviour(behaviour) {\n\t\tlet index = this.behaviours.indexOf(behaviour);\n\t\tthis.behaviours.splice(index, 1);\n\n\t\tif (behaviour.parents) {\n\t\t\tindex = behaviour.parents.indexOf(behaviour);\n\t\t\tbehaviour.parents.splice(index, 1);\n\t\t}\n\n\t\treturn index;\n\t}\n\n\t/**\n\t * remove all behaviours\n\t * @method removeAllBehaviours\n\t */\n\tremoveAllBehaviours() {\n\t\tUtil.destroyArray(this.behaviours);\n\t}\n\n\t// emitter update\n\tupdate(time) {\n\t\tthis.age += time;\n\t\tif (this.age >= this.life || this.dead) this.destroy();\n\n\t\tthis.emitting(time);\n\t\tthis.integrate(time);\n\t}\n\n\tintegrate(time) {\n\t\tif (!this.parent) return;\n\n\t\tconst damping = 1 - this.damping;\n\t\tthis.parent.integrator.calculate(this, time, damping);\n\n\t\tconst length = this.particles.length;\n\t\tlet i, particle;\n\n\t\tfor (i = length - 1; i >= 0; i--) {\n\t\t\tparticle = this.particles[i];\n\n\t\t\t// particle update\n\t\t\tparticle.update(time, i);\n\t\t\tthis.parent.integrator.calculate(particle, time, damping);\n\t\t\tthis.dispatch('PARTICLE_UPDATE', particle);\n\n\t\t\t// check dead\n\t\t\tif (particle.dead) {\n\t\t\t\tthis.dispatch('PARTICLE_DEAD', particle);\n\n\t\t\t\tthis.parent.pool.expire(particle);\n\t\t\t\tthis.particles.splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tdispatch(event, target) {\n\t\tthis.parent && this.parent.dispatchEvent(event, target);\n\t\tthis.bindEvent && this.dispatchEvent(event, target);\n\t}\n\n\temitting(time) {\n\t\tif (this.totalTime === 'once') {\n\t\t\tlet i;\n\t\t\tconst length = this.rate.getValue(99999);\n\n\t\t\tif (length > 0) this.emitSpeed = length;\n\t\t\tfor (i = 0; i < length; i++) this.createParticle();\n\t\t\tthis.totalTime = 'none';\n\t\t}\n\n\t\telse {\n\t\t\tthis.emitTime += time;\n\n\t\t\tif (this.emitTime < this.totalTime) {\n\t\t\t\tconst length = this.rate.getValue(time)\n\t\t\t\tlet i;\n\n\t\t\t\tif (length > 0) this.emitSpeed = length;\n\t\t\t\tfor (i = 0; i < length; i++) this.createParticle();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * create single particle;\n\t *\n\t * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\n\t * @method removeAllParticles\n\t */\n\tcreateParticle(initialize, behaviour) {\n\t\tconst particle = this.parent.pool.get(Particle);\n\t\tthis.setupParticle(particle, initialize, behaviour);\n\t\tthis.dispatch('PARTICLE_CREATED', particle);\n\n\t\treturn particle;\n\t}\n\n\tsetupParticle(particle, initialize, behaviour) {\n\t\tlet initializes = this.initializes;\n\t\tlet behaviours = this.behaviours;\n\n\t\tif (initialize) {\n\t\t\tinitializes = Util.isArray(initialize) ? initialize : [initialize];\n\t\t}\n\n\t\tif (behaviour) {\n\t\t\tbehaviour = Util.isArray(behaviour) ? behaviour : [behaviour];\n\t\t}\n\n\t\tparticle.reset();\n\t\tInitializeUtil.initialize(this, particle, initializes);\n\t\tparticle.addBehaviours(behaviours);\n\t\tparticle.parent = this;\n\n\t\tthis.particles.push(particle);\n\t}\n\n\tremove() {\n\t\tthis.stop();\n\t\tUtil.destroy(this.particles);\n\t}\n\n\t/**\n\t * Destory this Emitter\n\t * @method destroy\n\t */\n\tdestroy(slow) {\n\t\tthis.dead = true;\n\t\tthis.remove();\n\t\tthis.removeAllInitializers();\n\t\tthis.removeAllBehaviours();\n\t\tthis.parent && this.parent.removeEmitter(this);\n\t}\n\n}\n\nEventDispatcher.bind(Emitter);","import Emitter from './Emitter';\n\nexport default class BehaviourEmitter extends Emitter {\n\n\t/**\n\t * The BehaviourEmitter class inherits from Proton.Emitter\n\t *\n\t * use the BehaviourEmitter you can add behaviours to self;\n\t * @class Proton.BehaviourEmitter\n\t * @constructor\n\t * @param {Object} pObj the parameters object;\n\t */\n\tconstructor(pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.selfBehaviours = [];\n\t};\n\n\t/**\n\t * add the Behaviour to emitter;\n\t *\n\t * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\n\t * @method addSelfBehaviour\n\t * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\n\t */\n\taddSelfBehaviour(...rest) {\n\t\tconst length = rest.length;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tthis.selfBehaviours.push(rest[i]);\n\t\t}\n\t};\n\n\t/**\n\t * remove the Behaviour for self\n\t * @method removeSelfBehaviour\n\t * @param {Proton.Behaviour} behaviour a behaviour\n\t */\n\tremoveSelfBehaviour(behaviour) {\n\t\tconst index = this.selfBehaviours.indexOf(behaviour);\n\t\tif (index > -1) this.selfBehaviours.splice(index, 1);\n\t};\n\n\tupdate(time) {\n\t\tsuper.update(time);\n\n\t\tif (!this.sleep) {\n\t\t\tconst length = this.selfBehaviours.length;\n\t\t\tlet i;\n\n\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\tthis.selfBehaviours[i].applyBehaviour(this, time, i);\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Emitter from './Emitter';\n\nexport default class FollowEmitter extends Emitter {\n\n\t/**\n\t * The FollowEmitter class inherits from Proton.Emitter\n\t *\n\t * use the FollowEmitter will emit particle when mousemoving\n\t *\n\t * @class Proton.FollowEmitter\n\t * @constructor\n\t * @param {Element} mouseTarget mouseevent's target;\n\t * @param {Number} ease the easing of following speed;\n\t * @default 0.7\n\t * @param {Object} pObj the parameters object;\n\t */\n\tconstructor(mouseTarget, ease, pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.mouseTarget = Util.initValue(mouseTarget, window);\n\t\tthis.ease = Util.initValue(ease, 0.7);\n\n\t\tthis._allowEmitting = false;\n\t\tthis.initEventHandler();\n\t};\n\n\tinitEventHandler() {\n\t\tthis.mousemoveHandler = e => this.mousemove.call(this, e);\n\t\tthis.mousedownHandler = e => this.mousedown.call(this, e);\n\t\tthis.mouseupHandler = e => this.mouseup.call(this, e);\n\n\t\tthis.mouseTarget.addEventListener('mousemove', this.mousemoveHandler, false);\n\t}\n\n\t/**\n\t * start emit particle\n\t * @method emit\n\t */\n\temit() {\n\t\tthis._allowEmitting = true;\n\t}\n\n\t/**\n\t * stop emiting\n\t * @method stop\n\t */\n\tstop() {\n\t\tthis._allowEmitting = false;\n\t}\n\n\tmousemove(e) {\n\t\tif (e.layerX || e.layerX === 0) {\n\t\t\tthis.p.x += (e.layerX - this.p.x) * this.ease;\n\t\t\tthis.p.y += (e.layerY - this.p.y) * this.ease;\n\t\t} else if (e.offsetX || e.offsetX === 0) {\n\t\t\tthis.p.x += (e.offsetX - this.p.x) * this.ease;\n\t\t\tthis.p.y += (e.offsetY - this.p.y) * this.ease;\n\t\t}\n\n\t\tif (this._allowEmitting) super.emit('once');\n\t};\n\n\t/**\n\t * Destory this Emitter\n\t * @method destroy\n\t */\n\tdestroy() {\n\t\tsuper.destroy();\n\t\tthis.mouseTarget.removeEventListener('mousemove', this.mousemoveHandler, false);\n\t}\n\n}\n","import Pool from '../core/Pool';\nimport Util from '../utils/Util';\n\nexport default class BaseRenderer {\n\n constructor(element, stroke) {\n this.element = element;\n this.stroke = stroke;\n\n this.initHandler();\n\n this.circleConf = { isCircle: true };\n this.pool = new Pool();\n this.name = 'BaseRenderer';\n }\n\n setStroke(color, thinkness) {\n color = Util.initValue(color, '#000000');\n thinkness = Util.initValue(thinkness, 1);\n\n this.stroke = { color, thinkness };\n }\n\n initHandler() {\n this._protonUpdateHandler = () => { this.onProtonUpdate.call(this) };\n this._protonUpdateAfterHandler = () => { this.onProtonUpdateAfter.call(this) };\n this._emitterAddedHandler = (emitter) => { this.onEmitterAdded.call(this, emitter) };\n this._emitterRemovedHandler = (emitter) => { this.onEmitterRemoved.call(this, emitter) };\n this._particleCreatedHandler = (particle) => { this.onParticleCreated.call(this, particle) };\n this._particleUpdateHandler = (particle) => { this.onParticleUpdate.call(this, particle) };\n this._particleDeadHandler = (particle) => { this.onParticleDead.call(this, particle) };\n }\n\n init(proton) {\n this.parent = proton;\n\n proton.addEventListener('PROTON_UPDATE', this._protonUpdateHandler);\n proton.addEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\n\n proton.addEventListener('EMITTER_ADDED', this._emitterAddedHandler);\n proton.addEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\n\n proton.addEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\n proton.addEventListener('PARTICLE_UPDATE', this._particleUpdateHandler);\n proton.addEventListener('PARTICLE_DEAD', this._particleDeadHandler);\n }\n\n resize(width, height) { }\n\n destroy() {\n this.remove();\n }\n\n remove(proton) {\n this.parent.removeEventListener('PROTON_UPDATE', this._protonUpdateHandler);\n this.parent.removeEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\n\n this.parent.removeEventListener('EMITTER_ADDED', this._emitterAddedHandler);\n this.parent.removeEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\n\n this.parent.removeEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\n this.parent.removeEventListener('PARTICLE_UPDATE', this._particleUpdateHandler);\n this.parent.removeEventListener('PARTICLE_DEAD', this._particleDeadHandler);\n\n this.parent = null;\n }\n\n onProtonUpdate() { }\n onProtonUpdateAfter() { }\n\n onEmitterAdded(emitter) { }\n onEmitterRemoved(emitter) { }\n\n onParticleCreated(particle) { }\n onParticleUpdate(particle) { }\n onParticleDead(particle) { }\n}","import ImgUtil from '../utils/ImgUtil';\nimport ColorUtil from '../utils/ColorUtil';\nimport MathUtils from '../math/MathUtils';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class CanvasRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.context = this.element.getContext('2d');\n this.bufferCache = {};\n\n this.name = 'CanvasRenderer';\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n onProtonUpdate() {\n this.context.clearRect(0, 0, this.element.width, this.element.height);\n }\n\n onParticleCreated(particle) {\n if (particle.body)\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n else\n particle.color = particle.color || '#ff0000';\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n if (particle.body instanceof Image) this.drawImage(particle);\n } else {\n this.drawCircle(particle);\n }\n }\n\n onParticleDead(particle) {\n particle.body = null;\n }\n\n // private\n addImg2Body(img, particle) {\n particle.body = img;\n }\n\n // private drawCircle\n drawImage(particle) {\n const w = particle.body.width * particle.scale | 0;\n const h = particle.body.height * particle.scale | 0;\n const x = particle.p.x - w / 2;\n const y = particle.p.y - h / 2;\n\n if (!!particle.color) {\n if (!particle.transform['buffer']) particle.transform.buffer = this.createBuffer(particle.body);\n\n const bufferContext = particle.transform.buffer.getContext('2d');\n bufferContext.clearRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\n bufferContext.globalAlpha = particle.alpha;\n bufferContext.drawImage(particle.body, 0, 0);\n\n bufferContext.globalCompositeOperation = 'source-atop';\n bufferContext.fillStyle = ColorUtil.rgbToHex(particle.transform.rgb);\n bufferContext.fillRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\n bufferContext.globalCompositeOperation = 'source-over';\n bufferContext.globalAlpha = 1;\n\n this.context.drawImage(particle.transform.buffer, 0, 0, particle.transform.buffer.width, particle.transform.buffer.height, x, y, w, h);\n } else {\n this.context.save();\n\n this.context.globalAlpha = particle.alpha;\n this.context.translate(particle.p.x, particle.p.y);\n this.context.rotate(MathUtils.degreeTransform(particle.rotation));\n this.context.translate(-particle.p.x, -particle.p.y);\n this.context.drawImage(particle.body, 0, 0, particle.body.width, particle.body.height, x, y, w, h);\n\n this.context.globalAlpha = 1;\n this.context.restore();\n }\n }\n\n // private drawCircle --\n drawCircle(particle) {\n if (particle.transform['rgb'])\n this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')';\n else\n this.context.fillStyle = particle.color;\n\n // draw circle\n this.context.beginPath();\n this.context.arc(particle.p.x, particle.p.y, particle.radius, 0, Math.PI * 2, true);\n\n if (this.stroke) {\n this.context.strokeStyle = this.stroke.color;\n this.context.lineWidth = this.stroke.thinkness;\n this.context.stroke();\n }\n\n this.context.closePath();\n this.context.fill();\n }\n\n // private createBuffer --\n createBuffer(image) {\n if (image instanceof Image) {\n const size = image.width + '_' + image.height;\n let canvas = this.bufferCache[size];\n\n if (!canvas) {\n canvas = document.createElement('canvas');\n canvas.width = image.width;\n canvas.height = image.height;\n this.bufferCache[size] = canvas;\n }\n\n return canvas;\n }\n }\n}","import DomUtil from '../utils/DomUtil';\nimport ImgUtil from '../utils/ImgUtil';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class DomRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.transform3d = false;\n\n this.name = 'DomRenderer';\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n this.element.appendChild(particle.body);\n }\n }\n\n onParticleUpdate(particle) {\n if (this.bodyReady(particle)) {\n if (this.transform3d)\n DomUtil.transform3d(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\n else\n DomUtil.transform(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\n\n particle.body.style.opacity = particle.alpha;\n if (particle.body.isCircle) {\n particle.body.style.backgroundColor = particle.color || '#ff0000';\n }\n }\n }\n\n onParticleDead(particle) {\n if (this.bodyReady(particle)) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n }\n\n bodyReady(particle) {\n return typeof particle.body === 'object' && particle.body && !particle.body.isInner;\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = this.pool.get(img, particle);\n DomUtil.resize(particle.body, img.width, img.height);\n\n this.element.appendChild(particle.body);\n }\n\n createBody(body, particle) {\n if (body.isCircle)\n return this.createCircle(particle);\n else\n return this.createSprite(body, particle);\n }\n\n // private --\n createCircle(particle) {\n const dom = DomUtil.createDiv(`${particle.id}_dom`, 2 * particle.radius, 2 * particle.radius);\n dom.style.borderRadius = `${particle.radius}px`;\n\n if (this.stroke) {\n dom.style.borderColor = this.stroke.color;\n dom.style.borderWidth = `${this.stroke.thinkness}px`;\n }\n dom.isCircle = true;\n\n return dom;\n }\n\n createSprite(body, particle) {\n const url = typeof body === 'string' ? body : body.src;\n const dom = DomUtil.createDiv(`${particle.id}_dom`, body.width, body.height);\n dom.style.backgroundImage = `url(${url})`;\n\n return dom;\n }\n\n}","import BaseRenderer from './BaseRenderer';\n\nexport default class EaselRenderer extends BaseRenderer {\n\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.name = 'EaselRenderer';\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n this.createSprite(particle);\n } else {\n this.createCircle(particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n particle.body.x = particle.p.x;\n particle.body.y = particle.p.y;\n\n particle.body.alpha = particle.alpha;\n particle.body.scaleX = particle.body.scaleY = particle.scale;\n particle.body.rotation = particle.rotation;\n }\n }\n\n onParticleDead(particle) {\n if (particle.body) {\n particle.body.parent && particle.body.parent.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n if (particle.graphics) this.pool.expire(particle.graphics);\n }\n\n // private\n createSprite(particle) {\n particle.body = this.pool.get(particle.body);\n\n if (particle.body.parent) return;\n if (particle.body['image']) {\n particle.body.regX = particle.body.image.width / 2;\n particle.body.regY = particle.body.image.height / 2;\n }\n }\n\n createCircle(particle) {\n const graphics = this.pool.get(createjs.Graphics);\n\n if (this.stroke) {\n if (this.stroke instanceof String)\n graphics.beginStroke(this.stroke);\n else\n graphics.beginStroke('#000000');\n }\n graphics.beginFill(particle.color || '#ff0000').drawCircle(0, 0, particle.radius);\n\n const shape = this.pool.get(createjs.Shape, [graphics]);\n\n particle.body = shape;\n particle.graphics = graphics;\n }\n\n}","import Rectangle from '../math/Rectangle';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class PixelRenderer extends BaseRenderer {\n\n constructor(element, rectangle) {\n super(element);\n\n this.context = this.element.getContext('2d');\n this.imageData = null;\n this.rectangle = null;\n this.rectangle = rectangle;\n this.createImageData(rectangle);\n\n this.name = 'PixelRenderer';\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n createImageData(rectangle) {\n this.rectangle = rectangle ? rectangle : new Rectangle(0, 0, this.element.width, this.element.height);\n this.imageData = this.context.createImageData(this.rectangle.width, this.rectangle.height);\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\n }\n\n onProtonUpdate() {\n this.context.clearRect(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\n this.imageData = this.context.getImageData(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\n }\n\n onProtonUpdateAfter() {\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\n }\n\n onParticleCreated(particle) {}\n\n onParticleUpdate(particle) {\n if (this.imageData) {\n this.setPixel(this.imageData, Math.floor(particle.p.x - this.rectangle.x), Math.floor(particle.p.y - this.rectangle.y), particle);\n }\n }\n\n setPixel(imagedata, x, y, particle) {\n const rgb = particle.transform.rgb;\n\n if ((x < 0) || (x > this.element.width) || (y < 0) || (y > this.elementwidth))\n return;\n\n const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4;\n\n imagedata.data[i] = rgb.r;\n imagedata.data[i + 1] = rgb.g;\n imagedata.data[i + 2] = rgb.b;\n imagedata.data[i + 3] = particle.alpha * 255;\n }\n\n onParticleDead(particle) {\n\n }\n\n}","import ColorUtil from '../utils/ColorUtil';\nimport MathUtils from '../math/MathUtils';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class PixiRenderer extends BaseRenderer {\n\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.setColor = false;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.name = 'PixiRenderer';\n }\n\n onProtonUpdate() { }\n\n /**\n * @param particle\n */\n onParticleCreated(particle) {\n if (particle.body) {\n particle.body = this.pool.get(particle.body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n /**\n * @param particle\n */\n onParticleUpdate(particle) {\n this.transform(particle, particle.body);\n if (this.setColor) particle.body.tint = ColorUtil.getHex16FromParticle(particle);\n }\n\n /**\n * @param particle\n */\n onParticleDead(particle) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n destroy(particles) {\n super.destroy();\n this.pool.destroy();\n\n let i = particles.length;\n while (i--) {\n let particle = particles[i];\n if (particle.body) {\n this.element.removeChild(particle.body);\n }\n }\n }\n\n transform(particle, target) {\n target.x = particle.p.x;\n target.y = particle.p.y;\n\n target.alpha = particle.alpha;\n\n target.scale.x = particle.scale;\n target.scale.y = particle.scale;\n\n // using cached version of MathUtils.PI_180 for slight performance increase.\n target.rotation = particle.rotation * MathUtils.PI_180; // MathUtils.PI_180;\n }\n\n createBody(body, particle) {\n if (body.isCircle)\n return this.createCircle(particle);\n else\n return this.createSprite(body);\n }\n\n createSprite(body) {\n const sprite = body.isInner ? PIXI.Sprite.fromImage(body.src) : new PIXI.Sprite(body);\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n\n return sprite;\n }\n\n createCircle(particle) {\n const graphics = new PIXI.Graphics();\n\n if (this.stroke) {\n const stroke = this.stroke instanceof String ? this.stroke : 0x000000;\n graphics.beginStroke(stroke);\n }\n\n graphics.beginFill(particle.color || 0x008ced);\n graphics.drawCircle(0, 0, particle.radius);\n graphics.endFill();\n\n return graphics;\n }\n}","import Mat3 from '../math/Mat3';\n\nexport default class MStack {\n\n\tconstructor() {\n\t\tthis.mats = [];\n\t\tthis.size = 0;\n\n\t\tfor (let i = 0; i < 20; i++) this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\n\t}\n\n\tset(m, i) {\n\t\tif (i === 0)\n\t\t\tMat3.set(m, this.mats[0]);\n\t\telse\n\t\t\tMat3.multiply(this.mats[i - 1], m, this.mats[i]);\n\n\t\tthis.size = Math.max(this.size, i + 1);\n\t}\n\n\tpush(m) {\n\t\tif (this.size === 0)\n\t\t\tMat3.set(m, this.mats[0]);\n\t\telse\n\t\t\tMat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\n\n\t\tthis.size++;\n\t}\n\n\tpop() {\n\t\tif (this.size > 0)\n\t\t\tthis.size--;\n\t}\n\n\ttop() {\n\t\treturn (this.mats[this.size - 1]);\n\t}\n}","import Mat3 from '../math/Mat3';\nimport BaseRenderer from './BaseRenderer';\n\nimport Util from '../utils/Util';\nimport ImgUtil from '../utils/ImgUtil';\nimport MStack from '../utils/MStack';\nimport DomUtil from '../utils/DomUtil';\nimport WebGLUtil from '../utils/WebGLUtil';\nimport MathUtils from '../math/MathUtils';\n\nexport default class WebGLRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.gl = this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false });\n if (!this.gl) alert('Sorry your browser do not suppest WebGL!');\n\n this.initVar();\n this.setMaxRadius();\n this.initShaders();\n this.initBuffers();\n\n this.gl.blendEquation(this.gl.FUNC_ADD);\n this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);\n this.gl.enable(this.gl.BLEND);\n\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.name = 'WebGLRenderer';\n }\n\n init(proton) {\n super.init(proton);\n this.resize(this.element.width, this.element.height);\n }\n\n resize(width, height) {\n this.umat[4] = -2;\n this.umat[7] = 1;\n\n this.smat[0] = 1 / width;\n this.smat[4] = 1 / height;\n\n this.mstack.set(this.umat, 0);\n this.mstack.set(this.smat, 1);\n\n this.gl.viewport(0, 0, width, height);\n this.element.width = width;\n this.element.height = height;\n }\n\n setMaxRadius(radius) {\n this.circleCanvasURL = this.createCircle(radius);\n }\n\n getVertexShader() {\n const vsSource = ['uniform vec2 viewport;', 'attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 tMat;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'void main() {', 'vec3 v = tMat * vec3(aVertexPosition, 1.0);', 'gl_Position = vec4(v.x, v.y, 0, 1);', 'vTextureCoord = aTextureCoord;', 'alpha = tMat[0][2];', '}'].join('\\n');\n return vsSource;\n }\n\n getFragmentShader() {\n const fsSource = ['precision mediump float;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'uniform sampler2D uSampler;', 'uniform vec4 color;', 'uniform bool useTexture;', 'uniform vec3 uColor;', 'void main() {', 'vec4 textureColor = texture2D(uSampler, vTextureCoord);', 'gl_FragColor = textureColor * vec4(uColor, 1.0);', 'gl_FragColor.w *= alpha;', '}'].join('\\n');\n return fsSource;\n }\n\n initVar() {\n this.mstack = new MStack();\n this.umat = Mat3.create([2, 0, 1, 0, -2, 0, -1, 1, 1]);\n this.smat = Mat3.create([1 / 100, 0, 1, 0, 1 / 100, 0, 0, 0, 1]);\n this.texturebuffers = {};\n }\n\n blendEquation(A) {\n this.gl.blendEquation(this.gl[A]);\n }\n\n blendFunc(A, B) {\n this.gl.blendFunc(this.gl[A], this.gl[B]);\n }\n\n getShader(gl, str, fs) {\n const shader = fs ? gl.createShader(gl.FRAGMENT_SHADER) : gl.createShader(gl.VERTEX_SHADER);\n\n gl.shaderSource(shader, str);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n }\n\n initShaders() {\n const fragmentShader = this.getShader(this.gl, this.getFragmentShader(), true);\n const vertexShader = this.getShader(this.gl, this.getVertexShader(), false);\n\n this.sprogram = this.gl.createProgram();\n this.gl.attachShader(this.sprogram, vertexShader);\n this.gl.attachShader(this.sprogram, fragmentShader);\n this.gl.linkProgram(this.sprogram);\n\n if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS))\n alert('Could not initialise shaders');\n\n this.gl.useProgram(this.sprogram);\n this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, 'aVertexPosition');\n this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, 'aTextureCoord');\n this.gl.enableVertexAttribArray(this.sprogram.tca);\n this.gl.enableVertexAttribArray(this.sprogram.vpa);\n\n this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, 'tMat');\n this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, 'uSampler');\n this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, 'useTexture');\n this.sprogram.color = this.gl.getUniformLocation(this.sprogram, 'uColor');\n this.gl.uniform1i(this.sprogram.useTex, 1);\n };\n\n initBuffers() {\n const vs = [0, 3, 1, 0, 2, 3];\n let idx;\n\n this.unitIBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vs), this.gl.STATIC_DRAW);\n\n let i;\n let ids = [];\n for (i = 0; i < 100; i++) ids.push(i);\n idx = new Uint16Array(ids);\n\n this.unitI33 = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitI33);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n\n ids = [];\n for (i = 0; i < 100; i++) ids.push(i, i + 1, i + 2);\n idx = new Uint16Array(ids);\n\n this.stripBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.stripBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n };\n\n createCircle(raidus) {\n this.circleCanvasRadius = WebGLUtil.nhpot(Util.initValue(raidus, 32));\n const canvas = DomUtil.createCanvas('circle_canvas', this.circleCanvasRadius * 2, this.circleCanvasRadius * 2);\n const context = canvas.getContext('2d');\n\n context.beginPath();\n context.arc(this.circleCanvasRadius, this.circleCanvasRadius, this.circleCanvasRadius, 0, Math.PI * 2, true);\n context.closePath();\n context.fillStyle = '#FFF';\n context.fill();\n\n return canvas.toDataURL();\n };\n\n drawImg2Canvas(particle) {\n const _w = particle.body.width;\n const _h = particle.body.height;\n\n const _width = WebGLUtil.nhpot(particle.body.width);\n const _height = WebGLUtil.nhpot(particle.body.height);\n\n const _scaleX = particle.body.width / _width;\n const _scaleY = particle.body.height / _height;\n\n if (!this.texturebuffers[particle.transform.src])\n this.texturebuffers[particle.transform.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\n\n particle.transform.texture = this.texturebuffers[particle.transform.src][0];\n particle.transform.vcBuffer = this.texturebuffers[particle.transform.src][1];\n particle.transform.tcBuffer = this.texturebuffers[particle.transform.src][2];\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _scaleX, 0.0, 0.0, _scaleY, _scaleY, _scaleY]), this.gl.STATIC_DRAW);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _w, 0.0, 0.0, _h, _w, _h]), this.gl.STATIC_DRAW);\n\n const context = particle.transform.canvas.getContext('2d');\n const data = context.getImageData(0, 0, _width, _height);\n\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture);\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST);\n this.gl.generateMipmap(this.gl.TEXTURE_2D);\n\n particle.transform.textureLoaded = true;\n particle.transform.textureWidth = _w;\n particle.transform.textureHeight = _h;\n }\n\n onProtonUpdate() {\n // this.gl.clearColor(0, 0, 0, 1);\n // this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\n }\n\n onParticleCreated(particle) {\n particle.transform.textureLoaded = false;\n particle.transform.tmat = Mat3.create();\n particle.transform.tmat[8] = 1;\n particle.transform.imat = Mat3.create();\n particle.transform.imat[8] = 1;\n\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle);\n particle.transform.oldScale = particle.radius / this.circleCanvasRadius;\n }\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = img;\n particle.transform.src = img.src;\n particle.transform.canvas = ImgUtil.getCanvasFromCache(img);\n particle.transform.oldScale = 1;\n\n this.drawImg2Canvas(particle);\n }\n\n onParticleUpdate(particle) {\n if (particle.transform.textureLoaded) {\n this.updateMatrix(particle);\n\n this.gl.uniform3f(this.sprogram.color, particle.transform.rgb.r / 255, particle.transform.rgb.g / 255, particle.transform.rgb.b / 255);\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture);\n this.gl.uniform1i(this.sprogram.samplerUniform, 0);\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n\n this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0);\n\n this.mstack.pop();\n }\n }\n\n onParticleDead(particle) { }\n\n updateMatrix(particle) {\n const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.transform.textureWidth / 2, -particle.transform.textureHeight / 2);\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\n\n const angel = particle.rotation * (MathUtils.PI_180);\n const rotationMatrix = WebGLUtil.makeRotation(angel);\n\n const scale = particle.scale * particle.transform.oldScale;\n const scaleMatrix = WebGLUtil.makeScale(scale, scale);\n let matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix);\n\n matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix);\n matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix);\n\n Mat3.inverse(matrix, particle.transform.imat);\n matrix[2] = particle.alpha;\n\n this.mstack.push(matrix);\n }\n}","import BaseRenderer from './BaseRenderer';\n\nexport default class CustomRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.name = 'CustomRenderer';\n }\n\n}","import Zone from './Zone';\nimport Util from '../utils/Util';\nimport MathUtils from '../math/MathUtils';\n\nexport default class LineZone extends Zone {\n\n\tconstructor(x1, y1, x2, y2, direction) {\n\t\tsuper();\n\n\t\tif (x2 - x1 >= 0) {\n\t\t\tthis.x1 = x1;\n\t\t\tthis.y1 = y1;\n\t\t\tthis.x2 = x2;\n\t\t\tthis.y2 = y2;\n\t\t} else {\n\t\t\tthis.x1 = x2;\n\t\t\tthis.y1 = y2;\n\t\t\tthis.x2 = x1;\n\t\t\tthis.y2 = y1;\n\t\t}\n\n\t\tthis.dx = this.x2 - this.x1;\n\t\tthis.dy = this.y2 - this.y1;\n\n\t\tthis.minx = Math.min(this.x1, this.x2);\n\t\tthis.miny = Math.min(this.y1, this.y2);\n\t\tthis.maxx = Math.max(this.x1, this.x2);\n\t\tthis.maxy = Math.max(this.y1, this.y2);\n\n\t\tthis.dot = this.x2 * this.y1 - this.x1 * this.y2;\n\t\tthis.xxyy = this.dx * this.dx + this.dy * this.dy;\n\n\t\tthis.gradient = this.getGradient();\n\t\tthis.length = this.getLength();\n\t\tthis.direction = Util.initValue(direction, '>');\n\t}\n\n\tgetPosition() {\n\t\tthis.random = Math.random();\n\t\tthis.vector.x = this.x1 + this.random * this.length * Math.cos(this.gradient);\n\t\tthis.vector.y = this.y1 + this.random * this.length * Math.sin(this.gradient);\n\n\t\treturn this.vector;\n\t}\n\n\tgetDirection(x, y) {\n\t\tconst A = this.dy;\n\t\tconst B = -this.dx;\n\t\tconst C = this.dot;\n\t\tconst D = B === 0 ? 1 : B;\n\n\t\tif ((A * x + B * y + C) * D > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\tgetDistance(x, y) {\n\t\tconst A = this.dy;\n\t\tconst B = -this.dx;\n\t\tconst C = this.dot;\n\t\tconst D = (A * x + B * y + C);\n\n\t\treturn D / Math.sqrt(this.xxyy);\n\t}\n\n\tgetSymmetric(v) {\n\t\tconst tha2 = v.getGradient();\n\t\tconst tha1 = this.getGradient();\n\t\tconst tha = 2 * (tha1 - tha2);\n\n\t\tconst oldx = v.x;\n\t\tconst oldy = v.y;\n\n\t\tv.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n\t\tv.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n\n\t\treturn v;\n\t}\n\n\tgetGradient() {\n\t\treturn Math.atan2(this.dy, this.dx);\n\t}\n\n\trangeOut(particle) {\n\t\tconst angle = Math.abs(this.getGradient());\n\n\t\tif (angle <= MathUtils.PI / 4) {\n\t\t\tif (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\n\t\t} else {\n\t\t\tif (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetLength() {\n\t\treturn Math.sqrt(this.dx * this.dx + this.dy * this.dy)\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (this.direction === '>' || this.direction === 'R' || this.direction === 'right' || this.direction === 'down') {\n\t\t\t\tif (!this.rangeOut(particle)) return;\n\t\t\t\tif (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n\t\t\t} else {\n\t\t\t\tif (!this.rangeOut(particle)) return;\n\t\t\t\tif (!this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (!this.rangeOut(particle)) return;\n\n\t\t\tif (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\n\t\t\t\tif (this.dx === 0) {\n\t\t\t\t\tparticle.v.x *= -1;\n\t\t\t\t} else if (this.dy === 0) {\n\t\t\t\t\tparticle.v.y *= -1;\n\t\t\t\t} else {\n\t\t\t\t\tthis.getSymmetric(particle.v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'cross') {\n\t\t\tif (this.alert) {\n\t\t\t\tconsole.error('Sorry lineZone does not support cross method');\n\t\t\t\tthis.alert = false;\n\t\t\t}\n\t\t}\n\t}\n}","import Zone from './Zone';\nimport MathUtils from '../math/MathUtils';\n\nexport default class CircleZone extends Zone {\n\n constructor(x, y, radius) {\n super();\n\n this.x = x;\n this.y = y;\n this.radius = radius;\n\n this.angle = 0;\n this.center = { x, y };\n }\n\n getPosition() {\n this.random = Math.random();\n this.angle = MathUtils.PIx2 * Math.random();\n\n this.vector.x = this.x + this.random * this.radius * Math.cos(this.angle);\n this.vector.y = this.y + this.random * this.radius * Math.sin(this.angle);\n\n return this.vector;\n }\n\n setCenter(x, y) {\n this.center.x = x;\n this.center.y = y;\n }\n\n crossing(particle) {\n const d = particle.p.distanceTo(this.center);\n\n if (this.crossType === 'dead') {\n if (d - particle.radius > this.radius)\n particle.dead = true;\n } else if (this.crossType === 'bound') {\n if (d + particle.radius >= this.radius)\n this.getSymmetric(particle);\n } else if (this.crossType === 'cross') {\n if (this.alert) {\n alert('Sorry CircleZone does not support cross method');\n this.alert = false;\n }\n }\n }\n\n getSymmetric(particle) {\n let tha2 = particle.v.getGradient();\n let tha1 = this.getGradient(particle);\n\n let tha = 2 * (tha1 - tha2);\n let oldx = particle.v.x;\n let oldy = particle.v.y;\n\n particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n }\n\n getGradient(particle) {\n return -MathUtils.PI_2 + Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x);\n }\n}","import Zone from './Zone';\n\nexport default class RectZone extends Zone {\n\n\tconstructor(x, y, width, height) {\n\t\tsuper();\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\n\tgetPosition() {\n\t\tthis.vector.x = this.x + Math.random() * this.width;\n\t\tthis.vector.y = this.y + Math.random() * this.height;\n\n\t\treturn this.vector;\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (particle.p.x + particle.radius < this.x)\n\t\t\t\tparticle.dead = true;\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width)\n\t\t\t\tparticle.dead = true;\n\n\t\t\tif (particle.p.y + particle.radius < this.y)\n\t\t\t\tparticle.dead = true;\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height)\n\t\t\t\tparticle.dead = true;\n\t\t}\n\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (particle.p.x - particle.radius < this.x) {\n\t\t\t\tparticle.p.x = this.x + particle.radius;\n\t\t\t\tparticle.v.x *= -1;\n\t\t\t} else if (particle.p.x + particle.radius > this.x + this.width) {\n\t\t\t\tparticle.p.x = this.x + this.width - particle.radius;\n\t\t\t\tparticle.v.x *= -1;\n\t\t\t}\n\n\t\t\tif (particle.p.y - particle.radius < this.y) {\n\t\t\t\tparticle.p.y = this.y + particle.radius;\n\t\t\t\tparticle.v.y *= -1;\n\t\t\t} else if (particle.p.y + particle.radius > this.y + this.height) {\n\t\t\t\tparticle.p.y = this.y + this.height - particle.radius;\n\t\t\t\tparticle.v.y *= -1;\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'cross') {\n\t\t\tif (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\n\t\t\t\tparticle.p.x = this.x + this.width + particle.radius;\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0)\n\t\t\t\tparticle.p.x = this.x - particle.radius;\n\n\t\t\tif (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\n\t\t\t\tparticle.p.y = this.y + this.height + particle.radius;\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height && particle.v.y >= 0)\n\t\t\t\tparticle.p.y = this.y - particle.radius;\n\t\t}\n\t}\n}","import Zone from './Zone';\nimport Util from '../utils/Util';\n\nexport default class ImageZone extends Zone {\n\n\tconstructor(imageData, x, y, d) {\n\t\tsuper();\n\n\t\tthis.reset(imageData, x, y, d);\n\t}\n\n\treset(imageData, x, y, d) {\n\t\tthis.imageData = imageData;\n\t\tthis.x = Util.initValue(x, 0);\n\t\tthis.y = Util.initValue(y, 0);\n\t\tthis.d = Util.initValue(d, 2);\n\n\t\tthis.vectors = [];\n\t\tthis.setVectors();\n\t}\n\n\tsetVectors() {\n\t\tlet i, j;\n\t\tconst length1 = this.imageData.width;\n\t\tconst length2 = this.imageData.height;\n\n\t\tfor (i = 0; i < length1; i += this.d) {\n\t\t\tfor (j = 0; j < length2; j += this.d) {\n\t\t\t\tlet index = ((j >> 0) * length1 + (i >> 0)) * 4;\n\n\t\t\t\tif (this.imageData.data[index + 3] > 0) {\n\t\t\t\t\tthis.vectors.push({ x: i + this.x, y: j + this.y });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.vector;\n\t}\n\n\tgetBound(x, y) {\n\t\tvar index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\t\tif (this.imageData.data[index + 3] > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\tgetPosition() {\n\t\treturn this.vector.copy(this.vectors[Math.floor(Math.random() * this.vectors.length)]);\n\t}\n\n\tgetColor(x, y) {\n\t\tx -= this.x;\n\t\ty -= this.y;\n\t\tvar i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\n\t\treturn {\n\t\t\tr: this.imageData.data[i],\n\t\t\tg: this.imageData.data[i + 1],\n\t\t\tb: this.imageData.data[i + 2],\n\t\t\ta: this.imageData.data[i + 3]\n\t\t};\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n\t\t\t\tparticle.dead = true;\n\t\t\telse\n\t\t\t\tparticle.dead = false;\n\t\t}\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n\t\t\t\tparticle.v.negate();\n\t\t}\n\t}\n}","import ColorUtil from '../utils/ColorUtil';\nimport CircleZone from '../zone/CircleZone';\nimport PointZone from '../zone/PointZone';\nimport LineZone from '../zone/LineZone';\nimport RectZone from '../zone/RectZone';\n\nexport default {\n\taddEventListener(proton, fun) {\n\t\tproton.addEventListener('PROTON_UPDATE_AFTER', () => fun());\n\t},\n\n\tgetStyle(color) {\n\t\tconst rgb = ColorUtil.hexToRGB(color || '#ff0000');\n\t\treturn `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\n\t},\n\n\tdrawZone(proton, canvas, zone, clear) {\n\t\tconst context = canvas.getContext('2d');\n\t\tconst style = this.getStyle();\n\n\t\tthis.addEventListener(proton, () => {\n\t\t\tif (clear)\n\t\t\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\n\t\t\tif (zone instanceof PointZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.fillStyle = style;\n\t\t\t\tcontext.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\n\t\t\t\tcontext.fill();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof LineZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.moveTo(zone.x1, zone.y1);\n\t\t\t\tcontext.lineTo(zone.x2, zone.y2);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof RectZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.drawRect(zone.x, zone.y, zone.width, zone.height);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof CircleZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t}\n\t\t});\n\t},\n\n\tdrawEmitter(proton, canvas, emitter, clear) {\n\t\tconst context = canvas.getContext('2d');\n\t\tconst style = this.getStyle();\n\n\t\tthis.addEventListener(proton, () => {\n\t\t\tif (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n\t\t\tcontext.beginPath();\n\t\t\tcontext.fillStyle = style;\n\t\t\tcontext.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\n\t\t\tcontext.fill();\n\t\t\tcontext.closePath();\n\t\t});\n\t}\n}","import Proton from './core/Proton';\nimport Particle from './core/Particle';\nimport Pool from './core/Pool';\n\nimport Util from './utils/Util';\nimport ColorUtil from './utils/ColorUtil';\nimport MathUtils from './math/MathUtils';\nimport Vector2D from './math/Vector2D';\nimport Polar2D from './math/Polar2D';\nimport Mat3 from './math/Mat3';\nimport Span from './math/Span';\nimport ArraySpan from './math/ArraySpan';\nimport Rectangle from './math/Rectangle';\nimport ease from './math/ease';\n\nimport Rate from './initialize/Rate';\nimport Initialize from './initialize/Initialize';\nimport Life from './initialize/Life';\nimport Position from './initialize/Position';\nimport Velocity from './initialize/Velocity';\nimport Mass from './initialize/Mass';\nimport Radius from './initialize/Radius';\nimport Body from './initialize/Body';\n\nimport Behaviour from './behaviour/Behaviour';\nimport Force from './behaviour/Force';\nimport Attraction from './behaviour/Attraction';\nimport RandomDrift from './behaviour/RandomDrift';\nimport Gravity from './behaviour/Gravity';\nimport Collision from './behaviour/Collision';\nimport CrossZone from './behaviour/CrossZone';\nimport Alpha from './behaviour/Alpha';\nimport Scale from './behaviour/Scale';\nimport Rotate from './behaviour/Rotate';\nimport Color from './behaviour/Color';\nimport Repulsion from './behaviour/Repulsion';\nimport GravityWell from './behaviour/GravityWell';\n\nimport Emitter from './emitter/Emitter';\nimport BehaviourEmitter from './emitter/BehaviourEmitter';\nimport FollowEmitter from './emitter/FollowEmitter';\n\nimport CanvasRenderer from './render/CanvasRenderer';\nimport DomRenderer from './render/DomRenderer';\nimport EaselRenderer from './render/EaselRenderer';\nimport PixelRenderer from './render/PixelRenderer';\nimport PixiRenderer from './render/PixiRenderer';\nimport WebGLRenderer from './render/WebGLRenderer';\nimport CustomRenderer from './render/CustomRenderer';\n\nimport Zone from './zone/Zone';\nimport LineZone from './zone/LineZone';\nimport CircleZone from './zone/CircleZone';\nimport PointZone from './zone/PointZone';\nimport RectZone from './zone/RectZone';\nimport ImageZone from './zone/ImageZone';\n\nimport Debug from './debug/Debug';\n\n// namespace\nProton.Particle = Proton.P = Particle;\nProton.Pool = Pool;\n\nProton.Util = Util;\nProton.ColorUtil = ColorUtil;\nProton.MathUtils = MathUtils;\nProton.Vector2D = Proton.Vector = Vector2D;\nProton.Polar2D = Proton.Polar = Polar2D;\nProton.ArraySpan = ArraySpan;\nProton.Rectangle = Rectangle;\nProton.Rate = Rate;\nProton.ease = ease;\nProton.Span = Span;\nProton.Mat3 = Mat3;\nProton.getSpan = (a, b, center) => new Span(a, b, center);\nProton.createArraySpan = ArraySpan.createArraySpan;\n\nProton.Initialize = Proton.Init = Initialize;\nProton.Life = Proton.L = Life;\nProton.Position = Proton.P = Position;\nProton.Velocity = Proton.V = Velocity;\nProton.Mass = Proton.M = Mass;\nProton.Radius = Proton.R = Radius;\nProton.Body = Proton.B = Body;\n\nProton.Behaviour = Behaviour;\nProton.Force = Proton.F = Force;\nProton.Attraction = Proton.A = Attraction;\nProton.RandomDrift = Proton.RD = RandomDrift;\nProton.Gravity = Proton.G = Gravity;\nProton.Collision = Collision;\nProton.CrossZone = CrossZone;\nProton.Alpha = Proton.A = Alpha;\nProton.Scale = Proton.S = Scale;\nProton.Rotate = Rotate;\nProton.Color = Color;\nProton.Repulsion = Repulsion;\nProton.GravityWell = GravityWell;\n\nProton.Emitter = Emitter;\nProton.BehaviourEmitter = BehaviourEmitter;\nProton.FollowEmitter = FollowEmitter;\n\nProton.Zone = Zone;\nProton.LineZone = LineZone;\nProton.CircleZone = CircleZone;\nProton.PointZone = PointZone;\nProton.RectZone = RectZone;\nProton.ImageZone = ImageZone;\n\nProton.CanvasRenderer = CanvasRenderer;\nProton.DomRenderer = DomRenderer;\nProton.EaselRenderer = EaselRenderer;\nProton.PixiRenderer = PixiRenderer;\nProton.PixelRenderer = PixelRenderer;\nProton.WebGLRenderer = Proton.WebGlRenderer = WebGLRenderer;\nProton.CustomRenderer = CustomRenderer;\n\nProton.Debug = Debug;\n\nObject.assign(Proton, ease);\n\n// export\nexport default Proton;"],"names":["PI","MathUtils","a","b","INT","Math","random","floor","center","f","randomAToB","display","num","toString","slice","Span","isArray","Util","initValue","length","randomFloating","i","tx","ty","angleInRadians","c","cos","s","sin","sx","sy","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b01","b02","b10","b11","b12","b20","b21","b22","id","width","height","position","dom","document","createElement","style","opacity","transform","resize","marginLeft","marginTop","div","x","y","scale","rotate","willChange","css3","key","val","bkey","charAt","toUpperCase","substr","IMG_CACHE","CANVAS_CACHE","canvasID","context","image","rect","drawImage","imagedata","getImageData","clearRect","img","callback","param","src","Image","onload","e","target","WebGLUtil","nhpot","canvas","DomUtil","createCanvas","getContext","value","defaults","undefined","Object","prototype","call","array","obj","ignore","o","indexOf","constructor","args","concat","FactoryFunc","bind","apply","pOBJ","hasProp","p","v","copy","prototypeObject","filters","singleProp","hasOwnProperty","getSpanValue","pan","getValue","ImgUtil","arr","destroy","uid","getCacheID","cache","isInner","Pool","total","params","__puid","PUID","getID","pop","createOrClone","getCache","push","create","classApply","clone","count","Stats","proton","container","type","emitterIndex","rendererIndex","body","add","emitter","getEmitter","renderer","getRenderer","str","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","innerHTML","cssText","join","addEventListener","bg","color","parentNode","appendChild","renderers","result","cpool","round","EventDispatcher","_listeners","listener","removeEventListener","splice","listeners","handler","TargetClass","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","particle","sleep","old","multiplyScalar","mass","clear","Proton","integrationType","oldTime","elapsed","stats","EULER","integrator","render","init","index","remove","parent","EMITTER_ADDED","EMITTER_REMOVED","PROTON_UPDATE","USE_CLOCK","Date","getTime","amendChangeTabsBug","emittersUpdate","PROTON_UPDATE_AFTER","update","getAllParticles","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","pow","PI_2","sqrt","ease","easeLinear","Vector2D","atan2","w","addVectors","subVectors","set","divideScalar","distanceToSquared","tha","dx","dy","alpha","Particle","ID","reset","setPrototypeByObject","N180_PI","life","Infinity","age","energy","dead","sprite","radius","rotation","easing","destroyObject","removeAllBehaviours","rgb","r","g","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","destroyArray","h","hex16","substring","parseInt","rbg","Number","Polar2D","abs","getX","getY","mat3","mat","Float32Array","mat1","mat2","d","m","vec","ArraySpan","_arr","randomColor","Rectangle","bottom","right","Rate","numpan","timepan","numPan","setSpanValue","timePan","startTime","nextTime","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imagetarget","inner","Behaviour","getEasing","force","removeBehaviour","Force","fx","fy","normalizeForce","calculate","Attraction","targetPosition","normalizeValue","radiusSq","attractionForce","lengthSq","sub","normalize","RandomDrift","driftX","driftY","delay","panFoce","addXY","Gravity","Collision","collisionPool","delta","newPool","otherParticle","overlap","totalMass","averageMass1","averageMass2","distance","CrossZone","crossing","Alpha","same","alphaA","alphaB","Scale","scaleA","scaleB","Rotate","influence","rotationA","rotationB","getDirection","Color","createArraySpan","colorA","ColorUtil","hexToRGB","colorB","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVector2DByObject","degreeTransform","Emitter","pObj","emitTime","totalTime","rate","stoped","isNaN","oldStoped","oldEmitTime","oldTotalTime","step","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","slow","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mouseTarget","window","_allowEmitting","initEventHandler","mousemoveHandler","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","layerX","layerY","offsetX","offsetY","babelHelpers.get","BaseRenderer","element","stroke","initHandler","circleConf","isCircle","thinkness","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","CanvasRenderer","bufferCache","getImgFromCache","addImg2Body","drawCircle","buffer","createBuffer","bufferContext","globalAlpha","globalCompositeOperation","fillStyle","rgbToHex","fillRect","save","translate","restore","beginPath","arc","strokeStyle","lineWidth","closePath","fill","size","DomRenderer","createBody","transform3d","bodyReady","backgroundColor","removeChild","babelHelpers.typeof","createCircle","createSprite","createDiv","borderRadius","borderColor","borderWidth","url","backgroundImage","EaselRenderer","addChild","scaleX","scaleY","graphics","regX","regY","createjs","Graphics","String","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","data","PixiRenderer","setColor","tint","getHex16FromParticle","PIXI","Sprite","fromImage","anchor","endFill","MStack","mats","Mat3","multiply","WebGLRenderer","gl","antialias","stencil","depth","initVar","setMaxRadius","initShaders","initBuffers","blendEquation","FUNC_ADD","blendFunc","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","enable","BLEND","umat","smat","mstack","viewport","circleCanvasURL","vsSource","fsSource","texturebuffers","A","B","fs","shader","createShader","FRAGMENT_SHADER","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","fragmentShader","getShader","getFragmentShader","vertexShader","getVertexShader","sprogram","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","useProgram","vpa","getAttribLocation","tca","enableVertexAttribArray","tMatUniform","getUniformLocation","samplerUniform","useTex","uniform1i","vs","idx","unitIBuffer","bindBuffer","ELEMENT_ARRAY_BUFFER","bufferData","Uint16Array","STATIC_DRAW","ids","unitI33","stripBuffer","raidus","circleCanvasRadius","toDataURL","_w","_h","_width","_height","_scaleX","_scaleY","createTexture","texture","vcBuffer","tcBuffer","ARRAY_BUFFER","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_NEAREST","generateMipmap","textureLoaded","textureWidth","textureHeight","tmat","imat","oldScale","getCanvasFromCache","drawImg2Canvas","updateMatrix","uniform3f","uniformMatrix3fv","top","vertexAttribPointer","FLOAT","drawElements","TRIANGLES","UNSIGNED_SHORT","moveOriginMatrix","makeTranslation","translationMatrix","angel","rotationMatrix","makeRotation","scaleMatrix","makeScale","matrix","matrixMultiply","inverse","CustomRenderer","LineZone","x1","y1","x2","y2","direction","minx","min","miny","maxx","maxy","dot","xxyy","gradient","getGradient","getLength","C","D","tha2","tha1","oldx","oldy","angle","rangeOut","getDistance","getSymmetric","error","CircleZone","PIx2","distanceTo","RectZone","ImageZone","vectors","setVectors","j","length1","length2","getBound","negate","fun","getStyle","moveTo","lineTo","drawRect","P","Vector","Polar","getSpan","Init","L","V","M","R","F","RD","G","S","WebGlRenderer","Debug","assign"],"mappings":";;;;;;AAAA,IAAMA,KAAK,SAAX;;AAEA,IAAMC,YAAY;;QAEVD,EAFU;UAGRA,KAAK,CAHG;UAIRA,KAAK,CAJG;YAKNA,KAAK,GALC;aAML,MAAMA,EA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A9C;AACAhV,OAAOyc,cAAP,GAAwBA,cAAxB;;AAEAzc,OAAOogB,KAAP,GAAeA,KAAf;;AAEA5mB,OAAO6mB,MAAP,CAAcrgB,MAAd,EAAsBgC,IAAtB;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"proton.js","sources":["../src/math/MathUtil.js","../src/math/Span.js","../src/utils/WebGLUtil.js","../src/utils/DomUtil.js","../src/utils/ImgUtil.js","../src/utils/Util.js","../src/utils/Puid.js","../src/core/Pool.js","../src/debug/Stats.js","../src/events/EventDispatcher.js","../src/math/Integration.js","../src/core/Proton.js","../src/utils/Rgb.js","../src/math/ease.js","../src/math/Vector2D.js","../src/core/Particle.js","../src/utils/ColorUtil.js","../src/math/Polar2D.js","../src/math/Mat3.js","../src/math/ArraySpan.js","../src/math/Rectangle.js","../src/initialize/Rate.js","../src/initialize/Initialize.js","../src/initialize/Life.js","../src/zone/Zone.js","../src/zone/PointZone.js","../src/initialize/Position.js","../src/initialize/Velocity.js","../src/initialize/Mass.js","../src/initialize/Radius.js","../src/initialize/Body.js","../src/behaviour/Behaviour.js","../src/behaviour/Force.js","../src/behaviour/Attraction.js","../src/behaviour/RandomDrift.js","../src/behaviour/Gravity.js","../src/behaviour/Collision.js","../src/behaviour/CrossZone.js","../src/behaviour/Alpha.js","../src/behaviour/Scale.js","../src/behaviour/Rotate.js","../src/behaviour/Color.js","../src/behaviour/Repulsion.js","../src/behaviour/GravityWell.js","../src/initialize/InitializeUtil.js","../src/emitter/Emitter.js","../src/emitter/BehaviourEmitter.js","../src/emitter/FollowEmitter.js","../src/render/BaseRenderer.js","../src/render/CanvasRenderer.js","../src/render/DomRenderer.js","../src/render/EaselRenderer.js","../src/render/PixelRenderer.js","../src/render/PixiRenderer.js","../src/utils/MStack.js","../src/render/WebGLRenderer.js","../src/render/CustomRenderer.js","../src/zone/LineZone.js","../src/zone/CircleZone.js","../src/zone/RectZone.js","../src/zone/ImageZone.js","../src/debug/Debug.js","../src/index.js"],"sourcesContent":["const PI = 3.1415926;\nconst INFINITY = Infinity;\n\nconst MathUtil = {\n PI: PI,\n PIx2: PI * 2,\n PI_2: PI / 2,\n PI_180: PI / 180,\n N180_PI: 180 / PI,\n Infinity: -999,\n\n isInfinity(num) {\n return num === this.Infinity || num === INFINITY;\n },\n\n randomAToB(a, b, isInt = false) {\n if (!isInt) return a + Math.random() * (b - a);\n else return Math.floor(Math.random() * (b - a)) + a;\n },\n\n randomFloating(center, f, isInt) {\n return this.randomAToB(center - f, center + f, isInt);\n },\n\n randomZone(display) {},\n\n degreeTransform(a) {\n return (a * PI) / 180;\n },\n\n toColor16(num) {\n return `#${num.toString(16)}`;\n },\n\n randomColor() {\n return (\n \"#\" +\n (\"00000\" + ((Math.random() * 0x1000000) << 0).toString(16)).slice(\n -6\n )\n );\n }\n};\n\nexport default MathUtil;\n","import Util from \"../utils/Util\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Span {\n constructor(a, b, center) {\n if (Util.isArray(a)) {\n this.isArray = true;\n this.a = a;\n } else {\n this.isArray = false;\n this.a = Util.initValue(a, 1);\n this.b = Util.initValue(b, this.a);\n this.center = Util.initValue(center, false);\n }\n }\n\n getValue(isInt = false) {\n if (this.isArray) {\n return Util.getRandFromArray(this.a);\n } else {\n if (!this.center) {\n return MathUtil.randomAToB(this.a, this.b, isInt);\n } else {\n return MathUtil.randomFloating(this.a, this.b, isInt);\n }\n }\n }\n\n /**\n * Returns a new Span object\n *\n * @memberof Proton#Proton.Util\n * @method setSpanValue\n *\n * @todo a, b and c should be 'Mixed' or 'Number'?\n *\n * @param {Mixed | Span} a\n * @param {Mixed} b\n * @param {Mixed} c\n *\n * @return {Span}\n */\n static setSpanValue(a, b, c) {\n if (a instanceof Span) {\n return a;\n } else {\n if (b === undefined) {\n return new Span(a);\n } else {\n if (c === undefined) return new Span(a, b);\n else return new Span(a, b, c);\n }\n }\n }\n\n /**\n * Returns the value from a Span, if the param is not a Span it will return the given parameter\n *\n * @memberof Proton#Proton.Util\n * @method getValue\n *\n * @param {Mixed | Span} pan\n *\n * @return {Mixed} the value of Span OR the parameter if it is not a Span\n */\n static getSpanValue(pan) {\n return pan instanceof Span ? pan.getValue() : pan;\n }\n}\n","export default {\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method ipot\n *\n * @todo add description\n * @todo add length description\n *\n * @param {Number} length\n *\n * @return {Boolean}\n */\n ipot(length) {\n return (length & (length - 1)) === 0;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method nhpot\n *\n * @todo add description\n * @todo add length description\n *\n * @param {Number} length\n *\n * @return {Number}\n */\n nhpot(length) {\n --length;\n for (let i = 1; i < 32; i <<= 1) {\n length = length | (length >> i);\n }\n\n return length + 1;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeTranslation\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} tx either 0 or 1\n * @param {Number} ty either 0 or 1\n *\n * @return {Object}\n */\n makeTranslation(tx, ty) {\n return [1, 0, 0, 0, 1, 0, tx, ty, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeRotation\n *\n * @todo add description\n * @todo add return description\n *\n * @param {Number} angleInRadians\n *\n * @return {Object}\n */\n makeRotation(angleInRadians) {\n let c = Math.cos(angleInRadians);\n let s = Math.sin(angleInRadians);\n\n return [c, -s, 0, s, c, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeScale\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} sx either 0 or 1\n * @param {Number} sy either 0 or 1\n *\n * @return {Object}\n */\n makeScale(sx, sy) {\n return [sx, 0, 0, 0, sy, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method matrixMultiply\n *\n * @todo add description\n * @todo add a, b description\n * @todo add return description\n *\n * @param {Object} a\n * @param {Object} b\n *\n * @return {Object}\n */\n matrixMultiply(a, b) {\n let a00 = a[0 * 3 + 0];\n let a01 = a[0 * 3 + 1];\n let a02 = a[0 * 3 + 2];\n let a10 = a[1 * 3 + 0];\n let a11 = a[1 * 3 + 1];\n let a12 = a[1 * 3 + 2];\n let a20 = a[2 * 3 + 0];\n let a21 = a[2 * 3 + 1];\n let a22 = a[2 * 3 + 2];\n let b00 = b[0 * 3 + 0];\n let b01 = b[0 * 3 + 1];\n let b02 = b[0 * 3 + 2];\n let b10 = b[1 * 3 + 0];\n let b11 = b[1 * 3 + 1];\n let b12 = b[1 * 3 + 2];\n let b20 = b[2 * 3 + 0];\n let b21 = b[2 * 3 + 1];\n let b22 = b[2 * 3 + 2];\n\n return [\n a00 * b00 + a01 * b10 + a02 * b20,\n a00 * b01 + a01 * b11 + a02 * b21,\n a00 * b02 + a01 * b12 + a02 * b22,\n a10 * b00 + a11 * b10 + a12 * b20,\n a10 * b01 + a11 * b11 + a12 * b21,\n a10 * b02 + a11 * b12 + a12 * b22,\n a20 * b00 + a21 * b10 + a22 * b20,\n a20 * b01 + a21 * b11 + a22 * b21,\n a20 * b02 + a21 * b12 + a22 * b22\n ];\n }\n};\n","export default {\n /**\n * Creates and returns a new canvas. The opacity is by default set to 0\n *\n * @memberof Proton#Proton.DomUtil\n * @method createCanvas\n *\n * @param {String} $id the canvas' id\n * @param {Number} $width the canvas' width\n * @param {Number} $height the canvas' height\n * @param {String} [$position=absolute] the canvas' position, default is 'absolute'\n *\n * @return {Object}\n */\n createCanvas(id, width, height, position = \"absolute\") {\n const dom = document.createElement(\"canvas\");\n\n dom.id = id;\n dom.width = width;\n dom.height = height;\n dom.style.opacity = 0;\n dom.style.position = position;\n this.transform(dom, -500, -500, 0, 0);\n\n return dom;\n },\n\n createDiv(id, width, height) {\n const dom = document.createElement(\"div\");\n\n dom.id = id;\n dom.style.position = \"absolute\";\n this.resize(dom, width, height);\n\n return dom;\n },\n\n resize(dom, width, height) {\n dom.style.width = width + \"px\";\n dom.style.height = height + \"px\";\n dom.style.marginLeft = -width / 2 + \"px\";\n dom.style.marginTop = -height / 2 + \"px\";\n },\n\n /**\n * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers\n *\n * @memberof Proton#Proton.DomUtil\n * @method transform\n *\n * @param {HTMLDivElement} div\n * @param {Number} $x\n * @param {Number} $y\n * @param {Number} $scale\n * @param {Number} $rotate\n */\n transform(div, x, y, scale, rotate) {\n div.style.willChange = \"transform\";\n const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\n this.css3(div, \"transform\", transform);\n },\n\n transform3d(div, x, y, scale, rotate) {\n div.style.willChange = \"transform\";\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\n this.css3(div, \"backfaceVisibility\", \"hidden\");\n this.css3(div, \"transform\", transform);\n },\n\n css3(div, key, val) {\n const bkey = key.charAt(0).toUpperCase() + key.substr(1);\n\n div.style[`Webkit${bkey}`] = val;\n div.style[`Moz${bkey}`] = val;\n div.style[`O${bkey}`] = val;\n div.style[`ms${bkey}`] = val;\n div.style[`${key}`] = val;\n }\n};\n","import WebGLUtil from \"./WebGLUtil\";\nimport DomUtil from \"./DomUtil\";\n\nconst imgsCache = {};\nconst canvasCache = {};\nlet canvasId = 0;\n\nexport default {\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n context.drawImage(image, rect.x, rect.y);\n const imagedata = context.getImageData(\n rect.x,\n rect.y,\n rect.width,\n rect.height\n );\n context.clearRect(rect.x, rect.y, rect.width, rect.height);\n\n return imagedata;\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method getImgFromCache\n *\n * @todo add description\n * @todo describe func\n *\n * @param {Mixed} img\n * @param {Proton.Particle} particle\n * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.data.canvas\n * @param {Boolean} func\n */\n getImgFromCache(img, callback, param) {\n const src = typeof img === \"string\" ? img : img.src;\n\n if (imgsCache[src]) {\n callback(imgsCache[src], param);\n } else {\n const image = new Image();\n image.onload = e => {\n imgsCache[src] = e.target;\n callback(imgsCache[src], param);\n };\n\n image.src = src;\n }\n },\n\n getCanvasFromCache(img, callback, param) {\n const src = img.src;\n\n if (!canvasCache[src]) {\n const width = WebGLUtil.nhpot(img.width);\n const height = WebGLUtil.nhpot(img.height);\n\n const canvas = DomUtil.createCanvas(\n `proton_canvas_cache_${++canvasId}`,\n width,\n height\n );\n const context = canvas.getContext(\"2d\");\n context.drawImage(img, 0, 0, img.width, img.height);\n\n canvasCache[src] = canvas;\n }\n\n callback && callback(canvasCache[src], param);\n\n return canvasCache[src];\n }\n};\n","import Span from \"../math/Span\";\nimport ImgUtil from \"./ImgUtil\";\n\nexport default {\n /**\n * Returns the default if the value is null or undefined\n *\n * @memberof Proton#Proton.Util\n * @method initValue\n *\n * @param {Mixed} value a specific value, could be everything but null or undefined\n * @param {Mixed} defaults the default if the value is null or undefined\n */\n initValue(value, defaults) {\n value = value !== null && value !== undefined ? value : defaults;\n return value;\n },\n\n /**\n * Checks if the value is a valid array\n *\n * @memberof Proton#Proton.Util\n * @method isArray\n *\n * @param {Array} value Any array\n *\n * @returns {Boolean}\n */\n isArray(value) {\n return Object.prototype.toString.call(value) === \"[object Array]\";\n },\n\n /**\n * Destroyes the given array\n *\n * @memberof Proton#Proton.Util\n * @method emptyArray\n *\n * @param {Array} array Any array\n */\n emptyArray(arr) {\n if (arr) arr.length = 0;\n },\n\n toArray(arr) {\n return this.isArray(arr) ? arr : [arr];\n },\n\n getRandFromArray(arr) {\n if (!arr) return null;\n return arr[Math.floor(arr.length * Math.random())];\n },\n\n /**\n * Destroyes the given object\n *\n * @memberof Proton#Proton.Util\n * @method emptyObject\n *\n * @param {Object} obj Any object\n */\n emptyObject(obj, ignore = null) {\n for (let key in obj) {\n if (ignore && ignore.indexOf(key) > -1) continue;\n delete obj[key];\n }\n },\n\n /**\n * Makes an instance of a class and binds the given array\n *\n * @memberof Proton#Proton.Util\n * @method classApply\n *\n * @param {Function} constructor A class to make an instance from\n * @param {Array} [args] Any array to bind it to the constructor\n *\n * @return {Object} The instance of constructor, optionally bind with args\n */\n classApply(constructor, args = null) {\n if (!args) {\n return new constructor();\n } else {\n const FactoryFunc = constructor.bind.apply(\n constructor,\n [null].concat(args)\n );\n return new FactoryFunc();\n }\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method setVectorVal\n *\n * @todo add description for param `target`\n * @todo add description for param `conf`\n * @todo add description for function\n *\n * @param {Object} target\n * @param {Object} conf\n */\n setVectorVal(particle, conf = null) {\n if (!conf) return;\n\n if (this.hasProp(conf, \"x\")) particle.p.x = conf[\"x\"];\n if (this.hasProp(conf, \"y\")) particle.p.y = conf[\"y\"];\n\n if (this.hasProp(conf, \"vx\")) particle.v.x = conf[\"vx\"];\n if (this.hasProp(conf, \"vy\")) particle.v.y = conf[\"vy\"];\n\n if (this.hasProp(conf, \"ax\")) particle.a.x = conf[\"ax\"];\n if (this.hasProp(conf, \"ay\")) particle.a.y = conf[\"ay\"];\n\n if (this.hasProp(conf, \"p\")) particle.p.copy(conf[\"p\"]);\n if (this.hasProp(conf, \"v\")) particle.v.copy(conf[\"v\"]);\n if (this.hasProp(conf, \"a\")) particle.a.copy(conf[\"a\"]);\n\n if (this.hasProp(conf, \"position\")) particle.p.copy(conf[\"position\"]);\n if (this.hasProp(conf, \"velocity\")) particle.v.copy(conf[\"velocity\"]);\n if (this.hasProp(conf, \"accelerate\")) particle.a.copy(conf[\"accelerate\"]);\n },\n\n hasProp(target, key) {\n if (!target) return false;\n return target[key] !== undefined;\n // return obj.hasOwnProperty(key);\n },\n\n /**\n * set the prototype in a given prototypeObject\n *\n * @memberof Proton#Proton.Util\n * @method setProp\n *\n * @todo add description for param `target`\n * @todo translate desription from chinese to english\n *\n * @param {Object} target\n * @param {Object} prototypeObject An object of single prototypes\n *\n * @return {Object} target\n */\n setProp(target, props) {\n for (let prop in props) {\n if (target.hasOwnProperty(prop)) {\n target[prop] = Span.getSpanValue(props[prop]);\n }\n }\n\n return target;\n },\n\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n return ImgUtil.getImageData(context, image, rect);\n },\n\n destroyAll(arr, param = null) {\n let i = arr.length;\n\n while (i--) {\n try {\n arr[i].destroy(param);\n } catch (e) {}\n\n delete arr[i];\n }\n\n arr.length = 0;\n }\n};\n","const IdsMap = {};\n\nconst Puid = {\n _index: 0,\n _cache: {},\n\n id(type) {\n if (IdsMap[type] === undefined || IdsMap[type] === null) IdsMap[type] = 0;\n return `${type}_${IdsMap[type]++}`;\n },\n\n getId(target) {\n let uid = this.getIdFromCache(target);\n if (uid) return uid;\n\n uid = `PUID_${this._index++}`;\n this._cache[uid] = target;\n\n return uid;\n },\n\n getIdFromCache(target) {\n let obj, id;\n\n for (id in this._cache) {\n obj = this._cache[id];\n\n if (obj === target) return id;\n if (this.isBody(obj, target) && obj.src === target.src) return id;\n }\n\n return null;\n },\n\n isBody(obj, target) {\n return (\n typeof obj === \"object\" &&\n typeof target === \"object\" &&\n obj.isInner &&\n target.isInner\n );\n },\n\n getTarget(uid) {\n return this._cache[uid];\n }\n};\n\nexport default Puid;\n","/**\n * Pool is the cache pool of the proton engine, it is very important.\n *\n * get(target, params, uid)\n * Class\n * uid = Puid.getId -> Puid save target cache\n * target.__puid = uid\n *\n * body\n * uid = Puid.getId -> Puid save target cache\n *\n *\n * expire(target)\n * cache[target.__puid] push target\n *\n */\nimport Util from \"../utils/Util\";\nimport Puid from \"../utils/Puid\";\n\nexport default class Pool {\n /**\n * @memberof! Proton#\n * @constructor\n * @alias Proton.Pool\n *\n * @todo add description\n * @todo add description of properties\n *\n * @property {Number} total\n * @property {Object} cache\n */\n constructor(num) {\n this.total = 0;\n this.cache = {};\n }\n\n /**\n * @todo add description\n *\n * @method get\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n get(target, params, uid) {\n let p;\n uid = uid || target.__puid || Puid.getId(target);\n\n if (this.cache[uid] && this.cache[uid].length > 0) {\n p = this.cache[uid].pop();\n } else {\n p = this.createOrClone(target, params);\n }\n\n p.__puid = target.__puid || uid;\n return p;\n }\n\n /**\n * @todo add description\n *\n * @method set\n * @memberof Proton#Proton.Pool\n *\n * @param {Object} target\n *\n * @return {Object}\n */\n expire(target) {\n return this.getCache(target.__puid).push(target);\n }\n\n /**\n * Creates a new class instance\n *\n * @todo add more documentation\n *\n * @method create\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target any Object or Function\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n createOrClone(target, params) {\n this.total++;\n\n if (this.create) {\n return this.create(target, params);\n } else if (typeof target === \"function\") {\n return Util.classApply(target, params);\n } else {\n return target.clone();\n }\n }\n\n /**\n * @todo add description - what is in the cache?\n *\n * @method getCount\n * @memberof Proton#Proton.Pool\n *\n * @return {Number}\n */\n getCount() {\n let count = 0;\n for (let id in this.cache) count += this.cache[id].length;\n return count++;\n }\n\n /**\n * Destroyes all items from Pool.cache\n *\n * @method destroy\n * @memberof Proton#Proton.Pool\n */\n destroy() {\n for (let id in this.cache) {\n this.cache[id].length = 0;\n delete this.cache[id];\n }\n }\n\n /**\n * Returns Pool.cache\n *\n * @method getCache\n * @memberof Proton#Proton.Pool\n * @private\n *\n * @param {Number} uid the unique id\n *\n * @return {Object}\n */\n getCache(uid = \"default\") {\n if (!this.cache[uid]) this.cache[uid] = [];\n return this.cache[uid];\n }\n}\n","export default class Stats {\n constructor(proton) {\n this.proton = proton;\n this.container = null;\n this.type = 1;\n\n this.emitterIndex = 0;\n this.rendererIndex = 0;\n }\n\n update(style, body) {\n this.add(style, body);\n\n const emitter = this.getEmitter();\n const renderer = this.getRenderer();\n let str = \"\";\n\n switch (this.type) {\n case 2:\n str += \"emitter:\" + this.proton.emitters.length + \"
\";\n if (emitter) str += \"em speed:\" + emitter.emitSpeed + \"
\";\n if (emitter) str += \"pos:\" + this.getEmitterPos(emitter);\n break;\n\n case 3:\n if (emitter)\n str += \"initializes:\" + emitter.initializes.length + \"
\";\n if (emitter)\n str +=\n '' +\n this.concatArr(emitter.initializes) +\n \"
\";\n if (emitter) str += \"behaviours:\" + emitter.behaviours.length + \"
\";\n if (emitter)\n str +=\n '' +\n this.concatArr(emitter.behaviours) +\n \"
\";\n break;\n\n case 4:\n if (renderer) str += renderer.name + \"
\";\n if (renderer) str += \"body:\" + this.getCreatedNumber(renderer) + \"
\";\n break;\n\n default:\n str += \"particles:\" + this.proton.getCount() + \"
\";\n str += \"pool:\" + this.proton.pool.getCount() + \"
\";\n str += \"total:\" + this.proton.pool.total;\n }\n\n this.container.innerHTML = str;\n }\n\n add(style, body) {\n if (!this.container) {\n this.type = 1;\n\n this.container = document.createElement(\"div\");\n this.container.style.cssText = [\n \"position:absolute;bottom:0px;left:0;cursor:pointer;\",\n \"opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;\",\n \"width:120px;height:50px;background-color:#002;color:#0ff;\"\n ].join(\"\");\n\n this.container.addEventListener(\n \"click\",\n e => {\n this.type++;\n if (this.type > 4) this.type = 1;\n },\n false\n );\n\n let bg, color;\n switch (style) {\n case 2:\n bg = \"#201\";\n color = \"#f08\";\n break;\n\n case 3:\n bg = \"#020\";\n color = \"#0f0\";\n break;\n\n default:\n bg = \"#002\";\n color = \"#0ff\";\n }\n\n this.container.style[\"background-color\"] = bg;\n this.container.style[\"color\"] = color;\n }\n\n if (!this.container.parentNode) {\n body = body || this.body || document.body;\n body.appendChild(this.container);\n }\n }\n\n getEmitter() {\n return this.proton.emitters[this.emitterIndex];\n }\n\n getRenderer() {\n return this.proton.renderers[this.rendererIndex];\n }\n\n concatArr(arr) {\n let result = \"\";\n if (!arr || !arr.length) return result;\n\n for (let i = 0; i < arr.length; i++) {\n result += (arr[i].name || \"\").substr(0, 1) + \".\";\n }\n\n return result;\n }\n\n getCreatedNumber(renderer) {\n return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0;\n }\n\n getEmitterPos(e) {\n return Math.round(e.p.x) + \",\" + Math.round(e.p.y);\n }\n}\n","/*\n * EventDispatcher\n * This code reference since http://createjs.com/.\n *\n **/\n\nexport default class EventDispatcher {\n constructor() {\n this._listeners = null;\n }\n\n static bind(target) {\n target.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\n\n target.prototype.hasEventListener =\n EventDispatcher.prototype.hasEventListener;\n\n target.prototype.addEventListener =\n EventDispatcher.prototype.addEventListener;\n\n target.prototype.removeEventListener =\n EventDispatcher.prototype.removeEventListener;\n\n target.prototype.removeAllEventListeners =\n EventDispatcher.prototype.removeAllEventListeners;\n }\n\n addEventListener(type, listener) {\n if (!this._listeners) {\n this._listeners = {};\n } else {\n this.removeEventListener(type, listener);\n }\n\n if (!this._listeners[type]) this._listeners[type] = [];\n this._listeners[type].push(listener);\n\n return listener;\n }\n\n removeEventListener(type, listener) {\n if (!this._listeners) return;\n if (!this._listeners[type]) return;\n\n const arr = this._listeners[type];\n const length = arr.length;\n\n for (let i = 0; i < length; i++) {\n if (arr[i] === listener) {\n if (length === 1) {\n delete this._listeners[type];\n }\n\n // allows for faster checks.\n else {\n arr.splice(i, 1);\n }\n\n break;\n }\n }\n }\n\n removeAllEventListeners(type) {\n if (!type) this._listeners = null;\n else if (this._listeners) delete this._listeners[type];\n }\n\n dispatchEvent(type, args) {\n let result = false;\n const listeners = this._listeners;\n\n if (type && listeners) {\n let arr = listeners[type];\n if (!arr) return result;\n\n // arr = arr.slice();\n // to avoid issues with items being removed or added during the dispatch\n\n let handler;\n let i = arr.length;\n while (i--) {\n handler = arr[i];\n result = result || handler(args);\n }\n }\n\n return !!result;\n }\n\n hasEventListener(type) {\n const listeners = this._listeners;\n return !!(listeners && listeners[type]);\n }\n}\n","export default class Integration {\n constructor(type) {\n this.type = type;\n }\n\n calculate(particles, time, damping) {\n this.eulerIntegrate(particles, time, damping);\n }\n\n // Euler Integrate\n // https://rosettacode.org/wiki/Euler_method\n eulerIntegrate(particle, time, damping) {\n if (!particle.sleep) {\n particle.old.p.copy(particle.p);\n particle.old.v.copy(particle.v);\n\n particle.a.multiplyScalar(1 / particle.mass);\n particle.v.add(particle.a.multiplyScalar(time));\n particle.p.add(particle.old.v.multiplyScalar(time));\n\n if (damping) particle.v.multiplyScalar(damping);\n\n particle.a.clear();\n }\n }\n}\n","import Pool from \"./Pool\";\nimport Util from \"../utils/Util\";\nimport Stats from \"../debug/Stats\";\nimport EventDispatcher from \"../events/EventDispatcher\";\nimport Integration from \"../math/Integration\";\n\nexport default class Proton {\n static USE_CLOCK = false;\n\n // 1:100\n static MEASURE = 100;\n static EULER = \"euler\";\n static RK2 = \"runge-kutta2\";\n\n static PARTICLE_CREATED = \"PARTICLE_CREATED\";\n static PARTICLE_UPDATE = \"PARTICLE_UPDATE\";\n static PARTICLE_SLEEP = \"PARTICLE_SLEEP\";\n static PARTICLE_DEAD = \"PARTICLE_DEAD\";\n static PROTON_UPDATE = \"PROTON_UPDATE\";\n static PROTON_UPDATE_AFTER = \"PROTON_UPDATE_AFTER\";\n static EMITTER_ADDED = \"EMITTER_ADDED\";\n static EMITTER_REMOVED = \"EMITTER_REMOVED\";\n\n static amendChangeTabsBug = true;\n\n /**\n * The constructor to add emitters\n *\n * @constructor Proton\n *\n * @todo proParticleCount is not in use\n * @todo add more documentation of the single properties and parameters\n *\n * @param {Number} [proParticleCount] not in use?\n * @param {Number} [integrationType=Proton.EULER]\n *\n * @property {String} [integrationType=Proton.EULER]\n * @property {Array} emitters All added emitter\n * @property {Array} renderers All added renderer\n * @property {Number} time The active time\n * @property {Number} oldtime The old time\n */\n constructor(integrationType) {\n this.emitters = [];\n this.renderers = [];\n\n this.time = 0;\n this.oldTime = 0;\n this.elapsed = 0;\n\n this.stats = new Stats(this);\n this.pool = new Pool(80);\n\n this.integrationType = Util.initValue(integrationType, Proton.EULER);\n this.integrator = new Integration(this.integrationType);\n }\n\n /**\n * add a type of Renderer\n *\n * @method addRenderer\n * @memberof Proton\n * @instance\n *\n * @param {Renderer} render\n */\n addRenderer(render) {\n render.init(this);\n this.renderers.push(render);\n }\n\n /**\n * @name add a type of Renderer\n *\n * @method addRenderer\n * @param {Renderer} render\n */\n removeRenderer(render) {\n const index = this.renderers.indexOf(render);\n this.renderers.splice(index, 1);\n render.remove(this);\n }\n\n /**\n * add the Emitter\n *\n * @method addEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Emitter} emitter\n */\n addEmitter(emitter) {\n this.emitters.push(emitter);\n emitter.parent = this;\n\n this.dispatchEvent(Proton.EMITTER_ADDED, emitter);\n }\n\n /**\n * Removes an Emitter\n *\n * @method removeEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Proton.Emitter} emitter\n */\n removeEmitter(emitter) {\n const index = this.emitters.indexOf(emitter);\n this.emitters.splice(index, 1);\n emitter.parent = null;\n\n this.dispatchEvent(Proton.EMITTER_REMOVED, emitter);\n }\n\n /**\n * Updates all added emitters\n *\n * @method update\n * @memberof Proton\n * @instance\n */\n update() {\n this.dispatchEvent(Proton.PROTON_UPDATE);\n\n if (Proton.USE_CLOCK) {\n if (!this.oldTime) this.oldTime = new Date().getTime();\n\n let time = new Date().getTime();\n this.elapsed = (time - this.oldTime) / 1000;\n Proton.amendChangeTabsBug && this.amendChangeTabsBug();\n\n this.oldTime = time;\n } else {\n this.elapsed = 0.0167;\n }\n\n // emitter update\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\n\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\n }\n\n emittersUpdate(elapsed) {\n let i = this.emitters.length;\n while (i--) this.emitters[i].update(elapsed);\n }\n\n /**\n * @todo add description\n *\n * @method amendChangeTabsBug\n * @memberof Proton\n * @instance\n */\n amendChangeTabsBug() {\n if (this.elapsed > 0.5) {\n this.oldTime = new Date().getTime();\n this.elapsed = 0;\n }\n }\n\n /**\n * Counts all particles from all emitters\n *\n * @method getCount\n * @memberof Proton\n * @instance\n */\n getCount() {\n let total = 0;\n let i = this.emitters.length;\n\n while (i--) total += this.emitters[i].particles.length;\n return total;\n }\n\n getAllParticles() {\n let particles = [];\n let i = this.emitters.length;\n\n while (i--) particles = particles.concat(this.emitters[i].particles);\n return particles;\n }\n\n destroyAllEmitters() {\n Util.destroyAll(this.emitters);\n }\n\n /**\n * Destroys everything related to this Proton instance. This includes all emitters, and all properties\n *\n * @method destroy\n * @memberof Proton\n * @instance\n */\n destroy(remove = false) {\n const destroyOther = () => {\n this.time = 0;\n this.oldTime = 0;\n this.pool.destroy();\n\n Util.destroyAll(this.emitters);\n Util.destroyAll(this.renderers, this.getAllParticles());\n };\n\n if (remove) {\n setTimeout(destroyOther, 200);\n } else {\n destroyOther();\n }\n }\n}\n\nEventDispatcher.bind(Proton);\n","export default class Rgb {\n constructor(r = 255, g = 255, b = 255) {\n this.r = r;\n this.g = g;\n this.b = b;\n }\n\n reset() {\n this.r = 255;\n this.g = 255;\n this.b = 255;\n }\n}\n","import MathUtil from \"./MathUtil\";\n\nexport default {\n easeLinear(value) {\n return value;\n },\n\n easeInQuad(value) {\n return Math.pow(value, 2);\n },\n\n easeOutQuad(value) {\n return -(Math.pow(value - 1, 2) - 1);\n },\n\n easeInOutQuad(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 2);\n\n return -0.5 * ((value -= 2) * value - 2);\n },\n\n easeInCubic(value) {\n return Math.pow(value, 3);\n },\n\n easeOutCubic(value) {\n return Math.pow(value - 1, 3) + 1;\n },\n\n easeInOutCubic(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 3);\n\n return 0.5 * (Math.pow(value - 2, 3) + 2);\n },\n\n easeInQuart(value) {\n return Math.pow(value, 4);\n },\n\n easeOutQuart(value) {\n return -(Math.pow(value - 1, 4) - 1);\n },\n\n easeInOutQuart(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 4);\n\n return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2);\n },\n\n easeInSine(value) {\n return -Math.cos(value * MathUtil.PI_2) + 1;\n },\n\n easeOutSine(value) {\n return Math.sin(value * MathUtil.PI_2);\n },\n\n easeInOutSine(value) {\n return -0.5 * (Math.cos(Math.PI * value) - 1);\n },\n\n easeInExpo(value) {\n return value === 0 ? 0 : Math.pow(2, 10 * (value - 1));\n },\n\n easeOutExpo(value) {\n return value === 1 ? 1 : -Math.pow(2, -10 * value) + 1;\n },\n\n easeInOutExpo(value) {\n if (value === 0) return 0;\n\n if (value === 1) return 1;\n\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(2, 10 * (value - 1));\n\n return 0.5 * (-Math.pow(2, -10 * --value) + 2);\n },\n\n easeInCirc(value) {\n return -(Math.sqrt(1 - value * value) - 1);\n },\n\n easeOutCirc(value) {\n return Math.sqrt(1 - Math.pow(value - 1, 2));\n },\n\n easeInOutCirc(value) {\n if ((value /= 0.5) < 1) return -0.5 * (Math.sqrt(1 - value * value) - 1);\n return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1);\n },\n\n easeInBack(value) {\n let s = 1.70158;\n return value * value * ((s + 1) * value - s);\n },\n\n easeOutBack(value) {\n let s = 1.70158;\n return (value = value - 1) * value * ((s + 1) * value + s) + 1;\n },\n\n easeInOutBack(value) {\n let s = 1.70158;\n if ((value /= 0.5) < 1)\n return 0.5 * (value * value * (((s *= 1.525) + 1) * value - s));\n return 0.5 * ((value -= 2) * value * (((s *= 1.525) + 1) * value + s) + 2);\n },\n\n getEasing(ease) {\n if (typeof ease === \"function\") return ease;\n else return this[ease] || this.easeLinear;\n }\n};\n","import MathUtil from \"../math/MathUtil\";\n\nexport default class Vector2D {\n constructor(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n\n set(x, y) {\n this.x = x;\n this.y = y;\n return this;\n }\n\n setX(x) {\n this.x = x;\n return this;\n }\n\n setY(y) {\n this.y = y;\n return this;\n }\n\n getGradient() {\n if (this.x !== 0) return Math.atan2(this.y, this.x);\n else if (this.y > 0) return MathUtil.PI_2;\n else if (this.y < 0) return -MathUtil.PI_2;\n }\n\n copy(v) {\n this.x = v.x;\n this.y = v.y;\n\n return this;\n }\n\n add(v, w) {\n if (w !== undefined) {\n return this.addVectors(v, w);\n }\n\n this.x += v.x;\n this.y += v.y;\n\n return this;\n }\n\n addXY(a, b) {\n this.x += a;\n this.y += b;\n\n return this;\n }\n\n addVectors(a, b) {\n this.x = a.x + b.x;\n this.y = a.y + b.y;\n\n return this;\n }\n\n sub(v, w) {\n if (w !== undefined) {\n return this.subVectors(v, w);\n }\n\n this.x -= v.x;\n this.y -= v.y;\n\n return this;\n }\n\n subVectors(a, b) {\n this.x = a.x - b.x;\n this.y = a.y - b.y;\n\n return this;\n }\n\n divideScalar(s) {\n if (s !== 0) {\n this.x /= s;\n this.y /= s;\n } else {\n this.set(0, 0);\n }\n\n return this;\n }\n\n multiplyScalar(s) {\n this.x *= s;\n this.y *= s;\n\n return this;\n }\n\n negate() {\n return this.multiplyScalar(-1);\n }\n\n dot(v) {\n return this.x * v.x + this.y * v.y;\n }\n\n lengthSq() {\n return this.x * this.x + this.y * this.y;\n }\n\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n\n normalize() {\n return this.divideScalar(this.length());\n }\n\n distanceTo(v) {\n return Math.sqrt(this.distanceToSquared(v));\n }\n\n rotate(tha) {\n const x = this.x;\n const y = this.y;\n\n this.x = x * Math.cos(tha) + y * Math.sin(tha);\n this.y = -x * Math.sin(tha) + y * Math.cos(tha);\n\n return this;\n }\n\n distanceToSquared(v) {\n const dx = this.x - v.x;\n const dy = this.y - v.y;\n\n return dx * dx + dy * dy;\n }\n\n lerp(v, alpha) {\n this.x += (v.x - this.x) * alpha;\n this.y += (v.y - this.y) * alpha;\n\n return this;\n }\n\n equals(v) {\n return v.x === this.x && v.y === this.y;\n }\n\n clear() {\n this.x = 0.0;\n this.y = 0.0;\n return this;\n }\n\n clone() {\n return new Vector2D(this.x, this.y);\n }\n}\n","import Rgb from \"../utils/Rgb\";\nimport Puid from \"../utils/Puid\";\nimport Util from \"../utils/Util\";\nimport ease from \"../math/ease\";\nimport Vector2D from \"../math/Vector2D\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Particle {\n /**\n * the Particle class\n *\n * @class Proton.Particle\n * @constructor\n * @param {Object} pObj the parameters object;\n * for example {life:3,dead:false}\n */\n constructor(conf) {\n /**\n * The particle's id;\n * @property id\n * @type {string}\n */\n this.name = \"Particle\";\n this.id = Puid.id(this.name);\n this.old = {};\n this.data = {};\n this.behaviours = [];\n\n this.p = new Vector2D();\n this.v = new Vector2D();\n this.a = new Vector2D();\n this.old.p = new Vector2D();\n this.old.v = new Vector2D();\n this.old.a = new Vector2D();\n\n this.rgb = new Rgb();\n this.reset();\n conf && Util.setProp(this, conf);\n }\n\n getDirection() {\n return Math.atan2(this.v.x, -this.v.y) * MathUtil.N180_PI;\n }\n\n reset() {\n this.life = Infinity;\n this.age = 0;\n\n this.dead = false;\n this.sleep = false;\n this.body = null;\n this.sprite = null;\n this.parent = null;\n\n this.energy = 1; // Energy Loss\n this.mass = 1;\n this.radius = 10;\n this.alpha = 1;\n this.scale = 1;\n this.rotation = 0;\n this.color = null;\n\n this.p.set(0, 0);\n this.v.set(0, 0);\n this.a.set(0, 0);\n this.old.p.set(0, 0);\n this.old.v.set(0, 0);\n this.old.a.set(0, 0);\n this.easing = ease.easeLinear;\n\n this.rgb.reset();\n Util.emptyObject(this.data);\n this.removeAllBehaviours();\n\n return this;\n }\n\n update(time, index) {\n if (!this.sleep) {\n this.age += time;\n this.applyBehaviours(time, index);\n }\n\n if (this.age < this.life) {\n const scale = this.easing(this.age / this.life);\n this.energy = Math.max(1 - scale, 0);\n } else {\n this.destroy();\n }\n }\n\n applyBehaviours(time, index) {\n const length = this.behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.behaviours[i] &&\n this.behaviours[i].applyBehaviour(this, time, index);\n }\n }\n\n addBehaviour(behaviour) {\n this.behaviours.push(behaviour);\n\n if (behaviour.hasOwnProperty(\"parents\")) behaviour.parents.push(this);\n behaviour.initialize(this);\n }\n\n addBehaviours(behaviours) {\n const length = behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.addBehaviour(behaviours[i]);\n }\n }\n\n removeBehaviour(behaviour) {\n const index = this.behaviours.indexOf(behaviour);\n\n if (index > -1) {\n const behaviour = this.behaviours.splice(index, 1);\n behaviour.parents = null;\n }\n }\n\n removeAllBehaviours() {\n Util.emptyArray(this.behaviours);\n }\n\n /**\n * Destory this particle\n * @method destroy\n */\n destroy() {\n this.removeAllBehaviours();\n this.energy = 0;\n this.dead = true;\n this.parent = null;\n }\n}\n","export default {\n /**\n * @typedef {Object} rgbObject\n * @property {Number} r red value\n * @property {Number} g green value\n * @property {Number} b blue value\n */\n /**\n * converts a hex value to a rgb object\n *\n * @memberof Proton#Proton.Util\n * @method hexToRgb\n *\n * @param {String} h any hex value, e.g. #000000 or 000000 for black\n *\n * @return {rgbObject}\n */\n hexToRgb(h) {\n const hex16 = h.charAt(0) === \"#\" ? h.substring(1, 7) : h;\n const r = parseInt(hex16.substring(0, 2), 16);\n const g = parseInt(hex16.substring(2, 4), 16);\n const b = parseInt(hex16.substring(4, 6), 16);\n\n return { r, g, b };\n },\n\n /**\n * converts a rgb value to a rgb string\n *\n * @memberof Proton#Proton.Util\n * @method rgbToHex\n *\n * @param {Object | Proton.hexToRgb} rgb a rgb object like in {@link Proton#Proton.}\n *\n * @return {String} rgb()\n */\n rgbToHex(rbg) {\n return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`;\n },\n\n getHex16FromParticle(p) {\n return Number(p.rgb.r) * 65536 + Number(p.rgb.g) * 256 + Number(p.rgb.b);\n }\n};\n","import Vector2D from \"./Vector2D\";\n\nexport default class Polar2D {\n constructor(r, tha) {\n this.r = Math.abs(r) || 0;\n this.tha = tha || 0;\n }\n\n set(r, tha) {\n this.r = r;\n this.tha = tha;\n return this;\n }\n\n setR(r) {\n this.r = r;\n return this;\n }\n\n setTha(tha) {\n this.tha = tha;\n return this;\n }\n\n copy(p) {\n this.r = p.r;\n this.tha = p.tha;\n return this;\n }\n\n toVector() {\n return new Vector2D(this.getX(), this.getY());\n }\n\n getX() {\n return this.r * Math.sin(this.tha);\n }\n\n getY() {\n return -this.r * Math.cos(this.tha);\n }\n\n normalize() {\n this.r = 1;\n return this;\n }\n\n equals(v) {\n return v.r === this.r && v.tha === this.tha;\n }\n\n clear() {\n this.r = 0.0;\n this.tha = 0.0;\n return this;\n }\n\n clone() {\n return new Polar2D(this.r, this.tha);\n }\n}\n","const Mat3 = {\n create(mat3) {\n const mat = new Float32Array(9);\n if (mat3) this.set(mat3, mat);\n\n return mat;\n },\n\n set(mat1, mat2) {\n for (let i = 0; i < 9; i++) mat2[i] = mat1[i];\n\n return mat2;\n },\n\n multiply(mat, mat2, mat3) {\n let a00 = mat[0],\n a01 = mat[1],\n a02 = mat[2],\n a10 = mat[3],\n a11 = mat[4],\n a20 = mat[6],\n a21 = mat[7],\n b00 = mat2[0],\n b01 = mat2[1],\n b02 = mat2[2],\n b10 = mat2[3],\n b11 = mat2[4],\n b20 = mat2[6],\n b21 = mat2[7];\n\n mat3[0] = b00 * a00 + b01 * a10;\n mat3[1] = b00 * a01 + b01 * a11;\n mat3[2] = a02 * b02;\n mat3[3] = b10 * a00 + b11 * a10;\n mat3[4] = b10 * a01 + b11 * a11;\n mat3[6] = b20 * a00 + b21 * a10 + a20;\n mat3[7] = b20 * a01 + b21 * a11 + a21;\n\n return mat3;\n },\n\n inverse(mat, mat3) {\n let a00 = mat[0],\n a01 = mat[1],\n a10 = mat[3],\n a11 = mat[4],\n a20 = mat[6],\n a21 = mat[7],\n b01 = a11,\n b11 = -a10,\n b21 = a21 * a10 - a11 * a20,\n d = a00 * b01 + a01 * b11,\n id;\n\n id = 1 / d;\n mat3[0] = b01 * id;\n mat3[1] = -a01 * id;\n mat3[3] = b11 * id;\n mat3[4] = a00 * id;\n mat3[6] = b21 * id;\n mat3[7] = (-a21 * a00 + a01 * a20) * id;\n\n return mat3;\n },\n\n multiplyVec2(m, vec, mat3) {\n let x = vec[0],\n y = vec[1];\n\n mat3[0] = x * m[0] + y * m[3] + m[6];\n mat3[1] = x * m[1] + y * m[4] + m[7];\n\n return mat3;\n }\n};\n\nexport default Mat3;\n","import Span from \"./Span\";\nimport Util from \"../utils/Util\";\nimport MathUtil from \"./MathUtil\";\n\nexport default class ArraySpan extends Span {\n constructor(color) {\n super();\n this._arr = Util.toArray(color);\n }\n\n getValue() {\n const val = Util.getRandFromArray(this._arr);\n return val === \"random\" || val === \"Random\" ? MathUtil.randomColor() : val;\n }\n\n /**\n * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance\n *\n * @method setSpanValue\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n static createArraySpan(arr) {\n if (!arr) return null;\n\n if (arr instanceof ArraySpan) return arr;\n else return new ArraySpan(arr);\n }\n}\n","export default class Rectangle {\n constructor(x, y, w, h) {\n this.x = x;\n this.y = y;\n\n this.width = w;\n this.height = h;\n\n this.bottom = this.y + this.height;\n this.right = this.x + this.width;\n }\n\n contains(x, y) {\n if (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\n return true;\n else return false;\n }\n}\n","import Span from \"../math/Span\";\nimport Util from \"../utils/Util\";\n\nexport default class Rate {\n /**\n * The number of particles per second emission (a [particle]/b [s]);\n * @namespace\n * @memberof! Proton#\n * @constructor\n * @alias Rate\n *\n * @param {Array | Number | Span} numpan the number of each emission;\n * @param {Array | Number | Span} timepan the time of each emission;\n * for example: new Rate(new Span(10, 20), new Span(.1, .25));\n */\n constructor(numpan, timepan) {\n this.numPan = Span.setSpanValue(Util.initValue(numpan, 1));\n this.timePan = Span.setSpanValue(Util.initValue(timepan, 1));\n\n this.startTime = 0;\n this.nextTime = 0;\n this.init();\n }\n\n init() {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n }\n\n getValue(time) {\n this.startTime += time;\n\n if (this.startTime >= this.nextTime) {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n\n if (this.numPan.b === 1) {\n if (this.numPan.getValue(false) > 0.5) return 1;\n else return 0;\n } else {\n return this.numPan.getValue(true);\n }\n }\n\n return 0;\n }\n}\n","export default class Initialize {\n reset() {}\n\n init(emitter, particle) {\n if (particle) {\n this.initialize(particle);\n } else {\n this.initialize(emitter);\n }\n }\n\n // sub class init\n initialize(target) {}\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Life extends Initialize {\n constructor(a, b, c) {\n super();\n\n this.lifePan = Span.setSpanValue(a, b, c);\n this.name = \"Life\";\n }\n\n initialize(target) {\n if (this.lifePan.a === Infinity) target.life = Infinity;\n else target.life = this.lifePan.getValue();\n }\n}\n","import Vector2D from \"../math/Vector2D\";\n\nexport default class Zone {\n constructor() {\n this.vector = new Vector2D(0, 0);\n this.random = 0;\n this.crossType = \"dead\";\n this.alert = true;\n }\n\n getPosition() {}\n\n crossing(particle) {}\n}\n","import Zone from \"./Zone\";\n\nexport default class PointZone extends Zone {\n constructor(x, y) {\n super();\n\n this.x = x;\n this.y = y;\n }\n\n getPosition() {\n this.vector.x = this.x;\n this.vector.y = this.y;\n\n return this.vector;\n }\n\n crossing(particle) {\n if (this.alert) {\n console.error(\"Sorry, PointZone does not support crossing method!\");\n this.alert = false;\n }\n }\n}\n","import Util from \"../utils/Util\";\nimport PointZone from \"../zone/PointZone\";\nimport Initialize from \"./Initialize\";\n\nexport default class Position extends Initialize {\n constructor(zone) {\n super();\n this.zone = Util.initValue(zone, new PointZone());\n this.name = \"Position\";\n }\n\n reset(zone) {\n this.zone = Util.initValue(zone, new PointZone());\n }\n\n initialize(target) {\n this.zone.getPosition();\n\t\n target.p.x = this.zone.vector.x;\n target.p.y = this.zone.vector.y;\n }\n}\n","import Proton from \"../core/Proton\";\nimport Span from \"../math/Span\";\nimport Util from \"../utils/Util\";\nimport Initialize from \"./Initialize\";\nimport Polar2D from \"../math/Polar2D\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Velocity extends Initialize {\n constructor(rpan, thapan, type) {\n super();\n\n this.rPan = Span.setSpanValue(rpan);\n this.thaPan = Span.setSpanValue(thapan);\n this.type = Util.initValue(type, \"vector\");\n\n this.name = \"Velocity\";\n }\n\n reset(rpan, thapan, type) {\n this.rPan = Span.setSpanValue(rpan);\n this.thaPan = Span.setSpanValue(thapan);\n this.type = Util.initValue(type, \"vector\");\n }\n\n normalizeVelocity(vr) {\n return vr * Proton.MEASURE;\n }\n\n initialize(target) {\n if (this.type === \"p\" || this.type === \"P\" || this.type === \"polar\") {\n const polar2d = new Polar2D(\n this.normalizeVelocity(this.rPan.getValue()),\n this.thaPan.getValue() * MathUtil.PI_180\n );\n\n target.v.x = polar2d.getX();\n target.v.y = polar2d.getY();\n } else {\n target.v.x = this.normalizeVelocity(this.rPan.getValue());\n target.v.y = this.normalizeVelocity(this.thaPan.getValue());\n }\n }\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Mass extends Initialize {\n constructor(a, b, c) {\n super();\n this.massPan = Span.setSpanValue(a, b, c);\n this.name = \"Mass\";\n }\n\n initialize(target) {\n target.mass = this.massPan.getValue();\n }\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Radius extends Initialize {\n constructor(a, b, c) {\n super();\n this.radius = Span.setSpanValue(a, b, c);\n\n this.name = \"Radius\";\n }\n\n reset(a, b, c) {\n this.radius = Span.setSpanValue(a, b, c);\n }\n\n initialize(particle) {\n particle.radius = this.radius.getValue();\n particle.data.oldRadius = particle.radius;\n }\n}\n","import Util from \"../utils/Util\";\nimport ArraySpan from \"../math/ArraySpan\";\nimport Initialize from \"./Initialize\";\n\nexport default class Body extends Initialize {\n constructor(image, w, h) {\n super();\n\n this.image = this.setSpanValue(image);\n this.w = Util.initValue(w, 20);\n this.h = Util.initValue(h, this.w);\n this.name = \"Body\";\n }\n\n initialize(particle) {\n const imageTarget = this.image.getValue();\n\n if (typeof imageTarget === \"string\") {\n particle.body = {\n width: this.w,\n height: this.h,\n src: imageTarget,\n isInner: true,\n inner: true\n };\n } else {\n particle.body = imageTarget;\n }\n }\n\n setSpanValue(image) {\n return image instanceof ArraySpan ? image : new ArraySpan(image);\n }\n}\n","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport ease from '../math/ease';\n\nexport default class Behaviour {\n static id = 0;\n\n /**\n * The Behaviour class is the base for the other Behaviour\n *\n * @memberof! -\n * @interface\n * @alias Proton.Behaviour\n *\n * @param {Number} life \tthe behaviours life\n * @param {String} easing \tThe behaviour's decaying trend, for example ease.easeOutQuart\n *\n * @property {String} id \t\tThe behaviours id\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n * @property {Number} age=0 \tHow long the particle should be 'alife'\n * @property {Number} energy=1\n * @property {Boolean} dead=false The particle is dead at first\n * @property {Array} parents \tThe behaviour's parents array\n * @property {String} name \tThe behaviour name\n */\n constructor(life, easing) {\n\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n\n this.age = 0;\n this.energy = 1;\n this.dead = false;\n this.parents = [];\n\n this.id = `Behaviour_${Behaviour.id++}`;\n this.name = 'Behaviour';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(life, easing) {\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n }\n\n /**\n * Normalize a force by 1:100;\n *\n * @method normalizeForce\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Vector2D} force\n */\n normalizeForce(force) {\n return force.multiplyScalar(Proton.MEASURE);\n }\n\n /**\n * Normalize a value by 1:100;\n *\n * @method normalizeValue\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} value\n */\n normalizeValue(value) {\n return value * Proton.MEASURE;\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {}\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n calculate(particle, time, index) {\n this.age += time;\n\n if (this.age >= this.life || this.dead) {\n this.energy = 0;\n this.dead = true;\n this.destroy();\n } else {\n const scale = this.easing(particle.age / particle.life);\n this.energy = Math.max(1 - scale, 0);\n }\n }\n\n /**\n * Destory this behaviour\n *\n * @method destroy\n * @memberof Proton.Behaviour\n * @instance\n */\n destroy() {\n let i = this.parents.length;\n while (i--) {\n this.parents[i].removeBehaviour(this);\n }\n\n this.parents.length = 0;\n }\n}\n","import Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Force extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Force\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(fx, fy, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\t\tthis.name = 'Force';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(fx, fy, life, easing) {\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.a.add(this.force);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Attraction extends Behaviour {\n\n\t/**\n\t * This behaviour let the particles follow one specific Proton.Vector2D\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Attraction\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Proton.Vector2D} targetPosition\n\t * @property {Number} radius\n\t * @property {Number} force\n\t * @property {Number} radiusSq\n\t * @property {Proton.Vector2D} attractionForce\n\t * @property {Number} lengthSq\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tthis.name = 'Attraction';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Attraction\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Attraction\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tthis.attractionForce.copy(this.targetPosition);\n\t\tthis.attractionForce.sub(particle.p);\n\t\tthis.lengthSq = this.attractionForce.lengthSq();\n\n\t\tif (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) {\n\t\t\tthis.attractionForce.normalize();\n\t\t\tthis.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\n\t\t\tthis.attractionForce.multiplyScalar(this.force);\n\n\t\t\tparticle.a.add(this.attractionForce);\n\t\t}\n\t}\n}","import Vector2D from \"../math/Vector2D\";\nimport MathUtil from \"../math/MathUtil\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class RandomDrift extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Behaviour\n * @constructor\n * @alias RandomDrift\n *\n * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n * @param {Number} delay \t\t\t\tHow much delay the drift should have\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {Number} time The time of the drift\n * @property {String} name The Behaviour name\n */\n constructor(driftX, driftY, delay, life, easing) {\n super(life, easing);\n\n this.reset(driftX, driftY, delay);\n this.time = 0;\n this.name = \"RandomDrift\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#RandomDrift\n * @instance\n *\n * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n * @param {Number} delay \t\t\t\tHow much delay the drift should have\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(driftX, driftY, delay, life, easing) {\n this.panFoce = new Vector2D(driftX, driftY);\n this.panFoce = this.normalizeForce(this.panFoce);\n this.delay = delay;\n\n life && super.reset(life, easing);\n }\n\n initialize(particle) {\n particle.data.time = 0;\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#RandomDrift\n * @instance\n *\n * @param {Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n particle.data.time += time;\n\n if (particle.data.time >= this.delay) {\n particle.a.addXY(\n MathUtil.randomAToB(-this.panFoce.x, this.panFoce.x),\n MathUtil.randomAToB(-this.panFoce.y, this.panFoce.y)\n );\n\n particle.data.time = 0;\n }\n }\n}\n","import Force from './Force';\n\nexport default class Gravity extends Force {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Force\n\t * @constructor\n\t * @alias Proton.Gravity\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(g, life, easing) {\n\t\tsuper(0, g, life, easing);\n\t\tthis.name = 'Gravity';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Gravity\n\t * @instance\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(g, life, easing) {\n\t\tsuper.reset(0, g, life, easing);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Collision extends Behaviour {\n\n\t/**\n\t * The callback after collision\n\t *\n\t * @callback Callback\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Proton.Paritcle} otherParticle\n\t */\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Collision\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(emitter, mass, callback, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(emitter, mass, callback);\n\t\tthis.name = 'Collision';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method reset\n\t * @instance\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} \t\t\t[life=Infinity] \tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(emitter, mass, callback, life, easing) {\n\t\tthis.emitter = Util.initValue(emitter, null);\n\t\tthis.mass = Util.initValue(mass, true);\n\t\tthis.callback = Util.initValue(callback, null);\n\n\t\tthis.collisionPool = [];\n\t\tthis.delta = new Vector2D();\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tconst newPool = this.emitter ? this.emitter.particles.slice(index) : this.pool.slice(index);\n\t\tconst length = newPool.length;\n\n\t\tlet otherParticle;\n\t\tlet lengthSq;\n\t\tlet overlap;\n\t\tlet totalMass;\n\t\tlet averageMass1, averageMass2;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\totherParticle = newPool[i];\n\n\t\t\tif (otherParticle !== particle) {\n\t\t\t\tthis.delta.copy(otherParticle.p);\n\t\t\t\tthis.delta.sub(particle.p);\n\n\t\t\t\tlengthSq = this.delta.lengthSq();\n\t\t\t\tconst distance = particle.radius + otherParticle.radius;\n\n\t\t\t\tif (lengthSq <= distance * distance) {\n\t\t\t\t\toverlap = distance - Math.sqrt(lengthSq);\n\t\t\t\t\toverlap += 0.5;\n\n\t\t\t\t\ttotalMass = particle.mass + otherParticle.mass;\n\t\t\t\t\taverageMass1 = this.mass ? otherParticle.mass / totalMass : 0.5;\n\t\t\t\t\taverageMass2 = this.mass ? particle.mass / totalMass : 0.5;\n\n\t\t\t\t\tparticle.p.add(this.delta.clone().normalize().multiplyScalar(overlap * -averageMass1));\n\t\t\t\t\totherParticle.p.add(this.delta.normalize().multiplyScalar(overlap * averageMass2));\n\n\t\t\t\t\tthis.callback && this.callback(particle, otherParticle);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class CrossZone extends Behaviour {\n\n /**\n * Defines what happens if the particles come to the end of the specified zone\n *\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.CrossZone\n *\n * @param {Proton.Zone} zone \t\t\t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \t\t\twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \t\t\tthis behaviour's life\n * @param {String} \t\t[easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(zone, crossType, life, easing) {\n super(life, easing);\n\n this.reset(zone, crossType);\n this.name = 'CrossZone';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Zone} zone \t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \tthis behaviour's life\n * @param {String} \t\t[easing=easeLinear]\tthis behaviour's easing\n */\n reset(zone, crossType, life, easing) {\n this.zone = zone;\n this.zone.crossType = Util.initValue(crossType, 'dead');\n\n life && super.reset(life, easing);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n this.zone.crossing(particle);\n };\n}","import Util from \"../utils/Util\";\nimport Span from \"../math/Span\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Alpha extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Alpha\n *\n * @todo add description for 'a' and 'b'\n *\n * @param {Number} a\n * @param {String} b\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = \"Alpha\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @todo add description for 'a' and 'b'\n *\n * @param {Number} a\n * @param {String} b\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.same = b === null || b === undefined ? true : false;\n this.a = Span.setSpanValue(Util.initValue(a, 1));\n this.b = Span.setSpanValue(b);\n\n life && super.reset(life, easing);\n }\n\n /**\n * Sets the new alpha value of the particle\n *\n * @method initialize\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @param {Proton.Particle} particle A single Proton generated particle\n */\n initialize(particle) {\n particle.data.alphaA = this.a.getValue();\n\n if (this.same) particle.data.alphaB = particle.data.alphaA;\n else particle.data.alphaB = this.b.getValue();\n }\n\n /**\n * @method applyBehaviour\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n\tthis.calculate(particle, time, index);\n\t\n particle.alpha =\n particle.data.alphaB +\n\t (particle.data.alphaA - particle.data.alphaB) * this.energy;\n\t \n if (particle.alpha < 0.001) particle.alpha = 0;\n }\n}\n","import Span from \"../math/Span\";\nimport Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Scale extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Scale\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(a, b, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(a, b);\n\t\tthis.name = 'Scale';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Span.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Span.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.data.scaleA = this.a.getValue();\n\t\tparticle.data.oldRadius = particle.radius;\n\t\tparticle.data.scaleB = this.same ? particle.data.scaleA : this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.scale = particle.data.scaleB + (particle.data.scaleA - particle.data.scaleB) * this.energy;\n\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\n\t\tparticle.radius = particle.data.oldRadius * particle.scale;\n\t}\n}","import Span from \"../math/Span\";\nimport Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Rotate extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Rotate\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} [influence=Velocity] The rotation's influence\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(influence, b, style, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(influence, b, style);\n\t\tthis.name = 'Rotate';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} a\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, style, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\n\t\tthis.a = Span.setSpanValue(Util.initValue(a, 'Velocity'));\n\t\tthis.b = Span.setSpanValue(Util.initValue(b, 0));\n\t\tthis.style = Util.initValue(style, 'to');\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.rotation = this.a.getValue();\n\t\tparticle.data.rotationA = this.a.getValue();\n\n\t\tif (!this.same) particle.data.rotationB = this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tif (!this.same) {\n\t\t\tif (this.style === 'to' || this.style === 'TO' || this.style === '_') {\n\t\t\t\tparticle.rotation += particle.data.rotationB + (particle.data.rotationA - particle.data.rotationB) * this.energy\n\t\t\t} else {\n\t\t\t\tparticle.rotation += particle.data.rotationB;\n\t\t\t}\n\t\t} else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') {\n\t\t\t// beta...\n\t\t\tparticle.rotation = particle.getDirection();\n\t\t}\n\t}\n\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport ArraySpan from \"../math/ArraySpan\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Color extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Color\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = \"Color\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.a = ArraySpan.createArraySpan(a);\n this.b = ArraySpan.createArraySpan(b);\n life && super.reset(life, easing);\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {\n particle.color = this.a.getValue();\n particle.data.colorA = ColorUtil.hexToRgb(particle.color);\n\n if (this.b) particle.data.colorB = ColorUtil.hexToRgb(this.b.getValue());\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n if (this.b) {\n this.calculate(particle, time, index);\n\n particle.rgb.r =\n particle.data.colorB.r +\n (particle.data.colorA.r - particle.data.colorB.r) * this.energy;\n particle.rgb.g =\n particle.data.colorB.g +\n (particle.data.colorA.g - particle.data.colorB.g) * this.energy;\n particle.rgb.b =\n particle.data.colorB.b +\n (particle.data.colorA.b - particle.data.colorB.b) * this.energy;\n\n particle.rgb.r = Math.floor(particle.rgb.r);\n particle.rgb.g = Math.floor(particle.rgb.g);\n particle.rgb.b = Math.floor(particle.rgb.b);\n } else {\n particle.rgb.r = particle.data.colorA.r;\n particle.rgb.g = particle.data.colorA.g;\n particle.rgb.b = particle.data.colorA.b;\n }\n }\n}\n","import Attraction from './Attraction';\n\nexport default class Repulsion extends Attraction {\n\n\t/**\n\t * The oppisite of Proton.Attraction - turns the force\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Attraction\n\t * @constructor\n\t * @alias Proton.Repulsion\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} force\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(targetPosition, force, radius, life, easing);\n\n\t\tthis.force *= -1;\n\t\tthis.name = 'Repulsion';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Repulsion\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tsuper.reset(targetPosition, force, radius, life, easing);\n\t\tthis.force *= -1;\n\t}\n}\n","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class GravityWell extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias GravityWell\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(centerPoint, force, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.name = 'GravityWell';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t */\n\treset(centerPoint, force, life, easing) {\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tlife && super.reset(life, easing);\n\t};\n\n\t/**\n\t * @inheritdoc\n\t */\n\tinitialize(particle) {\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y);\n\t\tconst distanceSq = this.distanceVec.lengthSq();\n\n\t\tif (distanceSq !== 0) {\n\t\t\tconst distance = this.distanceVec.length();\n\t\t\tconst factor = (this.force * time) / (distanceSq * distance);\n\n\t\t\tparticle.v.x += factor * this.distanceVec.x;\n\t\t\tparticle.v.y += factor * this.distanceVec.y;\n\t\t}\n\t}\n}","import Util from \"../utils/Util\";\nimport Initialize from \"./Initialize\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default {\n initialize(emitter, particle, initializes) {\n const length = initializes.length;\n let i;\n\n for (i = 0; i < length; i++) {\n if (initializes[i] instanceof Initialize) {\n initializes[i].init(emitter, particle);\n } else {\n this.init(emitter, particle, initializes[i]);\n }\n }\n\n this.bindEmitter(emitter, particle);\n },\n\n // init\n init(emitter, particle, initialize) {\n Util.setProp(particle, initialize);\n Util.setVectorVal(particle, initialize);\n },\n\n bindEmitter(emitter, particle) {\n if (emitter.bindEmitter) {\n particle.p.add(emitter.p);\n particle.v.add(emitter.v);\n particle.a.add(emitter.a);\n\n particle.v.rotate(MathUtil.degreeTransform(emitter.rotation));\n }\n }\n};\n","import Util from \"../utils/Util\";\nimport Puid from \"../utils/Puid\";\nimport Particle from \"../core/Particle\";\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport Rate from \"../initialize/Rate\";\nimport InitializeUtil from \"../initialize/InitializeUtil\";\n\nexport default class Emitter extends Particle {\n /**\n * You can use this emit particles.\n *\n * It will dispatch follow events:\n * PARTICLE_CREATED\n * PARTICLE_UPDATA\n * PARTICLE_DEAD\n *\n * @class Emitter\n * @constructor\n * @param {Object} conf the parameters object;\n * for example {damping:0.01,bindEmitter:false}\n */\n constructor(conf = {}) {\n super(conf);\n\n this.particles = [];\n this.behaviours = [];\n this.initializes = [];\n\n this.emitTime = 0;\n this.emitSpeed = 0;\n this.totalTime = -1;\n\n /**\n * The friction coefficient for all particle emit by This;\n * @property damping\n * @type {Number}\n * @default 0.006\n */\n this.damping = 0.006;\n\n /**\n * If bindEmitter the particles can bind this emitter's property;\n * @property bindEmitter\n * @type {Boolean}\n * @default true\n */\n this.bindEmitter = true;\n\n /**\n * The number of particles per second emit (a [particle]/b [s]);\n * @property rate\n * @type {Rate}\n * @default Rate(1, .1)\n */\n this.rate = new Rate(1, 0.1);\n\n this.name = \"Emitter\";\n this.id = Puid.id(this.name);\n }\n\n /**\n * start emit particle\n * @method emit\n * @param {Number} emitTime begin emit time;\n * @param {String} life the life of this emitter\n */\n emit(totalTime, life) {\n this.stoped = false;\n this.emitTime = 0;\n this.totalTime = Util.initValue(totalTime, Infinity);\n\n if (life === true || life === \"life\" || life === \"destroy\") {\n this.life = totalTime === \"once\" ? 1 : this.totalTime;\n } else if (!isNaN(life)) {\n this.life = life;\n }\n\n this.rate.init();\n }\n\n /**\n * stop emiting\n * @method stop\n */\n stop() {\n this.totalTime = -1;\n this.emitTime = 0;\n this.stoped = true;\n }\n\n preEmit(time) {\n let oldStoped = this.stoped;\n let oldEmitTime = this.emitTime;\n let oldTotalTime = this.totalTime;\n\n this.stoped = false;\n this.emitTime = 0;\n this.totalTime = time;\n this.rate.init();\n\n const step = 0.0167;\n while (time > step) {\n time -= step;\n this.update(step);\n }\n\n this.stoped = oldStoped;\n this.emitTime = oldEmitTime + Math.max(time, 0);\n this.totalTime = oldTotalTime;\n }\n\n /**\n * remove current all particles\n * @method removeAllParticles\n */\n removeAllParticles() {\n let i = this.particles.length;\n while (i--) this.particles[i].dead = true;\n }\n\n /**\n * add initialize to this emitter\n * @method addSelfInitialize\n */\n addSelfInitialize(initialize) {\n if (initialize[\"init\"]) {\n initialize.init(this);\n } else {\n this.initAll();\n }\n }\n\n /**\n * add the Initialize to particles;\n *\n * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\n * @method addInitialize\n * @param {Initialize} initialize like this new Radius(1, 12)\n */\n addInitialize(...rest) {\n let i = rest.length;\n while (i--) this.initializes.push(rest[i]);\n }\n\n /**\n * remove the Initialize\n * @method removeInitialize\n * @param {Initialize} initialize a initialize\n */\n removeInitialize(initializer) {\n const index = this.initializes.indexOf(initializer);\n if (index > -1) this.initializes.splice(index, 1);\n }\n\n /**\n * remove all Initializes\n * @method removeInitializers\n */\n removeAllInitializers() {\n Util.emptyArray(this.initializes);\n }\n\n /**\n * add the Behaviour to particles;\n *\n * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\n * @method addBehaviour\n * @param {Behaviour} behaviour like this new Color('random')\n */\n addBehaviour(...rest) {\n let i = arguments.length;\n while (i--) {\n let behaviour = rest[i];\n this.behaviours.push(behaviour);\n if (behaviour.parents) behaviour.parents.push(this);\n }\n }\n\n /**\n * remove the Behaviour\n * @method removeBehaviour\n * @param {Behaviour} behaviour a behaviour\n */\n removeBehaviour(behaviour) {\n let index = this.behaviours.indexOf(behaviour);\n this.behaviours.splice(index, 1);\n\n if (behaviour.parents) {\n index = behaviour.parents.indexOf(behaviour);\n behaviour.parents.splice(index, 1);\n }\n\n return index;\n }\n\n /**\n * remove all behaviours\n * @method removeAllBehaviours\n */\n removeAllBehaviours() {\n Util.emptyArray(this.behaviours);\n }\n\n // emitter update\n update(time) {\n this.age += time;\n if (this.age >= this.life || this.dead) this.destroy();\n\n this.emitting(time);\n this.integrate(time);\n }\n\n integrate(time) {\n if (!this.parent) return;\n\n const damping = 1 - this.damping;\n this.parent.integrator.calculate(this, time, damping);\n\n const length = this.particles.length;\n let i, particle;\n\n for (i = length - 1; i >= 0; i--) {\n particle = this.particles[i];\n\n // particle update\n particle.update(time, i);\n this.parent.integrator.calculate(particle, time, damping);\n this.dispatch(\"PARTICLE_UPDATE\", particle);\n\n // check dead\n if (particle.dead) {\n this.dispatch(\"PARTICLE_DEAD\", particle);\n\n this.parent.pool.expire(particle);\n this.particles.splice(i, 1);\n }\n }\n }\n\n dispatch(event, target) {\n this.parent && this.parent.dispatchEvent(event, target);\n this.bindEvent && this.dispatchEvent(event, target);\n }\n\n emitting(time) {\n if (this.totalTime === \"once\") {\n let i;\n const length = this.rate.getValue(99999);\n\n if (length > 0) this.emitSpeed = length;\n for (i = 0; i < length; i++) this.createParticle();\n this.totalTime = \"none\";\n } else {\n this.emitTime += time;\n\n if (this.emitTime < this.totalTime) {\n const length = this.rate.getValue(time);\n let i;\n\n if (length > 0) this.emitSpeed = length;\n for (i = 0; i < length; i++) this.createParticle();\n }\n }\n }\n\n /**\n * create single particle;\n *\n * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\n * @method removeAllParticles\n */\n createParticle(initialize, behaviour) {\n const particle = this.parent.pool.get(Particle);\n this.setupParticle(particle, initialize, behaviour);\n this.dispatch(\"PARTICLE_CREATED\", particle);\n\n return particle;\n }\n\n setupParticle(particle, initialize, behaviour) {\n let initializes = this.initializes;\n let behaviours = this.behaviours;\n\n if (initialize) initializes = Util.toArray(initialize);\n if (behaviour) behaviours = Util.toArray(behaviour);\n\n particle.reset();\n InitializeUtil.initialize(this, particle, initializes);\n particle.addBehaviours(behaviours);\n particle.parent = this;\n\n this.particles.push(particle);\n }\n\n remove() {\n this.stop();\n Util.destroyAll(this.particles);\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n this.dead = true;\n this.remove();\n this.removeAllInitializers();\n this.removeAllBehaviours();\n this.parent && this.parent.removeEmitter(this);\n }\n}\n\nEventDispatcher.bind(Emitter);\n","import Emitter from \"./Emitter\";\n\nexport default class BehaviourEmitter extends Emitter {\n /**\n * The BehaviourEmitter class inherits from Proton.Emitter\n *\n * use the BehaviourEmitter you can add behaviours to self;\n * @class Proton.BehaviourEmitter\n * @constructor\n * @param {Object} conf the parameters object;\n */\n constructor(conf) {\n super(conf);\n\n this.selfBehaviours = [];\n }\n\n /**\n * add the Behaviour to emitter;\n *\n * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\n * @method addSelfBehaviour\n * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\n */\n addSelfBehaviour(...rest) {\n let i,\n length = rest.length;\n\n for (i = 0; i < length; i++) {\n this.selfBehaviours.push(rest[i]);\n }\n }\n\n /**\n * remove the Behaviour for self\n * @method removeSelfBehaviour\n * @param {Proton.Behaviour} behaviour a behaviour\n */\n removeSelfBehaviour(behaviour) {\n const index = this.selfBehaviours.indexOf(behaviour);\n if (index > -1) this.selfBehaviours.splice(index, 1);\n }\n\n update(time) {\n super.update(time);\n\n if (!this.sleep) {\n const length = this.selfBehaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.selfBehaviours[i].applyBehaviour(this, time, i);\n }\n }\n }\n}\n","import Util from \"../utils/Util\";\nimport Emitter from \"./Emitter\";\n\nexport default class FollowEmitter extends Emitter {\n /**\n * The FollowEmitter class inherits from Proton.Emitter\n *\n * use the FollowEmitter will emit particle when mousemoving\n *\n * @class Proton.FollowEmitter\n * @constructor\n * @param {Element} mouseTarget mouseevent's target;\n * @param {Number} ease the easing of following speed;\n * @default 0.7\n * @param {Object} conf the parameters object;\n */\n constructor(mouseTarget, ease, conf) {\n super(conf);\n\n this.mouseTarget = Util.initValue(mouseTarget, window);\n this.ease = Util.initValue(ease, 0.7);\n\n this._allowEmitting = false;\n this.initEventHandler();\n }\n\n initEventHandler() {\n this.mousemoveHandler = e => this.mousemove.call(this, e);\n this.mousedownHandler = e => this.mousedown.call(this, e);\n this.mouseupHandler = e => this.mouseup.call(this, e);\n\n this.mouseTarget.addEventListener(\n \"mousemove\",\n this.mousemoveHandler,\n false\n );\n }\n\n /**\n * start emit particle\n * @method emit\n */\n emit() {\n this._allowEmitting = true;\n }\n\n /**\n * stop emiting\n * @method stop\n */\n stop() {\n this._allowEmitting = false;\n }\n\n mousemove(e) {\n if (e.layerX || e.layerX === 0) {\n this.p.x += (e.layerX - this.p.x) * this.ease;\n this.p.y += (e.layerY - this.p.y) * this.ease;\n } else if (e.offsetX || e.offsetX === 0) {\n this.p.x += (e.offsetX - this.p.x) * this.ease;\n this.p.y += (e.offsetY - this.p.y) * this.ease;\n }\n\n if (this._allowEmitting) super.emit(\"once\");\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n super.destroy();\n this.mouseTarget.removeEventListener(\n \"mousemove\",\n this.mousemoveHandler,\n false\n );\n }\n}\n","import Pool from \"../core/Pool\";\nimport Util from \"../utils/Util\";\n\nexport default class BaseRenderer {\n constructor(element, stroke) {\n this.pool = new Pool();\n this.element = element;\n this.stroke = stroke;\n this.circleConf = { isCircle: true };\n\n this.initHandler();\n this.name = \"BaseRenderer\";\n }\n\n setStroke(color = \"#000000\", thinkness = 1) {\n this.stroke = { color, thinkness };\n }\n\n initHandler() {\n this._protonUpdateHandler = () => {\n this.onProtonUpdate.call(this);\n };\n\n this._protonUpdateAfterHandler = () => {\n this.onProtonUpdateAfter.call(this);\n };\n\n this._emitterAddedHandler = emitter => {\n this.onEmitterAdded.call(this, emitter);\n };\n\n this._emitterRemovedHandler = emitter => {\n this.onEmitterRemoved.call(this, emitter);\n };\n\n this._particleCreatedHandler = particle => {\n this.onParticleCreated.call(this, particle);\n };\n\n this._particleUpdateHandler = particle => {\n this.onParticleUpdate.call(this, particle);\n };\n\n this._particleDeadHandler = particle => {\n this.onParticleDead.call(this, particle);\n };\n }\n\n init(proton) {\n this.parent = proton;\n\n proton.addEventListener(\"PROTON_UPDATE\", this._protonUpdateHandler);\n proton.addEventListener(\n \"PROTON_UPDATE_AFTER\",\n this._protonUpdateAfterHandler\n );\n\n proton.addEventListener(\"EMITTER_ADDED\", this._emitterAddedHandler);\n proton.addEventListener(\"EMITTER_REMOVED\", this._emitterRemovedHandler);\n\n proton.addEventListener(\n \"PARTICLE_CREATED\",\n this._particleCreatedHandler\n );\n proton.addEventListener(\"PARTICLE_UPDATE\", this._particleUpdateHandler);\n proton.addEventListener(\"PARTICLE_DEAD\", this._particleDeadHandler);\n }\n\n resize(width, height) {}\n\n destroy() {\n this.remove();\n }\n\n remove(proton) {\n this.parent.removeEventListener(\n \"PROTON_UPDATE\",\n this._protonUpdateHandler\n );\n this.parent.removeEventListener(\n \"PROTON_UPDATE_AFTER\",\n this._protonUpdateAfterHandler\n );\n\n this.parent.removeEventListener(\n \"EMITTER_ADDED\",\n this._emitterAddedHandler\n );\n this.parent.removeEventListener(\n \"EMITTER_REMOVED\",\n this._emitterRemovedHandler\n );\n\n this.parent.removeEventListener(\n \"PARTICLE_CREATED\",\n this._particleCreatedHandler\n );\n this.parent.removeEventListener(\n \"PARTICLE_UPDATE\",\n this._particleUpdateHandler\n );\n this.parent.removeEventListener(\n \"PARTICLE_DEAD\",\n this._particleDeadHandler\n );\n\n this.parent = null;\n }\n\n onProtonUpdate() {}\n onProtonUpdateAfter() {}\n\n onEmitterAdded(emitter) {}\n onEmitterRemoved(emitter) {}\n\n onParticleCreated(particle) {}\n onParticleUpdate(particle) {}\n onParticleDead(particle) {}\n}\n","import ImgUtil from \"../utils/ImgUtil\";\nimport ColorUtil from \"../utils/ColorUtil\";\nimport MathUtil from \"../math/MathUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class CanvasRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.context = this.element.getContext(\"2d\");\n this.bufferCache = {};\n this.name = \"CanvasRenderer\";\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n onProtonUpdate() {\n this.context.clearRect(0, 0, this.element.width, this.element.height);\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.color = particle.color || \"#ff0000\";\n }\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n if (particle.body instanceof Image) this.drawImage(particle);\n } else {\n this.drawCircle(particle);\n }\n }\n\n onParticleDead(particle) {\n particle.body = null;\n }\n\n // private\n addImg2Body(img, particle) {\n particle.body = img;\n }\n\n // private drawCircle\n drawImage(particle) {\n const w = (particle.body.width * particle.scale) | 0;\n const h = (particle.body.height * particle.scale) | 0;\n const x = particle.p.x - w / 2;\n const y = particle.p.y - h / 2;\n\n if (!!particle.color) {\n if (!particle.data[\"buffer\"])\n particle.data.buffer = this.createBuffer(particle.body);\n\n const bufContext = particle.data.buffer.getContext(\"2d\");\n bufContext.clearRect(\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height\n );\n bufContext.globalAlpha = particle.alpha;\n bufContext.drawImage(particle.body, 0, 0);\n\n bufContext.globalCompositeOperation = \"source-atop\";\n bufContext.fillStyle = ColorUtil.rgbToHex(particle.rgb);\n bufContext.fillRect(\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height\n );\n bufContext.globalCompositeOperation = \"source-over\";\n bufContext.globalAlpha = 1;\n\n this.context.drawImage(\n particle.data.buffer,\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height,\n x,\n y,\n w,\n h\n );\n } else {\n this.context.save();\n\n this.context.globalAlpha = particle.alpha;\n this.context.translate(particle.p.x, particle.p.y);\n this.context.rotate(MathUtil.degreeTransform(particle.rotation));\n this.context.translate(-particle.p.x, -particle.p.y);\n this.context.drawImage(\n particle.body,\n 0,\n 0,\n particle.body.width,\n particle.body.height,\n x,\n y,\n w,\n h\n );\n\n this.context.globalAlpha = 1;\n this.context.restore();\n }\n }\n\n // private drawCircle --\n drawCircle(particle) {\n if (particle.rgb) {\n this.context.fillStyle = `rgba(${particle.rgb.r},${particle.rgb.g},${particle.rgb.b},${particle.alpha})`;\n } else {\n this.context.fillStyle = particle.color;\n }\n\n // draw circle\n this.context.beginPath();\n this.context.arc(\n particle.p.x,\n particle.p.y,\n particle.radius,\n 0,\n Math.PI * 2,\n true\n );\n\n if (this.stroke) {\n this.context.strokeStyle = this.stroke.color;\n this.context.lineWidth = this.stroke.thinkness;\n this.context.stroke();\n }\n\n this.context.closePath();\n this.context.fill();\n }\n\n // private createBuffer\n createBuffer(image) {\n if (image instanceof Image) {\n const size = image.width + \"_\" + image.height;\n let canvas = this.bufferCache[size];\n\n if (!canvas) {\n canvas = document.createElement(\"canvas\");\n canvas.width = image.width;\n canvas.height = image.height;\n this.bufferCache[size] = canvas;\n }\n\n return canvas;\n }\n }\n}\n","import DomUtil from \"../utils/DomUtil\";\nimport ImgUtil from \"../utils/ImgUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class DomRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.transform3d = false;\n this.name = \"DomRenderer\";\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n this.element.appendChild(particle.body);\n }\n }\n\n onParticleUpdate(particle) {\n if (this.bodyReady(particle)) {\n if (this.transform3d)\n DomUtil.transform3d(\n particle.body,\n particle.p.x,\n particle.p.y,\n particle.scale,\n particle.rotation\n );\n else\n DomUtil.transform(\n particle.body,\n particle.p.x,\n particle.p.y,\n particle.scale,\n particle.rotation\n );\n\n particle.body.style.opacity = particle.alpha;\n if (particle.body.isCircle) {\n particle.body.style.backgroundColor = particle.color || \"#ff0000\";\n }\n }\n }\n\n onParticleDead(particle) {\n if (this.bodyReady(particle)) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n }\n\n bodyReady(particle) {\n return (\n typeof particle.body === \"object\" &&\n particle.body &&\n !particle.body.isInner\n );\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = this.pool.get(img, particle);\n DomUtil.resize(particle.body, img.width, img.height);\n\n this.element.appendChild(particle.body);\n }\n\n createBody(body, particle) {\n if (body.isCircle) return this.createCircle(particle);\n else return this.createSprite(body, particle);\n }\n\n // private --\n createCircle(particle) {\n const dom = DomUtil.createDiv(\n `${particle.id}_dom`,\n 2 * particle.radius,\n 2 * particle.radius\n );\n dom.style.borderRadius = `${particle.radius}px`;\n\n if (this.stroke) {\n dom.style.borderColor = this.stroke.color;\n dom.style.borderWidth = `${this.stroke.thinkness}px`;\n }\n dom.isCircle = true;\n\n return dom;\n }\n\n createSprite(body, particle) {\n const url = typeof body === \"string\" ? body : body.src;\n const dom = DomUtil.createDiv(\n `${particle.id}_dom`,\n body.width,\n body.height\n );\n dom.style.backgroundImage = `url(${url})`;\n\n return dom;\n }\n}\n","import BaseRenderer from \"./BaseRenderer\";\n\nexport default class EaselRenderer extends BaseRenderer {\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.name = \"EaselRenderer\";\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n this.createSprite(particle);\n } else {\n this.createCircle(particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n particle.body.x = particle.p.x;\n particle.body.y = particle.p.y;\n\n particle.body.alpha = particle.alpha;\n particle.body.scaleX = particle.body.scaleY = particle.scale;\n particle.body.rotation = particle.rotation;\n }\n }\n\n onParticleDead(particle) {\n if (particle.body) {\n particle.body.parent && particle.body.parent.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n if (particle.graphics) this.pool.expire(particle.graphics);\n }\n\n // private\n createSprite(particle) {\n particle.body = this.pool.get(particle.body);\n\n if (particle.body.parent) return;\n if (particle.body[\"image\"]) {\n particle.body.regX = particle.body.image.width / 2;\n particle.body.regY = particle.body.image.height / 2;\n }\n }\n\n createCircle(particle) {\n const graphics = this.pool.get(createjs.Graphics);\n\n if (this.stroke) {\n if (this.stroke instanceof String) graphics.beginStroke(this.stroke);\n else graphics.beginStroke(\"#000000\");\n }\n graphics\n .beginFill(particle.color || \"#ff0000\")\n .drawCircle(0, 0, particle.radius);\n\n const shape = this.pool.get(createjs.Shape, [graphics]);\n\n particle.body = shape;\n particle.graphics = graphics;\n }\n}\n","import Rectangle from \"../math/Rectangle\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class PixelRenderer extends BaseRenderer {\n constructor(element, rectangle) {\n super(element);\n\n this.context = this.element.getContext(\"2d\");\n this.imageData = null;\n this.rectangle = null;\n this.rectangle = rectangle;\n this.createImageData(rectangle);\n\n this.name = \"PixelRenderer\";\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n createImageData(rectangle) {\n this.rectangle = rectangle\n ? rectangle\n : new Rectangle(0, 0, this.element.width, this.element.height);\n this.imageData = this.context.createImageData(\n this.rectangle.width,\n this.rectangle.height\n );\n this.context.putImageData(\n this.imageData,\n this.rectangle.x,\n this.rectangle.y\n );\n }\n\n onProtonUpdate() {\n this.context.clearRect(\n this.rectangle.x,\n this.rectangle.y,\n this.rectangle.width,\n this.rectangle.height\n );\n this.imageData = this.context.getImageData(\n this.rectangle.x,\n this.rectangle.y,\n this.rectangle.width,\n this.rectangle.height\n );\n }\n\n onProtonUpdateAfter() {\n this.context.putImageData(\n this.imageData,\n this.rectangle.x,\n this.rectangle.y\n );\n }\n\n onParticleCreated(particle) {}\n\n onParticleUpdate(particle) {\n if (this.imageData) {\n this.setPixel(\n this.imageData,\n Math.floor(particle.p.x - this.rectangle.x),\n Math.floor(particle.p.y - this.rectangle.y),\n particle\n );\n }\n }\n\n setPixel(imagedata, x, y, particle) {\n const rgb = particle.rgb;\n if (x < 0 || x > this.element.width || y < 0 || y > this.elementwidth)\n return;\n\n const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4;\n\n imagedata.data[i] = rgb.r;\n imagedata.data[i + 1] = rgb.g;\n imagedata.data[i + 2] = rgb.b;\n imagedata.data[i + 3] = particle.alpha * 255;\n }\n\n onParticleDead(particle) {}\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport MathUtil from \"../math/MathUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class PixiRenderer extends BaseRenderer {\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.setColor = false;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.createFromImage = PIXI.Sprite.from || PIXI.Sprite.fromImage;\n\n this.name = \"PixiRenderer\";\n }\n\n onProtonUpdate() {}\n\n /**\n * @param particle\n */\n onParticleCreated(particle) {\n if (particle.body) {\n particle.body = this.pool.get(particle.body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n /**\n * @param particle\n */\n onParticleUpdate(particle) {\n this.transform(particle, particle.body);\n if (this.setColor)\n particle.body.tint = ColorUtil.getHex16FromParticle(particle);\n }\n\n /**\n * @param particle\n */\n onParticleDead(particle) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n destroy(particles) {\n super.destroy();\n this.pool.destroy();\n\n let i = particles.length;\n while (i--) {\n let particle = particles[i];\n if (particle.body) {\n this.element.removeChild(particle.body);\n }\n }\n }\n\n transform(particle, target) {\n target.x = particle.p.x;\n target.y = particle.p.y;\n\n target.alpha = particle.alpha;\n\n target.scale.x = particle.scale;\n target.scale.y = particle.scale;\n\n // using cached version of MathUtil.PI_180 for slight performance increase.\n target.rotation = particle.rotation * MathUtil.PI_180; // MathUtil.PI_180;\n }\n\n createBody(body, particle) {\n if (body.isCircle) return this.createCircle(particle);\n else return this.createSprite(body);\n }\n\n createSprite(body) {\n const sprite = body.isInner\n ? this.createFromImage(body.src)\n : new PIXI.Sprite(body);\n\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n\n return sprite;\n }\n\n createCircle(particle) {\n const graphics = new PIXI.Graphics();\n\n if (this.stroke) {\n const stroke = this.stroke instanceof String ? this.stroke : 0x000000;\n graphics.beginStroke(stroke);\n }\n\n graphics.beginFill(particle.color || 0x008ced);\n graphics.drawCircle(0, 0, particle.radius);\n graphics.endFill();\n\n return graphics;\n }\n}\n","import Mat3 from \"../math/Mat3\";\n\nexport default class MStack {\n constructor() {\n this.mats = [];\n this.size = 0;\n\n for (let i = 0; i < 20; i++)\n this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\n }\n\n set(m, i) {\n if (i === 0) Mat3.set(m, this.mats[0]);\n else Mat3.multiply(this.mats[i - 1], m, this.mats[i]);\n\n this.size = Math.max(this.size, i + 1);\n }\n\n push(m) {\n if (this.size === 0) Mat3.set(m, this.mats[0]);\n else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\n\n this.size++;\n }\n\n pop() {\n if (this.size > 0) this.size--;\n }\n\n top() {\n return this.mats[this.size - 1];\n }\n}\n","import Mat3 from '../math/Mat3';\nimport BaseRenderer from './BaseRenderer';\n\nimport Util from '../utils/Util';\nimport ImgUtil from '../utils/ImgUtil';\nimport MStack from '../utils/MStack';\nimport DomUtil from '../utils/DomUtil';\nimport WebGLUtil from '../utils/WebGLUtil';\nimport MathUtil from '../math/MathUtil';\n\nexport default class WebGLRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.gl = this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false });\n if (!this.gl) alert('Sorry your browser do not suppest WebGL!');\n\n this.initVar();\n this.setMaxRadius();\n this.initShaders();\n this.initBuffers();\n\n this.gl.blendEquation(this.gl.FUNC_ADD);\n this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);\n this.gl.enable(this.gl.BLEND);\n\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.name = 'WebGLRenderer';\n }\n\n init(proton) {\n super.init(proton);\n this.resize(this.element.width, this.element.height);\n }\n\n resize(width, height) {\n this.umat[4] = -2;\n this.umat[7] = 1;\n\n this.smat[0] = 1 / width;\n this.smat[4] = 1 / height;\n\n this.mstack.set(this.umat, 0);\n this.mstack.set(this.smat, 1);\n\n this.gl.viewport(0, 0, width, height);\n this.element.width = width;\n this.element.height = height;\n }\n\n setMaxRadius(radius) {\n this.circleCanvasURL = this.createCircle(radius);\n }\n\n getVertexShader() {\n const vsSource = ['uniform vec2 viewport;', 'attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 tMat;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'void main() {', 'vec3 v = tMat * vec3(aVertexPosition, 1.0);', 'gl_Position = vec4(v.x, v.y, 0, 1);', 'vTextureCoord = aTextureCoord;', 'alpha = tMat[0][2];', '}'].join('\\n');\n return vsSource;\n }\n\n getFragmentShader() {\n const fsSource = ['precision mediump float;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'uniform sampler2D uSampler;', 'uniform vec4 color;', 'uniform bool useTexture;', 'uniform vec3 uColor;', 'void main() {', 'vec4 textureColor = texture2D(uSampler, vTextureCoord);', 'gl_FragColor = textureColor * vec4(uColor, 1.0);', 'gl_FragColor.w *= alpha;', '}'].join('\\n');\n return fsSource;\n }\n\n initVar() {\n this.mstack = new MStack();\n this.umat = Mat3.create([2, 0, 1, 0, -2, 0, -1, 1, 1]);\n this.smat = Mat3.create([1 / 100, 0, 1, 0, 1 / 100, 0, 0, 0, 1]);\n this.texturebuffers = {};\n }\n\n blendEquation(A) {\n this.gl.blendEquation(this.gl[A]);\n }\n\n blendFunc(A, B) {\n this.gl.blendFunc(this.gl[A], this.gl[B]);\n }\n\n getShader(gl, str, fs) {\n const shader = fs ? gl.createShader(gl.FRAGMENT_SHADER) : gl.createShader(gl.VERTEX_SHADER);\n\n gl.shaderSource(shader, str);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n }\n\n initShaders() {\n const fragmentShader = this.getShader(this.gl, this.getFragmentShader(), true);\n const vertexShader = this.getShader(this.gl, this.getVertexShader(), false);\n\n this.sprogram = this.gl.createProgram();\n this.gl.attachShader(this.sprogram, vertexShader);\n this.gl.attachShader(this.sprogram, fragmentShader);\n this.gl.linkProgram(this.sprogram);\n\n if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS))\n alert('Could not initialise shaders');\n\n this.gl.useProgram(this.sprogram);\n this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, 'aVertexPosition');\n this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, 'aTextureCoord');\n this.gl.enableVertexAttribArray(this.sprogram.tca);\n this.gl.enableVertexAttribArray(this.sprogram.vpa);\n\n this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, 'tMat');\n this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, 'uSampler');\n this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, 'useTexture');\n this.sprogram.color = this.gl.getUniformLocation(this.sprogram, 'uColor');\n this.gl.uniform1i(this.sprogram.useTex, 1);\n };\n\n initBuffers() {\n const vs = [0, 3, 1, 0, 2, 3];\n let idx;\n\n this.unitIBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vs), this.gl.STATIC_DRAW);\n\n let i;\n let ids = [];\n for (i = 0; i < 100; i++) ids.push(i);\n idx = new Uint16Array(ids);\n\n this.unitI33 = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitI33);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n\n ids = [];\n for (i = 0; i < 100; i++) ids.push(i, i + 1, i + 2);\n idx = new Uint16Array(ids);\n\n this.stripBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.stripBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n };\n\n createCircle(raidus) {\n this.circleCanvasRadius = WebGLUtil.nhpot(Util.initValue(raidus, 32));\n const canvas = DomUtil.createCanvas('circle_canvas', this.circleCanvasRadius * 2, this.circleCanvasRadius * 2);\n const context = canvas.getContext('2d');\n\n context.beginPath();\n context.arc(this.circleCanvasRadius, this.circleCanvasRadius, this.circleCanvasRadius, 0, Math.PI * 2, true);\n context.closePath();\n context.fillStyle = '#FFF';\n context.fill();\n\n return canvas.toDataURL();\n };\n\n drawImg2Canvas(particle) {\n const _w = particle.body.width;\n const _h = particle.body.height;\n\n const _width = WebGLUtil.nhpot(particle.body.width);\n const _height = WebGLUtil.nhpot(particle.body.height);\n\n const _scaleX = particle.body.width / _width;\n const _scaleY = particle.body.height / _height;\n\n if (!this.texturebuffers[particle.data.src])\n this.texturebuffers[particle.data.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\n\n particle.data.texture = this.texturebuffers[particle.data.src][0];\n particle.data.vcBuffer = this.texturebuffers[particle.data.src][1];\n particle.data.tcBuffer = this.texturebuffers[particle.data.src][2];\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _scaleX, 0.0, 0.0, _scaleY, _scaleY, _scaleY]), this.gl.STATIC_DRAW);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _w, 0.0, 0.0, _h, _w, _h]), this.gl.STATIC_DRAW);\n\n const context = particle.data.canvas.getContext('2d');\n const data = context.getImageData(0, 0, _width, _height);\n\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture);\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST);\n this.gl.generateMipmap(this.gl.TEXTURE_2D);\n\n particle.data.textureLoaded = true;\n particle.data.textureWidth = _w;\n particle.data.textureHeight = _h;\n }\n\n onProtonUpdate() {\n // this.gl.clearColor(0, 0, 0, 1);\n // this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\n }\n\n onParticleCreated(particle) {\n particle.data.textureLoaded = false;\n particle.data.tmat = Mat3.create();\n particle.data.tmat[8] = 1;\n particle.data.imat = Mat3.create();\n particle.data.imat[8] = 1;\n\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle);\n particle.data.oldScale = particle.radius / this.circleCanvasRadius;\n }\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = img;\n particle.data.src = img.src;\n particle.data.canvas = ImgUtil.getCanvasFromCache(img);\n particle.data.oldScale = 1;\n\n this.drawImg2Canvas(particle);\n }\n\n onParticleUpdate(particle) {\n if (particle.data.textureLoaded) {\n this.updateMatrix(particle);\n\n this.gl.uniform3f(this.sprogram.color, particle.rgb.r / 255, particle.rgb.g / 255, particle.rgb.b / 255);\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture);\n this.gl.uniform1i(this.sprogram.samplerUniform, 0);\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n\n this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0);\n\n this.mstack.pop();\n }\n }\n\n onParticleDead(particle) { }\n\n updateMatrix(particle) {\n const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.data.textureWidth / 2, -particle.data.textureHeight / 2);\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\n\n const angel = particle.rotation * (MathUtil.PI_180);\n const rotationMatrix = WebGLUtil.makeRotation(angel);\n\n const scale = particle.scale * particle.data.oldScale;\n const scaleMatrix = WebGLUtil.makeScale(scale, scale);\n let matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix);\n\n matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix);\n matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix);\n\n Mat3.inverse(matrix, particle.data.imat);\n matrix[2] = particle.alpha;\n\n this.mstack.push(matrix);\n }\n}","import BaseRenderer from \"./BaseRenderer\";\n\nexport default class CustomRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.name = \"CustomRenderer\";\n }\n}\n","import Zone from \"./Zone\";\nimport Util from \"../utils/Util\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class LineZone extends Zone {\n constructor(x1, y1, x2, y2, direction) {\n super();\n\n if (x2 - x1 >= 0) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n } else {\n this.x1 = x2;\n this.y1 = y2;\n this.x2 = x1;\n this.y2 = y1;\n }\n\n this.dx = this.x2 - this.x1;\n this.dy = this.y2 - this.y1;\n\n this.minx = Math.min(this.x1, this.x2);\n this.miny = Math.min(this.y1, this.y2);\n this.maxx = Math.max(this.x1, this.x2);\n this.maxy = Math.max(this.y1, this.y2);\n\n this.dot = this.x2 * this.y1 - this.x1 * this.y2;\n this.xxyy = this.dx * this.dx + this.dy * this.dy;\n\n this.gradient = this.getGradient();\n this.length = this.getLength();\n this.direction = Util.initValue(direction, \">\");\n }\n\n getPosition() {\n this.random = Math.random();\n\n this.vector.x =\n this.x1 + this.random * this.length * Math.cos(this.gradient);\n this.vector.y =\n this.y1 + this.random * this.length * Math.sin(this.gradient);\n\n return this.vector;\n }\n\n getDirection(x, y) {\n const A = this.dy;\n const B = -this.dx;\n const C = this.dot;\n const D = B === 0 ? 1 : B;\n\n if ((A * x + B * y + C) * D > 0) return true;\n else return false;\n }\n\n getDistance(x, y) {\n const A = this.dy;\n const B = -this.dx;\n const C = this.dot;\n const D = A * x + B * y + C;\n\n return D / Math.sqrt(this.xxyy);\n }\n\n getSymmetric(v) {\n const tha2 = v.getGradient();\n const tha1 = this.getGradient();\n const tha = 2 * (tha1 - tha2);\n\n const oldx = v.x;\n const oldy = v.y;\n\n v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n\n return v;\n }\n\n getGradient() {\n return Math.atan2(this.dy, this.dx);\n }\n\n rangeOut(particle) {\n const angle = Math.abs(this.getGradient());\n\n if (angle <= MathUtil.PI / 4) {\n if (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\n } else {\n if (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\n }\n\n return false;\n }\n\n getLength() {\n return Math.sqrt(this.dx * this.dx + this.dy * this.dy);\n }\n\n crossing(particle) {\n if (this.crossType === \"dead\") {\n if (\n this.direction === \">\" ||\n this.direction === \"R\" ||\n this.direction === \"right\" ||\n this.direction === \"down\"\n ) {\n if (!this.rangeOut(particle)) return;\n if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n } else {\n if (!this.rangeOut(particle)) return;\n if (!this.getDirection(particle.p.x, particle.p.y))\n particle.dead = true;\n }\n } else if (this.crossType === \"bound\") {\n if (!this.rangeOut(particle)) return;\n\n if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\n if (this.dx === 0) {\n particle.v.x *= -1;\n } else if (this.dy === 0) {\n particle.v.y *= -1;\n } else {\n this.getSymmetric(particle.v);\n }\n }\n } else if (this.crossType === \"cross\") {\n if (this.alert) {\n console.error(\"Sorry, LineZone does not support cross method!\");\n this.alert = false;\n }\n }\n }\n}\n","import Zone from \"./Zone\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class CircleZone extends Zone {\n constructor(x, y, radius) {\n super();\n\n this.x = x;\n this.y = y;\n this.radius = radius;\n\n this.angle = 0;\n this.center = { x, y };\n }\n\n getPosition() {\n this.angle = MathUtil.PIx2 * Math.random();\n this.randomRadius = Math.random() * this.radius;\n\n this.vector.x = this.x + this.randomRadius * Math.cos(this.angle);\n this.vector.y = this.y + this.randomRadius * Math.sin(this.angle);\n\n return this.vector;\n }\n\n setCenter(x, y) {\n this.center.x = x;\n this.center.y = y;\n }\n\n crossing(particle) {\n const d = particle.p.distanceTo(this.center);\n\n if (this.crossType === \"dead\") {\n if (d - particle.radius > this.radius) particle.dead = true;\n } else if (this.crossType === \"bound\") {\n if (d + particle.radius >= this.radius) this.getSymmetric(particle);\n } else if (this.crossType === \"cross\") {\n if (this.alert) {\n console.error(\"Sorry, CircleZone does not support cross method!\");\n this.alert = false;\n }\n }\n }\n\n getSymmetric(particle) {\n let tha2 = particle.v.getGradient();\n let tha1 = this.getGradient(particle);\n\n let tha = 2 * (tha1 - tha2);\n let oldx = particle.v.x;\n let oldy = particle.v.y;\n\n particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n }\n\n getGradient(particle) {\n return (\n -MathUtil.PI_2 +\n Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x)\n );\n }\n}\n","import Zone from \"./Zone\";\n\nexport default class RectZone extends Zone {\n constructor(x, y, width, height) {\n super();\n\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n\n getPosition() {\n this.vector.x = this.x + Math.random() * this.width;\n this.vector.y = this.y + Math.random() * this.height;\n\n return this.vector;\n }\n\n crossing(particle) {\n // particle dead zone\n if (this.crossType === \"dead\") {\n if (particle.p.x + particle.radius < this.x) particle.dead = true;\n else if (particle.p.x - particle.radius > this.x + this.width)\n particle.dead = true;\n\n if (particle.p.y + particle.radius < this.y) particle.dead = true;\n else if (particle.p.y - particle.radius > this.y + this.height)\n particle.dead = true;\n }\n\n // particle bound zone\n else if (this.crossType === \"bound\") {\n if (particle.p.x - particle.radius < this.x) {\n particle.p.x = this.x + particle.radius;\n particle.v.x *= -1;\n } else if (particle.p.x + particle.radius > this.x + this.width) {\n particle.p.x = this.x + this.width - particle.radius;\n particle.v.x *= -1;\n }\n\n if (particle.p.y - particle.radius < this.y) {\n particle.p.y = this.y + particle.radius;\n particle.v.y *= -1;\n } else if (particle.p.y + particle.radius > this.y + this.height) {\n particle.p.y = this.y + this.height - particle.radius;\n particle.v.y *= -1;\n }\n }\n\n // particle cross zone\n else if (this.crossType === \"cross\") {\n if (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\n particle.p.x = this.x + this.width + particle.radius;\n else if (\n particle.p.x - particle.radius > this.x + this.width &&\n particle.v.x >= 0\n )\n particle.p.x = this.x - particle.radius;\n\n if (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\n particle.p.y = this.y + this.height + particle.radius;\n else if (\n particle.p.y - particle.radius > this.y + this.height &&\n particle.v.y >= 0\n )\n particle.p.y = this.y - particle.radius;\n }\n }\n}\n","import Zone from \"./Zone\";\nimport Util from \"../utils/Util\";\n\nexport default class ImageZone extends Zone {\n constructor(imageData, x, y, d) {\n super();\n\n this.reset(imageData, x, y, d);\n }\n\n reset(imageData, x, y, d) {\n this.imageData = imageData;\n this.x = Util.initValue(x, 0);\n this.y = Util.initValue(y, 0);\n this.d = Util.initValue(d, 2);\n\n this.vectors = [];\n this.setVectors();\n }\n\n setVectors() {\n let i, j;\n const length1 = this.imageData.width;\n const length2 = this.imageData.height;\n\n for (i = 0; i < length1; i += this.d) {\n for (j = 0; j < length2; j += this.d) {\n let index = ((j >> 0) * length1 + (i >> 0)) * 4;\n\n if (this.imageData.data[index + 3] > 0) {\n this.vectors.push({ x: i + this.x, y: j + this.y });\n }\n }\n }\n\n return this.vector;\n }\n\n getBound(x, y) {\n var index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n if (this.imageData.data[index + 3] > 0) return true;\n else return false;\n }\n\n getPosition() {\n const vector = Util.getRandFromArray(this.vectors);\n return this.vector.copy(vector);\n }\n\n getColor(x, y) {\n x -= this.x;\n y -= this.y;\n var i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\n return {\n r: this.imageData.data[i],\n g: this.imageData.data[i + 1],\n b: this.imageData.data[i + 2],\n a: this.imageData.data[i + 3]\n };\n }\n\n crossing(particle) {\n if (this.crossType === \"dead\") {\n if (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n particle.dead = true;\n else particle.dead = false;\n } else if (this.crossType === \"bound\") {\n if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n particle.v.negate();\n }\n }\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport CircleZone from \"../zone/CircleZone\";\nimport PointZone from \"../zone/PointZone\";\nimport LineZone from \"../zone/LineZone\";\nimport RectZone from \"../zone/RectZone\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default {\n addEventListener(proton, func) {\n proton.addEventListener(\"PROTON_UPDATE_AFTER\", () => func());\n },\n\n getStyle(color = \"#ff0000\") {\n const rgb = ColorUtil.hexToRgb(color);\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\n },\n\n drawZone(proton, canvas, zone, clear) {\n const context = canvas.getContext(\"2d\");\n const style = this.getStyle();\n\n this.addEventListener(proton, () => {\n if (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n if (zone instanceof PointZone) {\n context.beginPath();\n context.fillStyle = style;\n context.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\n context.fill();\n context.closePath();\n } else if (zone instanceof LineZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.moveTo(zone.x1, zone.y1);\n context.lineTo(zone.x2, zone.y2);\n context.stroke();\n context.closePath();\n } else if (zone instanceof RectZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.drawRect(zone.x, zone.y, zone.width, zone.height);\n context.stroke();\n context.closePath();\n } else if (zone instanceof CircleZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\n context.stroke();\n context.closePath();\n }\n });\n },\n\n drawEmitter(proton, canvas, emitter, clear) {\n const context = canvas.getContext(\"2d\");\n const style = this.getStyle();\n\n this.addEventListener(proton, () => {\n if (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n context.beginPath();\n context.fillStyle = style;\n context.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\n context.fill();\n context.closePath();\n });\n }\n};\n","import Proton from \"./core/Proton\";\nimport Particle from \"./core/Particle\";\nimport Pool from \"./core/Pool\";\n\nimport Util from \"./utils/Util\";\nimport ColorUtil from \"./utils/ColorUtil\";\nimport MathUtil from \"./math/MathUtil\";\nimport Vector2D from \"./math/Vector2D\";\nimport Polar2D from \"./math/Polar2D\";\nimport Mat3 from \"./math/Mat3\";\nimport Span from \"./math/Span\";\nimport ArraySpan from \"./math/ArraySpan\";\nimport Rectangle from \"./math/Rectangle\";\nimport ease from \"./math/ease\";\n\nimport Rate from \"./initialize/Rate\";\nimport Initialize from \"./initialize/Initialize\";\nimport Life from \"./initialize/Life\";\nimport Position from \"./initialize/Position\";\nimport Velocity from \"./initialize/Velocity\";\nimport Mass from \"./initialize/Mass\";\nimport Radius from \"./initialize/Radius\";\nimport Body from \"./initialize/Body\";\n\nimport Behaviour from \"./behaviour/Behaviour\";\nimport Force from \"./behaviour/Force\";\nimport Attraction from \"./behaviour/Attraction\";\nimport RandomDrift from \"./behaviour/RandomDrift\";\nimport Gravity from \"./behaviour/Gravity\";\nimport Collision from \"./behaviour/Collision\";\nimport CrossZone from \"./behaviour/CrossZone\";\nimport Alpha from \"./behaviour/Alpha\";\nimport Scale from \"./behaviour/Scale\";\nimport Rotate from \"./behaviour/Rotate\";\nimport Color from \"./behaviour/Color\";\nimport Repulsion from \"./behaviour/Repulsion\";\nimport GravityWell from \"./behaviour/GravityWell\";\n\nimport Emitter from \"./emitter/Emitter\";\nimport BehaviourEmitter from \"./emitter/BehaviourEmitter\";\nimport FollowEmitter from \"./emitter/FollowEmitter\";\n\nimport CanvasRenderer from \"./render/CanvasRenderer\";\nimport DomRenderer from \"./render/DomRenderer\";\nimport EaselRenderer from \"./render/EaselRenderer\";\nimport PixelRenderer from \"./render/PixelRenderer\";\nimport PixiRenderer from \"./render/PixiRenderer\";\nimport WebGLRenderer from \"./render/WebGLRenderer\";\nimport CustomRenderer from \"./render/CustomRenderer\";\n\nimport Zone from \"./zone/Zone\";\nimport LineZone from \"./zone/LineZone\";\nimport CircleZone from \"./zone/CircleZone\";\nimport PointZone from \"./zone/PointZone\";\nimport RectZone from \"./zone/RectZone\";\nimport ImageZone from \"./zone/ImageZone\";\n\nimport Debug from \"./debug/Debug\";\n\n// namespace\nProton.Particle = Proton.P = Particle;\nProton.Pool = Pool;\n\nProton.Util = Util;\nProton.ColorUtil = ColorUtil;\nProton.MathUtil = MathUtil;\nProton.Vector2D = Proton.Vector = Vector2D;\nProton.Polar2D = Proton.Polar = Polar2D;\nProton.ArraySpan = ArraySpan;\nProton.Rectangle = Rectangle;\nProton.Rate = Rate;\nProton.ease = ease;\nProton.Span = Span;\nProton.Mat3 = Mat3;\nProton.getSpan = (a, b, center) => new Span(a, b, center);\nProton.createArraySpan = ArraySpan.createArraySpan;\n\nProton.Initialize = Proton.Init = Initialize;\nProton.Life = Proton.L = Life;\nProton.Position = Proton.P = Position;\nProton.Velocity = Proton.V = Velocity;\nProton.Mass = Proton.M = Mass;\nProton.Radius = Proton.R = Radius;\nProton.Body = Proton.B = Body;\n\nProton.Behaviour = Behaviour;\nProton.Force = Proton.F = Force;\nProton.Attraction = Proton.A = Attraction;\nProton.RandomDrift = Proton.RD = RandomDrift;\nProton.Gravity = Proton.G = Gravity;\nProton.Collision = Collision;\nProton.CrossZone = CrossZone;\nProton.Alpha = Proton.A = Alpha;\nProton.Scale = Proton.S = Scale;\nProton.Rotate = Rotate;\nProton.Color = Color;\nProton.Repulsion = Repulsion;\nProton.GravityWell = GravityWell;\n\nProton.Emitter = Emitter;\nProton.BehaviourEmitter = BehaviourEmitter;\nProton.FollowEmitter = FollowEmitter;\n\nProton.Zone = Zone;\nProton.LineZone = LineZone;\nProton.CircleZone = CircleZone;\nProton.PointZone = PointZone;\nProton.RectZone = RectZone;\nProton.ImageZone = ImageZone;\n\nProton.CanvasRenderer = CanvasRenderer;\nProton.DomRenderer = DomRenderer;\nProton.EaselRenderer = EaselRenderer;\nProton.PixiRenderer = PixiRenderer;\nProton.PixelRenderer = PixelRenderer;\nProton.WebGLRenderer = Proton.WebGlRenderer = WebGLRenderer;\nProton.CustomRenderer = CustomRenderer;\n\nProton.Debug = Debug;\n\nObject.assign(Proton, ease);\n\n// export\nexport default Proton;\n"],"names":["PI","INFINITY","Infinity","MathUtil","num","a","b","isInt","Math","random","floor","center","f","randomAToB","display","toString","slice","Span","Util","isArray","initValue","getRandFromArray","randomFloating","c","undefined","pan","getValue","length","i","tx","ty","angleInRadians","cos","s","sin","sx","sy","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b01","b02","b10","b11","b12","b20","b21","b22","id","width","height","position","dom","document","createElement","style","opacity","transform","resize","marginLeft","marginTop","div","x","y","scale","rotate","willChange","css3","key","val","bkey","charAt","toUpperCase","substr","imgsCache","canvasCache","canvasId","context","image","rect","drawImage","imagedata","getImageData","clearRect","img","callback","param","src","Image","onload","e","target","WebGLUtil","nhpot","canvas","DomUtil","createCanvas","getContext","value","defaults","Object","prototype","call","arr","obj","ignore","indexOf","constructor","args","FactoryFunc","bind","apply","concat","particle","conf","hasProp","p","v","copy","props","prop","hasOwnProperty","getSpanValue","ImgUtil","destroy","IdsMap","Puid","type","uid","getIdFromCache","_index","_cache","isBody","isInner","Pool","total","cache","params","__puid","getId","pop","createOrClone","getCache","push","create","classApply","clone","count","Stats","proton","container","emitterIndex","rendererIndex","body","add","emitter","getEmitter","renderer","getRenderer","str","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","innerHTML","cssText","join","addEventListener","bg","color","parentNode","appendChild","renderers","result","cpool","round","EventDispatcher","_listeners","listener","removeEventListener","splice","listeners","handler","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","sleep","old","multiplyScalar","mass","clear","Proton","integrationType","oldTime","elapsed","stats","EULER","integrator","render","init","index","remove","parent","EMITTER_ADDED","EMITTER_REMOVED","PROTON_UPDATE","USE_CLOCK","Date","getTime","amendChangeTabsBug","emittersUpdate","PROTON_UPDATE_AFTER","update","destroyAll","destroyOther","getAllParticles","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","Rgb","r","g","pow","PI_2","sqrt","ease","easeLinear","Vector2D","atan2","w","addVectors","subVectors","set","divideScalar","distanceToSquared","tha","dx","dy","alpha","Particle","data","rgb","reset","setProp","N180_PI","life","age","dead","sprite","energy","radius","rotation","easing","emptyObject","removeAllBehaviours","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","emptyArray","h","hex16","substring","parseInt","rbg","Number","Polar2D","abs","getX","getY","Mat3","mat3","mat","Float32Array","mat1","mat2","d","m","vec","ArraySpan","_arr","toArray","randomColor","Rectangle","bottom","right","Rate","numpan","timepan","numPan","setSpanValue","timePan","startTime","nextTime","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","error","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imageTarget","Behaviour","getEasing","force","removeBehaviour","Force","fx","fy","normalizeForce","calculate","Attraction","targetPosition","normalizeValue","radiusSq","attractionForce","lengthSq","sub","normalize","RandomDrift","driftX","driftY","delay","panFoce","addXY","Gravity","Collision","collisionPool","delta","newPool","otherParticle","overlap","totalMass","averageMass1","averageMass2","distance","CrossZone","crossing","Alpha","same","alphaA","alphaB","Scale","scaleA","scaleB","Rotate","influence","rotationA","rotationB","getDirection","Color","createArraySpan","colorA","ColorUtil","hexToRgb","colorB","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVectorVal","degreeTransform","Emitter","emitTime","totalTime","rate","stoped","isNaN","oldStoped","oldEmitTime","oldTotalTime","step","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mouseTarget","window","_allowEmitting","initEventHandler","mousemoveHandler","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","layerX","layerY","offsetX","offsetY","babelHelpers.get","BaseRenderer","element","stroke","circleConf","isCircle","initHandler","thinkness","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","CanvasRenderer","bufferCache","getImgFromCache","addImg2Body","drawCircle","buffer","createBuffer","bufContext","globalAlpha","globalCompositeOperation","fillStyle","rgbToHex","fillRect","save","translate","restore","beginPath","arc","strokeStyle","lineWidth","closePath","fill","size","DomRenderer","createBody","transform3d","bodyReady","backgroundColor","removeChild","babelHelpers.typeof","createCircle","createSprite","createDiv","borderRadius","borderColor","borderWidth","url","backgroundImage","EaselRenderer","addChild","scaleX","scaleY","graphics","regX","regY","createjs","Graphics","String","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","PixiRenderer","setColor","createFromImage","PIXI","Sprite","from","fromImage","tint","getHex16FromParticle","anchor","endFill","MStack","mats","multiply","WebGLRenderer","gl","antialias","stencil","depth","initVar","setMaxRadius","initShaders","initBuffers","blendEquation","FUNC_ADD","blendFunc","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","enable","BLEND","umat","smat","mstack","viewport","circleCanvasURL","vsSource","fsSource","texturebuffers","A","B","fs","shader","createShader","FRAGMENT_SHADER","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","fragmentShader","getShader","getFragmentShader","vertexShader","getVertexShader","sprogram","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","useProgram","vpa","getAttribLocation","tca","enableVertexAttribArray","tMatUniform","getUniformLocation","samplerUniform","useTex","uniform1i","vs","idx","unitIBuffer","bindBuffer","ELEMENT_ARRAY_BUFFER","bufferData","Uint16Array","STATIC_DRAW","ids","unitI33","stripBuffer","raidus","circleCanvasRadius","toDataURL","_w","_h","_width","_height","_scaleX","_scaleY","createTexture","texture","vcBuffer","tcBuffer","ARRAY_BUFFER","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_NEAREST","generateMipmap","textureLoaded","textureWidth","textureHeight","tmat","imat","oldScale","getCanvasFromCache","drawImg2Canvas","updateMatrix","uniform3f","uniformMatrix3fv","top","vertexAttribPointer","FLOAT","drawElements","TRIANGLES","UNSIGNED_SHORT","moveOriginMatrix","makeTranslation","translationMatrix","angel","rotationMatrix","makeRotation","scaleMatrix","makeScale","matrix","matrixMultiply","inverse","CustomRenderer","LineZone","x1","y1","x2","y2","direction","minx","min","miny","maxx","maxy","dot","xxyy","gradient","getGradient","getLength","C","D","tha2","tha1","oldx","oldy","angle","rangeOut","getDistance","getSymmetric","CircleZone","PIx2","randomRadius","distanceTo","RectZone","ImageZone","vectors","setVectors","j","length1","length2","getBound","negate","func","getStyle","moveTo","lineTo","drawRect","P","Vector","Polar","getSpan","Init","L","V","M","R","F","RD","G","S","WebGlRenderer","Debug","assign"],"mappings":";;;;;;AAAA,IAAMA,KAAK,SAAX;AACA,IAAMC,WAAWC,QAAjB;;AAEA,IAAMC,WAAW;QACTH,EADS;UAEPA,KAAK,CAFE;UAGPA,KAAK,CAHE;YAILA,KAAK,GAJA;aAKJ,MAAMA,EALF;cAMH,CAAC,GANE;;cAAA,sBAQFI,GARE,EAQG;eACLA,QAAQ,KAAKF,QAAb,IAAyBE,QAAQH,QAAxC;KATS;cAAA,sBAYFI,CAZE,EAYCC,CAZD,EAYmB;YAAfC,KAAe,uEAAP,KAAO;;YACxB,CAACA,KAAL,EAAY,OAAOF,IAAIG,KAAKC,MAAL,MAAiBH,IAAID,CAArB,CAAX,CAAZ,KACK,OAAOG,KAAKE,KAAL,CAAWF,KAAKC,MA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AAP,GAAWpW,OAA5B;AACA/J,OAAOgK,SAAP,GAAmBA,SAAnB;AACAhK,OAAO0K,SAAP,GAAmBA,SAAnB;AACA1K,OAAO4K,KAAP,GAAe5K,OAAO0W,CAAP,GAAW9L,KAA1B;AACA5K,OAAOgL,KAAP,GAAehL,OAAOogB,CAAP,GAAWpV,KAA1B;AACAhL,OAAOmL,MAAP,GAAgBA,MAAhB;AACAnL,OAAOwL,KAAP,GAAeA,KAAf;AACAxL,OAAO8L,SAAP,GAAmBA,SAAnB;AACA9L,OAAO+L,WAAP,GAAqBA,WAArB;;AAEA/L,OAAOuM,OAAP,GAAiBA,OAAjB;AACAvM,OAAOkO,gBAAP,GAA0BA,gBAA1B;AACAlO,OAAOoO,aAAP,GAAuBA,aAAvB;;AAEApO,OAAOgH,IAAP,GAAcA,IAAd;AACAhH,OAAO4c,QAAP,GAAkBA,QAAlB;AACA5c,OAAOse,UAAP,GAAoBA,UAApB;AACAte,OAAOoH,SAAP,GAAmBA,SAAnB;AACApH,OAAO0e,QAAP,GAAkBA,QAAlB;AACA1e,OAAO2e,SAAP,GAAmBA,SAAnB;;AAEA3e,OAAOyQ,cAAP,GAAwBA,cAAxB;AACAzQ,OAAOgS,WAAP,GAAqBA,WAArB;AACAhS,OAAO+S,aAAP,GAAuBA,aAAvB;AACA/S,OAAOoU,YAAP,GAAsBA,YAAtB;AACApU,OAAO6T,aAAP,GAAuBA,aAAvB;AACA7T,OAAOkV,aAAP,GAAuBlV,OAAOqgB,aAAP,GAAuBnL,aAA9C;AACAlV,OAAO2c,cAAP,GAAwBA,cAAxB;;AAEA3c,OAAOsgB,KAAP,GAAeA,KAAf;;AAEA5mB,OAAO6mB,MAAP,CAAcvgB,MAAd,EAAsBqC,IAAtB;;;;;;;;"} \ No newline at end of file diff --git a/build/proton.min.js b/build/proton.min.js old mode 100644 new mode 100755 index cf8896c..3d1ec60 --- a/build/proton.min.js +++ b/build/proton.min.js @@ -1,5 +1,5 @@ /*! -* Proton v3.3.0 +* Proton v4.0.0 * https://github.com/a-jie/Proton * * Copyright 2013-2019, A-JIE @@ -7,5 +7,5 @@ * http://www.opensource.org/licenses/mit-license * */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Proton=e()}(this,function(){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var e=3.1415926,h={PI:e,PIx2:2*e,PI_2:e/2,PI_180:e/180,N180_PI:180/e,randomAToB:function(t,e,i){return i?Math.floor(Math.random()*(e-t))+t:t+Math.random()*(e-t)},randomFloating:function(t,e,i){return this.randomAToB(t-e,t+e,i)},randomZone:function(){},degreeTransform:function(t){return t*e/180},toColor16:function(t){return"#"+t.toString(16)},randomColor:function(){return"#"+("00000"+(16777216*Math.random()<<0).toString(16)).slice(-6)}},r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t=function(t,e,i){return e&&a(t.prototype,e),i&&a(t,i),t};function a(t,e){for(var i=0;i>e;return t+1},d=function(t,e){return[1,0,0,0,1,0,t,e,1]},f=function(t){var e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},y=function(t,e){return[t,0,0,0,e,0,0,0,1]},p=function(t,e){var i=t[0],r=t[1],a=t[2],s=t[3],n=t[4],o=t[5],h=t[6],l=t[7],u=t[8],c=e[0],d=e[1],f=e[2],y=e[3],p=e[4],v=e[5],g=e[6],m=e[7],b=e[8];return[i*c+r*y+a*g,i*d+r*p+a*m,i*f+r*v+a*b,s*c+n*y+o*g,s*d+n*p+o*m,s*f+n*v+o*b,h*c+l*y+u*g,h*d+l*p+u*m,h*f+l*v+u*b]},v={createCanvas:function(t,e,i,r){var a=document.createElement("canvas");return r=r||"absolute",a.id=t,a.width=e,a.height=i,a.style.opacity=0,a.style.position=r,this.transform(a,-500,-500,0,0),a},createDiv:function(t,e,i){var r=document.createElement("div");return r.id=t,r.style.position="absolute",this.resize(r,e,i),r},resize:function(t,e,i){t.style.width=e+"px",t.style.height=i+"px",t.style.marginLeft=-e/2+"px",t.style.marginTop=-i/2+"px"},transform:function(t,e,i,r,a){var s="translate("+e+"px, "+i+"px) scale("+r+") rotate("+a+"deg)";t.style.willChange="transform",this.css3(t,"transform",s)},transform3d:function(t,e,i,r,a){var s="translate3d("+e+"px, "+i+"px, 0) scale("+r+") rotate("+a+"deg)";t.style.willChange="transform",this.css3(t,"backfaceVisibility","hidden"),this.css3(t,"transform",s)},css3:function(t,e,i){var r=e.charAt(0).toUpperCase()+e.substr(1);t.style["Webkit"+r]=i,t.style["Moz"+r]=i,t.style["O"+r]=i,t.style["ms"+r]=i,t.style[""+e]=i}},g={},m={},b=function(t,e,i){t.drawImage(e,i.x,i.y);var r=t.getImageData(i.x,i.y,i.width,i.height);return t.clearRect(i.x,i.y,i.width,i.height),r},_=function(t,e,i){var r="string"==typeof t?t:t.src;if(g[r])e(g[r],i);else{var a=new Image;a.onload=function(t){g[r]=t.target,e(g[r],i)},a.src=r}},x=function(t,e,i){var r=t.src;if(!m[r]){var a=c(t.width),s=c(t.height),n=v.createCanvas("canvas_cache_0",a,s);n.getContext("2d").drawImage(t,0,0,t.width,t.height),m[r]=n}return e&&e(m[r],i),m[r]},k={initValue:function(t,e){return t=null!=t?t:e},isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},destroyArray:function(t){t&&(t.length=0)},destroyObject:function(t,e){for(var i in t)e&&-1",i&&(a+="em speed:"+i.emitSpeed+"
"),i&&(a+="pos:"+this.getEmitterPos(i));break;case 3:i&&(a+="initializes:"+i.initializes.length+"
"),i&&(a+=''+this.concatArr(i.initializes)+"
"),i&&(a+="behaviours:"+i.behaviours.length+"
"),i&&(a+=''+this.concatArr(i.behaviours)+"
");break;case 4:r&&(a+=r.name+"
"),r&&(a+="body:"+this.getCreatedNumber(r)+"
");break;default:a+="particles:"+this.proton.getCount()+"
",a+="pool:"+this.proton.pool.getCount()+"
",a+="total:"+this.proton.pool.total}this.container.innerHTML=a}},{key:"add",value:function(t,e){var i=this;if(!this.container){this.type=1,this.container=document.createElement("div"),this.container.style.cssText=["position:absolute;bottom:0px;left:0;cursor:pointer;","opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;","width:120px;height:50px;background-color:#002;color:#0ff;"].join(""),this.container.addEventListener("click",function(t){i.type++,4=this.x&&e<=this.bottom&&e>=this.y}}]),X);function X(t,e,i,r){n(this,X),this.x=t,this.y=e,this.width=i,this.height=r,this.bottom=this.y+this.height,this.right=this.x+this.width}var Y=(t(W,[{key:"init",value:function(){this.startTime=0,this.nextTime=this.timePan.getValue()}},{key:"getValue",value:function(t){return this.startTime+=t,this.startTime>=this.nextTime?(this.startTime=0,this.nextTime=this.timePan.getValue(),1===this.numPan.b?.5=this.life||this.dead)this.energy=0,this.dead=!0,this.destroy();else{var i=this.easing(t.age/t.life);this.energy=Math.max(1-i,0)}}},{key:"destroy",value:function(){for(var t=this.parents.length;t--;)this.parents[t].removeBehaviour(this);this.parents.length=0}}]),yt);function yt(t,e){n(this,yt),this.life=k.initValue(t,1/0),this.easing=B.getEasing(e),this.age=0,this.energy=1,this.dead=!1,this.parents=[],this.id="Behaviour_"+yt.id++,this.name="Behaviour"}ft.id=0;var pt=(i(vt,ft),t(vt,[{key:"reset",value:function(t,e,i,r){this.force=this.normalizeForce(new V(t,e)),i&&o(vt.prototype.__proto__||Object.getPrototypeOf(vt.prototype),"reset",this).call(this,i,r)}},{key:"applyBehaviour",value:function(t,e,i){this.calculate(t,e,i),t.a.add(this.force)}}]),vt);function vt(t,e,i,r){n(this,vt);var a=l(this,(vt.__proto__||Object.getPrototypeOf(vt)).call(this,i,r));return a.force=a.normalizeForce(new V(t,e)),a.name="Force",a}var gt=(i(mt,ft),t(mt,[{key:"reset",value:function(t,e,i,r,a){this.targetPosition=k.initValue(t,new V),this.radius=k.initValue(i,1e3),this.force=k.initValue(this.normalizeValue(e),100),this.radiusSq=this.radius*this.radius,this.attractionForce=new V,this.lengthSq=0,r&&o(mt.prototype.__proto__||Object.getPrototypeOf(mt.prototype),"reset",this).call(this,r,a)}},{key:"applyBehaviour",value:function(t,e,i){this.calculate(t,e,i),this.attractionForce.copy(this.targetPosition),this.attractionForce.sub(t.p),this.lengthSq=this.attractionForce.lengthSq(),4e-6=this.delay&&(t.a.addXY(h.randomAToB(-this.panFoce.x,this.panFoce.x),h.randomAToB(-this.panFoce.y,this.panFoce.y)),this.time=0)}}]),_t);function _t(t,e,i,r,a){n(this,_t);var s=l(this,(_t.__proto__||Object.getPrototypeOf(_t)).call(this,r,a));return s.reset(t,e,i),s.time=0,s.name="RandomDrift",s}var xt=(i(kt,pt),t(kt,[{key:"reset",value:function(t,e,i){o(kt.prototype.__proto__||Object.getPrototypeOf(kt.prototype),"reset",this).call(this,0,t,e,i)}}]),kt);function kt(t,e,i){n(this,kt);var r=l(this,(kt.__proto__||Object.getPrototypeOf(kt)).call(this,0,t,e,i));return r.name="Gravity",r}var Pt=(i(Et,ft),t(Et,[{key:"reset",value:function(t,e,i,r,a){this.emitter=k.initValue(t,null),this.mass=k.initValue(e,!0),this.callback=k.initValue(i,null),this.collisionPool=[],this.delta=new V,r&&o(Et.prototype.__proto__||Object.getPrototypeOf(Et.prototype),"reset",this).call(this,r,a)}},{key:"applyBehaviour",value:function(t,e,i){var r=this.emitter?this.emitter.particles.slice(i):this.pool.slice(i),a=r.length,s=void 0,n=void 0,o=void 0,h=void 0,l=void 0,u=void 0,c=void 0;for(c=0;c=this.life||this.dead)&&this.destroy(),this.emitting(t),this.integrate(t)}},{key:"integrate",value:function(t){if(this.parent){var e=1-this.damping;this.parent.integrator.calculate(this,t,e);var i=void 0,r=void 0;for(i=this.particles.length-1;0<=i;i--)(r=this.particles[i]).update(t,i),this.parent.integrator.calculate(r,t,e),this.dispatch("PARTICLE_UPDATE",r),r.dead&&(this.dispatch("PARTICLE_DEAD",r),this.parent.pool.expire(r),this.particles.splice(i,1))}}},{key:"dispatch",value:function(t,e){this.parent&&this.parent.dispatchEvent(t,e),this.bindEvent&&this.dispatchEvent(t,e)}},{key:"emitting",value:function(t){if("once"===this.totalTime){var e=void 0,i=this.rate.getValue(99999);for(0this.element.width||i<0||i>this.elementwidth)){var s=4*((i>>0)*t.width+(e>>0));t.data[s]=a.r,t.data[1+s]=a.g,t.data[2+s]=a.b,t.data[3+s]=255*r.alpha}}},{key:"onParticleDead",value:function(){}}]),ee);function ee(t,e){n(this,ee);var i=l(this,(ee.__proto__||Object.getPrototypeOf(ee)).call(this,t));return i.context=i.element.getContext("2d"),i.imageData=null,i.rectangle=null,i.rectangle=e,i.createImageData(e),i.name="PixelRenderer",i}var ie=(i(re,Xt),t(re,[{key:"onProtonUpdate",value:function(){}},{key:"onParticleCreated",value:function(t){t.body?t.body=this.pool.get(t.body,t):t.body=this.pool.get(this.circleConf,t),this.element.addChild(t.body)}},{key:"onParticleUpdate",value:function(t){this.transform(t,t.body),this.setColor&&(t.body.tint=F.getHex16FromParticle(t))}},{key:"onParticleDead",value:function(t){this.element.removeChild(t.body),this.pool.expire(t.body),t.body=null}},{key:"destroy",value:function(t){o(re.prototype.__proto__||Object.getPrototypeOf(re.prototype),"destroy",this).call(this),this.pool.destroy();for(var e=t.length;e--;){var i=t[e];i.body&&this.element.removeChild(i.body)}}},{key:"transform",value:function(t,e){e.x=t.p.x,e.y=t.p.y,e.alpha=t.alpha,e.scale.x=t.scale,e.scale.y=t.scale,e.rotation=t.rotation*h.PI_180}},{key:"createBody",value:function(t,e){return t.isCircle?this.createCircle(e):this.createSprite(t)}},{key:"createSprite",value:function(t){var e=t.isInner?PIXI.Sprite.fromImage(t.src):new PIXI.Sprite(t);return e.anchor.x=.5,e.anchor.y=.5,e}},{key:"createCircle",value:function(t){var e=new PIXI.Graphics;if(this.stroke){var i=this.stroke instanceof String?this.stroke:0;e.beginStroke(i)}return e.beginFill(t.color||36077),e.drawCircle(0,0,t.radius),e.endFill(),e}}]),re);function re(t,e){n(this,re);var i=l(this,(re.__proto__||Object.getPrototypeOf(re)).call(this,t));return i.stroke=e,i.setColor=!1,i.pool.create=function(t,e){return i.createBody(t,e)},i.name="PixiRenderer",i}var ae=(t(se,[{key:"set",value:function(t,e){0===e?H.set(t,this.mats[0]):H.multiply(this.mats[e-1],t,this.mats[e]),this.size=Math.max(this.size,e+1)}},{key:"push",value:function(t){0===this.size?H.set(t,this.mats[0]):H.multiply(this.mats[this.size-1],t,this.mats[this.size]),this.size++}},{key:"pop",value:function(){0=this.minx)return!0}else if(t.p.y<=this.maxy&&t.p.y>=this.miny)return!0;return!1}},{key:"getLength",value:function(){return Math.sqrt(this.dx*this.dx+this.dy*this.dy)}},{key:"crossing",value:function(t){if("dead"===this.crossType)if(">"===this.direction||"R"===this.direction||"right"===this.direction||"down"===this.direction){if(!this.rangeOut(t))return;this.getDirection(t.p.x,t.p.y)&&(t.dead=!0)}else{if(!this.rangeOut(t))return;this.getDirection(t.p.x,t.p.y)||(t.dead=!0)}else if("bound"===this.crossType){if(!this.rangeOut(t))return;this.getDistance(t.p.x,t.p.y)<=t.radius&&(0===this.dx?t.v.x*=-1:0===this.dy?t.v.y*=-1:this.getSymmetric(t.v))}else"cross"===this.crossType&&this.alert&&(console.error("Sorry lineZone does not support cross method"),this.alert=!1)}}]),ce);function ce(t,e,i,r,a){n(this,ce);var s=l(this,(ce.__proto__||Object.getPrototypeOf(ce)).call(this));return 0<=i-t?(s.x1=t,s.y1=e,s.x2=i,s.y2=r):(s.x1=i,s.y1=r,s.x2=t,s.y2=e),s.dx=s.x2-s.x1,s.dy=s.y2-s.y1,s.minx=Math.min(s.x1,s.x2),s.miny=Math.min(s.y1,s.y2),s.maxx=Math.max(s.x1,s.x2),s.maxy=Math.max(s.y1,s.y2),s.dot=s.x2*s.y1-s.x1*s.y2,s.xxyy=s.dx*s.dx+s.dy*s.dy,s.gradient=s.getGradient(),s.length=s.getLength(),s.direction=k.initValue(a,">"),s}var de=(i(fe,$),t(fe,[{key:"getPosition",value:function(){return this.random=Math.random(),this.angle=h.PIx2*Math.random(),this.vector.x=this.x+this.random*this.radius*Math.cos(this.angle),this.vector.y=this.y+this.random*this.radius*Math.sin(this.angle),this.vector}},{key:"setCenter",value:function(t,e){this.center.x=t,this.center.y=e}},{key:"crossing",value:function(t){var e=t.p.distanceTo(this.center);"dead"===this.crossType?e-t.radius>this.radius&&(t.dead=!0):"bound"===this.crossType?e+t.radius>=this.radius&&this.getSymmetric(t):"cross"===this.crossType&&this.alert&&(alert("Sorry CircleZone does not support cross method"),this.alert=!1)}},{key:"getSymmetric",value:function(t){var e=t.v.getGradient(),i=2*(this.getGradient(t)-e),r=t.v.x,a=t.v.y;t.v.x=r*Math.cos(i)-a*Math.sin(i),t.v.y=r*Math.sin(i)+a*Math.cos(i)}},{key:"getGradient",value:function(t){return-h.PI_2+Math.atan2(t.p.y-this.center.y,t.p.x-this.center.x)}}]),fe);function fe(t,e,i){n(this,fe);var r=l(this,(fe.__proto__||Object.getPrototypeOf(fe)).call(this));return r.x=t,r.y=e,r.radius=i,r.angle=0,r.center={x:t,y:e},r}var ye=(i(pe,$),t(pe,[{key:"getPosition",value:function(){return this.vector.x=this.x+Math.random()*this.width,this.vector.y=this.y+Math.random()*this.height,this.vector}},{key:"crossing",value:function(t){"dead"===this.crossType?(t.p.x+t.radiusthis.x+this.width&&(t.dead=!0),t.p.y+t.radiusthis.y+this.height&&(t.dead=!0)):"bound"===this.crossType?(t.p.x-t.radiusthis.x+this.width&&(t.p.x=this.x+this.width-t.radius,t.v.x*=-1),t.p.y-t.radiusthis.y+this.height&&(t.p.y=this.y+this.height-t.radius,t.v.y*=-1)):"cross"===this.crossType&&(t.p.x+t.radiusthis.x+this.width&&0<=t.v.x&&(t.p.x=this.x-t.radius),t.p.y+t.radiusthis.y+this.height&&0<=t.v.y&&(t.p.y=this.y-t.radius))}}]),pe);function pe(t,e,i,r){n(this,pe);var a=l(this,(pe.__proto__||Object.getPrototypeOf(pe)).call(this));return a.x=t,a.y=e,a.width=i,a.height=r,a}var ve=(i(ge,$),t(ge,[{key:"reset",value:function(t,e,i,r){this.imageData=t,this.x=k.initValue(e,0),this.y=k.initValue(i,0),this.d=k.initValue(r,2),this.vectors=[],this.setVectors()}},{key:"setVectors",value:function(){var t=void 0,e=void 0,i=this.imageData.width,r=this.imageData.height;for(t=0;t>0)*i+(t>>0));0>0)*this.imageData.width+(t>>0));return 0>0)*this.imageData.width+(t>>0));return{r:this.imageData.data[i],g:this.imageData.data[1+i],b:this.imageData.data[2+i],a:this.imageData.data[3+i]}}},{key:"crossing",value:function(t){"dead"===this.crossType?this.getBound(t.p.x-this.x,t.p.y-this.y)?t.dead=!0:t.dead=!1:"bound"===this.crossType&&(this.getBound(t.p.x-this.x,t.p.y-this.y)||t.v.negate())}}]),ge);function ge(t,e,i,r){n(this,ge);var a=l(this,(ge.__proto__||Object.getPrototypeOf(ge)).call(this));return a.reset(t,e,i,r),a}var me={addEventListener:function(t,e){t.addEventListener("PROTON_UPDATE_AFTER",function(){return e()})},getStyle:function(t){var e=F.hexToRGB(t||"#ff0000");return"rgba("+e.r+", "+e.g+", "+e.b+", 0.5)"},drawZone:function(t,e,i,r){var a=e.getContext("2d"),s=this.getStyle();this.addEventListener(t,function(){r&&a.clearRect(0,0,e.width,e.height),i instanceof et?(a.beginPath(),a.fillStyle=s,a.arc(i.x,i.y,10,0,2*Math.PI,!0),a.fill(),a.closePath()):i instanceof ue?(a.beginPath(),a.strokeStyle=s,a.moveTo(i.x1,i.y1),a.lineTo(i.x2,i.y2),a.stroke(),a.closePath()):i instanceof ye?(a.beginPath(),a.strokeStyle=s,a.drawRect(i.x,i.y,i.width,i.height),a.stroke(),a.closePath()):i instanceof de&&(a.beginPath(),a.strokeStyle=s,a.arc(i.x,i.y,i.radius,0,2*Math.PI,!0),a.stroke(),a.closePath())})},drawEmitter:function(t,e,i,r){var a=e.getContext("2d"),s=this.getStyle();this.addEventListener(t,function(){r&&a.clearRect(0,0,e.width,e.height),a.beginPath(),a.fillStyle=s,a.arc(i.p.x,i.p.y,10,0,2*Math.PI,!0),a.fill(),a.closePath()})}};return I.Particle=I.P=L,I.Pool=E,I.Util=k,I.ColorUtil=F,I.MathUtils=h,I.Vector2D=I.Vector=V,I.Polar2D=I.Polar=z,I.ArraySpan=N,I.Rectangle=q,I.Rate=Y,I.ease=B,I.Span=s,I.Mat3=H,I.getSpan=function(t,e,i){return new s(t,e,i)},I.createArraySpan=N.createArraySpan,I.Initialize=I.Init=Z,I.Life=I.L=K,I.Position=I.P=rt,I.Velocity=I.V=st,I.Mass=I.M=ot,I.Radius=I.R=lt,I.Body=I.B=ct,I.Behaviour=ft,I.Force=I.F=pt,I.Attraction=I.A=gt,I.RandomDrift=I.RD=bt,I.Gravity=I.G=xt,I.Collision=Pt,I.CrossZone=Tt,I.Alpha=I.A=Rt,I.Scale=I.S=wt,I.Rotate=Ct,I.Color=Dt,I.Repulsion=Vt,I.GravityWell=Lt,I.Emitter=zt,I.BehaviourEmitter=Ht,I.FollowEmitter=Gt,I.Zone=$,I.LineZone=ue,I.CircleZone=de,I.PointZone=et,I.RectZone=ye,I.ImageZone=ve,I.CanvasRenderer=Wt,I.DomRenderer=Qt,I.EaselRenderer=Jt,I.PixiRenderer=ie,I.PixelRenderer=te,I.WebGLRenderer=I.WebGlRenderer=ne,I.CustomRenderer=he,I.Debug=me,Object.assign(I,B),I}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Proton=e()}(this,function(){"use strict";function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var e=3.1415926,h={PI:e,PIx2:2*e,PI_2:e/2,PI_180:e/180,N180_PI:180/e,Infinity:-999,isInfinity:function(t){return t===this.Infinity||t===1/0},randomAToB:function(t,e,i){return 2>e;return t+1},d=function(t,e){return[1,0,0,0,1,0,t,e,1]},y=function(t){var e=Math.cos(t),i=Math.sin(t);return[e,-i,0,i,e,0,0,0,1]},p=function(t,e){return[t,0,0,0,e,0,0,0,1]},f=function(t,e){var i=t[0],a=t[1],r=t[2],n=t[3],s=t[4],o=t[5],h=t[6],l=t[7],u=t[8],c=e[0],d=e[1],y=e[2],p=e[3],f=e[4],v=e[5],g=e[6],m=e[7],b=e[8];return[i*c+a*p+r*g,i*d+a*f+r*m,i*y+a*v+r*b,n*c+s*p+o*g,n*d+s*f+o*m,n*y+s*v+o*b,h*c+l*p+u*g,h*d+l*f+u*m,h*y+l*v+u*b]},v={createCanvas:function(t,e,i,a){var r=3",i&&(r+="em speed:"+i.emitSpeed+"
"),i&&(r+="pos:"+this.getEmitterPos(i));break;case 3:i&&(r+="initializes:"+i.initializes.length+"
"),i&&(r+=''+this.concatArr(i.initializes)+"
"),i&&(r+="behaviours:"+i.behaviours.length+"
"),i&&(r+=''+this.concatArr(i.behaviours)+"
");break;case 4:a&&(r+=a.name+"
"),a&&(r+="body:"+this.getCreatedNumber(a)+"
");break;default:r+="particles:"+this.proton.getCount()+"
",r+="pool:"+this.proton.pool.getCount()+"
",r+="total:"+this.proton.pool.total}this.container.innerHTML=r}},{key:"add",value:function(t,e){var i=this;if(!this.container){this.type=1,this.container=document.createElement("div"),this.container.style.cssText=["position:absolute;bottom:0px;left:0;cursor:pointer;","opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;","width:120px;height:50px;background-color:#002;color:#0ff;"].join(""),this.container.addEventListener("click",function(t){i.type++,4=this.x&&e<=this.bottom&&e>=this.y}}]),Q);function Q(t,e,i,a){s(this,Q),this.x=t,this.y=e,this.width=i,this.height=a,this.bottom=this.y+this.height,this.right=this.x+this.width}var K=(t(J,[{key:"init",value:function(){this.startTime=0,this.nextTime=this.timePan.getValue()}},{key:"getValue",value:function(t){return this.startTime+=t,this.startTime>=this.nextTime?(this.startTime=0,this.nextTime=this.timePan.getValue(),1===this.numPan.b?.5=this.life||this.dead)this.energy=0,this.dead=!0,this.destroy();else{var i=this.easing(t.age/t.life);this.energy=Math.max(1-i,0)}}},{key:"destroy",value:function(){for(var t=this.parents.length;t--;)this.parents[t].removeBehaviour(this);this.parents.length=0}}]),mt);function mt(t,e){s(this,mt),this.life=P.initValue(t,1/0),this.easing=U.getEasing(e),this.age=0,this.energy=1,this.dead=!1,this.parents=[],this.id="Behaviour_"+mt.id++,this.name="Behaviour"}gt.id=0;var bt=(r(_t,gt),t(_t,[{key:"reset",value:function(t,e,i,a){this.force=this.normalizeForce(new F(t,e)),i&&o(_t.prototype.__proto__||Object.getPrototypeOf(_t.prototype),"reset",this).call(this,i,a)}},{key:"applyBehaviour",value:function(t,e,i){this.calculate(t,e,i),t.a.add(this.force)}}]),_t);function _t(t,e,i,a){s(this,_t);var r=l(this,(_t.__proto__||Object.getPrototypeOf(_t)).call(this,i,a));return r.force=r.normalizeForce(new F(t,e)),r.name="Force",r}var xt=(r(kt,gt),t(kt,[{key:"reset",value:function(t,e,i,a,r){this.targetPosition=P.initValue(t,new F),this.radius=P.initValue(i,1e3),this.force=P.initValue(this.normalizeValue(e),100),this.radiusSq=this.radius*this.radius,this.attractionForce=new F,this.lengthSq=0,a&&o(kt.prototype.__proto__||Object.getPrototypeOf(kt.prototype),"reset",this).call(this,a,r)}},{key:"applyBehaviour",value:function(t,e,i){this.calculate(t,e,i),this.attractionForce.copy(this.targetPosition),this.attractionForce.sub(t.p),this.lengthSq=this.attractionForce.lengthSq(),4e-6=this.delay&&(t.a.addXY(h.randomAToB(-this.panFoce.x,this.panFoce.x),h.randomAToB(-this.panFoce.y,this.panFoce.y)),t.data.time=0)}}]),Et);function Et(t,e,i,a,r){s(this,Et);var n=l(this,(Et.__proto__||Object.getPrototypeOf(Et)).call(this,a,r));return n.reset(t,e,i),n.time=0,n.name="RandomDrift",n}var At=(r(Tt,bt),t(Tt,[{key:"reset",value:function(t,e,i){o(Tt.prototype.__proto__||Object.getPrototypeOf(Tt.prototype),"reset",this).call(this,0,t,e,i)}}]),Tt);function Tt(t,e,i){s(this,Tt);var a=l(this,(Tt.__proto__||Object.getPrototypeOf(Tt)).call(this,0,t,e,i));return a.name="Gravity",a}var Rt=(r(Ot,gt),t(Ot,[{key:"reset",value:function(t,e,i,a,r){this.emitter=P.initValue(t,null),this.mass=P.initValue(e,!0),this.callback=P.initValue(i,null),this.collisionPool=[],this.delta=new F,a&&o(Ot.prototype.__proto__||Object.getPrototypeOf(Ot.prototype),"reset",this).call(this,a,r)}},{key:"applyBehaviour",value:function(t,e,i){var a=this.emitter?this.emitter.particles.slice(i):this.pool.slice(i),r=a.length,n=void 0,s=void 0,o=void 0,h=void 0,l=void 0,u=void 0,c=void 0;for(c=0;c=this.life||this.dead)&&this.destroy(),this.emitting(t),this.integrate(t)}},{key:"integrate",value:function(t){if(this.parent){var e=1-this.damping;this.parent.integrator.calculate(this,t,e);var i=void 0,a=void 0;for(i=this.particles.length-1;0<=i;i--)(a=this.particles[i]).update(t,i),this.parent.integrator.calculate(a,t,e),this.dispatch("PARTICLE_UPDATE",a),a.dead&&(this.dispatch("PARTICLE_DEAD",a),this.parent.pool.expire(a),this.particles.splice(i,1))}}},{key:"dispatch",value:function(t,e){this.parent&&this.parent.dispatchEvent(t,e),this.bindEvent&&this.dispatchEvent(t,e)}},{key:"emitting",value:function(t){if("once"===this.totalTime){var e=void 0,i=this.rate.getValue(99999);for(0this.element.width||i<0||i>this.elementwidth)){var n=4*((i>>0)*t.width+(e>>0));t.data[n]=r.r,t.data[1+n]=r.g,t.data[2+n]=r.b,t.data[3+n]=255*a.alpha}}},{key:"onParticleDead",value:function(){}}]),ne);function ne(t,e){s(this,ne);var i=l(this,(ne.__proto__||Object.getPrototypeOf(ne)).call(this,t));return i.context=i.element.getContext("2d"),i.imageData=null,i.rectangle=null,i.rectangle=e,i.createImageData(e),i.name="PixelRenderer",i}var se=(r(oe,Qt),t(oe,[{key:"onProtonUpdate",value:function(){}},{key:"onParticleCreated",value:function(t){t.body?t.body=this.pool.get(t.body,t):t.body=this.pool.get(this.circleConf,t),this.element.addChild(t.body)}},{key:"onParticleUpdate",value:function(t){this.transform(t,t.body),this.setColor&&(t.body.tint=N.getHex16FromParticle(t))}},{key:"onParticleDead",value:function(t){this.element.removeChild(t.body),this.pool.expire(t.body),t.body=null}},{key:"destroy",value:function(t){o(oe.prototype.__proto__||Object.getPrototypeOf(oe.prototype),"destroy",this).call(this),this.pool.destroy();for(var e=t.length;e--;){var i=t[e];i.body&&this.element.removeChild(i.body)}}},{key:"transform",value:function(t,e){e.x=t.p.x,e.y=t.p.y,e.alpha=t.alpha,e.scale.x=t.scale,e.scale.y=t.scale,e.rotation=t.rotation*h.PI_180}},{key:"createBody",value:function(t,e){return t.isCircle?this.createCircle(e):this.createSprite(t)}},{key:"createSprite",value:function(t){var e=t.isInner?this.createFromImage(t.src):new PIXI.Sprite(t);return e.anchor.x=.5,e.anchor.y=.5,e}},{key:"createCircle",value:function(t){var e=new PIXI.Graphics;if(this.stroke){var i=this.stroke instanceof String?this.stroke:0;e.beginStroke(i)}return e.beginFill(t.color||36077),e.drawCircle(0,0,t.radius),e.endFill(),e}}]),oe);function oe(t,e){s(this,oe);var i=l(this,(oe.__proto__||Object.getPrototypeOf(oe)).call(this,t));return i.stroke=e,i.setColor=!1,i.pool.create=function(t,e){return i.createBody(t,e)},i.createFromImage=PIXI.Sprite.from||PIXI.Sprite.fromImage,i.name="PixiRenderer",i}var he=(t(le,[{key:"set",value:function(t,e){0===e?X.set(t,this.mats[0]):X.multiply(this.mats[e-1],t,this.mats[e]),this.size=Math.max(this.size,e+1)}},{key:"push",value:function(t){0===this.size?X.set(t,this.mats[0]):X.multiply(this.mats[this.size-1],t,this.mats[this.size]),this.size++}},{key:"pop",value:function(){0=this.minx)return!0}else if(t.p.y<=this.maxy&&t.p.y>=this.miny)return!0;return!1}},{key:"getLength",value:function(){return Math.sqrt(this.dx*this.dx+this.dy*this.dy)}},{key:"crossing",value:function(t){if("dead"===this.crossType)if(">"===this.direction||"R"===this.direction||"right"===this.direction||"down"===this.direction){if(!this.rangeOut(t))return;this.getDirection(t.p.x,t.p.y)&&(t.dead=!0)}else{if(!this.rangeOut(t))return;this.getDirection(t.p.x,t.p.y)||(t.dead=!0)}else if("bound"===this.crossType){if(!this.rangeOut(t))return;this.getDistance(t.p.x,t.p.y)<=t.radius&&(0===this.dx?t.v.x*=-1:0===this.dy?t.v.y*=-1:this.getSymmetric(t.v))}else"cross"===this.crossType&&this.alert&&(console.error("Sorry, LineZone does not support cross method!"),this.alert=!1)}}]),fe);function fe(t,e,i,a,r){s(this,fe);var n=l(this,(fe.__proto__||Object.getPrototypeOf(fe)).call(this));return 0<=i-t?(n.x1=t,n.y1=e,n.x2=i,n.y2=a):(n.x1=i,n.y1=a,n.x2=t,n.y2=e),n.dx=n.x2-n.x1,n.dy=n.y2-n.y1,n.minx=Math.min(n.x1,n.x2),n.miny=Math.min(n.y1,n.y2),n.maxx=Math.max(n.x1,n.x2),n.maxy=Math.max(n.y1,n.y2),n.dot=n.x2*n.y1-n.x1*n.y2,n.xxyy=n.dx*n.dx+n.dy*n.dy,n.gradient=n.getGradient(),n.length=n.getLength(),n.direction=P.initValue(r,">"),n}var ve=(r(ge,at),t(ge,[{key:"getPosition",value:function(){return this.angle=h.PIx2*Math.random(),this.randomRadius=Math.random()*this.radius,this.vector.x=this.x+this.randomRadius*Math.cos(this.angle),this.vector.y=this.y+this.randomRadius*Math.sin(this.angle),this.vector}},{key:"setCenter",value:function(t,e){this.center.x=t,this.center.y=e}},{key:"crossing",value:function(t){var e=t.p.distanceTo(this.center);"dead"===this.crossType?e-t.radius>this.radius&&(t.dead=!0):"bound"===this.crossType?e+t.radius>=this.radius&&this.getSymmetric(t):"cross"===this.crossType&&this.alert&&(console.error("Sorry, CircleZone does not support cross method!"),this.alert=!1)}},{key:"getSymmetric",value:function(t){var e=t.v.getGradient(),i=2*(this.getGradient(t)-e),a=t.v.x,r=t.v.y;t.v.x=a*Math.cos(i)-r*Math.sin(i),t.v.y=a*Math.sin(i)+r*Math.cos(i)}},{key:"getGradient",value:function(t){return-h.PI_2+Math.atan2(t.p.y-this.center.y,t.p.x-this.center.x)}}]),ge);function ge(t,e,i){s(this,ge);var a=l(this,(ge.__proto__||Object.getPrototypeOf(ge)).call(this));return a.x=t,a.y=e,a.radius=i,a.angle=0,a.center={x:t,y:e},a}var me=(r(be,at),t(be,[{key:"getPosition",value:function(){return this.vector.x=this.x+Math.random()*this.width,this.vector.y=this.y+Math.random()*this.height,this.vector}},{key:"crossing",value:function(t){"dead"===this.crossType?(t.p.x+t.radiusthis.x+this.width&&(t.dead=!0),t.p.y+t.radiusthis.y+this.height&&(t.dead=!0)):"bound"===this.crossType?(t.p.x-t.radiusthis.x+this.width&&(t.p.x=this.x+this.width-t.radius,t.v.x*=-1),t.p.y-t.radiusthis.y+this.height&&(t.p.y=this.y+this.height-t.radius,t.v.y*=-1)):"cross"===this.crossType&&(t.p.x+t.radiusthis.x+this.width&&0<=t.v.x&&(t.p.x=this.x-t.radius),t.p.y+t.radiusthis.y+this.height&&0<=t.v.y&&(t.p.y=this.y-t.radius))}}]),be);function be(t,e,i,a){s(this,be);var r=l(this,(be.__proto__||Object.getPrototypeOf(be)).call(this));return r.x=t,r.y=e,r.width=i,r.height=a,r}var _e=(r(xe,at),t(xe,[{key:"reset",value:function(t,e,i,a){this.imageData=t,this.x=P.initValue(e,0),this.y=P.initValue(i,0),this.d=P.initValue(a,2),this.vectors=[],this.setVectors()}},{key:"setVectors",value:function(){var t=void 0,e=void 0,i=this.imageData.width,a=this.imageData.height;for(t=0;t>0)*i+(t>>0));0>0)*this.imageData.width+(t>>0));return 0>0)*this.imageData.width+(t>>0));return{r:this.imageData.data[i],g:this.imageData.data[1+i],b:this.imageData.data[2+i],a:this.imageData.data[3+i]}}},{key:"crossing",value:function(t){"dead"===this.crossType?this.getBound(t.p.x-this.x,t.p.y-this.y)?t.dead=!0:t.dead=!1:"bound"===this.crossType&&(this.getBound(t.p.x-this.x,t.p.y-this.y)||t.v.negate())}}]),xe);function xe(t,e,i,a){s(this,xe);var r=l(this,(xe.__proto__||Object.getPrototypeOf(xe)).call(this));return r.reset(t,e,i,a),r}var ke={addEventListener:function(t,e){t.addEventListener("PROTON_UPDATE_AFTER",function(){return e()})},getStyle:function(t){var e=N.hexToRgb(0> i;\n }\n\n return length + 1;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeTranslation\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} tx either 0 or 1\n * @param {Number} ty either 0 or 1\n *\n * @return {Object}\n */\n makeTranslation(tx, ty) {\n return [1, 0, 0, 0, 1, 0, tx, ty, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeRotation\n *\n * @todo add description\n * @todo add return description\n *\n * @param {Number} angleInRadians\n *\n * @return {Object}\n */\n makeRotation(angleInRadians) {\n let c = Math.cos(angleInRadians);\n let s = Math.sin(angleInRadians);\n\n return [c, -s, 0, s, c, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeScale\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} sx either 0 or 1\n * @param {Number} sy either 0 or 1\n *\n * @return {Object}\n */\n makeScale(sx, sy) {\n return [sx, 0, 0, 0, sy, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method matrixMultiply\n *\n * @todo add description\n * @todo add a, b description\n * @todo add return description\n *\n * @param {Object} a\n * @param {Object} b\n *\n * @return {Object}\n */\n matrixMultiply(a, b) {\n let a00 = a[0 * 3 + 0];\n let a01 = a[0 * 3 + 1];\n let a02 = a[0 * 3 + 2];\n let a10 = a[1 * 3 + 0];\n let a11 = a[1 * 3 + 1];\n let a12 = a[1 * 3 + 2];\n let a20 = a[2 * 3 + 0];\n let a21 = a[2 * 3 + 1];\n let a22 = a[2 * 3 + 2];\n let b00 = b[0 * 3 + 0];\n let b01 = b[0 * 3 + 1];\n let b02 = b[0 * 3 + 2];\n let b10 = b[1 * 3 + 0];\n let b11 = b[1 * 3 + 1];\n let b12 = b[1 * 3 + 2];\n let b20 = b[2 * 3 + 0];\n let b21 = b[2 * 3 + 1];\n let b22 = b[2 * 3 + 2];\n\n return [\n a00 * b00 + a01 * b10 + a02 * b20,\n a00 * b01 + a01 * b11 + a02 * b21,\n a00 * b02 + a01 * b12 + a02 * b22,\n a10 * b00 + a11 * b10 + a12 * b20,\n a10 * b01 + a11 * b11 + a12 * b21,\n a10 * b02 + a11 * b12 + a12 * b22,\n a20 * b00 + a21 * b10 + a22 * b20,\n a20 * b01 + a21 * b11 + a22 * b21,\n a20 * b02 + a21 * b12 + a22 * b22\n ];\n }\n}","export default {\n\n /**\n * Creates and returns a new canvas. The opacity is by default set to 0\n *\n * @memberof Proton#Proton.DomUtil\n * @method createCanvas\n *\n * @param {String} $id the canvas' id\n * @param {Number} $width the canvas' width\n * @param {Number} $height the canvas' height\n * @param {String} [$position=absolute] the canvas' position, default is 'absolute'\n *\n * @return {Object}\n */\n createCanvas(id, width, height, position) {\n const dom = document.createElement('canvas');\n position = position || 'absolute';\n\n dom.id = id;\n dom.width = width;\n dom.height = height;\n dom.style.opacity = 0;\n dom.style.position = position;\n\n this.transform(dom, -500, -500, 0, 0);\n\n return dom;\n },\n\n createDiv(id, width, height) {\n const dom = document.createElement('div');\n\n dom.id = id;\n dom.style.position = 'absolute';\n this.resize(dom, width, height);\n\n return dom;\n },\n\n resize(dom, width, height) {\n dom.style.width = width + 'px';\n dom.style.height = height + 'px';\n dom.style.marginLeft = -width / 2 + 'px';\n dom.style.marginTop = -height / 2 + 'px';\n },\n\n /**\n * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers\n *\n * @memberof Proton#Proton.DomUtil\n * @method transform\n *\n * @param {HTMLDivElement} div\n * @param {Number} $x\n * @param {Number} $y\n * @param {Number} $scale\n * @param {Number} $rotate\n */\n transform(div, x, y, scale, rotate) {\n const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\n\n div.style.willChange = 'transform';\n this.css3(div, 'transform', transform);\n },\n\n transform3d(div, x, y, scale, rotate) {\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\n\n div.style.willChange = 'transform';\n this.css3(div, 'backfaceVisibility', 'hidden');\n this.css3(div, 'transform', transform);\n },\n\n css3(div, key, val) {\n const bkey = key.charAt(0).toUpperCase() + key.substr(1);\n\n div.style[`Webkit${bkey}`] = val;\n div.style[`Moz${bkey}`] = val;\n div.style[`O${bkey}`] = val;\n div.style[`ms${bkey}`] = val;\n div.style[`${key}`] = val;\n }\n}","import WebGLUtil from './WebGLUtil';\nimport DomUtil from './DomUtil';\n\nconst IMG_CACHE = {};\nconst CANVAS_CACHE = {};\nlet canvasID = 0;\n\nexport default {\n\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n context.drawImage(image, rect.x, rect.y);\n const imagedata = context.getImageData(rect.x, rect.y, rect.width, rect.height);\n context.clearRect(rect.x, rect.y, rect.width, rect.height);\n\n return imagedata;\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method getImgFromCache\n *\n * @todo add description\n * @todo describe func\n *\n * @param {Mixed} img\n * @param {Proton.Particle} particle\n * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.transform.canvas\n * @param {Boolean} func\n */\n getImgFromCache(img, callback, param) {\n const src = typeof (img) === 'string' ? img : img.src;\n\n if (IMG_CACHE[src]) {\n callback(IMG_CACHE[src], param);\n } else {\n const image = new Image();\n image.onload = e => {\n IMG_CACHE[src] = e.target;\n callback(IMG_CACHE[src], param);\n }\n\n image.src = src;\n }\n },\n\n getCanvasFromCache(img, callback, param) {\n const src = img.src;\n\n if (!CANVAS_CACHE[src]) {\n const width = WebGLUtil.nhpot(img.width);\n const height = WebGLUtil.nhpot(img.height);\n\n const canvas = DomUtil.createCanvas(`canvas_cache_${canvasID}`, width, height);\n const context = canvas.getContext('2d');\n context.drawImage(img, 0, 0, img.width, img.height);\n\n CANVAS_CACHE[src] = canvas;\n }\n\n callback && callback(CANVAS_CACHE[src], param);\n\n return CANVAS_CACHE[src];\n }\n}","import Span from '../math/Span';\nimport ImgUtil from './ImgUtil';\n\nexport default {\n\n /**\n * Returns the default if the value is null or undefined\n *\n * @memberof Proton#Proton.Util\n * @method initValue\n *\n * @param {Mixed} value a specific value, could be everything but null or undefined\n * @param {Mixed} defaults the default if the value is null or undefined\n */\n initValue(value, defaults) {\n value = (value !== null && value !== undefined) ? value : defaults;\n return value;\n },\n\n /**\n * Checks if the value is a valid array\n *\n * @memberof Proton#Proton.Util\n * @method isArray\n *\n * @param {Array} value Any array\n *\n * @returns {Boolean}\n */\n isArray(value) {\n return Object.prototype.toString.call(value) === '[object Array]';\n },\n\n /**\n * Destroyes the given array\n *\n * @memberof Proton#Proton.Util\n * @method destroyArray\n *\n * @param {Array} array Any array\n */\n destroyArray(array) {\n if (array) array.length = 0;\n },\n\n /**\n * Destroyes the given object\n *\n * @memberof Proton#Proton.Util\n * @method destroyObject\n *\n * @param {Object} obj Any object\n */\n destroyObject(obj, ignore) {\n for (let o in obj) {\n if (ignore && ignore.indexOf(o) > -1) continue;\n delete obj[o];\n }\n },\n\n /**\n * Makes an instance of a class and binds the given array\n *\n * @memberof Proton#Proton.Util\n * @method classApply\n *\n * @param {Function} constructor A class to make an instance from\n * @param {Array} [args] Any array to bind it to the constructor\n *\n * @return {Object} The instance of constructor, optionally bind with args\n */\n classApply(constructor, args) {\n if (!args) return new constructor;\n\n args = [null].concat(args);\n const FactoryFunc = constructor.bind.apply(constructor, args);\n return new FactoryFunc();\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method setVector2DByObject\n *\n * @todo add description for param `target`\n * @todo add description for param `pOBJ`\n * @todo add description for function\n *\n * @param {Object} target\n * @param {Object} pOBJ\n */\n setVector2DByObject(target, pOBJ) {\n if (this.hasProp(pOBJ, 'x')) target.p.x = pOBJ['x'];\n if (this.hasProp(pOBJ, 'y')) target.p.y = pOBJ['y'];\n\n if (this.hasProp(pOBJ, 'vx')) target.v.x = pOBJ['vx'];\n if (this.hasProp(pOBJ, 'vy')) target.v.y = pOBJ['vy'];\n\n if (this.hasProp(pOBJ, 'ax')) target.a.x = pOBJ['ax'];\n if (this.hasProp(pOBJ, 'ay')) target.a.y = pOBJ['ay'];\n\n if (this.hasProp(pOBJ, 'p')) target.p.copy(pOBJ['p']);\n if (this.hasProp(pOBJ, 'v')) target.v.copy(pOBJ['v']);\n if (this.hasProp(pOBJ, 'a')) target.a.copy(pOBJ['a']);\n\n if (this.hasProp(pOBJ, 'position')) target.p.copy(pOBJ['position']);\n if (this.hasProp(pOBJ, 'velocity')) target.v.copy(pOBJ['velocity']);\n if (this.hasProp(pOBJ, 'accelerate')) target.a.copy(pOBJ['accelerate']);\n },\n\n hasProp(obj, key) {\n if (!obj) return false;\n return obj[key] !== undefined;\n // return obj.hasOwnProperty(key);\n },\n\n /**\n * set the prototype in a given prototypeObject\n *\n * @memberof Proton#Proton.Util\n * @method setPrototypeByObject\n *\n * @todo add description for param `target`\n * @todo add description for param `filters`\n * @todo translate desription from chinese to english\n *\n * @param {Object} target\n * @param {Object} prototypeObject An object of single prototypes\n * @param {Object} filters\n *\n * @return {Object} target\n */\n setPrototypeByObject(target, prototypeObject, filters) {\n for (let singleProp in prototypeObject) {\n if (target.hasOwnProperty(singleProp)) {\n if (filters) {\n if (filters.indexOf(singleProp) < 0)\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\n } else {\n target[singleProp] = this.getSpanValue(prototypeObject[singleProp]);\n }\n }\n }\n\n return target;\n },\n\n /**\n * Returns a new Span object\n *\n * @memberof Proton#Proton.Util\n * @method setSpanValue\n *\n * @todo a, b and c should be 'Mixed' or 'Number'?\n *\n * @param {Mixed | Span} a\n * @param {Mixed} b\n * @param {Mixed} c\n *\n * @return {Span}\n */\n setSpanValue(a, b, c) {\n if (a instanceof Span) {\n return a;\n } else {\n if (!b) {\n return new Span(a);\n } else {\n if (!c)\n return new Span(a, b);\n else\n return new Span(a, b, c);\n }\n }\n },\n\n /**\n * Returns the value from a Span, if the param is not a Span it will return the given parameter\n *\n * @memberof Proton#Proton.Util\n * @method getSpanValue\n *\n * @param {Mixed | Span} pan\n *\n * @return {Mixed} the value of Span OR the parameter if it is not a Span\n */\n getSpanValue(pan) {\n return pan instanceof Span ? pan.getValue() : pan;\n },\n\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n return ImgUtil.getImageData(context, image, rect);\n },\n\n destroy(arr, param) {\n let i = arr.length;\n\n while (i--) {\n try { arr[i].destroy(param); } catch (e) { }\n delete arr[i];\n }\n\n arr.length = 0;\n }\n\n}","export default {\n id: 0,\n cache: {},\n\n getID(target) {\n let uid = this.getCacheID(target);\n if (uid) return uid;\n\n uid = `PUID_${this.id++}`;\n this.cache[uid] = target;\n\n return uid;\n },\n\n getCacheID(target) {\n let obj;\n for (let id in this.cache) {\n obj = this.cache[id];\n\n if (obj === target) return id;\n if (typeof obj === 'object' && typeof target === 'object' && obj.isInner && target.isInner) {\n if (obj.src === target.src)\n return id;\n }\n }\n\n return null;\n },\n\n getTarget(uid) {\n return this.cache[uid];\n }\n}","/**\n * get -> PUID :: uid-> Body\n * -> cache[abc]. -> cache[abc] .pop()\n * -> create [new Body| clone]\n * -> return p1: { __pid: abc }\n *\n * expire -> cache[abc]= [p0, p1];\n *\n */\nimport Util from '../utils/Util';\nimport PUID from '../utils/PUID';\n\nexport default class Pool {\n\n /**\n * @memberof! Proton#\n * @constructor\n * @alias Proton.Pool\n *\n * @todo add description\n * @todo add description of properties\n *\n * @property {Number} total\n * @property {Object} cache\n */\n constructor(num) {\n this.total = 0;\n this.cache = {};\n }\n\n /**\n * @todo add description\n *\n * @method get\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n get(target, params, uid) {\n let p;\n uid = uid || target.__puid || PUID.getID(target);\n\n if (this.cache[uid] && this.cache[uid].length > 0)\n p = this.cache[uid].pop();\n else\n p = this.createOrClone(target, params);\n\n p.__puid = target.__puid || uid;\n return p;\n }\n\n /**\n * @todo add description\n *\n * @method set\n * @memberof Proton#Proton.Pool\n *\n * @param {Object} target\n *\n * @return {Object}\n */\n expire(target) {\n return this.getCache(target.__puid).push(target);\n }\n\n /**\n * Creates a new class instance\n *\n * @todo add more documentation\n *\n * @method create\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target any Object or Function\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n createOrClone(target, params) {\n this.total++;\n\n if (this.create) {\n return this.create(target, params);\n } else if (typeof target === 'function') {\n return Util.classApply(target, params);\n } else {\n return target.clone();\n }\n }\n\n /**\n * @todo add description - what is in the cache?\n *\n * @method getCount\n * @memberof Proton#Proton.Pool\n *\n * @return {Number}\n */\n getCount() {\n let count = 0;\n\n for (let id in this.cache)\n count += this.cache[id].length;\n\n return count++;\n }\n\n /**\n * Destroyes all items from Pool.cache\n *\n * @method destroy\n * @memberof Proton#Proton.Pool\n */\n destroy() {\n for (let id in this.cache) {\n this.cache[id].length = 0;\n delete this.cache[id];\n }\n }\n\n /**\n * Returns Pool.cache\n *\n * @method getCache\n * @memberof Proton#Proton.Pool\n * @private\n *\n * @param {Number} uid the unique id\n *\n * @return {Object}\n */\n getCache(uid) {\n uid = uid || 'default';\n\n if (!this.cache[uid]) this.cache[uid] = [];\n return this.cache[uid];\n }\n}","export default class Stats {\n\n constructor(proton) {\n this.proton = proton;\n this.container = null;\n this.type = 1;\n\n this.emitterIndex = 0;\n this.rendererIndex = 0;\n }\n\n update(style, body) {\n this.add(style, body);\n\n const emitter = this.getEmitter();\n const renderer = this.getRenderer();\n let str = '';\n\n switch (this.type) {\n case 2:\n str += 'emitter:' + this.proton.emitters.length + '
';\n if (emitter) str += 'em speed:' + emitter.emitSpeed + '
';\n if (emitter) str += 'pos:' + this.getEmitterPos(emitter);\n break;\n\n case 3:\n if (emitter) str += 'initializes:' + emitter.initializes.length + '
';\n if (emitter) str += '' + this.concatArr(emitter.initializes) + '
';\n if (emitter) str += 'behaviours:' + emitter.behaviours.length + '
';\n if (emitter) str += '' + this.concatArr(emitter.behaviours) + '
';\n break;\n\n case 4:\n if (renderer) str += renderer.name + '
';\n if (renderer) str += 'body:' + this.getCreatedNumber(renderer) + '
';\n break;\n\n default:\n str += 'particles:' + this.proton.getCount() + '
';\n str += 'pool:' + this.proton.pool.getCount() + '
';\n str += 'total:' + this.proton.pool.total;\n }\n\n this.container.innerHTML = str;\n }\n\n add(style, body) {\n if (!this.container) {\n this.type = 1;\n\n this.container = document.createElement('div');\n this.container.style.cssText = [\n 'position:absolute;bottom:0px;left:0;cursor:pointer;',\n 'opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;',\n 'width:120px;height:50px;background-color:#002;color:#0ff;'\n ].join('');\n\n this.container.addEventListener('click', e => {\n this.type++;\n if (this.type > 4) this.type = 1;\n }, false);\n\n let bg, color;\n switch (style) {\n case 2:\n bg = '#201';\n color = '#f08';\n break;\n\n case 3:\n bg = '#020';\n color = '#0f0';\n break;\n\n default:\n bg = '#002';\n color = '#0ff';\n }\n\n this.container.style['background-color'] = bg;\n this.container.style['color'] = color;\n }\n\n if (!this.container.parentNode) {\n body = body || this.body || document.body;\n body.appendChild(this.container);\n }\n }\n\n getEmitter() {\n return this.proton.emitters[this.emitterIndex];\n }\n\n getRenderer() {\n return this.proton.renderers[this.rendererIndex];\n }\n\n concatArr(arr) {\n let result = '';\n if (!arr || !arr.length) return result;\n\n for (let i = 0; i < arr.length; i++) {\n result += (arr[i].name || '').substr(0, 1) + '.';\n }\n\n return result;\n }\n\n getCreatedNumber(renderer) {\n return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0;\n }\n\n getEmitterPos(e) {\n return Math.round(e.p.x) + ',' + Math.round(e.p.y);\n }\n}","/*\n * EventDispatcher\n * This code reference since http://createjs.com/.\n *\n **/\n\nexport default class EventDispatcher {\n\n constructor() {\n this._listeners = null;\n }\n\n static bind(TargetClass) {\n TargetClass.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\n TargetClass.prototype.hasEventListener = EventDispatcher.prototype.hasEventListener;\n TargetClass.prototype.addEventListener = EventDispatcher.prototype.addEventListener;\n TargetClass.prototype.removeEventListener = EventDispatcher.prototype.removeEventListener;\n TargetClass.prototype.removeAllEventListeners = EventDispatcher.prototype.removeAllEventListeners;\n }\n\n addEventListener(type, listener) {\n if (!this._listeners) {\n this._listeners = {};\n } else {\n this.removeEventListener(type, listener);\n }\n\n if (!this._listeners[type]) this._listeners[type] = [];\n this._listeners[type].push(listener);\n\n return listener;\n }\n\n removeEventListener(type, listener) {\n if (!this._listeners) return;\n if (!this._listeners[type]) return;\n\n const arr = this._listeners[type];\n const length = arr.length;\n\n for (let i = 0; i < length; i++) {\n if (arr[i] === listener) {\n if (length === 1) {\n delete (this._listeners[type]);\n }\n\n // allows for faster checks.\n else {\n arr.splice(i, 1);\n }\n\n break;\n }\n }\n }\n\n removeAllEventListeners(type) {\n if (!type)\n this._listeners = null;\n else if (this._listeners)\n delete (this._listeners[type]);\n }\n\n dispatchEvent(type, args) {\n let result = false;\n const listeners = this._listeners;\n\n if (type && listeners) {\n let arr = listeners[type];\n if (!arr) return result;\n\n // arr = arr.slice();\n // to avoid issues with items being removed or added during the dispatch\n\n let handler;\n let i = arr.length;\n while (i--) {\n handler = arr[i];\n result = result || handler(args);\n }\n\n }\n\n return !!result;\n }\n\n hasEventListener(type) {\n const listeners = this._listeners;\n return !!(listeners && listeners[type]);\n }\n\n}","export default class Integration {\n\n\tconstructor(type) {\n\t\tthis.type = type;\n\t}\n\n\tcalculate(particles, time, damping) {\n\t\tthis.eulerIntegrate(particles, time, damping);\n\t}\n\n\t// Euler Integrate\n\teulerIntegrate(particle, time, damping) {\n\t\tif (!particle.sleep) {\n\t\t\tparticle.old.p.copy(particle.p);\n\t\t\tparticle.old.v.copy(particle.v);\n\n\t\t\tparticle.a.multiplyScalar(1 / particle.mass);\n\t\t\tparticle.v.add(particle.a.multiplyScalar(time));\n\t\t\tparticle.p.add(particle.old.v.multiplyScalar(time));\n\n\t\t\tif (damping) particle.v.multiplyScalar(damping);\n\n\t\t\tparticle.a.clear();\n\t\t}\n\t}\n}","import Pool from './Pool';\nimport Util from '../utils/Util';\nimport Stats from '../debug/Stats';\nimport EventDispatcher from '../events/EventDispatcher';\nimport Integration from '../math/Integration';\n\nexport default class Proton {\n\n static USE_CLOCK = false;\n\n // 1:100\n static MEASURE = 100;\n static EULER = 'euler';\n static RK2 = 'runge-kutta2';\n\n static PARTICLE_CREATED = 'PARTICLE_CREATED';\n static PARTICLE_UPDATE = 'PARTICLE_UPDATE';\n static PARTICLE_SLEEP = 'PARTICLE_SLEEP';\n static PARTICLE_DEAD = 'PARTICLE_DEAD';\n static PROTON_UPDATE = 'PROTON_UPDATE';\n static PROTON_UPDATE_AFTER = 'PROTON_UPDATE_AFTER';\n static EMITTER_ADDED = 'EMITTER_ADDED';\n static EMITTER_REMOVED = 'EMITTER_REMOVED';\n\n static amendChangeTabsBug = true;\n\n /**\n * The constructor to add emitters\n *\n * @constructor Proton\n *\n * @todo proParticleCount is not in use\n * @todo add more documentation of the single properties and parameters\n *\n * @param {Number} [proParticleCount] not in use?\n * @param {Number} [integrationType=Proton.EULER]\n *\n * @property {String} [integrationType=Proton.EULER]\n * @property {Array} emitters All added emitter\n * @property {Array} renderers All added renderer\n * @property {Number} time The active time\n * @property {Number} oldtime The old time\n */\n constructor(integrationType) {\n\n this.emitters = [];\n this.renderers = [];\n\n this.time = 0;\n this.oldTime = 0;\n this.elapsed = 0;\n\n this.stats = new Stats(this);\n this.pool = new Pool(80);\n\n this.integrationType = Util.initValue(integrationType, Proton.EULER);\n this.integrator = new Integration(this.integrationType);\n }\n\n /**\n * add a type of Renderer\n *\n * @method addRenderer\n * @memberof Proton\n * @instance\n *\n * @param {Renderer} render\n */\n addRenderer(render) {\n render.init(this);\n this.renderers.push(render);\n }\n\n /**\n * @name add a type of Renderer\n *\n * @method addRenderer\n * @param {Renderer} render\n */\n removeRenderer(render) {\n const index = this.renderers.indexOf(render);\n this.renderers.splice(index, 1);\n render.remove(this);\n }\n\n /**\n * add the Emitter\n *\n * @method addEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Emitter} emitter\n */\n addEmitter(emitter) {\n this.emitters.push(emitter);\n emitter.parent = this;\n\n this.dispatchEvent(Proton.EMITTER_ADDED, emitter);\n }\n\n /**\n * Removes an Emitter\n *\n * @method removeEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Proton.Emitter} emitter\n */\n removeEmitter(emitter) {\n const index = this.emitters.indexOf(emitter);\n this.emitters.splice(index, 1);\n emitter.parent = null;\n\n this.dispatchEvent(Proton.EMITTER_REMOVED, emitter);\n }\n\n /**\n * Updates all added emitters\n *\n * @method update\n * @memberof Proton\n * @instance\n */\n update() {\n this.dispatchEvent(Proton.PROTON_UPDATE);\n\n if (Proton.USE_CLOCK) {\n if (!this.oldTime) this.oldTime = (new Date()).getTime();\n\n let time = new Date().getTime();\n this.elapsed = (time - this.oldTime) / 1000;\n Proton.amendChangeTabsBug && this.amendChangeTabsBug();\n\n this.oldTime = time;\n } else {\n this.elapsed = 0.0167;\n }\n\n // emitter update\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\n\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\n }\n\n emittersUpdate(elapsed) {\n let i = this.emitters.length;\n while (i--) this.emitters[i].update(elapsed);\n }\n\n /**\n * @todo add description\n *\n * @method amendChangeTabsBug\n * @memberof Proton\n * @instance\n */\n amendChangeTabsBug() {\n if (this.elapsed > 0.5) {\n this.oldTime = (new Date()).getTime();\n this.elapsed = 0;\n }\n }\n\n /**\n * Counts all particles from all emitters\n *\n * @method getCount\n * @memberof Proton\n * @instance\n */\n getCount() {\n let total = 0;\n let i = this.emitters.length;\n\n while (i--) total += this.emitters[i].particles.length;\n return total;\n }\n\n getAllParticles() {\n let particles = [];\n let i = this.emitters.length;\n\n while (i--) particles = particles.concat(this.emitters[i].particles);\n return particles;\n }\n\n /**\n * Destroys everything related to this Proton instance. This includes all emitters, and all properties\n *\n * @method destroy\n * @memberof Proton\n * @instance\n */\n destroy() {\n Util.destroy(this.renderers, this.getAllParticles());\n Util.destroy(this.emitters);\n\n this.time = 0;\n this.oldTime = 0;\n\n this.pool.destroy();\n }\n}\n\nEventDispatcher.bind(Proton);","import MathUtils from './MathUtils';\n\nexport default {\n\n easeLinear(value) {\n return value;\n },\n\n easeInQuad(value) {\n return Math.pow(value, 2);\n },\n\n easeOutQuad(value) {\n return -(Math.pow((value - 1), 2) - 1);\n },\n\n easeInOutQuad(value) {\n if ((value /= 0.5) < 1)\n return 0.5 * Math.pow(value, 2);\n\n return -0.5 * ((value -= 2) * value - 2);\n },\n\n easeInCubic(value) {\n return Math.pow(value, 3);\n },\n\n easeOutCubic(value) {\n return (Math.pow((value - 1), 3) + 1);\n },\n\n easeInOutCubic(value) {\n if ((value /= 0.5) < 1)\n return 0.5 * Math.pow(value, 3);\n\n return 0.5 * (Math.pow((value - 2), 3) + 2);\n },\n\n easeInQuart(value) {\n return Math.pow(value, 4);\n },\n\n easeOutQuart(value) {\n return -(Math.pow((value - 1), 4) - 1);\n },\n\n easeInOutQuart(value) {\n if ((value /= 0.5) < 1)\n return 0.5 * Math.pow(value, 4);\n\n return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2);\n },\n\n easeInSine(value) {\n return -Math.cos(value * (MathUtils.PI_2)) + 1;\n },\n\n easeOutSine(value) {\n return Math.sin(value * (MathUtils.PI_2));\n },\n\n easeInOutSine(value) {\n return (-0.5 * (Math.cos(MathUtils.PI * value) - 1));\n },\n\n easeInExpo(value) {\n return (value === 0) ? 0 : Math.pow(2, 10 * (value - 1));\n },\n\n easeOutExpo(value) {\n return (value === 1) ? 1 : -Math.pow(2, -10 * value) + 1;\n },\n\n easeInOutExpo(value) {\n if (value === 0)\n return 0;\n\n if (value === 1)\n return 1;\n\n if ((value /= 0.5) < 1)\n return 0.5 * Math.pow(2, 10 * (value - 1));\n\n return 0.5 * (-Math.pow(2, -10 * --value) + 2);\n },\n\n easeInCirc(value) {\n return -(Math.sqrt(1 - (value * value)) - 1);\n },\n\n easeOutCirc(value) {\n return Math.sqrt(1 - Math.pow((value - 1), 2));\n },\n\n easeInOutCirc(value) {\n if ((value /= 0.5) < 1)\n return -0.5 * (Math.sqrt(1 - value * value) - 1);\n return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1);\n },\n\n easeInBack(value) {\n let s = 1.70158;\n return (value) * value * ((s + 1) * value - s);\n },\n\n easeOutBack(value) {\n let s = 1.70158;\n return (value = value - 1) * value * ((s + 1) * value + s) + 1;\n },\n\n easeInOutBack(value) {\n let s = 1.70158;\n if ((value /= 0.5) < 1)\n return 0.5 * (value * value * (((s *= (1.525)) + 1) * value - s));\n return 0.5 * ((value -= 2) * value * (((s *= (1.525)) + 1) * value + s) + 2);\n },\n\n getEasing(ease) {\n if (typeof ease === 'function')\n return ease;\n else\n return this[ease] || this.easeLinear;\n }\n};","import MathUtils from '../math/MathUtils';\n\nexport default class Vector2D {\n\n constructor(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n\n set(x, y) {\n this.x = x;\n this.y = y;\n return this;\n }\n\n setX(x) {\n this.x = x;\n return this;\n }\n\n setY(y) {\n this.y = y;\n return this;\n }\n\n getGradient() {\n if (this.x !== 0)\n return Math.atan2(this.y, this.x);\n else if (this.y > 0)\n return MathUtils.PI_2;\n else if (this.y < 0)\n return -MathUtils.PI_2;\n }\n\n copy(v) {\n this.x = v.x;\n this.y = v.y;\n\n return this;\n }\n\n add(v, w) {\n if (w !== undefined) {\n return this.addVectors(v, w);\n }\n\n this.x += v.x;\n this.y += v.y;\n\n return this;\n }\n\n addXY(a, b) {\n this.x += a;\n this.y += b;\n\n return this;\n }\n\n addVectors(a, b) {\n this.x = a.x + b.x;\n this.y = a.y + b.y;\n\n return this;\n }\n\n sub(v, w) {\n if (w !== undefined) {\n return this.subVectors(v, w);\n }\n\n this.x -= v.x;\n this.y -= v.y;\n\n return this;\n }\n\n subVectors(a, b) {\n this.x = a.x - b.x;\n this.y = a.y - b.y;\n\n return this;\n }\n\n divideScalar(s) {\n if (s !== 0) {\n this.x /= s;\n this.y /= s;\n } else {\n this.set(0, 0);\n }\n\n return this;\n }\n\n multiplyScalar(s) {\n this.x *= s;\n this.y *= s;\n\n return this;\n }\n\n negate() {\n return this.multiplyScalar(-1);\n }\n\n dot(v) {\n return this.x * v.x + this.y * v.y;\n }\n\n lengthSq() {\n return this.x * this.x + this.y * this.y;\n }\n\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n\n normalize() {\n return this.divideScalar(this.length());\n }\n\n distanceTo(v) {\n return Math.sqrt(this.distanceToSquared(v));\n }\n\n rotate(tha) {\n const x = this.x;\n const y = this.y;\n\n this.x = x * Math.cos(tha) + y * Math.sin(tha);\n this.y = -x * Math.sin(tha) + y * Math.cos(tha);\n\n return this;\n }\n\n distanceToSquared(v) {\n const dx = this.x - v.x;\n const dy = this.y - v.y;\n\n return dx * dx + dy * dy;\n }\n\n lerp(v, alpha) {\n this.x += (v.x - this.x) * alpha;\n this.y += (v.y - this.y) * alpha;\n\n return this;\n }\n\n equals(v) {\n return ((v.x === this.x) && (v.y === this.y));\n }\n\n clear() {\n this.x = 0.0;\n this.y = 0.0;\n return this;\n }\n\n clone() {\n return new Vector2D(this.x, this.y);\n }\n}","import Util from '../utils/Util';\nimport ease from '../math/ease';\nimport Vector2D from '../math/Vector2D';\nimport MathUtils from '../math/MathUtils';\n\nexport default class Particle {\n\n static ID = 0;\n\n /**\n * the Particle class\n *\n * @class Proton.Particle\n * @constructor\n * @param {Object} pObj the parameters object;\n * for example {life:3,dead:false}\n */\n constructor(pOBJ) {\n /**\n * The particle's id;\n * @property id\n * @type {string}\n */\n this.id = `particle_${Particle.ID++}`;\n this.reset('init');\n\n pOBJ && Util.setPrototypeByObject(this, pOBJ);\n }\n\n getDirection() {\n return Math.atan2(this.v.x, -this.v.y) * MathUtils.N180_PI;\n }\n\n reset(init) {\n this.life = Infinity;\n this.age = 0;\n\n // Energy loss\n this.energy = 1;\n this.dead = false;\n this.sleep = false;\n this.body = null;\n this.sprite = null;\n this.parent = null;\n\n this.mass = 1;\n this.radius = 10;\n this.alpha = 1;\n this.scale = 1;\n this.rotation = 0;\n this.color = null;\n\n this.easing = ease.easeLinear;\n\n if (init === 'init') {\n this.transform = {};\n this.p = new Vector2D();\n this.v = new Vector2D();\n this.a = new Vector2D();\n\n this.old = {\n p: new Vector2D(),\n v: new Vector2D(),\n a: new Vector2D()\n };\n\n this.behaviours = [];\n } else {\n Util.destroyObject(this.transform, 'rgb');\n\n this.p.set(0, 0);\n this.v.set(0, 0);\n this.a.set(0, 0);\n\n this.old.p.set(0, 0);\n this.old.v.set(0, 0);\n this.old.a.set(0, 0);\n\n this.removeAllBehaviours();\n }\n\n if (!this.transform.rgb) {\n this.transform.rgb = { r: 255, g: 255, b: 255 };\n } else {\n this.transform.rgb.r = 255;\n this.transform.rgb.g = 255;\n this.transform.rgb.b = 255;\n }\n\n return this;\n }\n\n update(time, index) {\n if (!this.sleep) {\n this.age += time;\n this.applyBehaviours(time, index);\n }\n\n if (this.age < this.life) {\n const scale = this.easing(this.age / this.life);\n this.energy = Math.max(1 - scale, 0);\n } else {\n this.destroy();\n }\n }\n\n applyBehaviours(time, index) {\n const length = this.behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.behaviours[i] && this.behaviours[i].applyBehaviour(this, time, index)\n }\n }\n\n addBehaviour(behaviour) {\n this.behaviours.push(behaviour);\n\n if (behaviour.hasOwnProperty('parents')) behaviour.parents.push(this);\n behaviour.initialize(this);\n }\n\n addBehaviours(behaviours) {\n const length = behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.addBehaviour(behaviours[i]);\n }\n }\n\n removeBehaviour(behaviour) {\n const index = this.behaviours.indexOf(behaviour);\n\n if (index > -1) {\n const behaviour = this.behaviours.splice(index, 1);\n behaviour.parents = null;\n }\n }\n\n removeAllBehaviours() {\n Util.destroyArray(this.behaviours);\n }\n\n /**\n * Destory this particle\n * @method destroy\n */\n destroy() {\n this.removeAllBehaviours();\n this.energy = 0;\n this.dead = true;\n this.parent = null;\n }\n\n}","export default {\n\n /**\n * @typedef {Object} rgbObject\n * @property {Number} r red value\n * @property {Number} g green value\n * @property {Number} b blue value\n */\n /**\n * converts a hex value to a rgb object\n *\n * @memberof Proton#Proton.Util\n * @method hexToRGB\n *\n * @param {String} h any hex value, e.g. #000000 or 000000 for black\n *\n * @return {rgbObject}\n */\n hexToRGB(h) {\n const hex16 = (h.charAt(0) === '#') ? h.substring(1, 7) : h;\n const r = parseInt(hex16.substring(0, 2), 16);\n const g = parseInt(hex16.substring(2, 4), 16);\n const b = parseInt(hex16.substring(4, 6), 16);\n\n return { r, g, b };\n },\n\n /**\n * converts a rgb value to a rgb string\n *\n * @memberof Proton#Proton.Util\n * @method rgbToHex\n *\n * @param {Object | Proton.hexToRGB} rgb a rgb object like in {@link Proton#Proton.}\n *\n * @return {String} rgb()\n */\n rgbToHex(rbg) {\n return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`;\n },\n\n getHex16FromParticle(p) {\n return Number(p.transform.rgb.r) * 65536 + Number(p.transform.rgb.g) * 256 + Number(p.transform.rgb.b);\n }\n}","import Vector2D from './Vector2D';\n\nexport default class Polar2D {\n\n\tconstructor(r, tha) {\n\t\tthis.r = Math.abs(r) || 0;\n\t\tthis.tha = tha || 0;\n\t}\n\n\tset(r, tha) {\n\t\tthis.r = r;\n\t\tthis.tha = tha;\n\t\treturn this;\n\t}\n\n\tsetR(r) {\n\t\tthis.r = r;\n\t\treturn this;\n\t}\n\n\tsetTha(tha) {\n\t\tthis.tha = tha;\n\t\treturn this;\n\t}\n\n\tcopy(p) {\n\t\tthis.r = p.r;\n\t\tthis.tha = p.tha;\n\t\treturn this;\n\t}\n\n\ttoVector() {\n\t\treturn new Vector2D(this.getX(), this.getY());\n\t}\n\n\tgetX() {\n\t\treturn this.r * Math.sin(this.tha);\n\t}\n\n\tgetY() {\n\t\treturn -this.r * Math.cos(this.tha);\n\t}\n\n\tnormalize() {\n\t\tthis.r = 1;\n\t\treturn this;\n\t}\n\n\tequals(v) {\n\t\treturn ((v.r === this.r) && (v.tha === this.tha));\n\t}\n\n\tclear() {\n\t\tthis.r = 0.0;\n\t\tthis.tha = 0.0;\n\t\treturn this;\n\t}\n\n\tclone() {\n\t\treturn new Polar2D(this.r, this.tha);\n\t}\n}","export default {\n\tcreate(mat3) {\n\t\tconst mat = new Float32Array(9);\n\t\tif (mat3) this.set(mat3, mat);\n\n\t\treturn mat;\n\t},\n\n\tset(mat1, mat2) {\n\t\tfor (let i = 0; i < 9; i++)\n\t\t\tmat2[i] = mat1[i];\n\n\t\treturn mat2;\n\t},\n\n\tmultiply(mat, mat2, mat3) {\n\t\tlet a00 = mat[0], a01 = mat[1], a02 = mat[2], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b00 = mat2[0], b01 = mat2[1], b02 = mat2[2], b10 = mat2[3], b11 = mat2[4], b20 = mat2[6], b21 = mat2[7];\n\n\t\tmat3[0] = b00 * a00 + b01 * a10;\n\t\tmat3[1] = b00 * a01 + b01 * a11;\n\t\tmat3[2] = a02 * b02;\n\t\tmat3[3] = b10 * a00 + b11 * a10;\n\t\tmat3[4] = b10 * a01 + b11 * a11;\n\t\tmat3[6] = b20 * a00 + b21 * a10 + a20;\n\t\tmat3[7] = b20 * a01 + b21 * a11 + a21;\n\n\t\treturn mat3;\n\t},\n\n\tinverse(mat, mat3) {\n\t\tlet a00 = mat[0], a01 = mat[1], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b01 = a11, b11 = -a10, b21 = a21 * a10 - a11 * a20, d = a00 * b01 + a01 * b11, id;\n\n\t\tid = 1 / d;\n\t\tmat3[0] = b01 * id;\n\t\tmat3[1] = (-a01) * id;\n\t\tmat3[3] = b11 * id;\n\t\tmat3[4] = a00 * id;\n\t\tmat3[6] = b21 * id;\n\t\tmat3[7] = (-a21 * a00 + a01 * a20) * id;\n\n\t\treturn mat3;\n\t},\n\n\tmultiplyVec2(m, vec, mat3) {\n\t\tlet x = vec[0], y = vec[1];\n\n\t\tmat3[0] = x * m[0] + y * m[3] + m[6];\n\t\tmat3[1] = x * m[1] + y * m[4] + m[7];\n\n\t\treturn mat3;\n\t}\n}","import Span from './Span';\nimport Util from '../utils/Util';\nimport MathUtils from './MathUtils';\n\nexport default class ArraySpan extends Span {\n\n constructor(color) {\n super();\n this._arr = Util.isArray(color) ? color : [color];\n }\n\n getValue() {\n const color = this._arr[Math.floor(this._arr.length * Math.random())];\n return color === 'random' || color === 'Random' ? MathUtils.randomColor() : color;\n }\n\n /**\n * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance\n *\n * @method setSpanValue\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n static createArraySpan(arr) {\n if (!arr) return null;\n\n if (arr instanceof ArraySpan)\n return arr;\n else\n return new ArraySpan(arr);\n }\n\n}","export default class Rectangle {\n\n\tconstructor(x, y, w, h) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\tthis.width = w;\n\t\tthis.height = h;\n\n\t\tthis.bottom = this.y + this.height;\n\t\tthis.right = this.x + this.width;\n\t}\n\n\tcontains(x, y) {\n\t\tif (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n}\n","import Util from '../utils/Util';\n\nexport default class Rate {\n\n\t/**\n\t * The number of particles per second emission (a [particle]/b [s]);\n\t * @namespace\n\t * @memberof! Proton#\n\t * @constructor\n\t * @alias Rate\n\t *\n\t * @param {Array | Number | Span} numpan the number of each emission;\n\t * @param {Array | Number | Span} timepan the time of each emission;\n\t * for example: new Rate(new Span(10, 20), new Span(.1, .25));\n\t */\n\tconstructor(numpan, timepan) {\n\t\tthis.numPan = Util.setSpanValue(Util.initValue(numpan, 1));\n\t\tthis.timePan = Util.setSpanValue(Util.initValue(timepan, 1));\n\n\t\tthis.startTime = 0;\n\t\tthis.nextTime = 0;\n\t\tthis.init();\n\t}\n\n\tinit() {\n\t\tthis.startTime = 0;\n\t\tthis.nextTime = this.timePan.getValue();\n\t}\n\n\tgetValue(time) {\n\t\tthis.startTime += time;\n\n\t\tif (this.startTime >= this.nextTime) {\n\t\t\tthis.startTime = 0;\n\t\t\tthis.nextTime = this.timePan.getValue();\n\n\t\t\tif (this.numPan.b === 1) {\n\t\t\t\tif (this.numPan.getValue(false) > 0.5)\n\t\t\t\t\treturn 1;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn this.numPan.getValue(true);\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}\n}","export default class Initialize {\n\n\treset() {\n\t}\n\n\tinit(emitter, particle) {\n\t\tif (particle) {\n\t\t\tthis.initialize(particle);\n\t\t} else {\n\t\t\tthis.initialize(emitter);\n\t\t}\n\t};\n\n\t// sub class init\n\tinitialize(target) {\n\t};\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Life extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\n\t\tthis.lifePan = Util.setSpanValue(a, b, c);\n\t\tthis.name = 'Life';\n\t}\n\n\tinitialize(target) {\n\t\tif (this.lifePan.a === Infinity)\n\t\t\ttarget.life = Infinity;\n\t\telse\n\t\t\ttarget.life = this.lifePan.getValue();\n\t}\n}\n","import Vector2D from '../math/Vector2D';\n\nexport default class Zone {\n\n\tconstructor() {\n\t\tthis.vector = new Vector2D(0, 0);\n\t\tthis.random = 0;\n\t\tthis.crossType = 'dead';\n\t\tthis.alert = true;\n\t}\n\n\tgetPosition() {\n\t}\n\n\tcrossing(particle) {\n\t}\n}\n","import Zone from './Zone';\n\nexport default class PointZone extends Zone {\n\n\tconstructor(x, y) {\n\t\tsuper();\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}\n\n\tgetPosition() {\n\t\tthis.vector.x = this.x;\n\t\tthis.vector.y = this.y;\n\t\treturn this.vector;\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.alert) {\n\t\t\talert('Sorry PointZone does not support crossing method');\n\t\t\tthis.alert = false;\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport PointZone from '../zone/PointZone';\nimport Initialize from './Initialize';\n\nexport default class Position extends Initialize {\n\n\tconstructor(zone) {\n\t\tsuper();\n\t\tthis.zone = Util.initValue(zone, new PointZone());\n\n\t\tthis.name = 'Position';\n\t}\n\n\treset(zone) {\n\t\tthis.zone = Util.initValue(zone, new PointZone());\n\t}\n\n\tinitialize(target) {\n\t\tthis.zone.getPosition();\n\n\t\ttarget.p.x = this.zone.vector.x;\n\t\ttarget.p.y = this.zone.vector.y;\n\t};\n\n}\n","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport Polar2D from '../math/Polar2D';\nimport MathUtils from '../math/MathUtils';\nimport Initialize from './Initialize';\n\nexport default class Velocity extends Initialize {\n\n constructor(rpan, thapan, type) {\n super();\n\n this.rPan = Util.setSpanValue(rpan);\n this.thaPan = Util.setSpanValue(thapan);\n this.type = Util.initValue(type, 'vector');\n\n this.name = 'Velocity';\n }\n\n reset(rpan, thapan, type) {\n this.rPan = Util.setSpanValue(rpan);\n this.thaPan = Util.setSpanValue(thapan);\n this.type = Util.initValue(type, 'vector');\n };\n\n normalizeVelocity(vr) {\n return vr * Proton.MEASURE;\n }\n\n initialize(target) {\n if (this.type === 'p' || this.type === 'P' || this.type === 'polar') {\n const polar2d = new Polar2D(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtils.PI_180);\n\n target.v.x = polar2d.getX();\n target.v.y = polar2d.getY();\n } else {\n target.v.x = this.normalizeVelocity(this.rPan.getValue());\n target.v.y = this.normalizeVelocity(this.thaPan.getValue());\n }\n };\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Mass extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\t\tthis.massPan = Util.setSpanValue(a, b, c);\n\t\tthis.name = 'Mass';\n\t}\n\n\tinitialize(target) {\n\t\ttarget.mass = this.massPan.getValue();\n\t}\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\n\nexport default class Radius extends Initialize {\n\n\tconstructor(a, b, c) {\n\t\tsuper();\n\t\tthis.radius = Util.setSpanValue(a, b, c);\n\n\t\tthis.name = 'Radius';\n\t}\n\n\treset(a, b, c) {\n\t\tthis.radius = Util.setSpanValue(a, b, c);\n\t};\n\n\tinitialize(particle) {\n\t\tparticle.radius = this.radius.getValue();\n\t\tparticle.transform.oldRadius = particle.radius;\n\t};\n}","import Util from '../utils/Util';\nimport ArraySpan from '../math/ArraySpan';\nimport Initialize from './Initialize';\n\nexport default class Body extends Initialize {\n\n constructor(image, w, h) {\n super();\n\n this.image = this.setSpanValue(image);\n this.w = Util.initValue(w, 20);\n this.h = Util.initValue(h, this.w);\n this.name = 'Body';\n }\n\n initialize(particle) {\n const imagetarget = this.image.getValue();\n\n if (typeof (imagetarget) === 'string') {\n particle.body = { width: this.w, height: this.h, src: imagetarget, isInner: true, inner: true };\n } else {\n particle.body = imagetarget;\n }\n };\n\n setSpanValue(color) {\n return color instanceof ArraySpan ? color : new ArraySpan(color);\n }\n}","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport ease from '../math/ease';\n\nexport default class Behaviour {\n static id = 0;\n\n /**\n * The Behaviour class is the base for the other Behaviour\n *\n * @memberof! -\n * @interface\n * @alias Proton.Behaviour\n *\n * @param {Number} life \tthe behaviours life\n * @param {String} easing \tThe behaviour's decaying trend, for example ease.easeOutQuart\n *\n * @property {String} id \t\tThe behaviours id\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n * @property {Number} age=0 \tHow long the particle should be 'alife'\n * @property {Number} energy=1\n * @property {Boolean} dead=false The particle is dead at first\n * @property {Array} parents \tThe behaviour's parents array\n * @property {String} name \tThe behaviour name\n */\n constructor(life, easing) {\n\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n\n this.age = 0;\n this.energy = 1;\n this.dead = false;\n this.parents = [];\n\n this.id = `Behaviour_${Behaviour.id++}`;\n this.name = 'Behaviour';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(life, easing) {\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n }\n\n /**\n * Normalize a force by 1:100;\n *\n * @method normalizeForce\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Vector2D} force\n */\n normalizeForce(force) {\n return force.multiplyScalar(Proton.MEASURE);\n }\n\n /**\n * Normalize a value by 1:100;\n *\n * @method normalizeValue\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} value\n */\n normalizeValue(value) {\n return value * Proton.MEASURE;\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {}\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n calculate(particle, time, index) {\n this.age += time;\n\n if (this.age >= this.life || this.dead) {\n this.energy = 0;\n this.dead = true;\n this.destroy();\n } else {\n const scale = this.easing(particle.age / particle.life);\n this.energy = Math.max(1 - scale, 0);\n }\n }\n\n /**\n * Destory this behaviour\n *\n * @method destroy\n * @memberof Proton.Behaviour\n * @instance\n */\n destroy() {\n let i = this.parents.length;\n while (i--) {\n this.parents[i].removeBehaviour(this);\n }\n\n this.parents.length = 0;\n }\n}","import Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Force extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Force\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(fx, fy, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\t\tthis.name = 'Force';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(fx, fy, life, easing) {\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.a.add(this.force);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Attraction extends Behaviour {\n\n\t/**\n\t * This behaviour let the particles follow one specific Proton.Vector2D\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Attraction\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Proton.Vector2D} targetPosition\n\t * @property {Number} radius\n\t * @property {Number} force\n\t * @property {Number} radiusSq\n\t * @property {Proton.Vector2D} attractionForce\n\t * @property {Number} lengthSq\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tthis.name = 'Attraction';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Attraction\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Attraction\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tthis.attractionForce.copy(this.targetPosition);\n\t\tthis.attractionForce.sub(particle.p);\n\t\tthis.lengthSq = this.attractionForce.lengthSq();\n\n\t\tif (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) {\n\t\t\tthis.attractionForce.normalize();\n\t\t\tthis.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\n\t\t\tthis.attractionForce.multiplyScalar(this.force);\n\n\t\t\tparticle.a.add(this.attractionForce);\n\t\t}\n\t}\n}","import Vector2D from '../math/Vector2D';\nimport MathUtils from '../math/MathUtils';\nimport Behaviour from './Behaviour';\n\nexport default class RandomDrift extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias RandomDrift\n\t *\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} time The time of the drift\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(driftX, driftY, delay, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(driftX, driftY, delay);\n\t\tthis.time = 0;\n\t\tthis.name = 'RandomDrift';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#RandomDrift\n\t * @instance\n\t *\n\t * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n\t * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n\t * @param {Number} delay \t\t\t\tHow much delay the drift should have\n\t * @param {Number} [life=Infinity] \t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear] \tthis behaviour's easing\n\t */\n\treset(driftX, driftY, delay, life, easing) {\n\t\tthis.panFoce = new Vector2D(driftX, driftY);\n\t\tthis.panFoce = this.normalizeForce(this.panFoce);\n\t\tthis.delay = delay;\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#RandomDrift\n\t * @instance\n\t *\n\t * @param {Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tthis.time += time;\n\n\t\tif (this.time >= this.delay) {\n\t\t\tparticle.a.addXY(MathUtils.randomAToB(-this.panFoce.x, this.panFoce.x), MathUtils.randomAToB(-this.panFoce.y, this.panFoce.y));\n\t\t\tthis.time = 0;\n\t\t};\n\t}\n}\n","import Force from './Force';\n\nexport default class Gravity extends Force {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Force\n\t * @constructor\n\t * @alias Proton.Gravity\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(g, life, easing) {\n\t\tsuper(0, g, life, easing);\n\t\tthis.name = 'Gravity';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Gravity\n\t * @instance\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(g, life, easing) {\n\t\tsuper.reset(0, g, life, easing);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Collision extends Behaviour {\n\n\t/**\n\t * The callback after collision\n\t *\n\t * @callback Callback\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Proton.Paritcle} otherParticle\n\t */\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Collision\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(emitter, mass, callback, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(emitter, mass, callback);\n\t\tthis.name = 'Collision';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method reset\n\t * @instance\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} \t\t\t[life=Infinity] \tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(emitter, mass, callback, life, easing) {\n\t\tthis.emitter = Util.initValue(emitter, null);\n\t\tthis.mass = Util.initValue(mass, true);\n\t\tthis.callback = Util.initValue(callback, null);\n\n\t\tthis.collisionPool = [];\n\t\tthis.delta = new Vector2D();\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tconst newPool = this.emitter ? this.emitter.particles.slice(index) : this.pool.slice(index);\n\t\tconst length = newPool.length;\n\n\t\tlet otherParticle;\n\t\tlet lengthSq;\n\t\tlet overlap;\n\t\tlet totalMass;\n\t\tlet averageMass1, averageMass2;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\totherParticle = newPool[i];\n\n\t\t\tif (otherParticle !== particle) {\n\t\t\t\tthis.delta.copy(otherParticle.p);\n\t\t\t\tthis.delta.sub(particle.p);\n\n\t\t\t\tlengthSq = this.delta.lengthSq();\n\t\t\t\tconst distance = particle.radius + otherParticle.radius;\n\n\t\t\t\tif (lengthSq <= distance * distance) {\n\t\t\t\t\toverlap = distance - Math.sqrt(lengthSq);\n\t\t\t\t\toverlap += 0.5;\n\n\t\t\t\t\ttotalMass = particle.mass + otherParticle.mass;\n\t\t\t\t\taverageMass1 = this.mass ? otherParticle.mass / totalMass : 0.5;\n\t\t\t\t\taverageMass2 = this.mass ? particle.mass / totalMass : 0.5;\n\n\t\t\t\t\tparticle.p.add(this.delta.clone().normalize().multiplyScalar(overlap * -averageMass1));\n\t\t\t\t\totherParticle.p.add(this.delta.normalize().multiplyScalar(overlap * averageMass2));\n\n\t\t\t\t\tthis.callback && this.callback(particle, otherParticle);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class CrossZone extends Behaviour {\n\n /**\n * Defines what happens if the particles come to the end of the specified zone\n *\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.CrossZone\n *\n * @param {Proton.Zone} zone \t\t\t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \t\t\twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \t\t\tthis behaviour's life\n * @param {String} \t\t[easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(zone, crossType, life, easing) {\n super(life, easing);\n\n this.reset(zone, crossType);\n this.name = 'CrossZone';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Zone} zone \t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \tthis behaviour's life\n * @param {String} \t\t[easing=easeLinear]\tthis behaviour's easing\n */\n reset(zone, crossType, life, easing) {\n this.zone = zone;\n this.zone.crossType = Util.initValue(crossType, 'dead');\n\n life && super.reset(life, easing);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n this.zone.crossing(particle);\n };\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Alpha extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Alpha\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(a, b, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(a, b);\n\t\tthis.name = 'Alpha';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Alpha\n\t * @instance\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Util.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Sets the new alpha value of the particle\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Alpha\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle A single Proton generated particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.transform.alphaA = this.a.getValue();\n\n\t\tif (this.same)\n\t\t\tparticle.transform.alphaB = particle.transform.alphaA;\n\t\telse\n\t\t\tparticle.transform.alphaB = this.b.getValue();\n\t}\n\n\t/**\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Alpha\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n \t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.alpha = particle.transform.alphaB + (particle.transform.alphaA - particle.transform.alphaB) * this.energy;\n\t\tif (particle.alpha < 0.001) particle.alpha = 0;\n\t}\n}\n","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Scale extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Scale\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(a, b, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(a, b);\n\t\tthis.name = 'Scale';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Util.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.transform.scaleA = this.a.getValue();\n\t\tparticle.transform.oldRadius = particle.radius;\n\t\tparticle.transform.scaleB = this.same ? particle.transform.scaleA : this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.scale = particle.transform.scaleB + (particle.transform.scaleA - particle.transform.scaleB) * this.energy;\n\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\n\t\tparticle.radius = particle.transform.oldRadius * particle.scale;\n\t}\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Rotate extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Rotate\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} [influence=Velocity] The rotation's influence\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(influence, b, style, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(influence, b, style);\n\t\tthis.name = 'Rotate';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} a\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, style, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\n\t\tthis.a = Util.setSpanValue(Util.initValue(a, 'Velocity'));\n\t\tthis.b = Util.setSpanValue(Util.initValue(b, 0));\n\t\tthis.style = Util.initValue(style, 'to');\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.rotation = this.a.getValue();\n\t\tparticle.transform.rotationA = this.a.getValue();\n\n\t\tif (!this.same) particle.transform.rotationB = this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tif (!this.same) {\n\t\t\tif (this.style === 'to' || this.style === 'TO' || this.style === '_') {\n\t\t\t\tparticle.rotation += particle.transform.rotationB + (particle.transform.rotationA - particle.transform.rotationB) * this.energy\n\t\t\t} else {\n\t\t\t\tparticle.rotation += particle.transform.rotationB;\n\t\t\t}\n\t\t} else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') {\n\t\t\t// beta...\n\t\t\tparticle.rotation = particle.getDirection();\n\t\t}\n\t}\n\n}\n","import ColorUtil from '../utils/ColorUtil';\nimport ArraySpan from '../math/ArraySpan';\nimport Behaviour from './Behaviour';\n\nexport default class Color extends Behaviour {\n\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Color\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = 'Color';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.a = ArraySpan.createArraySpan(a);\n this.b = ArraySpan.createArraySpan(b);\n\n life && super.reset(life, easing);\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {\n particle.color = this.a.getValue();\n particle.transform.colorA = ColorUtil.hexToRGB(particle.color);\n\n if (this.b)\n particle.transform.colorB = ColorUtil.hexToRGB(this.b.getValue());\n };\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n if (this.b) {\n this.calculate(particle, time, index);\n\n particle.transform.rgb.r = particle.transform.colorB.r + (particle.transform.colorA.r - particle.transform.colorB.r) * this.energy;\n particle.transform.rgb.g = particle.transform.colorB.g + (particle.transform.colorA.g - particle.transform.colorB.g) * this.energy;\n particle.transform.rgb.b = particle.transform.colorB.b + (particle.transform.colorA.b - particle.transform.colorB.b) * this.energy;\n\n particle.transform.rgb.r = Math.floor(particle.transform.rgb.r);\n particle.transform.rgb.g = Math.floor(particle.transform.rgb.g);\n particle.transform.rgb.b = Math.floor(particle.transform.rgb.b);\n\n } else {\n particle.transform.rgb.r = particle.transform.colorA.r;\n particle.transform.rgb.g = particle.transform.colorA.g;\n particle.transform.rgb.b = particle.transform.colorA.b;\n }\n };\n\n}","import Attraction from './Attraction';\n\nexport default class Repulsion extends Attraction {\n\n\t/**\n\t * The oppisite of Proton.Attraction - turns the force\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Attraction\n\t * @constructor\n\t * @alias Proton.Repulsion\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} force\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(targetPosition, force, radius, life, easing);\n\n\t\tthis.force *= -1;\n\t\tthis.name = 'Repulsion';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Repulsion\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tsuper.reset(targetPosition, force, radius, life, easing);\n\t\tthis.force *= -1;\n\t}\n}\n","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class GravityWell extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias GravityWell\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(centerPoint, force, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.name = 'GravityWell';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t */\n\treset(centerPoint, force, life, easing) {\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tlife && super.reset(life, easing);\n\t};\n\n\t/**\n\t * @inheritdoc\n\t */\n\tinitialize(particle) {\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y);\n\t\tconst distanceSq = this.distanceVec.lengthSq();\n\n\t\tif (distanceSq !== 0) {\n\t\t\tconst distance = this.distanceVec.length();\n\t\t\tconst factor = (this.force * time) / (distanceSq * distance);\n\n\t\t\tparticle.v.x += factor * this.distanceVec.x;\n\t\t\tparticle.v.y += factor * this.distanceVec.y;\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Initialize from './Initialize';\nimport MathUtils from '../math/MathUtils';\n\nexport default {\n\n\tinitialize(emitter, particle, initializes) {\n\t\tconst length = initializes.length;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tif (initializes[i] instanceof Initialize)\n\t\t\t\tinitializes[i].init(emitter, particle);\n\t\t\telse\n\t\t\t\tthis.init(emitter, particle, initializes[i]);\n\t\t}\n\n\t\tthis.bindEmitter(emitter, particle);\n\t},\n\n\t// init\n\tinit(emitter, particle, initialize) {\n\t\tUtil.setPrototypeByObject(particle, initialize);\n\t\tUtil.setVector2DByObject(particle, initialize);\n\t},\n\n\tbindEmitter(emitter, particle) {\n\t\tif (emitter.bindEmitter) {\n\t\t\tparticle.p.add(emitter.p);\n\t\t\tparticle.v.add(emitter.v);\n\t\t\tparticle.a.add(emitter.a);\n\n\t\t\tparticle.v.rotate(MathUtils.degreeTransform(emitter.rotation));\n\t\t}\n\t}\n}\n","import Util from '../utils/Util';\nimport Particle from '../core/Particle';\nimport EventDispatcher from '../events/EventDispatcher';\n\nimport Rate from '../initialize/Rate';\nimport InitializeUtil from '../initialize/InitializeUtil';\n\nexport default class Emitter extends Particle {\n\n\tstatic ID = 0;\n\n\t/**\n\t * You can use this emit particles.\n\t *\n\t * It will dispatch follow events:\n\t * PARTICLE_CREATED\n\t * PARTICLE_UPDATA\n\t * PARTICLE_DEAD\n\t *\n\t * @class Emitter\n\t * @constructor\n\t * @param {Object} pObj the parameters object;\n\t * for example {damping:0.01,bindEmitter:false}\n\t */\n\tconstructor(pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.initializes = [];\n\t\tthis.particles = [];\n\t\tthis.behaviours = [];\n\n\t\tthis.emitSpeed = 0;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = -1;\n\n\t\t/**\n\t\t * The friction coefficient for all particle emit by This;\n\t\t * @property damping\n\t\t * @type {Number}\n\t\t * @default 0.006\n\t\t */\n\t\tthis.damping = .006;\n\n\t\t/**\n\t\t * If bindEmitter the particles can bind this emitter's property;\n\t\t * @property bindEmitter\n\t\t * @type {Boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.bindEmitter = true;\n\n\t\t/**\n\t\t * The number of particles per second emit (a [particle]/b [s]);\n\t\t * @property rate\n\t\t * @type {Rate}\n\t\t * @default Rate(1, .1)\n\t\t */\n\t\tthis.rate = new Rate(1, .1);\n\n\t\tthis.id = `emitter_${Emitter.ID++}`;\n\t\tthis.name = 'Emitter';\n\t}\n\n\t/**\n\t * start emit particle\n\t * @method emit\n\t * @param {Number} emitTime begin emit time;\n\t * @param {String} life the life of this emitter\n\t */\n\temit(totalTime, life) {\n\t\tthis.stoped = false;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = Util.initValue(totalTime, Infinity);\n\n\t\tif (life === true || life === 'life' || life === 'destroy') {\n\t\t\tthis.life = totalTime === 'once' ? 1 : this.totalTime;\n\t\t} else if (!isNaN(life)) {\n\t\t\tthis.life = life;\n\t\t}\n\n\t\tthis.rate.init();\n\t}\n\n\t/**\n\t * stop emiting\n\t * @method stop\n\t */\n\tstop() {\n\t\tthis.totalTime = -1;\n\t\tthis.emitTime = 0;\n\t\tthis.stoped = true;\n\t}\n\n\tpreEmit(time) {\n\t\tlet oldStoped = this.stoped;\n\t\tlet oldEmitTime = this.emitTime;\n\t\tlet oldTotalTime = this.totalTime;\n\n\t\tthis.stoped = false;\n\t\tthis.emitTime = 0;\n\t\tthis.totalTime = time;\n\t\tthis.rate.init();\n\n\t\tconst step = 0.0167;\n\t\twhile (time > step) {\n\t\t\ttime -= step;\n\t\t\tthis.update(step);\n\t\t}\n\n\t\tthis.stoped = oldStoped;\n\t\tthis.emitTime = oldEmitTime + Math.max(time, 0);\n\t\tthis.totalTime = oldTotalTime;\n\t}\n\n\t/**\n\t * remove current all particles\n\t * @method removeAllParticles\n\t */\n\tremoveAllParticles() {\n\t\tlet i = this.particles.length;\n\t\twhile (i--) this.particles[i].dead = true;\n\t}\n\n\t/**\n\t * add initialize to this emitter\n\t * @method addSelfInitialize\n\t */\n\taddSelfInitialize(pObj) {\n\t\tif (pObj['init']) {\n\t\t\tpObj.init(this);\n\t\t} else {\n\t\t\tthis.initAll();\n\t\t}\n\t}\n\n\t/**\n\t * add the Initialize to particles;\n\t *\n\t * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\n\t * @method addInitialize\n\t * @param {Initialize} initialize like this new Radius(1, 12)\n\t */\n\taddInitialize(...rest) {\n\t\tlet i = rest.length;\n\t\twhile (i--)\n\t\t\tthis.initializes.push(rest[i]);\n\t}\n\n\t/**\n\t * remove the Initialize\n\t * @method removeInitialize\n\t * @param {Initialize} initialize a initialize\n\t */\n\tremoveInitialize(initializer) {\n\t\tconst index = this.initializes.indexOf(initializer);\n\t\tif (index > -1) this.initializes.splice(index, 1);\n\t}\n\n\t/**\n\t * remove all Initializes\n\t * @method removeInitializers\n\t */\n\tremoveAllInitializers() {\n\t\tUtil.destroyArray(this.initializes);\n\t}\n\n\t/**\n\t * add the Behaviour to particles;\n\t *\n\t * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\n\t * @method addBehaviour\n\t * @param {Behaviour} behaviour like this new Color('random')\n\t */\n\taddBehaviour(...rest) {\n\t\tlet i = arguments.length;\n\t\twhile (i--) {\n\t\t\tlet behaviour = rest[i];\n\t\t\tthis.behaviours.push(behaviour);\n\t\t\tif (behaviour.parents) behaviour.parents.push(this);\n\t\t}\n\t}\n\n\t/**\n\t * remove the Behaviour\n\t * @method removeBehaviour\n\t * @param {Behaviour} behaviour a behaviour\n\t */\n\tremoveBehaviour(behaviour) {\n\t\tlet index = this.behaviours.indexOf(behaviour);\n\t\tthis.behaviours.splice(index, 1);\n\n\t\tif (behaviour.parents) {\n\t\t\tindex = behaviour.parents.indexOf(behaviour);\n\t\t\tbehaviour.parents.splice(index, 1);\n\t\t}\n\n\t\treturn index;\n\t}\n\n\t/**\n\t * remove all behaviours\n\t * @method removeAllBehaviours\n\t */\n\tremoveAllBehaviours() {\n\t\tUtil.destroyArray(this.behaviours);\n\t}\n\n\t// emitter update\n\tupdate(time) {\n\t\tthis.age += time;\n\t\tif (this.age >= this.life || this.dead) this.destroy();\n\n\t\tthis.emitting(time);\n\t\tthis.integrate(time);\n\t}\n\n\tintegrate(time) {\n\t\tif (!this.parent) return;\n\n\t\tconst damping = 1 - this.damping;\n\t\tthis.parent.integrator.calculate(this, time, damping);\n\n\t\tconst length = this.particles.length;\n\t\tlet i, particle;\n\n\t\tfor (i = length - 1; i >= 0; i--) {\n\t\t\tparticle = this.particles[i];\n\n\t\t\t// particle update\n\t\t\tparticle.update(time, i);\n\t\t\tthis.parent.integrator.calculate(particle, time, damping);\n\t\t\tthis.dispatch('PARTICLE_UPDATE', particle);\n\n\t\t\t// check dead\n\t\t\tif (particle.dead) {\n\t\t\t\tthis.dispatch('PARTICLE_DEAD', particle);\n\n\t\t\t\tthis.parent.pool.expire(particle);\n\t\t\t\tthis.particles.splice(i, 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tdispatch(event, target) {\n\t\tthis.parent && this.parent.dispatchEvent(event, target);\n\t\tthis.bindEvent && this.dispatchEvent(event, target);\n\t}\n\n\temitting(time) {\n\t\tif (this.totalTime === 'once') {\n\t\t\tlet i;\n\t\t\tconst length = this.rate.getValue(99999);\n\n\t\t\tif (length > 0) this.emitSpeed = length;\n\t\t\tfor (i = 0; i < length; i++) this.createParticle();\n\t\t\tthis.totalTime = 'none';\n\t\t}\n\n\t\telse {\n\t\t\tthis.emitTime += time;\n\n\t\t\tif (this.emitTime < this.totalTime) {\n\t\t\t\tconst length = this.rate.getValue(time)\n\t\t\t\tlet i;\n\n\t\t\t\tif (length > 0) this.emitSpeed = length;\n\t\t\t\tfor (i = 0; i < length; i++) this.createParticle();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * create single particle;\n\t *\n\t * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\n\t * @method removeAllParticles\n\t */\n\tcreateParticle(initialize, behaviour) {\n\t\tconst particle = this.parent.pool.get(Particle);\n\t\tthis.setupParticle(particle, initialize, behaviour);\n\t\tthis.dispatch('PARTICLE_CREATED', particle);\n\n\t\treturn particle;\n\t}\n\n\tsetupParticle(particle, initialize, behaviour) {\n\t\tlet initializes = this.initializes;\n\t\tlet behaviours = this.behaviours;\n\n\t\tif (initialize) {\n\t\t\tinitializes = Util.isArray(initialize) ? initialize : [initialize];\n\t\t}\n\n\t\tif (behaviour) {\n\t\t\tbehaviour = Util.isArray(behaviour) ? behaviour : [behaviour];\n\t\t}\n\n\t\tparticle.reset();\n\t\tInitializeUtil.initialize(this, particle, initializes);\n\t\tparticle.addBehaviours(behaviours);\n\t\tparticle.parent = this;\n\n\t\tthis.particles.push(particle);\n\t}\n\n\tremove() {\n\t\tthis.stop();\n\t\tUtil.destroy(this.particles);\n\t}\n\n\t/**\n\t * Destory this Emitter\n\t * @method destroy\n\t */\n\tdestroy(slow) {\n\t\tthis.dead = true;\n\t\tthis.remove();\n\t\tthis.removeAllInitializers();\n\t\tthis.removeAllBehaviours();\n\t\tthis.parent && this.parent.removeEmitter(this);\n\t}\n\n}\n\nEventDispatcher.bind(Emitter);","import Emitter from './Emitter';\n\nexport default class BehaviourEmitter extends Emitter {\n\n\t/**\n\t * The BehaviourEmitter class inherits from Proton.Emitter\n\t *\n\t * use the BehaviourEmitter you can add behaviours to self;\n\t * @class Proton.BehaviourEmitter\n\t * @constructor\n\t * @param {Object} pObj the parameters object;\n\t */\n\tconstructor(pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.selfBehaviours = [];\n\t};\n\n\t/**\n\t * add the Behaviour to emitter;\n\t *\n\t * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\n\t * @method addSelfBehaviour\n\t * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\n\t */\n\taddSelfBehaviour(...rest) {\n\t\tconst length = rest.length;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\tthis.selfBehaviours.push(rest[i]);\n\t\t}\n\t};\n\n\t/**\n\t * remove the Behaviour for self\n\t * @method removeSelfBehaviour\n\t * @param {Proton.Behaviour} behaviour a behaviour\n\t */\n\tremoveSelfBehaviour(behaviour) {\n\t\tconst index = this.selfBehaviours.indexOf(behaviour);\n\t\tif (index > -1) this.selfBehaviours.splice(index, 1);\n\t};\n\n\tupdate(time) {\n\t\tsuper.update(time);\n\n\t\tif (!this.sleep) {\n\t\t\tconst length = this.selfBehaviours.length;\n\t\t\tlet i;\n\n\t\t\tfor (i = 0; i < length; i++) {\n\t\t\t\tthis.selfBehaviours[i].applyBehaviour(this, time, i);\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Emitter from './Emitter';\n\nexport default class FollowEmitter extends Emitter {\n\n\t/**\n\t * The FollowEmitter class inherits from Proton.Emitter\n\t *\n\t * use the FollowEmitter will emit particle when mousemoving\n\t *\n\t * @class Proton.FollowEmitter\n\t * @constructor\n\t * @param {Element} mouseTarget mouseevent's target;\n\t * @param {Number} ease the easing of following speed;\n\t * @default 0.7\n\t * @param {Object} pObj the parameters object;\n\t */\n\tconstructor(mouseTarget, ease, pObj) {\n\t\tsuper(pObj);\n\n\t\tthis.mouseTarget = Util.initValue(mouseTarget, window);\n\t\tthis.ease = Util.initValue(ease, 0.7);\n\n\t\tthis._allowEmitting = false;\n\t\tthis.initEventHandler();\n\t};\n\n\tinitEventHandler() {\n\t\tthis.mousemoveHandler = e => this.mousemove.call(this, e);\n\t\tthis.mousedownHandler = e => this.mousedown.call(this, e);\n\t\tthis.mouseupHandler = e => this.mouseup.call(this, e);\n\n\t\tthis.mouseTarget.addEventListener('mousemove', this.mousemoveHandler, false);\n\t}\n\n\t/**\n\t * start emit particle\n\t * @method emit\n\t */\n\temit() {\n\t\tthis._allowEmitting = true;\n\t}\n\n\t/**\n\t * stop emiting\n\t * @method stop\n\t */\n\tstop() {\n\t\tthis._allowEmitting = false;\n\t}\n\n\tmousemove(e) {\n\t\tif (e.layerX || e.layerX === 0) {\n\t\t\tthis.p.x += (e.layerX - this.p.x) * this.ease;\n\t\t\tthis.p.y += (e.layerY - this.p.y) * this.ease;\n\t\t} else if (e.offsetX || e.offsetX === 0) {\n\t\t\tthis.p.x += (e.offsetX - this.p.x) * this.ease;\n\t\t\tthis.p.y += (e.offsetY - this.p.y) * this.ease;\n\t\t}\n\n\t\tif (this._allowEmitting) super.emit('once');\n\t};\n\n\t/**\n\t * Destory this Emitter\n\t * @method destroy\n\t */\n\tdestroy() {\n\t\tsuper.destroy();\n\t\tthis.mouseTarget.removeEventListener('mousemove', this.mousemoveHandler, false);\n\t}\n\n}\n","import Pool from '../core/Pool';\nimport Util from '../utils/Util';\n\nexport default class BaseRenderer {\n\n constructor(element, stroke) {\n this.element = element;\n this.stroke = stroke;\n\n this.initHandler();\n\n this.circleConf = { isCircle: true };\n this.pool = new Pool();\n this.name = 'BaseRenderer';\n }\n\n setStroke(color, thinkness) {\n color = Util.initValue(color, '#000000');\n thinkness = Util.initValue(thinkness, 1);\n\n this.stroke = { color, thinkness };\n }\n\n initHandler() {\n this._protonUpdateHandler = () => { this.onProtonUpdate.call(this) };\n this._protonUpdateAfterHandler = () => { this.onProtonUpdateAfter.call(this) };\n this._emitterAddedHandler = (emitter) => { this.onEmitterAdded.call(this, emitter) };\n this._emitterRemovedHandler = (emitter) => { this.onEmitterRemoved.call(this, emitter) };\n this._particleCreatedHandler = (particle) => { this.onParticleCreated.call(this, particle) };\n this._particleUpdateHandler = (particle) => { this.onParticleUpdate.call(this, particle) };\n this._particleDeadHandler = (particle) => { this.onParticleDead.call(this, particle) };\n }\n\n init(proton) {\n this.parent = proton;\n\n proton.addEventListener('PROTON_UPDATE', this._protonUpdateHandler);\n proton.addEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\n\n proton.addEventListener('EMITTER_ADDED', this._emitterAddedHandler);\n proton.addEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\n\n proton.addEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\n proton.addEventListener('PARTICLE_UPDATE', this._particleUpdateHandler);\n proton.addEventListener('PARTICLE_DEAD', this._particleDeadHandler);\n }\n\n resize(width, height) { }\n\n destroy() {\n this.remove();\n }\n\n remove(proton) {\n this.parent.removeEventListener('PROTON_UPDATE', this._protonUpdateHandler);\n this.parent.removeEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler);\n\n this.parent.removeEventListener('EMITTER_ADDED', this._emitterAddedHandler);\n this.parent.removeEventListener('EMITTER_REMOVED', this._emitterRemovedHandler);\n\n this.parent.removeEventListener('PARTICLE_CREATED', this._particleCreatedHandler);\n this.parent.removeEventListener('PARTICLE_UPDATE', this._particleUpdateHandler);\n this.parent.removeEventListener('PARTICLE_DEAD', this._particleDeadHandler);\n\n this.parent = null;\n }\n\n onProtonUpdate() { }\n onProtonUpdateAfter() { }\n\n onEmitterAdded(emitter) { }\n onEmitterRemoved(emitter) { }\n\n onParticleCreated(particle) { }\n onParticleUpdate(particle) { }\n onParticleDead(particle) { }\n}","import ImgUtil from '../utils/ImgUtil';\nimport ColorUtil from '../utils/ColorUtil';\nimport MathUtils from '../math/MathUtils';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class CanvasRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.context = this.element.getContext('2d');\n this.bufferCache = {};\n\n this.name = 'CanvasRenderer';\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n onProtonUpdate() {\n this.context.clearRect(0, 0, this.element.width, this.element.height);\n }\n\n onParticleCreated(particle) {\n if (particle.body)\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n else\n particle.color = particle.color || '#ff0000';\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n if (particle.body instanceof Image) this.drawImage(particle);\n } else {\n this.drawCircle(particle);\n }\n }\n\n onParticleDead(particle) {\n particle.body = null;\n }\n\n // private\n addImg2Body(img, particle) {\n particle.body = img;\n }\n\n // private drawCircle\n drawImage(particle) {\n const w = particle.body.width * particle.scale | 0;\n const h = particle.body.height * particle.scale | 0;\n const x = particle.p.x - w / 2;\n const y = particle.p.y - h / 2;\n\n if (!!particle.color) {\n if (!particle.transform['buffer']) particle.transform.buffer = this.createBuffer(particle.body);\n\n const bufferContext = particle.transform.buffer.getContext('2d');\n bufferContext.clearRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\n bufferContext.globalAlpha = particle.alpha;\n bufferContext.drawImage(particle.body, 0, 0);\n\n bufferContext.globalCompositeOperation = 'source-atop';\n bufferContext.fillStyle = ColorUtil.rgbToHex(particle.transform.rgb);\n bufferContext.fillRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height);\n bufferContext.globalCompositeOperation = 'source-over';\n bufferContext.globalAlpha = 1;\n\n this.context.drawImage(particle.transform.buffer, 0, 0, particle.transform.buffer.width, particle.transform.buffer.height, x, y, w, h);\n } else {\n this.context.save();\n\n this.context.globalAlpha = particle.alpha;\n this.context.translate(particle.p.x, particle.p.y);\n this.context.rotate(MathUtils.degreeTransform(particle.rotation));\n this.context.translate(-particle.p.x, -particle.p.y);\n this.context.drawImage(particle.body, 0, 0, particle.body.width, particle.body.height, x, y, w, h);\n\n this.context.globalAlpha = 1;\n this.context.restore();\n }\n }\n\n // private drawCircle --\n drawCircle(particle) {\n if (particle.transform['rgb'])\n this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')';\n else\n this.context.fillStyle = particle.color;\n\n // draw circle\n this.context.beginPath();\n this.context.arc(particle.p.x, particle.p.y, particle.radius, 0, Math.PI * 2, true);\n\n if (this.stroke) {\n this.context.strokeStyle = this.stroke.color;\n this.context.lineWidth = this.stroke.thinkness;\n this.context.stroke();\n }\n\n this.context.closePath();\n this.context.fill();\n }\n\n // private createBuffer --\n createBuffer(image) {\n if (image instanceof Image) {\n const size = image.width + '_' + image.height;\n let canvas = this.bufferCache[size];\n\n if (!canvas) {\n canvas = document.createElement('canvas');\n canvas.width = image.width;\n canvas.height = image.height;\n this.bufferCache[size] = canvas;\n }\n\n return canvas;\n }\n }\n}","import DomUtil from '../utils/DomUtil';\nimport ImgUtil from '../utils/ImgUtil';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class DomRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.transform3d = false;\n\n this.name = 'DomRenderer';\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n this.element.appendChild(particle.body);\n }\n }\n\n onParticleUpdate(particle) {\n if (this.bodyReady(particle)) {\n if (this.transform3d)\n DomUtil.transform3d(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\n else\n DomUtil.transform(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation);\n\n particle.body.style.opacity = particle.alpha;\n if (particle.body.isCircle) {\n particle.body.style.backgroundColor = particle.color || '#ff0000';\n }\n }\n }\n\n onParticleDead(particle) {\n if (this.bodyReady(particle)) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n }\n\n bodyReady(particle) {\n return typeof particle.body === 'object' && particle.body && !particle.body.isInner;\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = this.pool.get(img, particle);\n DomUtil.resize(particle.body, img.width, img.height);\n\n this.element.appendChild(particle.body);\n }\n\n createBody(body, particle) {\n if (body.isCircle)\n return this.createCircle(particle);\n else\n return this.createSprite(body, particle);\n }\n\n // private --\n createCircle(particle) {\n const dom = DomUtil.createDiv(`${particle.id}_dom`, 2 * particle.radius, 2 * particle.radius);\n dom.style.borderRadius = `${particle.radius}px`;\n\n if (this.stroke) {\n dom.style.borderColor = this.stroke.color;\n dom.style.borderWidth = `${this.stroke.thinkness}px`;\n }\n dom.isCircle = true;\n\n return dom;\n }\n\n createSprite(body, particle) {\n const url = typeof body === 'string' ? body : body.src;\n const dom = DomUtil.createDiv(`${particle.id}_dom`, body.width, body.height);\n dom.style.backgroundImage = `url(${url})`;\n\n return dom;\n }\n\n}","import BaseRenderer from './BaseRenderer';\n\nexport default class EaselRenderer extends BaseRenderer {\n\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.name = 'EaselRenderer';\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n this.createSprite(particle);\n } else {\n this.createCircle(particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n particle.body.x = particle.p.x;\n particle.body.y = particle.p.y;\n\n particle.body.alpha = particle.alpha;\n particle.body.scaleX = particle.body.scaleY = particle.scale;\n particle.body.rotation = particle.rotation;\n }\n }\n\n onParticleDead(particle) {\n if (particle.body) {\n particle.body.parent && particle.body.parent.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n if (particle.graphics) this.pool.expire(particle.graphics);\n }\n\n // private\n createSprite(particle) {\n particle.body = this.pool.get(particle.body);\n\n if (particle.body.parent) return;\n if (particle.body['image']) {\n particle.body.regX = particle.body.image.width / 2;\n particle.body.regY = particle.body.image.height / 2;\n }\n }\n\n createCircle(particle) {\n const graphics = this.pool.get(createjs.Graphics);\n\n if (this.stroke) {\n if (this.stroke instanceof String)\n graphics.beginStroke(this.stroke);\n else\n graphics.beginStroke('#000000');\n }\n graphics.beginFill(particle.color || '#ff0000').drawCircle(0, 0, particle.radius);\n\n const shape = this.pool.get(createjs.Shape, [graphics]);\n\n particle.body = shape;\n particle.graphics = graphics;\n }\n\n}","import Rectangle from '../math/Rectangle';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class PixelRenderer extends BaseRenderer {\n\n constructor(element, rectangle) {\n super(element);\n\n this.context = this.element.getContext('2d');\n this.imageData = null;\n this.rectangle = null;\n this.rectangle = rectangle;\n this.createImageData(rectangle);\n\n this.name = 'PixelRenderer';\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n createImageData(rectangle) {\n this.rectangle = rectangle ? rectangle : new Rectangle(0, 0, this.element.width, this.element.height);\n this.imageData = this.context.createImageData(this.rectangle.width, this.rectangle.height);\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\n }\n\n onProtonUpdate() {\n this.context.clearRect(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\n this.imageData = this.context.getImageData(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height);\n }\n\n onProtonUpdateAfter() {\n this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y);\n }\n\n onParticleCreated(particle) {}\n\n onParticleUpdate(particle) {\n if (this.imageData) {\n this.setPixel(this.imageData, Math.floor(particle.p.x - this.rectangle.x), Math.floor(particle.p.y - this.rectangle.y), particle);\n }\n }\n\n setPixel(imagedata, x, y, particle) {\n const rgb = particle.transform.rgb;\n\n if ((x < 0) || (x > this.element.width) || (y < 0) || (y > this.elementwidth))\n return;\n\n const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4;\n\n imagedata.data[i] = rgb.r;\n imagedata.data[i + 1] = rgb.g;\n imagedata.data[i + 2] = rgb.b;\n imagedata.data[i + 3] = particle.alpha * 255;\n }\n\n onParticleDead(particle) {\n\n }\n\n}","import ColorUtil from '../utils/ColorUtil';\nimport MathUtils from '../math/MathUtils';\nimport BaseRenderer from './BaseRenderer';\n\nexport default class PixiRenderer extends BaseRenderer {\n\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.setColor = false;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.name = 'PixiRenderer';\n }\n\n onProtonUpdate() { }\n\n /**\n * @param particle\n */\n onParticleCreated(particle) {\n if (particle.body) {\n particle.body = this.pool.get(particle.body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n /**\n * @param particle\n */\n onParticleUpdate(particle) {\n this.transform(particle, particle.body);\n if (this.setColor) particle.body.tint = ColorUtil.getHex16FromParticle(particle);\n }\n\n /**\n * @param particle\n */\n onParticleDead(particle) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n destroy(particles) {\n super.destroy();\n this.pool.destroy();\n\n let i = particles.length;\n while (i--) {\n let particle = particles[i];\n if (particle.body) {\n this.element.removeChild(particle.body);\n }\n }\n }\n\n transform(particle, target) {\n target.x = particle.p.x;\n target.y = particle.p.y;\n\n target.alpha = particle.alpha;\n\n target.scale.x = particle.scale;\n target.scale.y = particle.scale;\n\n // using cached version of MathUtils.PI_180 for slight performance increase.\n target.rotation = particle.rotation * MathUtils.PI_180; // MathUtils.PI_180;\n }\n\n createBody(body, particle) {\n if (body.isCircle)\n return this.createCircle(particle);\n else\n return this.createSprite(body);\n }\n\n createSprite(body) {\n const sprite = body.isInner ? PIXI.Sprite.fromImage(body.src) : new PIXI.Sprite(body);\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n\n return sprite;\n }\n\n createCircle(particle) {\n const graphics = new PIXI.Graphics();\n\n if (this.stroke) {\n const stroke = this.stroke instanceof String ? this.stroke : 0x000000;\n graphics.beginStroke(stroke);\n }\n\n graphics.beginFill(particle.color || 0x008ced);\n graphics.drawCircle(0, 0, particle.radius);\n graphics.endFill();\n\n return graphics;\n }\n}","import Mat3 from '../math/Mat3';\n\nexport default class MStack {\n\n\tconstructor() {\n\t\tthis.mats = [];\n\t\tthis.size = 0;\n\n\t\tfor (let i = 0; i < 20; i++) this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\n\t}\n\n\tset(m, i) {\n\t\tif (i === 0)\n\t\t\tMat3.set(m, this.mats[0]);\n\t\telse\n\t\t\tMat3.multiply(this.mats[i - 1], m, this.mats[i]);\n\n\t\tthis.size = Math.max(this.size, i + 1);\n\t}\n\n\tpush(m) {\n\t\tif (this.size === 0)\n\t\t\tMat3.set(m, this.mats[0]);\n\t\telse\n\t\t\tMat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\n\n\t\tthis.size++;\n\t}\n\n\tpop() {\n\t\tif (this.size > 0)\n\t\t\tthis.size--;\n\t}\n\n\ttop() {\n\t\treturn (this.mats[this.size - 1]);\n\t}\n}","import Mat3 from '../math/Mat3';\nimport BaseRenderer from './BaseRenderer';\n\nimport Util from '../utils/Util';\nimport ImgUtil from '../utils/ImgUtil';\nimport MStack from '../utils/MStack';\nimport DomUtil from '../utils/DomUtil';\nimport WebGLUtil from '../utils/WebGLUtil';\nimport MathUtils from '../math/MathUtils';\n\nexport default class WebGLRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.gl = this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false });\n if (!this.gl) alert('Sorry your browser do not suppest WebGL!');\n\n this.initVar();\n this.setMaxRadius();\n this.initShaders();\n this.initBuffers();\n\n this.gl.blendEquation(this.gl.FUNC_ADD);\n this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);\n this.gl.enable(this.gl.BLEND);\n\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.name = 'WebGLRenderer';\n }\n\n init(proton) {\n super.init(proton);\n this.resize(this.element.width, this.element.height);\n }\n\n resize(width, height) {\n this.umat[4] = -2;\n this.umat[7] = 1;\n\n this.smat[0] = 1 / width;\n this.smat[4] = 1 / height;\n\n this.mstack.set(this.umat, 0);\n this.mstack.set(this.smat, 1);\n\n this.gl.viewport(0, 0, width, height);\n this.element.width = width;\n this.element.height = height;\n }\n\n setMaxRadius(radius) {\n this.circleCanvasURL = this.createCircle(radius);\n }\n\n getVertexShader() {\n const vsSource = ['uniform vec2 viewport;', 'attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 tMat;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'void main() {', 'vec3 v = tMat * vec3(aVertexPosition, 1.0);', 'gl_Position = vec4(v.x, v.y, 0, 1);', 'vTextureCoord = aTextureCoord;', 'alpha = tMat[0][2];', '}'].join('\\n');\n return vsSource;\n }\n\n getFragmentShader() {\n const fsSource = ['precision mediump float;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'uniform sampler2D uSampler;', 'uniform vec4 color;', 'uniform bool useTexture;', 'uniform vec3 uColor;', 'void main() {', 'vec4 textureColor = texture2D(uSampler, vTextureCoord);', 'gl_FragColor = textureColor * vec4(uColor, 1.0);', 'gl_FragColor.w *= alpha;', '}'].join('\\n');\n return fsSource;\n }\n\n initVar() {\n this.mstack = new MStack();\n this.umat = Mat3.create([2, 0, 1, 0, -2, 0, -1, 1, 1]);\n this.smat = Mat3.create([1 / 100, 0, 1, 0, 1 / 100, 0, 0, 0, 1]);\n this.texturebuffers = {};\n }\n\n blendEquation(A) {\n this.gl.blendEquation(this.gl[A]);\n }\n\n blendFunc(A, B) {\n this.gl.blendFunc(this.gl[A], this.gl[B]);\n }\n\n getShader(gl, str, fs) {\n const shader = fs ? gl.createShader(gl.FRAGMENT_SHADER) : gl.createShader(gl.VERTEX_SHADER);\n\n gl.shaderSource(shader, str);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n }\n\n initShaders() {\n const fragmentShader = this.getShader(this.gl, this.getFragmentShader(), true);\n const vertexShader = this.getShader(this.gl, this.getVertexShader(), false);\n\n this.sprogram = this.gl.createProgram();\n this.gl.attachShader(this.sprogram, vertexShader);\n this.gl.attachShader(this.sprogram, fragmentShader);\n this.gl.linkProgram(this.sprogram);\n\n if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS))\n alert('Could not initialise shaders');\n\n this.gl.useProgram(this.sprogram);\n this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, 'aVertexPosition');\n this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, 'aTextureCoord');\n this.gl.enableVertexAttribArray(this.sprogram.tca);\n this.gl.enableVertexAttribArray(this.sprogram.vpa);\n\n this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, 'tMat');\n this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, 'uSampler');\n this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, 'useTexture');\n this.sprogram.color = this.gl.getUniformLocation(this.sprogram, 'uColor');\n this.gl.uniform1i(this.sprogram.useTex, 1);\n };\n\n initBuffers() {\n const vs = [0, 3, 1, 0, 2, 3];\n let idx;\n\n this.unitIBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vs), this.gl.STATIC_DRAW);\n\n let i;\n let ids = [];\n for (i = 0; i < 100; i++) ids.push(i);\n idx = new Uint16Array(ids);\n\n this.unitI33 = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitI33);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n\n ids = [];\n for (i = 0; i < 100; i++) ids.push(i, i + 1, i + 2);\n idx = new Uint16Array(ids);\n\n this.stripBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.stripBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n };\n\n createCircle(raidus) {\n this.circleCanvasRadius = WebGLUtil.nhpot(Util.initValue(raidus, 32));\n const canvas = DomUtil.createCanvas('circle_canvas', this.circleCanvasRadius * 2, this.circleCanvasRadius * 2);\n const context = canvas.getContext('2d');\n\n context.beginPath();\n context.arc(this.circleCanvasRadius, this.circleCanvasRadius, this.circleCanvasRadius, 0, Math.PI * 2, true);\n context.closePath();\n context.fillStyle = '#FFF';\n context.fill();\n\n return canvas.toDataURL();\n };\n\n drawImg2Canvas(particle) {\n const _w = particle.body.width;\n const _h = particle.body.height;\n\n const _width = WebGLUtil.nhpot(particle.body.width);\n const _height = WebGLUtil.nhpot(particle.body.height);\n\n const _scaleX = particle.body.width / _width;\n const _scaleY = particle.body.height / _height;\n\n if (!this.texturebuffers[particle.transform.src])\n this.texturebuffers[particle.transform.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\n\n particle.transform.texture = this.texturebuffers[particle.transform.src][0];\n particle.transform.vcBuffer = this.texturebuffers[particle.transform.src][1];\n particle.transform.tcBuffer = this.texturebuffers[particle.transform.src][2];\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _scaleX, 0.0, 0.0, _scaleY, _scaleY, _scaleY]), this.gl.STATIC_DRAW);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _w, 0.0, 0.0, _h, _w, _h]), this.gl.STATIC_DRAW);\n\n const context = particle.transform.canvas.getContext('2d');\n const data = context.getImageData(0, 0, _width, _height);\n\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture);\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST);\n this.gl.generateMipmap(this.gl.TEXTURE_2D);\n\n particle.transform.textureLoaded = true;\n particle.transform.textureWidth = _w;\n particle.transform.textureHeight = _h;\n }\n\n onProtonUpdate() {\n // this.gl.clearColor(0, 0, 0, 1);\n // this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\n }\n\n onParticleCreated(particle) {\n particle.transform.textureLoaded = false;\n particle.transform.tmat = Mat3.create();\n particle.transform.tmat[8] = 1;\n particle.transform.imat = Mat3.create();\n particle.transform.imat[8] = 1;\n\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle);\n particle.transform.oldScale = particle.radius / this.circleCanvasRadius;\n }\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = img;\n particle.transform.src = img.src;\n particle.transform.canvas = ImgUtil.getCanvasFromCache(img);\n particle.transform.oldScale = 1;\n\n this.drawImg2Canvas(particle);\n }\n\n onParticleUpdate(particle) {\n if (particle.transform.textureLoaded) {\n this.updateMatrix(particle);\n\n this.gl.uniform3f(this.sprogram.color, particle.transform.rgb.r / 255, particle.transform.rgb.g / 255, particle.transform.rgb.b / 255);\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture);\n this.gl.uniform1i(this.sprogram.samplerUniform, 0);\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n\n this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0);\n\n this.mstack.pop();\n }\n }\n\n onParticleDead(particle) { }\n\n updateMatrix(particle) {\n const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.transform.textureWidth / 2, -particle.transform.textureHeight / 2);\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\n\n const angel = particle.rotation * (MathUtils.PI_180);\n const rotationMatrix = WebGLUtil.makeRotation(angel);\n\n const scale = particle.scale * particle.transform.oldScale;\n const scaleMatrix = WebGLUtil.makeScale(scale, scale);\n let matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix);\n\n matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix);\n matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix);\n\n Mat3.inverse(matrix, particle.transform.imat);\n matrix[2] = particle.alpha;\n\n this.mstack.push(matrix);\n }\n}","import BaseRenderer from './BaseRenderer';\n\nexport default class CustomRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.name = 'CustomRenderer';\n }\n\n}","import Zone from './Zone';\nimport Util from '../utils/Util';\nimport MathUtils from '../math/MathUtils';\n\nexport default class LineZone extends Zone {\n\n\tconstructor(x1, y1, x2, y2, direction) {\n\t\tsuper();\n\n\t\tif (x2 - x1 >= 0) {\n\t\t\tthis.x1 = x1;\n\t\t\tthis.y1 = y1;\n\t\t\tthis.x2 = x2;\n\t\t\tthis.y2 = y2;\n\t\t} else {\n\t\t\tthis.x1 = x2;\n\t\t\tthis.y1 = y2;\n\t\t\tthis.x2 = x1;\n\t\t\tthis.y2 = y1;\n\t\t}\n\n\t\tthis.dx = this.x2 - this.x1;\n\t\tthis.dy = this.y2 - this.y1;\n\n\t\tthis.minx = Math.min(this.x1, this.x2);\n\t\tthis.miny = Math.min(this.y1, this.y2);\n\t\tthis.maxx = Math.max(this.x1, this.x2);\n\t\tthis.maxy = Math.max(this.y1, this.y2);\n\n\t\tthis.dot = this.x2 * this.y1 - this.x1 * this.y2;\n\t\tthis.xxyy = this.dx * this.dx + this.dy * this.dy;\n\n\t\tthis.gradient = this.getGradient();\n\t\tthis.length = this.getLength();\n\t\tthis.direction = Util.initValue(direction, '>');\n\t}\n\n\tgetPosition() {\n\t\tthis.random = Math.random();\n\t\tthis.vector.x = this.x1 + this.random * this.length * Math.cos(this.gradient);\n\t\tthis.vector.y = this.y1 + this.random * this.length * Math.sin(this.gradient);\n\n\t\treturn this.vector;\n\t}\n\n\tgetDirection(x, y) {\n\t\tconst A = this.dy;\n\t\tconst B = -this.dx;\n\t\tconst C = this.dot;\n\t\tconst D = B === 0 ? 1 : B;\n\n\t\tif ((A * x + B * y + C) * D > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\tgetDistance(x, y) {\n\t\tconst A = this.dy;\n\t\tconst B = -this.dx;\n\t\tconst C = this.dot;\n\t\tconst D = (A * x + B * y + C);\n\n\t\treturn D / Math.sqrt(this.xxyy);\n\t}\n\n\tgetSymmetric(v) {\n\t\tconst tha2 = v.getGradient();\n\t\tconst tha1 = this.getGradient();\n\t\tconst tha = 2 * (tha1 - tha2);\n\n\t\tconst oldx = v.x;\n\t\tconst oldy = v.y;\n\n\t\tv.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n\t\tv.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n\n\t\treturn v;\n\t}\n\n\tgetGradient() {\n\t\treturn Math.atan2(this.dy, this.dx);\n\t}\n\n\trangeOut(particle) {\n\t\tconst angle = Math.abs(this.getGradient());\n\n\t\tif (angle <= MathUtils.PI / 4) {\n\t\t\tif (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\n\t\t} else {\n\t\t\tif (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tgetLength() {\n\t\treturn Math.sqrt(this.dx * this.dx + this.dy * this.dy)\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (this.direction === '>' || this.direction === 'R' || this.direction === 'right' || this.direction === 'down') {\n\t\t\t\tif (!this.rangeOut(particle)) return;\n\t\t\t\tif (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n\t\t\t} else {\n\t\t\t\tif (!this.rangeOut(particle)) return;\n\t\t\t\tif (!this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (!this.rangeOut(particle)) return;\n\n\t\t\tif (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\n\t\t\t\tif (this.dx === 0) {\n\t\t\t\t\tparticle.v.x *= -1;\n\t\t\t\t} else if (this.dy === 0) {\n\t\t\t\t\tparticle.v.y *= -1;\n\t\t\t\t} else {\n\t\t\t\t\tthis.getSymmetric(particle.v);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'cross') {\n\t\t\tif (this.alert) {\n\t\t\t\tconsole.error('Sorry lineZone does not support cross method');\n\t\t\t\tthis.alert = false;\n\t\t\t}\n\t\t}\n\t}\n}","import Zone from './Zone';\nimport MathUtils from '../math/MathUtils';\n\nexport default class CircleZone extends Zone {\n\n constructor(x, y, radius) {\n super();\n\n this.x = x;\n this.y = y;\n this.radius = radius;\n\n this.angle = 0;\n this.center = { x, y };\n }\n\n getPosition() {\n this.random = Math.random();\n this.angle = MathUtils.PIx2 * Math.random();\n\n this.vector.x = this.x + this.random * this.radius * Math.cos(this.angle);\n this.vector.y = this.y + this.random * this.radius * Math.sin(this.angle);\n\n return this.vector;\n }\n\n setCenter(x, y) {\n this.center.x = x;\n this.center.y = y;\n }\n\n crossing(particle) {\n const d = particle.p.distanceTo(this.center);\n\n if (this.crossType === 'dead') {\n if (d - particle.radius > this.radius)\n particle.dead = true;\n } else if (this.crossType === 'bound') {\n if (d + particle.radius >= this.radius)\n this.getSymmetric(particle);\n } else if (this.crossType === 'cross') {\n if (this.alert) {\n alert('Sorry CircleZone does not support cross method');\n this.alert = false;\n }\n }\n }\n\n getSymmetric(particle) {\n let tha2 = particle.v.getGradient();\n let tha1 = this.getGradient(particle);\n\n let tha = 2 * (tha1 - tha2);\n let oldx = particle.v.x;\n let oldy = particle.v.y;\n\n particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n }\n\n getGradient(particle) {\n return -MathUtils.PI_2 + Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x);\n }\n}","import Zone from './Zone';\n\nexport default class RectZone extends Zone {\n\n\tconstructor(x, y, width, height) {\n\t\tsuper();\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}\n\n\tgetPosition() {\n\t\tthis.vector.x = this.x + Math.random() * this.width;\n\t\tthis.vector.y = this.y + Math.random() * this.height;\n\n\t\treturn this.vector;\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (particle.p.x + particle.radius < this.x)\n\t\t\t\tparticle.dead = true;\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width)\n\t\t\t\tparticle.dead = true;\n\n\t\t\tif (particle.p.y + particle.radius < this.y)\n\t\t\t\tparticle.dead = true;\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height)\n\t\t\t\tparticle.dead = true;\n\t\t}\n\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (particle.p.x - particle.radius < this.x) {\n\t\t\t\tparticle.p.x = this.x + particle.radius;\n\t\t\t\tparticle.v.x *= -1;\n\t\t\t} else if (particle.p.x + particle.radius > this.x + this.width) {\n\t\t\t\tparticle.p.x = this.x + this.width - particle.radius;\n\t\t\t\tparticle.v.x *= -1;\n\t\t\t}\n\n\t\t\tif (particle.p.y - particle.radius < this.y) {\n\t\t\t\tparticle.p.y = this.y + particle.radius;\n\t\t\t\tparticle.v.y *= -1;\n\t\t\t} else if (particle.p.y + particle.radius > this.y + this.height) {\n\t\t\t\tparticle.p.y = this.y + this.height - particle.radius;\n\t\t\t\tparticle.v.y *= -1;\n\t\t\t}\n\t\t}\n\n\t\telse if (this.crossType === 'cross') {\n\t\t\tif (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\n\t\t\t\tparticle.p.x = this.x + this.width + particle.radius;\n\t\t\telse if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0)\n\t\t\t\tparticle.p.x = this.x - particle.radius;\n\n\t\t\tif (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\n\t\t\t\tparticle.p.y = this.y + this.height + particle.radius;\n\t\t\telse if (particle.p.y - particle.radius > this.y + this.height && particle.v.y >= 0)\n\t\t\t\tparticle.p.y = this.y - particle.radius;\n\t\t}\n\t}\n}","import Zone from './Zone';\nimport Util from '../utils/Util';\n\nexport default class ImageZone extends Zone {\n\n\tconstructor(imageData, x, y, d) {\n\t\tsuper();\n\n\t\tthis.reset(imageData, x, y, d);\n\t}\n\n\treset(imageData, x, y, d) {\n\t\tthis.imageData = imageData;\n\t\tthis.x = Util.initValue(x, 0);\n\t\tthis.y = Util.initValue(y, 0);\n\t\tthis.d = Util.initValue(d, 2);\n\n\t\tthis.vectors = [];\n\t\tthis.setVectors();\n\t}\n\n\tsetVectors() {\n\t\tlet i, j;\n\t\tconst length1 = this.imageData.width;\n\t\tconst length2 = this.imageData.height;\n\n\t\tfor (i = 0; i < length1; i += this.d) {\n\t\t\tfor (j = 0; j < length2; j += this.d) {\n\t\t\t\tlet index = ((j >> 0) * length1 + (i >> 0)) * 4;\n\n\t\t\t\tif (this.imageData.data[index + 3] > 0) {\n\t\t\t\t\tthis.vectors.push({ x: i + this.x, y: j + this.y });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this.vector;\n\t}\n\n\tgetBound(x, y) {\n\t\tvar index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\t\tif (this.imageData.data[index + 3] > 0)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\n\tgetPosition() {\n\t\treturn this.vector.copy(this.vectors[Math.floor(Math.random() * this.vectors.length)]);\n\t}\n\n\tgetColor(x, y) {\n\t\tx -= this.x;\n\t\ty -= this.y;\n\t\tvar i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\n\t\treturn {\n\t\t\tr: this.imageData.data[i],\n\t\t\tg: this.imageData.data[i + 1],\n\t\t\tb: this.imageData.data[i + 2],\n\t\t\ta: this.imageData.data[i + 3]\n\t\t};\n\t}\n\n\tcrossing(particle) {\n\t\tif (this.crossType === 'dead') {\n\t\t\tif (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n\t\t\t\tparticle.dead = true;\n\t\t\telse\n\t\t\t\tparticle.dead = false;\n\t\t}\n\t\telse if (this.crossType === 'bound') {\n\t\t\tif (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n\t\t\t\tparticle.v.negate();\n\t\t}\n\t}\n}","import ColorUtil from '../utils/ColorUtil';\nimport CircleZone from '../zone/CircleZone';\nimport PointZone from '../zone/PointZone';\nimport LineZone from '../zone/LineZone';\nimport RectZone from '../zone/RectZone';\n\nexport default {\n\taddEventListener(proton, fun) {\n\t\tproton.addEventListener('PROTON_UPDATE_AFTER', () => fun());\n\t},\n\n\tgetStyle(color) {\n\t\tconst rgb = ColorUtil.hexToRGB(color || '#ff0000');\n\t\treturn `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\n\t},\n\n\tdrawZone(proton, canvas, zone, clear) {\n\t\tconst context = canvas.getContext('2d');\n\t\tconst style = this.getStyle();\n\n\t\tthis.addEventListener(proton, () => {\n\t\t\tif (clear)\n\t\t\t\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\n\t\t\tif (zone instanceof PointZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.fillStyle = style;\n\t\t\t\tcontext.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\n\t\t\t\tcontext.fill();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof LineZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.moveTo(zone.x1, zone.y1);\n\t\t\t\tcontext.lineTo(zone.x2, zone.y2);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof RectZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.drawRect(zone.x, zone.y, zone.width, zone.height);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t} else if (zone instanceof CircleZone) {\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.strokeStyle = style;\n\t\t\t\tcontext.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\n\t\t\t\tcontext.stroke();\n\t\t\t\tcontext.closePath();\n\t\t\t}\n\t\t});\n\t},\n\n\tdrawEmitter(proton, canvas, emitter, clear) {\n\t\tconst context = canvas.getContext('2d');\n\t\tconst style = this.getStyle();\n\n\t\tthis.addEventListener(proton, () => {\n\t\t\tif (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n\t\t\tcontext.beginPath();\n\t\t\tcontext.fillStyle = style;\n\t\t\tcontext.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\n\t\t\tcontext.fill();\n\t\t\tcontext.closePath();\n\t\t});\n\t}\n}","import Proton from './core/Proton';\nimport Particle from './core/Particle';\nimport Pool from './core/Pool';\n\nimport Util from './utils/Util';\nimport ColorUtil from './utils/ColorUtil';\nimport MathUtils from './math/MathUtils';\nimport Vector2D from './math/Vector2D';\nimport Polar2D from './math/Polar2D';\nimport Mat3 from './math/Mat3';\nimport Span from './math/Span';\nimport ArraySpan from './math/ArraySpan';\nimport Rectangle from './math/Rectangle';\nimport ease from './math/ease';\n\nimport Rate from './initialize/Rate';\nimport Initialize from './initialize/Initialize';\nimport Life from './initialize/Life';\nimport Position from './initialize/Position';\nimport Velocity from './initialize/Velocity';\nimport Mass from './initialize/Mass';\nimport Radius from './initialize/Radius';\nimport Body from './initialize/Body';\n\nimport Behaviour from './behaviour/Behaviour';\nimport Force from './behaviour/Force';\nimport Attraction from './behaviour/Attraction';\nimport RandomDrift from './behaviour/RandomDrift';\nimport Gravity from './behaviour/Gravity';\nimport Collision from './behaviour/Collision';\nimport CrossZone from './behaviour/CrossZone';\nimport Alpha from './behaviour/Alpha';\nimport Scale from './behaviour/Scale';\nimport Rotate from './behaviour/Rotate';\nimport Color from './behaviour/Color';\nimport Repulsion from './behaviour/Repulsion';\nimport GravityWell from './behaviour/GravityWell';\n\nimport Emitter from './emitter/Emitter';\nimport BehaviourEmitter from './emitter/BehaviourEmitter';\nimport FollowEmitter from './emitter/FollowEmitter';\n\nimport CanvasRenderer from './render/CanvasRenderer';\nimport DomRenderer from './render/DomRenderer';\nimport EaselRenderer from './render/EaselRenderer';\nimport PixelRenderer from './render/PixelRenderer';\nimport PixiRenderer from './render/PixiRenderer';\nimport WebGLRenderer from './render/WebGLRenderer';\nimport CustomRenderer from './render/CustomRenderer';\n\nimport Zone from './zone/Zone';\nimport LineZone from './zone/LineZone';\nimport CircleZone from './zone/CircleZone';\nimport PointZone from './zone/PointZone';\nimport RectZone from './zone/RectZone';\nimport ImageZone from './zone/ImageZone';\n\nimport Debug from './debug/Debug';\n\n// namespace\nProton.Particle = Proton.P = Particle;\nProton.Pool = Pool;\n\nProton.Util = Util;\nProton.ColorUtil = ColorUtil;\nProton.MathUtils = MathUtils;\nProton.Vector2D = Proton.Vector = Vector2D;\nProton.Polar2D = Proton.Polar = Polar2D;\nProton.ArraySpan = ArraySpan;\nProton.Rectangle = Rectangle;\nProton.Rate = Rate;\nProton.ease = ease;\nProton.Span = Span;\nProton.Mat3 = Mat3;\nProton.getSpan = (a, b, center) => new Span(a, b, center);\nProton.createArraySpan = ArraySpan.createArraySpan;\n\nProton.Initialize = Proton.Init = Initialize;\nProton.Life = Proton.L = Life;\nProton.Position = Proton.P = Position;\nProton.Velocity = Proton.V = Velocity;\nProton.Mass = Proton.M = Mass;\nProton.Radius = Proton.R = Radius;\nProton.Body = Proton.B = Body;\n\nProton.Behaviour = Behaviour;\nProton.Force = Proton.F = Force;\nProton.Attraction = Proton.A = Attraction;\nProton.RandomDrift = Proton.RD = RandomDrift;\nProton.Gravity = Proton.G = Gravity;\nProton.Collision = Collision;\nProton.CrossZone = CrossZone;\nProton.Alpha = Proton.A = Alpha;\nProton.Scale = Proton.S = Scale;\nProton.Rotate = Rotate;\nProton.Color = Color;\nProton.Repulsion = Repulsion;\nProton.GravityWell = GravityWell;\n\nProton.Emitter = Emitter;\nProton.BehaviourEmitter = BehaviourEmitter;\nProton.FollowEmitter = FollowEmitter;\n\nProton.Zone = Zone;\nProton.LineZone = LineZone;\nProton.CircleZone = CircleZone;\nProton.PointZone = PointZone;\nProton.RectZone = RectZone;\nProton.ImageZone = ImageZone;\n\nProton.CanvasRenderer = CanvasRenderer;\nProton.DomRenderer = DomRenderer;\nProton.EaselRenderer = EaselRenderer;\nProton.PixiRenderer = PixiRenderer;\nProton.PixelRenderer = PixelRenderer;\nProton.WebGLRenderer = Proton.WebGlRenderer = WebGLRenderer;\nProton.CustomRenderer = CustomRenderer;\n\nProton.Debug = Debug;\n\nObject.assign(Proton, ease);\n\n// export\nexport default Proton;"],"names":["PI","MathUtils","a","b","INT","Math","floor","random","center","f","this","randomAToB","num","toString","slice","Span","isArray","length","randomFloating","Util","initValue","i","tx","ty","angleInRadians","c","cos","s","sin","sx","sy","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b01","b02","b10","b11","b12","b20","b21","b22","id","width","height","position","dom","document","createElement","style","opacity","transform","resize","marginLeft","marginTop","div","x","y","scale","rotate","willChange","css3","key","val","bkey","charAt","toUpperCase","substr","IMG_CACHE","CANVAS_CACHE","context","image","rect","drawImage","imagedata","getImageData","clearRect","img","callback","param","src","Image","onload","e","target","WebGLUtil","canvas","DomUtil","createCanvas","getContext","value","defaults","Object","prototype","call","array","obj","ignore","o","indexOf","constructor","args","concat","bind","apply","pOBJ","hasProp","p","v","copy","undefined","prototypeObject","filters","singleProp","hasOwnProperty","getSpanValue","pan","getValue","ImgUtil","arr","destroy","uid","getCacheID","cache","isInner","Pool","params","__puid","PUID","getID","pop","createOrClone","getCache","push","total","create","classApply","clone","count","Stats","body","add","emitter","getEmitter","renderer","getRenderer","str","type","proton","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","container","innerHTML","cssText","join","addEventListener","_this","bg","color","parentNode","appendChild","emitterIndex","renderers","rendererIndex","result","cpool","round","EventDispatcher","listener","_listeners","removeEventListener","splice","listeners","handler","TargetClass","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","particle","sleep","old","multiplyScalar","mass","clear","Proton","render","init","index","remove","parent","EMITTER_ADDED","EMITTER_REMOVED","PROTON_UPDATE","USE_CLOCK","oldTime","Date","getTime","elapsed","amendChangeTabsBug","emittersUpdate","PROTON_UPDATE_AFTER","update","getAllParticles","integrationType","stats","EULER","integrator","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","pow","PI_2","sqrt","ease","easeLinear","Vector2D","atan2","w","addVectors","subVectors","set","divideScalar","distanceToSquared","tha","dx","dy","alpha","Particle","N180_PI","life","Infinity","age","energy","dead","sprite","radius","rotation","easing","destroyObject","removeAllBehaviours","rgb","r","g","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","destroyArray","ID","reset","setPrototypeByObject","h","hex16","substring","parseInt","rbg","Number","Polar2D","getX","getY","abs","mat3","mat","Float32Array","mat1","mat2","m","vec","ArraySpan","_arr","randomColor","Rectangle","right","bottom","Rate","startTime","nextTime","timePan","numPan","numpan","timepan","setSpanValue","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imagetarget","inner","Behaviour","getEasing","force","removeBehaviour","Force","fx","fy","normalizeForce","calculate","Attraction","targetPosition","normalizeValue","radiusSq","attractionForce","lengthSq","sub","normalize","RandomDrift","driftX","driftY","delay","panFoce","addXY","Gravity","Collision","collisionPool","delta","newPool","otherParticle","overlap","totalMass","averageMass1","averageMass2","distance","CrossZone","crossing","Alpha","same","alphaA","alphaB","Scale","scaleA","scaleB","Rotate","rotationA","rotationB","getDirection","influence","Color","createArraySpan","colorA","ColorUtil","hexToRGB","colorB","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVector2DByObject","degreeTransform","Emitter","totalTime","stoped","emitTime","isNaN","rate","oldStoped","oldEmitTime","oldTotalTime","pObj","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mousemoveHandler","_this2","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","mouseTarget","_allowEmitting","layerX","layerY","offsetX","offsetY","babelHelpers.get","window","initEventHandler","BaseRenderer","thinkness","stroke","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","element","initHandler","circleConf","isCircle","CanvasRenderer","addImg2Body","drawCircle","buffer","createBuffer","bufferContext","globalAlpha","globalCompositeOperation","fillStyle","rgbToHex","fillRect","save","translate","restore","beginPath","arc","strokeStyle","lineWidth","closePath","fill","size","bufferCache","DomRenderer","bodyReady","transform3d","backgroundColor","removeChild","babelHelpers.typeof","createCircle","createSprite","createDiv","borderRadius","borderColor","borderWidth","url","backgroundImage","createBody","EaselRenderer","addChild","scaleX","scaleY","graphics","regX","regY","createjs","Graphics","String","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","data","PixiRenderer","setColor","tint","getHex16FromParticle","PIXI","Sprite","fromImage","anchor","endFill","MStack","Mat3","mats","multiply","WebGLRenderer","umat","smat","mstack","gl","viewport","circleCanvasURL","texturebuffers","A","blendEquation","B","blendFunc","fs","shader","createShader","FRAGMENT_SHADER","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","fragmentShader","getShader","getFragmentShader","vertexShader","getVertexShader","sprogram","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","useProgram","vpa","getAttribLocation","tca","enableVertexAttribArray","tMatUniform","getUniformLocation","samplerUniform","useTex","uniform1i","idx","unitIBuffer","bindBuffer","ELEMENT_ARRAY_BUFFER","bufferData","Uint16Array","STATIC_DRAW","ids","unitI33","stripBuffer","raidus","circleCanvasRadius","toDataURL","_w","_h","_width","_height","_scaleX","_scaleY","createTexture","texture","vcBuffer","tcBuffer","ARRAY_BUFFER","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_NEAREST","generateMipmap","textureLoaded","textureWidth","textureHeight","tmat","imat","oldScale","drawImg2Canvas","updateMatrix","uniform3f","uniformMatrix3fv","top","vertexAttribPointer","FLOAT","drawElements","TRIANGLES","UNSIGNED_SHORT","moveOriginMatrix","translationMatrix","angel","rotationMatrix","scaleMatrix","matrix","inverse","antialias","stencil","depth","initVar","setMaxRadius","initShaders","initBuffers","FUNC_ADD","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","enable","BLEND","CustomRenderer","LineZone","x1","gradient","y1","dot","xxyy","tha2","getGradient","oldx","oldy","maxx","minx","maxy","miny","direction","rangeOut","getDistance","getSymmetric","error","x2","y2","min","getLength","CircleZone","angle","PIx2","d","distanceTo","RectZone","ImageZone","vectors","setVectors","j","length1","length2","getBound","negate","fun","getStyle","moveTo","lineTo","drawRect","P","Vector","Polar","getSpan","Init","L","V","M","R","F","RD","G","S","WebGlRenderer","Debug","assign"],"mappings":";;;;;;;;;gRAAA,IAAMA,EAAK,UAELC,EAAY,IAEVD,OACO,EAALA,OACAA,EAAK,SACHA,EAAK,YACJ,IAAMA,sBAEJE,EAAGC,EAAGC,U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AiBA,GACxBrQ,EAAO2R,YAAcA,GACrB3R,EAAO0S,cAAgBA,GACvB1S,EAAOgU,aAAeA,GACtBhU,EAAOwT,cAAgBA,GACvBxT,EAAO6U,cAAgB7U,EAAOsf,cAAgBzK,GAC9C7U,EAAO8b,eAAiBA,GAExB9b,EAAOuf,MAAQA,GAEfhmB,OAAOimB,OAAOxf,EAAQgC"} \ No newline at end of file +{"version":3,"file":"proton.min.js","sources":["../src/math/MathUtil.js","../src/math/Span.js","../src/utils/WebGLUtil.js","../src/utils/DomUtil.js","../src/utils/ImgUtil.js","../src/utils/Util.js","../src/utils/Puid.js","../src/core/Pool.js","../src/debug/Stats.js","../src/events/EventDispatcher.js","../src/math/Integration.js","../src/core/Proton.js","../src/utils/Rgb.js","../src/math/ease.js","../src/math/Vector2D.js","../src/core/Particle.js","../src/utils/ColorUtil.js","../src/math/Polar2D.js","../src/math/Mat3.js","../src/math/ArraySpan.js","../src/math/Rectangle.js","../src/initialize/Rate.js","../src/initialize/Initialize.js","../src/initialize/Life.js","../src/zone/Zone.js","../src/zone/PointZone.js","../src/initialize/Position.js","../src/initialize/Velocity.js","../src/initialize/Mass.js","../src/initialize/Radius.js","../src/initialize/Body.js","../src/behaviour/Behaviour.js","../src/behaviour/Force.js","../src/behaviour/Attraction.js","../src/behaviour/RandomDrift.js","../src/behaviour/Gravity.js","../src/behaviour/Collision.js","../src/behaviour/CrossZone.js","../src/behaviour/Alpha.js","../src/behaviour/Scale.js","../src/behaviour/Rotate.js","../src/behaviour/Color.js","../src/behaviour/Repulsion.js","../src/behaviour/GravityWell.js","../src/initialize/InitializeUtil.js","../src/emitter/Emitter.js","../src/emitter/BehaviourEmitter.js","../src/emitter/FollowEmitter.js","../src/render/BaseRenderer.js","../src/render/CanvasRenderer.js","../src/render/DomRenderer.js","../src/render/EaselRenderer.js","../src/render/PixelRenderer.js","../src/render/PixiRenderer.js","../src/utils/MStack.js","../src/render/WebGLRenderer.js","../src/render/CustomRenderer.js","../src/zone/LineZone.js","../src/zone/CircleZone.js","../src/zone/RectZone.js","../src/zone/ImageZone.js","../src/debug/Debug.js","../src/index.js"],"sourcesContent":["const PI = 3.1415926;\nconst INFINITY = Infinity;\n\nconst MathUtil = {\n PI: PI,\n PIx2: PI * 2,\n PI_2: PI / 2,\n PI_180: PI / 180,\n N180_PI: 180 / PI,\n Infinity: -999,\n\n isInfinity(num) {\n return num === this.Infinity || num === INFINITY;\n },\n\n randomAToB(a, b, isInt = false) {\n if (!isInt) return a + Math.random() * (b - a);\n else return Math.floor(Math.random() * (b - a)) + a;\n },\n\n randomFloating(center, f, isInt) {\n return this.randomAToB(center - f, center + f, isInt);\n },\n\n randomZone(display) {},\n\n degreeTransform(a) {\n return (a * PI) / 180;\n },\n\n toColor16(num) {\n return `#${num.toString(16)}`;\n },\n\n randomColor() {\n return (\n \"#\" +\n (\"00000\" + ((Math.random() * 0x1000000) << 0).toString(16)).slice(\n -6\n )\n );\n }\n};\n\nexport default MathUtil;\n","import Util from \"../utils/Util\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Span {\n constructor(a, b, center) {\n if (Util.isArray(a)) {\n this.isArray = true;\n this.a = a;\n } else {\n this.isArray = false;\n this.a = Util.initValue(a, 1);\n this.b = Util.initValue(b, this.a);\n this.center = Util.initValue(center, false);\n }\n }\n\n getValue(isInt = false) {\n if (this.isArray) {\n return Util.getRandFromArray(this.a);\n } else {\n if (!this.center) {\n return MathUtil.randomAToB(this.a, this.b, isInt);\n } else {\n return MathUtil.randomFloating(this.a, this.b, isInt);\n }\n }\n }\n\n /**\n * Returns a new Span object\n *\n * @memberof Proton#Proton.Util\n * @method setSpanValue\n *\n * @todo a, b and c should be 'Mixed' or 'Number'?\n *\n * @param {Mixed | Span} a\n * @param {Mixed} b\n * @param {Mixed} c\n *\n * @return {Span}\n */\n static setSpanValue(a, b, c) {\n if (a instanceof Span) {\n return a;\n } else {\n if (b === undefined) {\n return new Span(a);\n } else {\n if (c === undefined) return new Span(a, b);\n else return new Span(a, b, c);\n }\n }\n }\n\n /**\n * Returns the value from a Span, if the param is not a Span it will return the given parameter\n *\n * @memberof Proton#Proton.Util\n * @method getValue\n *\n * @param {Mixed | Span} pan\n *\n * @return {Mixed} the value of Span OR the parameter if it is not a Span\n */\n static getSpanValue(pan) {\n return pan instanceof Span ? pan.getValue() : pan;\n }\n}\n","export default {\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method ipot\n *\n * @todo add description\n * @todo add length description\n *\n * @param {Number} length\n *\n * @return {Boolean}\n */\n ipot(length) {\n return (length & (length - 1)) === 0;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method nhpot\n *\n * @todo add description\n * @todo add length description\n *\n * @param {Number} length\n *\n * @return {Number}\n */\n nhpot(length) {\n --length;\n for (let i = 1; i < 32; i <<= 1) {\n length = length | (length >> i);\n }\n\n return length + 1;\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeTranslation\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} tx either 0 or 1\n * @param {Number} ty either 0 or 1\n *\n * @return {Object}\n */\n makeTranslation(tx, ty) {\n return [1, 0, 0, 0, 1, 0, tx, ty, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeRotation\n *\n * @todo add description\n * @todo add return description\n *\n * @param {Number} angleInRadians\n *\n * @return {Object}\n */\n makeRotation(angleInRadians) {\n let c = Math.cos(angleInRadians);\n let s = Math.sin(angleInRadians);\n\n return [c, -s, 0, s, c, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method makeScale\n *\n * @todo add description\n * @todo add tx, ty description\n * @todo add return description\n *\n * @param {Number} sx either 0 or 1\n * @param {Number} sy either 0 or 1\n *\n * @return {Object}\n */\n makeScale(sx, sy) {\n return [sx, 0, 0, 0, sy, 0, 0, 0, 1];\n },\n\n /**\n * @memberof Proton#Proton.WebGLUtil\n * @method matrixMultiply\n *\n * @todo add description\n * @todo add a, b description\n * @todo add return description\n *\n * @param {Object} a\n * @param {Object} b\n *\n * @return {Object}\n */\n matrixMultiply(a, b) {\n let a00 = a[0 * 3 + 0];\n let a01 = a[0 * 3 + 1];\n let a02 = a[0 * 3 + 2];\n let a10 = a[1 * 3 + 0];\n let a11 = a[1 * 3 + 1];\n let a12 = a[1 * 3 + 2];\n let a20 = a[2 * 3 + 0];\n let a21 = a[2 * 3 + 1];\n let a22 = a[2 * 3 + 2];\n let b00 = b[0 * 3 + 0];\n let b01 = b[0 * 3 + 1];\n let b02 = b[0 * 3 + 2];\n let b10 = b[1 * 3 + 0];\n let b11 = b[1 * 3 + 1];\n let b12 = b[1 * 3 + 2];\n let b20 = b[2 * 3 + 0];\n let b21 = b[2 * 3 + 1];\n let b22 = b[2 * 3 + 2];\n\n return [\n a00 * b00 + a01 * b10 + a02 * b20,\n a00 * b01 + a01 * b11 + a02 * b21,\n a00 * b02 + a01 * b12 + a02 * b22,\n a10 * b00 + a11 * b10 + a12 * b20,\n a10 * b01 + a11 * b11 + a12 * b21,\n a10 * b02 + a11 * b12 + a12 * b22,\n a20 * b00 + a21 * b10 + a22 * b20,\n a20 * b01 + a21 * b11 + a22 * b21,\n a20 * b02 + a21 * b12 + a22 * b22\n ];\n }\n};\n","export default {\n /**\n * Creates and returns a new canvas. The opacity is by default set to 0\n *\n * @memberof Proton#Proton.DomUtil\n * @method createCanvas\n *\n * @param {String} $id the canvas' id\n * @param {Number} $width the canvas' width\n * @param {Number} $height the canvas' height\n * @param {String} [$position=absolute] the canvas' position, default is 'absolute'\n *\n * @return {Object}\n */\n createCanvas(id, width, height, position = \"absolute\") {\n const dom = document.createElement(\"canvas\");\n\n dom.id = id;\n dom.width = width;\n dom.height = height;\n dom.style.opacity = 0;\n dom.style.position = position;\n this.transform(dom, -500, -500, 0, 0);\n\n return dom;\n },\n\n createDiv(id, width, height) {\n const dom = document.createElement(\"div\");\n\n dom.id = id;\n dom.style.position = \"absolute\";\n this.resize(dom, width, height);\n\n return dom;\n },\n\n resize(dom, width, height) {\n dom.style.width = width + \"px\";\n dom.style.height = height + \"px\";\n dom.style.marginLeft = -width / 2 + \"px\";\n dom.style.marginTop = -height / 2 + \"px\";\n },\n\n /**\n * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers\n *\n * @memberof Proton#Proton.DomUtil\n * @method transform\n *\n * @param {HTMLDivElement} div\n * @param {Number} $x\n * @param {Number} $y\n * @param {Number} $scale\n * @param {Number} $rotate\n */\n transform(div, x, y, scale, rotate) {\n div.style.willChange = \"transform\";\n const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`;\n this.css3(div, \"transform\", transform);\n },\n\n transform3d(div, x, y, scale, rotate) {\n div.style.willChange = \"transform\";\n const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`;\n this.css3(div, \"backfaceVisibility\", \"hidden\");\n this.css3(div, \"transform\", transform);\n },\n\n css3(div, key, val) {\n const bkey = key.charAt(0).toUpperCase() + key.substr(1);\n\n div.style[`Webkit${bkey}`] = val;\n div.style[`Moz${bkey}`] = val;\n div.style[`O${bkey}`] = val;\n div.style[`ms${bkey}`] = val;\n div.style[`${key}`] = val;\n }\n};\n","import WebGLUtil from \"./WebGLUtil\";\nimport DomUtil from \"./DomUtil\";\n\nconst imgsCache = {};\nconst canvasCache = {};\nlet canvasId = 0;\n\nexport default {\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n context.drawImage(image, rect.x, rect.y);\n const imagedata = context.getImageData(\n rect.x,\n rect.y,\n rect.width,\n rect.height\n );\n context.clearRect(rect.x, rect.y, rect.width, rect.height);\n\n return imagedata;\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method getImgFromCache\n *\n * @todo add description\n * @todo describe func\n *\n * @param {Mixed} img\n * @param {Proton.Particle} particle\n * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.data.canvas\n * @param {Boolean} func\n */\n getImgFromCache(img, callback, param) {\n const src = typeof img === \"string\" ? img : img.src;\n\n if (imgsCache[src]) {\n callback(imgsCache[src], param);\n } else {\n const image = new Image();\n image.onload = e => {\n imgsCache[src] = e.target;\n callback(imgsCache[src], param);\n };\n\n image.src = src;\n }\n },\n\n getCanvasFromCache(img, callback, param) {\n const src = img.src;\n\n if (!canvasCache[src]) {\n const width = WebGLUtil.nhpot(img.width);\n const height = WebGLUtil.nhpot(img.height);\n\n const canvas = DomUtil.createCanvas(\n `proton_canvas_cache_${++canvasId}`,\n width,\n height\n );\n const context = canvas.getContext(\"2d\");\n context.drawImage(img, 0, 0, img.width, img.height);\n\n canvasCache[src] = canvas;\n }\n\n callback && callback(canvasCache[src], param);\n\n return canvasCache[src];\n }\n};\n","import Span from \"../math/Span\";\nimport ImgUtil from \"./ImgUtil\";\n\nexport default {\n /**\n * Returns the default if the value is null or undefined\n *\n * @memberof Proton#Proton.Util\n * @method initValue\n *\n * @param {Mixed} value a specific value, could be everything but null or undefined\n * @param {Mixed} defaults the default if the value is null or undefined\n */\n initValue(value, defaults) {\n value = value !== null && value !== undefined ? value : defaults;\n return value;\n },\n\n /**\n * Checks if the value is a valid array\n *\n * @memberof Proton#Proton.Util\n * @method isArray\n *\n * @param {Array} value Any array\n *\n * @returns {Boolean}\n */\n isArray(value) {\n return Object.prototype.toString.call(value) === \"[object Array]\";\n },\n\n /**\n * Destroyes the given array\n *\n * @memberof Proton#Proton.Util\n * @method emptyArray\n *\n * @param {Array} array Any array\n */\n emptyArray(arr) {\n if (arr) arr.length = 0;\n },\n\n toArray(arr) {\n return this.isArray(arr) ? arr : [arr];\n },\n\n getRandFromArray(arr) {\n if (!arr) return null;\n return arr[Math.floor(arr.length * Math.random())];\n },\n\n /**\n * Destroyes the given object\n *\n * @memberof Proton#Proton.Util\n * @method emptyObject\n *\n * @param {Object} obj Any object\n */\n emptyObject(obj, ignore = null) {\n for (let key in obj) {\n if (ignore && ignore.indexOf(key) > -1) continue;\n delete obj[key];\n }\n },\n\n /**\n * Makes an instance of a class and binds the given array\n *\n * @memberof Proton#Proton.Util\n * @method classApply\n *\n * @param {Function} constructor A class to make an instance from\n * @param {Array} [args] Any array to bind it to the constructor\n *\n * @return {Object} The instance of constructor, optionally bind with args\n */\n classApply(constructor, args = null) {\n if (!args) {\n return new constructor();\n } else {\n const FactoryFunc = constructor.bind.apply(\n constructor,\n [null].concat(args)\n );\n return new FactoryFunc();\n }\n },\n\n /**\n * @memberof Proton#Proton.Util\n * @method setVectorVal\n *\n * @todo add description for param `target`\n * @todo add description for param `conf`\n * @todo add description for function\n *\n * @param {Object} target\n * @param {Object} conf\n */\n setVectorVal(particle, conf = null) {\n if (!conf) return;\n\n if (this.hasProp(conf, \"x\")) particle.p.x = conf[\"x\"];\n if (this.hasProp(conf, \"y\")) particle.p.y = conf[\"y\"];\n\n if (this.hasProp(conf, \"vx\")) particle.v.x = conf[\"vx\"];\n if (this.hasProp(conf, \"vy\")) particle.v.y = conf[\"vy\"];\n\n if (this.hasProp(conf, \"ax\")) particle.a.x = conf[\"ax\"];\n if (this.hasProp(conf, \"ay\")) particle.a.y = conf[\"ay\"];\n\n if (this.hasProp(conf, \"p\")) particle.p.copy(conf[\"p\"]);\n if (this.hasProp(conf, \"v\")) particle.v.copy(conf[\"v\"]);\n if (this.hasProp(conf, \"a\")) particle.a.copy(conf[\"a\"]);\n\n if (this.hasProp(conf, \"position\")) particle.p.copy(conf[\"position\"]);\n if (this.hasProp(conf, \"velocity\")) particle.v.copy(conf[\"velocity\"]);\n if (this.hasProp(conf, \"accelerate\")) particle.a.copy(conf[\"accelerate\"]);\n },\n\n hasProp(target, key) {\n if (!target) return false;\n return target[key] !== undefined;\n // return obj.hasOwnProperty(key);\n },\n\n /**\n * set the prototype in a given prototypeObject\n *\n * @memberof Proton#Proton.Util\n * @method setProp\n *\n * @todo add description for param `target`\n * @todo translate desription from chinese to english\n *\n * @param {Object} target\n * @param {Object} prototypeObject An object of single prototypes\n *\n * @return {Object} target\n */\n setProp(target, props) {\n for (let prop in props) {\n if (target.hasOwnProperty(prop)) {\n target[prop] = Span.getSpanValue(props[prop]);\n }\n }\n\n return target;\n },\n\n /**\n * This will get the image data. It could be necessary to create a Proton.Zone.\n *\n * @memberof Proton#Proton.Util\n * @method getImageData\n *\n * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')'\n * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag');\n * @param {Proton.Rectangle} rect\n */\n getImageData(context, image, rect) {\n return ImgUtil.getImageData(context, image, rect);\n },\n\n destroyAll(arr, param = null) {\n let i = arr.length;\n\n while (i--) {\n try {\n arr[i].destroy(param);\n } catch (e) {}\n\n delete arr[i];\n }\n\n arr.length = 0;\n }\n};\n","const IdsMap = {};\n\nconst Puid = {\n _index: 0,\n _cache: {},\n\n id(type) {\n if (IdsMap[type] === undefined || IdsMap[type] === null) IdsMap[type] = 0;\n return `${type}_${IdsMap[type]++}`;\n },\n\n getId(target) {\n let uid = this.getIdFromCache(target);\n if (uid) return uid;\n\n uid = `PUID_${this._index++}`;\n this._cache[uid] = target;\n\n return uid;\n },\n\n getIdFromCache(target) {\n let obj, id;\n\n for (id in this._cache) {\n obj = this._cache[id];\n\n if (obj === target) return id;\n if (this.isBody(obj, target) && obj.src === target.src) return id;\n }\n\n return null;\n },\n\n isBody(obj, target) {\n return (\n typeof obj === \"object\" &&\n typeof target === \"object\" &&\n obj.isInner &&\n target.isInner\n );\n },\n\n getTarget(uid) {\n return this._cache[uid];\n }\n};\n\nexport default Puid;\n","/**\n * Pool is the cache pool of the proton engine, it is very important.\n *\n * get(target, params, uid)\n * Class\n * uid = Puid.getId -> Puid save target cache\n * target.__puid = uid\n *\n * body\n * uid = Puid.getId -> Puid save target cache\n *\n *\n * expire(target)\n * cache[target.__puid] push target\n *\n */\nimport Util from \"../utils/Util\";\nimport Puid from \"../utils/Puid\";\n\nexport default class Pool {\n /**\n * @memberof! Proton#\n * @constructor\n * @alias Proton.Pool\n *\n * @todo add description\n * @todo add description of properties\n *\n * @property {Number} total\n * @property {Object} cache\n */\n constructor(num) {\n this.total = 0;\n this.cache = {};\n }\n\n /**\n * @todo add description\n *\n * @method get\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n get(target, params, uid) {\n let p;\n uid = uid || target.__puid || Puid.getId(target);\n\n if (this.cache[uid] && this.cache[uid].length > 0) {\n p = this.cache[uid].pop();\n } else {\n p = this.createOrClone(target, params);\n }\n\n p.__puid = target.__puid || uid;\n return p;\n }\n\n /**\n * @todo add description\n *\n * @method set\n * @memberof Proton#Proton.Pool\n *\n * @param {Object} target\n *\n * @return {Object}\n */\n expire(target) {\n return this.getCache(target.__puid).push(target);\n }\n\n /**\n * Creates a new class instance\n *\n * @todo add more documentation\n *\n * @method create\n * @memberof Proton#Proton.Pool\n *\n * @param {Object|Function} target any Object or Function\n * @param {Object} [params] just add if `target` is a function\n *\n * @return {Object}\n */\n createOrClone(target, params) {\n this.total++;\n\n if (this.create) {\n return this.create(target, params);\n } else if (typeof target === \"function\") {\n return Util.classApply(target, params);\n } else {\n return target.clone();\n }\n }\n\n /**\n * @todo add description - what is in the cache?\n *\n * @method getCount\n * @memberof Proton#Proton.Pool\n *\n * @return {Number}\n */\n getCount() {\n let count = 0;\n for (let id in this.cache) count += this.cache[id].length;\n return count++;\n }\n\n /**\n * Destroyes all items from Pool.cache\n *\n * @method destroy\n * @memberof Proton#Proton.Pool\n */\n destroy() {\n for (let id in this.cache) {\n this.cache[id].length = 0;\n delete this.cache[id];\n }\n }\n\n /**\n * Returns Pool.cache\n *\n * @method getCache\n * @memberof Proton#Proton.Pool\n * @private\n *\n * @param {Number} uid the unique id\n *\n * @return {Object}\n */\n getCache(uid = \"default\") {\n if (!this.cache[uid]) this.cache[uid] = [];\n return this.cache[uid];\n }\n}\n","export default class Stats {\n constructor(proton) {\n this.proton = proton;\n this.container = null;\n this.type = 1;\n\n this.emitterIndex = 0;\n this.rendererIndex = 0;\n }\n\n update(style, body) {\n this.add(style, body);\n\n const emitter = this.getEmitter();\n const renderer = this.getRenderer();\n let str = \"\";\n\n switch (this.type) {\n case 2:\n str += \"emitter:\" + this.proton.emitters.length + \"
\";\n if (emitter) str += \"em speed:\" + emitter.emitSpeed + \"
\";\n if (emitter) str += \"pos:\" + this.getEmitterPos(emitter);\n break;\n\n case 3:\n if (emitter)\n str += \"initializes:\" + emitter.initializes.length + \"
\";\n if (emitter)\n str +=\n '' +\n this.concatArr(emitter.initializes) +\n \"
\";\n if (emitter) str += \"behaviours:\" + emitter.behaviours.length + \"
\";\n if (emitter)\n str +=\n '' +\n this.concatArr(emitter.behaviours) +\n \"
\";\n break;\n\n case 4:\n if (renderer) str += renderer.name + \"
\";\n if (renderer) str += \"body:\" + this.getCreatedNumber(renderer) + \"
\";\n break;\n\n default:\n str += \"particles:\" + this.proton.getCount() + \"
\";\n str += \"pool:\" + this.proton.pool.getCount() + \"
\";\n str += \"total:\" + this.proton.pool.total;\n }\n\n this.container.innerHTML = str;\n }\n\n add(style, body) {\n if (!this.container) {\n this.type = 1;\n\n this.container = document.createElement(\"div\");\n this.container.style.cssText = [\n \"position:absolute;bottom:0px;left:0;cursor:pointer;\",\n \"opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;\",\n \"width:120px;height:50px;background-color:#002;color:#0ff;\"\n ].join(\"\");\n\n this.container.addEventListener(\n \"click\",\n e => {\n this.type++;\n if (this.type > 4) this.type = 1;\n },\n false\n );\n\n let bg, color;\n switch (style) {\n case 2:\n bg = \"#201\";\n color = \"#f08\";\n break;\n\n case 3:\n bg = \"#020\";\n color = \"#0f0\";\n break;\n\n default:\n bg = \"#002\";\n color = \"#0ff\";\n }\n\n this.container.style[\"background-color\"] = bg;\n this.container.style[\"color\"] = color;\n }\n\n if (!this.container.parentNode) {\n body = body || this.body || document.body;\n body.appendChild(this.container);\n }\n }\n\n getEmitter() {\n return this.proton.emitters[this.emitterIndex];\n }\n\n getRenderer() {\n return this.proton.renderers[this.rendererIndex];\n }\n\n concatArr(arr) {\n let result = \"\";\n if (!arr || !arr.length) return result;\n\n for (let i = 0; i < arr.length; i++) {\n result += (arr[i].name || \"\").substr(0, 1) + \".\";\n }\n\n return result;\n }\n\n getCreatedNumber(renderer) {\n return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0;\n }\n\n getEmitterPos(e) {\n return Math.round(e.p.x) + \",\" + Math.round(e.p.y);\n }\n}\n","/*\n * EventDispatcher\n * This code reference since http://createjs.com/.\n *\n **/\n\nexport default class EventDispatcher {\n constructor() {\n this._listeners = null;\n }\n\n static bind(target) {\n target.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent;\n\n target.prototype.hasEventListener =\n EventDispatcher.prototype.hasEventListener;\n\n target.prototype.addEventListener =\n EventDispatcher.prototype.addEventListener;\n\n target.prototype.removeEventListener =\n EventDispatcher.prototype.removeEventListener;\n\n target.prototype.removeAllEventListeners =\n EventDispatcher.prototype.removeAllEventListeners;\n }\n\n addEventListener(type, listener) {\n if (!this._listeners) {\n this._listeners = {};\n } else {\n this.removeEventListener(type, listener);\n }\n\n if (!this._listeners[type]) this._listeners[type] = [];\n this._listeners[type].push(listener);\n\n return listener;\n }\n\n removeEventListener(type, listener) {\n if (!this._listeners) return;\n if (!this._listeners[type]) return;\n\n const arr = this._listeners[type];\n const length = arr.length;\n\n for (let i = 0; i < length; i++) {\n if (arr[i] === listener) {\n if (length === 1) {\n delete this._listeners[type];\n }\n\n // allows for faster checks.\n else {\n arr.splice(i, 1);\n }\n\n break;\n }\n }\n }\n\n removeAllEventListeners(type) {\n if (!type) this._listeners = null;\n else if (this._listeners) delete this._listeners[type];\n }\n\n dispatchEvent(type, args) {\n let result = false;\n const listeners = this._listeners;\n\n if (type && listeners) {\n let arr = listeners[type];\n if (!arr) return result;\n\n // arr = arr.slice();\n // to avoid issues with items being removed or added during the dispatch\n\n let handler;\n let i = arr.length;\n while (i--) {\n handler = arr[i];\n result = result || handler(args);\n }\n }\n\n return !!result;\n }\n\n hasEventListener(type) {\n const listeners = this._listeners;\n return !!(listeners && listeners[type]);\n }\n}\n","export default class Integration {\n constructor(type) {\n this.type = type;\n }\n\n calculate(particles, time, damping) {\n this.eulerIntegrate(particles, time, damping);\n }\n\n // Euler Integrate\n // https://rosettacode.org/wiki/Euler_method\n eulerIntegrate(particle, time, damping) {\n if (!particle.sleep) {\n particle.old.p.copy(particle.p);\n particle.old.v.copy(particle.v);\n\n particle.a.multiplyScalar(1 / particle.mass);\n particle.v.add(particle.a.multiplyScalar(time));\n particle.p.add(particle.old.v.multiplyScalar(time));\n\n if (damping) particle.v.multiplyScalar(damping);\n\n particle.a.clear();\n }\n }\n}\n","import Pool from \"./Pool\";\nimport Util from \"../utils/Util\";\nimport Stats from \"../debug/Stats\";\nimport EventDispatcher from \"../events/EventDispatcher\";\nimport Integration from \"../math/Integration\";\n\nexport default class Proton {\n static USE_CLOCK = false;\n\n // 1:100\n static MEASURE = 100;\n static EULER = \"euler\";\n static RK2 = \"runge-kutta2\";\n\n static PARTICLE_CREATED = \"PARTICLE_CREATED\";\n static PARTICLE_UPDATE = \"PARTICLE_UPDATE\";\n static PARTICLE_SLEEP = \"PARTICLE_SLEEP\";\n static PARTICLE_DEAD = \"PARTICLE_DEAD\";\n static PROTON_UPDATE = \"PROTON_UPDATE\";\n static PROTON_UPDATE_AFTER = \"PROTON_UPDATE_AFTER\";\n static EMITTER_ADDED = \"EMITTER_ADDED\";\n static EMITTER_REMOVED = \"EMITTER_REMOVED\";\n\n static amendChangeTabsBug = true;\n\n /**\n * The constructor to add emitters\n *\n * @constructor Proton\n *\n * @todo proParticleCount is not in use\n * @todo add more documentation of the single properties and parameters\n *\n * @param {Number} [proParticleCount] not in use?\n * @param {Number} [integrationType=Proton.EULER]\n *\n * @property {String} [integrationType=Proton.EULER]\n * @property {Array} emitters All added emitter\n * @property {Array} renderers All added renderer\n * @property {Number} time The active time\n * @property {Number} oldtime The old time\n */\n constructor(integrationType) {\n this.emitters = [];\n this.renderers = [];\n\n this.time = 0;\n this.oldTime = 0;\n this.elapsed = 0;\n\n this.stats = new Stats(this);\n this.pool = new Pool(80);\n\n this.integrationType = Util.initValue(integrationType, Proton.EULER);\n this.integrator = new Integration(this.integrationType);\n }\n\n /**\n * add a type of Renderer\n *\n * @method addRenderer\n * @memberof Proton\n * @instance\n *\n * @param {Renderer} render\n */\n addRenderer(render) {\n render.init(this);\n this.renderers.push(render);\n }\n\n /**\n * @name add a type of Renderer\n *\n * @method addRenderer\n * @param {Renderer} render\n */\n removeRenderer(render) {\n const index = this.renderers.indexOf(render);\n this.renderers.splice(index, 1);\n render.remove(this);\n }\n\n /**\n * add the Emitter\n *\n * @method addEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Emitter} emitter\n */\n addEmitter(emitter) {\n this.emitters.push(emitter);\n emitter.parent = this;\n\n this.dispatchEvent(Proton.EMITTER_ADDED, emitter);\n }\n\n /**\n * Removes an Emitter\n *\n * @method removeEmitter\n * @memberof Proton\n * @instance\n *\n * @param {Proton.Emitter} emitter\n */\n removeEmitter(emitter) {\n const index = this.emitters.indexOf(emitter);\n this.emitters.splice(index, 1);\n emitter.parent = null;\n\n this.dispatchEvent(Proton.EMITTER_REMOVED, emitter);\n }\n\n /**\n * Updates all added emitters\n *\n * @method update\n * @memberof Proton\n * @instance\n */\n update() {\n this.dispatchEvent(Proton.PROTON_UPDATE);\n\n if (Proton.USE_CLOCK) {\n if (!this.oldTime) this.oldTime = new Date().getTime();\n\n let time = new Date().getTime();\n this.elapsed = (time - this.oldTime) / 1000;\n Proton.amendChangeTabsBug && this.amendChangeTabsBug();\n\n this.oldTime = time;\n } else {\n this.elapsed = 0.0167;\n }\n\n // emitter update\n if (this.elapsed > 0) this.emittersUpdate(this.elapsed);\n\n this.dispatchEvent(Proton.PROTON_UPDATE_AFTER);\n }\n\n emittersUpdate(elapsed) {\n let i = this.emitters.length;\n while (i--) this.emitters[i].update(elapsed);\n }\n\n /**\n * @todo add description\n *\n * @method amendChangeTabsBug\n * @memberof Proton\n * @instance\n */\n amendChangeTabsBug() {\n if (this.elapsed > 0.5) {\n this.oldTime = new Date().getTime();\n this.elapsed = 0;\n }\n }\n\n /**\n * Counts all particles from all emitters\n *\n * @method getCount\n * @memberof Proton\n * @instance\n */\n getCount() {\n let total = 0;\n let i = this.emitters.length;\n\n while (i--) total += this.emitters[i].particles.length;\n return total;\n }\n\n getAllParticles() {\n let particles = [];\n let i = this.emitters.length;\n\n while (i--) particles = particles.concat(this.emitters[i].particles);\n return particles;\n }\n\n destroyAllEmitters() {\n Util.destroyAll(this.emitters);\n }\n\n /**\n * Destroys everything related to this Proton instance. This includes all emitters, and all properties\n *\n * @method destroy\n * @memberof Proton\n * @instance\n */\n destroy(remove = false) {\n const destroyOther = () => {\n this.time = 0;\n this.oldTime = 0;\n this.pool.destroy();\n\n Util.destroyAll(this.emitters);\n Util.destroyAll(this.renderers, this.getAllParticles());\n };\n\n if (remove) {\n setTimeout(destroyOther, 200);\n } else {\n destroyOther();\n }\n }\n}\n\nEventDispatcher.bind(Proton);\n","export default class Rgb {\n constructor(r = 255, g = 255, b = 255) {\n this.r = r;\n this.g = g;\n this.b = b;\n }\n\n reset() {\n this.r = 255;\n this.g = 255;\n this.b = 255;\n }\n}\n","import MathUtil from \"./MathUtil\";\n\nexport default {\n easeLinear(value) {\n return value;\n },\n\n easeInQuad(value) {\n return Math.pow(value, 2);\n },\n\n easeOutQuad(value) {\n return -(Math.pow(value - 1, 2) - 1);\n },\n\n easeInOutQuad(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 2);\n\n return -0.5 * ((value -= 2) * value - 2);\n },\n\n easeInCubic(value) {\n return Math.pow(value, 3);\n },\n\n easeOutCubic(value) {\n return Math.pow(value - 1, 3) + 1;\n },\n\n easeInOutCubic(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 3);\n\n return 0.5 * (Math.pow(value - 2, 3) + 2);\n },\n\n easeInQuart(value) {\n return Math.pow(value, 4);\n },\n\n easeOutQuart(value) {\n return -(Math.pow(value - 1, 4) - 1);\n },\n\n easeInOutQuart(value) {\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 4);\n\n return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2);\n },\n\n easeInSine(value) {\n return -Math.cos(value * MathUtil.PI_2) + 1;\n },\n\n easeOutSine(value) {\n return Math.sin(value * MathUtil.PI_2);\n },\n\n easeInOutSine(value) {\n return -0.5 * (Math.cos(Math.PI * value) - 1);\n },\n\n easeInExpo(value) {\n return value === 0 ? 0 : Math.pow(2, 10 * (value - 1));\n },\n\n easeOutExpo(value) {\n return value === 1 ? 1 : -Math.pow(2, -10 * value) + 1;\n },\n\n easeInOutExpo(value) {\n if (value === 0) return 0;\n\n if (value === 1) return 1;\n\n if ((value /= 0.5) < 1) return 0.5 * Math.pow(2, 10 * (value - 1));\n\n return 0.5 * (-Math.pow(2, -10 * --value) + 2);\n },\n\n easeInCirc(value) {\n return -(Math.sqrt(1 - value * value) - 1);\n },\n\n easeOutCirc(value) {\n return Math.sqrt(1 - Math.pow(value - 1, 2));\n },\n\n easeInOutCirc(value) {\n if ((value /= 0.5) < 1) return -0.5 * (Math.sqrt(1 - value * value) - 1);\n return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1);\n },\n\n easeInBack(value) {\n let s = 1.70158;\n return value * value * ((s + 1) * value - s);\n },\n\n easeOutBack(value) {\n let s = 1.70158;\n return (value = value - 1) * value * ((s + 1) * value + s) + 1;\n },\n\n easeInOutBack(value) {\n let s = 1.70158;\n if ((value /= 0.5) < 1)\n return 0.5 * (value * value * (((s *= 1.525) + 1) * value - s));\n return 0.5 * ((value -= 2) * value * (((s *= 1.525) + 1) * value + s) + 2);\n },\n\n getEasing(ease) {\n if (typeof ease === \"function\") return ease;\n else return this[ease] || this.easeLinear;\n }\n};\n","import MathUtil from \"../math/MathUtil\";\n\nexport default class Vector2D {\n constructor(x, y) {\n this.x = x || 0;\n this.y = y || 0;\n }\n\n set(x, y) {\n this.x = x;\n this.y = y;\n return this;\n }\n\n setX(x) {\n this.x = x;\n return this;\n }\n\n setY(y) {\n this.y = y;\n return this;\n }\n\n getGradient() {\n if (this.x !== 0) return Math.atan2(this.y, this.x);\n else if (this.y > 0) return MathUtil.PI_2;\n else if (this.y < 0) return -MathUtil.PI_2;\n }\n\n copy(v) {\n this.x = v.x;\n this.y = v.y;\n\n return this;\n }\n\n add(v, w) {\n if (w !== undefined) {\n return this.addVectors(v, w);\n }\n\n this.x += v.x;\n this.y += v.y;\n\n return this;\n }\n\n addXY(a, b) {\n this.x += a;\n this.y += b;\n\n return this;\n }\n\n addVectors(a, b) {\n this.x = a.x + b.x;\n this.y = a.y + b.y;\n\n return this;\n }\n\n sub(v, w) {\n if (w !== undefined) {\n return this.subVectors(v, w);\n }\n\n this.x -= v.x;\n this.y -= v.y;\n\n return this;\n }\n\n subVectors(a, b) {\n this.x = a.x - b.x;\n this.y = a.y - b.y;\n\n return this;\n }\n\n divideScalar(s) {\n if (s !== 0) {\n this.x /= s;\n this.y /= s;\n } else {\n this.set(0, 0);\n }\n\n return this;\n }\n\n multiplyScalar(s) {\n this.x *= s;\n this.y *= s;\n\n return this;\n }\n\n negate() {\n return this.multiplyScalar(-1);\n }\n\n dot(v) {\n return this.x * v.x + this.y * v.y;\n }\n\n lengthSq() {\n return this.x * this.x + this.y * this.y;\n }\n\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n\n normalize() {\n return this.divideScalar(this.length());\n }\n\n distanceTo(v) {\n return Math.sqrt(this.distanceToSquared(v));\n }\n\n rotate(tha) {\n const x = this.x;\n const y = this.y;\n\n this.x = x * Math.cos(tha) + y * Math.sin(tha);\n this.y = -x * Math.sin(tha) + y * Math.cos(tha);\n\n return this;\n }\n\n distanceToSquared(v) {\n const dx = this.x - v.x;\n const dy = this.y - v.y;\n\n return dx * dx + dy * dy;\n }\n\n lerp(v, alpha) {\n this.x += (v.x - this.x) * alpha;\n this.y += (v.y - this.y) * alpha;\n\n return this;\n }\n\n equals(v) {\n return v.x === this.x && v.y === this.y;\n }\n\n clear() {\n this.x = 0.0;\n this.y = 0.0;\n return this;\n }\n\n clone() {\n return new Vector2D(this.x, this.y);\n }\n}\n","import Rgb from \"../utils/Rgb\";\nimport Puid from \"../utils/Puid\";\nimport Util from \"../utils/Util\";\nimport ease from \"../math/ease\";\nimport Vector2D from \"../math/Vector2D\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Particle {\n /**\n * the Particle class\n *\n * @class Proton.Particle\n * @constructor\n * @param {Object} pObj the parameters object;\n * for example {life:3,dead:false}\n */\n constructor(conf) {\n /**\n * The particle's id;\n * @property id\n * @type {string}\n */\n this.name = \"Particle\";\n this.id = Puid.id(this.name);\n this.old = {};\n this.data = {};\n this.behaviours = [];\n\n this.p = new Vector2D();\n this.v = new Vector2D();\n this.a = new Vector2D();\n this.old.p = new Vector2D();\n this.old.v = new Vector2D();\n this.old.a = new Vector2D();\n\n this.rgb = new Rgb();\n this.reset();\n conf && Util.setProp(this, conf);\n }\n\n getDirection() {\n return Math.atan2(this.v.x, -this.v.y) * MathUtil.N180_PI;\n }\n\n reset() {\n this.life = Infinity;\n this.age = 0;\n\n this.dead = false;\n this.sleep = false;\n this.body = null;\n this.sprite = null;\n this.parent = null;\n\n this.energy = 1; // Energy Loss\n this.mass = 1;\n this.radius = 10;\n this.alpha = 1;\n this.scale = 1;\n this.rotation = 0;\n this.color = null;\n\n this.p.set(0, 0);\n this.v.set(0, 0);\n this.a.set(0, 0);\n this.old.p.set(0, 0);\n this.old.v.set(0, 0);\n this.old.a.set(0, 0);\n this.easing = ease.easeLinear;\n\n this.rgb.reset();\n Util.emptyObject(this.data);\n this.removeAllBehaviours();\n\n return this;\n }\n\n update(time, index) {\n if (!this.sleep) {\n this.age += time;\n this.applyBehaviours(time, index);\n }\n\n if (this.age < this.life) {\n const scale = this.easing(this.age / this.life);\n this.energy = Math.max(1 - scale, 0);\n } else {\n this.destroy();\n }\n }\n\n applyBehaviours(time, index) {\n const length = this.behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.behaviours[i] &&\n this.behaviours[i].applyBehaviour(this, time, index);\n }\n }\n\n addBehaviour(behaviour) {\n this.behaviours.push(behaviour);\n\n if (behaviour.hasOwnProperty(\"parents\")) behaviour.parents.push(this);\n behaviour.initialize(this);\n }\n\n addBehaviours(behaviours) {\n const length = behaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.addBehaviour(behaviours[i]);\n }\n }\n\n removeBehaviour(behaviour) {\n const index = this.behaviours.indexOf(behaviour);\n\n if (index > -1) {\n const behaviour = this.behaviours.splice(index, 1);\n behaviour.parents = null;\n }\n }\n\n removeAllBehaviours() {\n Util.emptyArray(this.behaviours);\n }\n\n /**\n * Destory this particle\n * @method destroy\n */\n destroy() {\n this.removeAllBehaviours();\n this.energy = 0;\n this.dead = true;\n this.parent = null;\n }\n}\n","export default {\n /**\n * @typedef {Object} rgbObject\n * @property {Number} r red value\n * @property {Number} g green value\n * @property {Number} b blue value\n */\n /**\n * converts a hex value to a rgb object\n *\n * @memberof Proton#Proton.Util\n * @method hexToRgb\n *\n * @param {String} h any hex value, e.g. #000000 or 000000 for black\n *\n * @return {rgbObject}\n */\n hexToRgb(h) {\n const hex16 = h.charAt(0) === \"#\" ? h.substring(1, 7) : h;\n const r = parseInt(hex16.substring(0, 2), 16);\n const g = parseInt(hex16.substring(2, 4), 16);\n const b = parseInt(hex16.substring(4, 6), 16);\n\n return { r, g, b };\n },\n\n /**\n * converts a rgb value to a rgb string\n *\n * @memberof Proton#Proton.Util\n * @method rgbToHex\n *\n * @param {Object | Proton.hexToRgb} rgb a rgb object like in {@link Proton#Proton.}\n *\n * @return {String} rgb()\n */\n rgbToHex(rbg) {\n return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`;\n },\n\n getHex16FromParticle(p) {\n return Number(p.rgb.r) * 65536 + Number(p.rgb.g) * 256 + Number(p.rgb.b);\n }\n};\n","import Vector2D from \"./Vector2D\";\n\nexport default class Polar2D {\n constructor(r, tha) {\n this.r = Math.abs(r) || 0;\n this.tha = tha || 0;\n }\n\n set(r, tha) {\n this.r = r;\n this.tha = tha;\n return this;\n }\n\n setR(r) {\n this.r = r;\n return this;\n }\n\n setTha(tha) {\n this.tha = tha;\n return this;\n }\n\n copy(p) {\n this.r = p.r;\n this.tha = p.tha;\n return this;\n }\n\n toVector() {\n return new Vector2D(this.getX(), this.getY());\n }\n\n getX() {\n return this.r * Math.sin(this.tha);\n }\n\n getY() {\n return -this.r * Math.cos(this.tha);\n }\n\n normalize() {\n this.r = 1;\n return this;\n }\n\n equals(v) {\n return v.r === this.r && v.tha === this.tha;\n }\n\n clear() {\n this.r = 0.0;\n this.tha = 0.0;\n return this;\n }\n\n clone() {\n return new Polar2D(this.r, this.tha);\n }\n}\n","const Mat3 = {\n create(mat3) {\n const mat = new Float32Array(9);\n if (mat3) this.set(mat3, mat);\n\n return mat;\n },\n\n set(mat1, mat2) {\n for (let i = 0; i < 9; i++) mat2[i] = mat1[i];\n\n return mat2;\n },\n\n multiply(mat, mat2, mat3) {\n let a00 = mat[0],\n a01 = mat[1],\n a02 = mat[2],\n a10 = mat[3],\n a11 = mat[4],\n a20 = mat[6],\n a21 = mat[7],\n b00 = mat2[0],\n b01 = mat2[1],\n b02 = mat2[2],\n b10 = mat2[3],\n b11 = mat2[4],\n b20 = mat2[6],\n b21 = mat2[7];\n\n mat3[0] = b00 * a00 + b01 * a10;\n mat3[1] = b00 * a01 + b01 * a11;\n mat3[2] = a02 * b02;\n mat3[3] = b10 * a00 + b11 * a10;\n mat3[4] = b10 * a01 + b11 * a11;\n mat3[6] = b20 * a00 + b21 * a10 + a20;\n mat3[7] = b20 * a01 + b21 * a11 + a21;\n\n return mat3;\n },\n\n inverse(mat, mat3) {\n let a00 = mat[0],\n a01 = mat[1],\n a10 = mat[3],\n a11 = mat[4],\n a20 = mat[6],\n a21 = mat[7],\n b01 = a11,\n b11 = -a10,\n b21 = a21 * a10 - a11 * a20,\n d = a00 * b01 + a01 * b11,\n id;\n\n id = 1 / d;\n mat3[0] = b01 * id;\n mat3[1] = -a01 * id;\n mat3[3] = b11 * id;\n mat3[4] = a00 * id;\n mat3[6] = b21 * id;\n mat3[7] = (-a21 * a00 + a01 * a20) * id;\n\n return mat3;\n },\n\n multiplyVec2(m, vec, mat3) {\n let x = vec[0],\n y = vec[1];\n\n mat3[0] = x * m[0] + y * m[3] + m[6];\n mat3[1] = x * m[1] + y * m[4] + m[7];\n\n return mat3;\n }\n};\n\nexport default Mat3;\n","import Span from \"./Span\";\nimport Util from \"../utils/Util\";\nimport MathUtil from \"./MathUtil\";\n\nexport default class ArraySpan extends Span {\n constructor(color) {\n super();\n this._arr = Util.toArray(color);\n }\n\n getValue() {\n const val = Util.getRandFromArray(this._arr);\n return val === \"random\" || val === \"Random\" ? MathUtil.randomColor() : val;\n }\n\n /**\n * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance\n *\n * @method setSpanValue\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n static createArraySpan(arr) {\n if (!arr) return null;\n\n if (arr instanceof ArraySpan) return arr;\n else return new ArraySpan(arr);\n }\n}\n","export default class Rectangle {\n constructor(x, y, w, h) {\n this.x = x;\n this.y = y;\n\n this.width = w;\n this.height = h;\n\n this.bottom = this.y + this.height;\n this.right = this.x + this.width;\n }\n\n contains(x, y) {\n if (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y)\n return true;\n else return false;\n }\n}\n","import Span from \"../math/Span\";\nimport Util from \"../utils/Util\";\n\nexport default class Rate {\n /**\n * The number of particles per second emission (a [particle]/b [s]);\n * @namespace\n * @memberof! Proton#\n * @constructor\n * @alias Rate\n *\n * @param {Array | Number | Span} numpan the number of each emission;\n * @param {Array | Number | Span} timepan the time of each emission;\n * for example: new Rate(new Span(10, 20), new Span(.1, .25));\n */\n constructor(numpan, timepan) {\n this.numPan = Span.setSpanValue(Util.initValue(numpan, 1));\n this.timePan = Span.setSpanValue(Util.initValue(timepan, 1));\n\n this.startTime = 0;\n this.nextTime = 0;\n this.init();\n }\n\n init() {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n }\n\n getValue(time) {\n this.startTime += time;\n\n if (this.startTime >= this.nextTime) {\n this.startTime = 0;\n this.nextTime = this.timePan.getValue();\n\n if (this.numPan.b === 1) {\n if (this.numPan.getValue(false) > 0.5) return 1;\n else return 0;\n } else {\n return this.numPan.getValue(true);\n }\n }\n\n return 0;\n }\n}\n","export default class Initialize {\n reset() {}\n\n init(emitter, particle) {\n if (particle) {\n this.initialize(particle);\n } else {\n this.initialize(emitter);\n }\n }\n\n // sub class init\n initialize(target) {}\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Life extends Initialize {\n constructor(a, b, c) {\n super();\n\n this.lifePan = Span.setSpanValue(a, b, c);\n this.name = \"Life\";\n }\n\n initialize(target) {\n if (this.lifePan.a === Infinity) target.life = Infinity;\n else target.life = this.lifePan.getValue();\n }\n}\n","import Vector2D from \"../math/Vector2D\";\n\nexport default class Zone {\n constructor() {\n this.vector = new Vector2D(0, 0);\n this.random = 0;\n this.crossType = \"dead\";\n this.alert = true;\n }\n\n getPosition() {}\n\n crossing(particle) {}\n}\n","import Zone from \"./Zone\";\n\nexport default class PointZone extends Zone {\n constructor(x, y) {\n super();\n\n this.x = x;\n this.y = y;\n }\n\n getPosition() {\n this.vector.x = this.x;\n this.vector.y = this.y;\n\n return this.vector;\n }\n\n crossing(particle) {\n if (this.alert) {\n console.error(\"Sorry, PointZone does not support crossing method!\");\n this.alert = false;\n }\n }\n}\n","import Util from \"../utils/Util\";\nimport PointZone from \"../zone/PointZone\";\nimport Initialize from \"./Initialize\";\n\nexport default class Position extends Initialize {\n constructor(zone) {\n super();\n this.zone = Util.initValue(zone, new PointZone());\n this.name = \"Position\";\n }\n\n reset(zone) {\n this.zone = Util.initValue(zone, new PointZone());\n }\n\n initialize(target) {\n this.zone.getPosition();\n\t\n target.p.x = this.zone.vector.x;\n target.p.y = this.zone.vector.y;\n }\n}\n","import Proton from \"../core/Proton\";\nimport Span from \"../math/Span\";\nimport Util from \"../utils/Util\";\nimport Initialize from \"./Initialize\";\nimport Polar2D from \"../math/Polar2D\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class Velocity extends Initialize {\n constructor(rpan, thapan, type) {\n super();\n\n this.rPan = Span.setSpanValue(rpan);\n this.thaPan = Span.setSpanValue(thapan);\n this.type = Util.initValue(type, \"vector\");\n\n this.name = \"Velocity\";\n }\n\n reset(rpan, thapan, type) {\n this.rPan = Span.setSpanValue(rpan);\n this.thaPan = Span.setSpanValue(thapan);\n this.type = Util.initValue(type, \"vector\");\n }\n\n normalizeVelocity(vr) {\n return vr * Proton.MEASURE;\n }\n\n initialize(target) {\n if (this.type === \"p\" || this.type === \"P\" || this.type === \"polar\") {\n const polar2d = new Polar2D(\n this.normalizeVelocity(this.rPan.getValue()),\n this.thaPan.getValue() * MathUtil.PI_180\n );\n\n target.v.x = polar2d.getX();\n target.v.y = polar2d.getY();\n } else {\n target.v.x = this.normalizeVelocity(this.rPan.getValue());\n target.v.y = this.normalizeVelocity(this.thaPan.getValue());\n }\n }\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Mass extends Initialize {\n constructor(a, b, c) {\n super();\n this.massPan = Span.setSpanValue(a, b, c);\n this.name = \"Mass\";\n }\n\n initialize(target) {\n target.mass = this.massPan.getValue();\n }\n}\n","import Span from \"../math/Span\";\nimport Initialize from \"./Initialize\";\n\nexport default class Radius extends Initialize {\n constructor(a, b, c) {\n super();\n this.radius = Span.setSpanValue(a, b, c);\n\n this.name = \"Radius\";\n }\n\n reset(a, b, c) {\n this.radius = Span.setSpanValue(a, b, c);\n }\n\n initialize(particle) {\n particle.radius = this.radius.getValue();\n particle.data.oldRadius = particle.radius;\n }\n}\n","import Util from \"../utils/Util\";\nimport ArraySpan from \"../math/ArraySpan\";\nimport Initialize from \"./Initialize\";\n\nexport default class Body extends Initialize {\n constructor(image, w, h) {\n super();\n\n this.image = this.setSpanValue(image);\n this.w = Util.initValue(w, 20);\n this.h = Util.initValue(h, this.w);\n this.name = \"Body\";\n }\n\n initialize(particle) {\n const imageTarget = this.image.getValue();\n\n if (typeof imageTarget === \"string\") {\n particle.body = {\n width: this.w,\n height: this.h,\n src: imageTarget,\n isInner: true,\n inner: true\n };\n } else {\n particle.body = imageTarget;\n }\n }\n\n setSpanValue(image) {\n return image instanceof ArraySpan ? image : new ArraySpan(image);\n }\n}\n","import Proton from '../core/Proton';\nimport Util from '../utils/Util';\nimport ease from '../math/ease';\n\nexport default class Behaviour {\n static id = 0;\n\n /**\n * The Behaviour class is the base for the other Behaviour\n *\n * @memberof! -\n * @interface\n * @alias Proton.Behaviour\n *\n * @param {Number} life \tthe behaviours life\n * @param {String} easing \tThe behaviour's decaying trend, for example ease.easeOutQuart\n *\n * @property {String} id \t\tThe behaviours id\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n * @property {Number} age=0 \tHow long the particle should be 'alife'\n * @property {Number} energy=1\n * @property {Boolean} dead=false The particle is dead at first\n * @property {Array} parents \tThe behaviour's parents array\n * @property {String} name \tThe behaviour name\n */\n constructor(life, easing) {\n\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n\n this.age = 0;\n this.energy = 1;\n this.dead = false;\n this.parents = [];\n\n this.id = `Behaviour_${Behaviour.id++}`;\n this.name = 'Behaviour';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(life, easing) {\n this.life = Util.initValue(life, Infinity);\n this.easing = ease.getEasing(easing);\n }\n\n /**\n * Normalize a force by 1:100;\n *\n * @method normalizeForce\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Vector2D} force\n */\n normalizeForce(force) {\n return force.multiplyScalar(Proton.MEASURE);\n }\n\n /**\n * Normalize a value by 1:100;\n *\n * @method normalizeValue\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Number} value\n */\n normalizeValue(value) {\n return value * Proton.MEASURE;\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {}\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton.Behaviour\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n calculate(particle, time, index) {\n this.age += time;\n\n if (this.age >= this.life || this.dead) {\n this.energy = 0;\n this.dead = true;\n this.destroy();\n } else {\n const scale = this.easing(particle.age / particle.life);\n this.energy = Math.max(1 - scale, 0);\n }\n }\n\n /**\n * Destory this behaviour\n *\n * @method destroy\n * @memberof Proton.Behaviour\n * @instance\n */\n destroy() {\n let i = this.parents.length;\n while (i--) {\n this.parents[i].removeBehaviour(this);\n }\n\n this.parents.length = 0;\n }\n}\n","import Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Force extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Force\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(fx, fy, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\t\tthis.name = 'Force';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Number} fx\n\t * @param {Number} fy\n\t * @param {Number} [life=Infinity] \t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(fx, fy, life, easing) {\n\t\tthis.force = this.normalizeForce(new Vector2D(fx, fy));\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Force\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.a.add(this.force);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Attraction extends Behaviour {\n\n\t/**\n\t * This behaviour let the particles follow one specific Proton.Vector2D\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Attraction\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Proton.Vector2D} targetPosition\n\t * @property {Number} radius\n\t * @property {Number} force\n\t * @property {Number} radiusSq\n\t * @property {Proton.Vector2D} attractionForce\n\t * @property {Number} lengthSq\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tthis.name = 'Attraction';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Attraction\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tthis.targetPosition = Util.initValue(targetPosition, new Vector2D);\n\t\tthis.radius = Util.initValue(radius, 1000);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.radiusSq = this.radius * this.radius\n\t\tthis.attractionForce = new Vector2D();\n\t\tthis.lengthSq = 0;\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Attraction\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tthis.attractionForce.copy(this.targetPosition);\n\t\tthis.attractionForce.sub(particle.p);\n\t\tthis.lengthSq = this.attractionForce.lengthSq();\n\n\t\tif (this.lengthSq > 0.000004 && this.lengthSq < this.radiusSq) {\n\t\t\tthis.attractionForce.normalize();\n\t\t\tthis.attractionForce.multiplyScalar(1 - this.lengthSq / this.radiusSq);\n\t\t\tthis.attractionForce.multiplyScalar(this.force);\n\n\t\t\tparticle.a.add(this.attractionForce);\n\t\t}\n\t}\n}","import Vector2D from \"../math/Vector2D\";\nimport MathUtil from \"../math/MathUtil\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class RandomDrift extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Behaviour\n * @constructor\n * @alias RandomDrift\n *\n * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n * @param {Number} delay \t\t\t\tHow much delay the drift should have\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {Number} time The time of the drift\n * @property {String} name The Behaviour name\n */\n constructor(driftX, driftY, delay, life, easing) {\n super(life, easing);\n\n this.reset(driftX, driftY, delay);\n this.time = 0;\n this.name = \"RandomDrift\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#RandomDrift\n * @instance\n *\n * @param {Number} driftX \t\t\t\tX value of the new Vector2D\n * @param {Number} driftY \t\t\t\tY value of the new Vector2D\n * @param {Number} delay \t\t\t\tHow much delay the drift should have\n * @param {Number} [life=Infinity] \t\tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(driftX, driftY, delay, life, easing) {\n this.panFoce = new Vector2D(driftX, driftY);\n this.panFoce = this.normalizeForce(this.panFoce);\n this.delay = delay;\n\n life && super.reset(life, easing);\n }\n\n initialize(particle) {\n particle.data.time = 0;\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#RandomDrift\n * @instance\n *\n * @param {Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n particle.data.time += time;\n\n if (particle.data.time >= this.delay) {\n particle.a.addXY(\n MathUtil.randomAToB(-this.panFoce.x, this.panFoce.x),\n MathUtil.randomAToB(-this.panFoce.y, this.panFoce.y)\n );\n\n particle.data.time = 0;\n }\n }\n}\n","import Force from './Force';\n\nexport default class Gravity extends Force {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Force\n\t * @constructor\n\t * @alias Proton.Gravity\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(g, life, easing) {\n\t\tsuper(0, g, life, easing);\n\t\tthis.name = 'Gravity';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Gravity\n\t * @instance\n\t *\n\t * @param {Number} g \t\t\t\t\t\t\tGravity\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(g, life, easing) {\n\t\tsuper.reset(0, g, life, easing);\n\t}\n}","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class Collision extends Behaviour {\n\n\t/**\n\t * The callback after collision\n\t *\n\t * @callback Callback\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Proton.Paritcle} otherParticle\n\t */\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Collision\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(emitter, mass, callback, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(emitter, mass, callback);\n\t\tthis.name = 'Collision';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method reset\n\t * @instance\n\t *\n\t * @todo add description to mass\n\t *\n\t * @param {Proton.Emitter} \t[emitter=null] \t\tthe attraction point coordinates\n\t * @param {Boolean} \t\t[mass=true]\n\t * @param {Callback}\t \t[callback=null]\t\tthe callback after the collision\n\t * @param {Number} \t\t\t[life=Infinity] \tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(emitter, mass, callback, life, easing) {\n\t\tthis.emitter = Util.initValue(emitter, null);\n\t\tthis.mass = Util.initValue(mass, true);\n\t\tthis.callback = Util.initValue(callback, null);\n\n\t\tthis.collisionPool = [];\n\t\tthis.delta = new Vector2D();\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @memberof Proton#Proton.Collision\n\t * @method applyBehaviour\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tconst newPool = this.emitter ? this.emitter.particles.slice(index) : this.pool.slice(index);\n\t\tconst length = newPool.length;\n\n\t\tlet otherParticle;\n\t\tlet lengthSq;\n\t\tlet overlap;\n\t\tlet totalMass;\n\t\tlet averageMass1, averageMass2;\n\t\tlet i;\n\n\t\tfor (i = 0; i < length; i++) {\n\t\t\totherParticle = newPool[i];\n\n\t\t\tif (otherParticle !== particle) {\n\t\t\t\tthis.delta.copy(otherParticle.p);\n\t\t\t\tthis.delta.sub(particle.p);\n\n\t\t\t\tlengthSq = this.delta.lengthSq();\n\t\t\t\tconst distance = particle.radius + otherParticle.radius;\n\n\t\t\t\tif (lengthSq <= distance * distance) {\n\t\t\t\t\toverlap = distance - Math.sqrt(lengthSq);\n\t\t\t\t\toverlap += 0.5;\n\n\t\t\t\t\ttotalMass = particle.mass + otherParticle.mass;\n\t\t\t\t\taverageMass1 = this.mass ? otherParticle.mass / totalMass : 0.5;\n\t\t\t\t\taverageMass2 = this.mass ? particle.mass / totalMass : 0.5;\n\n\t\t\t\t\tparticle.p.add(this.delta.clone().normalize().multiplyScalar(overlap * -averageMass1));\n\t\t\t\t\totherParticle.p.add(this.delta.normalize().multiplyScalar(overlap * averageMass2));\n\n\t\t\t\t\tthis.callback && this.callback(particle, otherParticle);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}","import Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class CrossZone extends Behaviour {\n\n /**\n * Defines what happens if the particles come to the end of the specified zone\n *\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.CrossZone\n *\n * @param {Proton.Zone} zone \t\t\t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \t\t\twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \t\t\tthis behaviour's life\n * @param {String} \t\t[easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(zone, crossType, life, easing) {\n super(life, easing);\n\n this.reset(zone, crossType);\n this.name = 'CrossZone';\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Zone} zone \t\t\t\tcan be any Proton.Zone - e.g. Proton.RectZone()\n * @param {String} \t\t[crossType=dead] \twhat happens if the particles pass the zone - allowed strings: dead | bound | cross\n * @param {Number} \t\t[life=Infinity] \tthis behaviour's life\n * @param {String} \t\t[easing=easeLinear]\tthis behaviour's easing\n */\n reset(zone, crossType, life, easing) {\n this.zone = zone;\n this.zone.crossType = Util.initValue(crossType, 'dead');\n\n life && super.reset(life, easing);\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.CrossZone\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n this.calculate(particle, time, index);\n this.zone.crossing(particle);\n };\n}","import Util from \"../utils/Util\";\nimport Span from \"../math/Span\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Alpha extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Alpha\n *\n * @todo add description for 'a' and 'b'\n *\n * @param {Number} a\n * @param {String} b\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = \"Alpha\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @todo add description for 'a' and 'b'\n *\n * @param {Number} a\n * @param {String} b\n * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.same = b === null || b === undefined ? true : false;\n this.a = Span.setSpanValue(Util.initValue(a, 1));\n this.b = Span.setSpanValue(b);\n\n life && super.reset(life, easing);\n }\n\n /**\n * Sets the new alpha value of the particle\n *\n * @method initialize\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @param {Proton.Particle} particle A single Proton generated particle\n */\n initialize(particle) {\n particle.data.alphaA = this.a.getValue();\n\n if (this.same) particle.data.alphaB = particle.data.alphaA;\n else particle.data.alphaB = this.b.getValue();\n }\n\n /**\n * @method applyBehaviour\n * @memberof Proton#Proton.Alpha\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} \t\t\ttime the integrate time 1/ms\n * @param {Int} \t\t\tindex the particle index\n */\n applyBehaviour(particle, time, index) {\n\tthis.calculate(particle, time, index);\n\t\n particle.alpha =\n particle.data.alphaB +\n\t (particle.data.alphaA - particle.data.alphaB) * this.energy;\n\t \n if (particle.alpha < 0.001) particle.alpha = 0;\n }\n}\n","import Span from \"../math/Span\";\nimport Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Scale extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Scale\n\t *\n\t * @todo add description for 'a' and 'b'\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(a, b, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(a, b);\n\t\tthis.name = 'Scale';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Number} a\n\t * @param {String} b\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\t\tthis.a = Span.setSpanValue(Util.initValue(a, 1));\n\t\tthis.b = Span.setSpanValue(b);\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.data.scaleA = this.a.getValue();\n\t\tparticle.data.oldRadius = particle.radius;\n\t\tparticle.data.scaleB = this.same ? particle.data.scaleA : this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Scale\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\t\tparticle.scale = particle.data.scaleB + (particle.data.scaleA - particle.data.scaleB) * this.energy;\n\n\t\tif (particle.scale < 0.0001) particle.scale = 0;\n\t\tparticle.radius = particle.data.oldRadius * particle.scale;\n\t}\n}","import Span from \"../math/Span\";\nimport Util from '../utils/Util';\nimport Behaviour from './Behaviour';\n\nexport default class Rotate extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Proton.Behaviour\n\t * @constructor\n\t * @alias Proton.Rotate\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} [influence=Velocity] The rotation's influence\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(influence, b, style, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.reset(influence, b, style);\n\t\tthis.name = 'Rotate';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @todo add description for 'a', 'b' and 'style'\n\t *\n\t * @param {String} a\n\t * @param {String} b\n\t * @param {String} [style=to]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(a, b, style, life, easing) {\n\t\tthis.same = b === null || b === undefined ? true : false;\n\n\t\tthis.a = Span.setSpanValue(Util.initValue(a, 'Velocity'));\n\t\tthis.b = Span.setSpanValue(Util.initValue(b, 0));\n\t\tthis.style = Util.initValue(style, 'to');\n\n\t\tlife && super.reset(life, easing);\n\t}\n\n\t/**\n\t * Initialize the behaviour's parameters for all particles\n\t *\n\t * @method initialize\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t */\n\tinitialize(particle) {\n\t\tparticle.rotation = this.a.getValue();\n\t\tparticle.data.rotationA = this.a.getValue();\n\n\t\tif (!this.same) particle.data.rotationB = this.b.getValue();\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#Proton.Rotate\n\t * @instance\n\t *\n\t * @param {Proton.Particle} particle\n\t * @param {Number} \t\t\ttime the integrate time 1/ms\n\t * @param {Int} \t\t\tindex the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.calculate(particle, time, index);\n\n\t\tif (!this.same) {\n\t\t\tif (this.style === 'to' || this.style === 'TO' || this.style === '_') {\n\t\t\t\tparticle.rotation += particle.data.rotationB + (particle.data.rotationA - particle.data.rotationB) * this.energy\n\t\t\t} else {\n\t\t\t\tparticle.rotation += particle.data.rotationB;\n\t\t\t}\n\t\t} else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') {\n\t\t\t// beta...\n\t\t\tparticle.rotation = particle.getDirection();\n\t\t}\n\t}\n\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport ArraySpan from \"../math/ArraySpan\";\nimport Behaviour from \"./Behaviour\";\n\nexport default class Color extends Behaviour {\n /**\n * @memberof! Proton#\n * @augments Proton.Behaviour\n * @constructor\n * @alias Proton.Color\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n *\n * @property {String} name The Behaviour name\n */\n constructor(a, b, life, easing) {\n super(life, easing);\n\n this.reset(a, b);\n this.name = \"Color\";\n }\n\n /**\n * Reset this behaviour's parameters\n *\n * @method reset\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black\n * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black\n * @param {Number} [life=Infinity] \tthis behaviour's life\n * @param {String} [easing=easeLinear] \tthis behaviour's easing\n */\n reset(a, b, life, easing) {\n this.a = ArraySpan.createArraySpan(a);\n this.b = ArraySpan.createArraySpan(b);\n life && super.reset(life, easing);\n }\n\n /**\n * Initialize the behaviour's parameters for all particles\n *\n * @method initialize\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n */\n initialize(particle) {\n particle.color = this.a.getValue();\n particle.data.colorA = ColorUtil.hexToRgb(particle.color);\n\n if (this.b) particle.data.colorB = ColorUtil.hexToRgb(this.b.getValue());\n }\n\n /**\n * Apply this behaviour for all particles every time\n *\n * @method applyBehaviour\n * @memberof Proton#Proton.Color\n * @instance\n *\n * @param {Proton.Particle} particle\n * @param {Number} the integrate time 1/ms\n * @param {Int} the particle index\n */\n applyBehaviour(particle, time, index) {\n if (this.b) {\n this.calculate(particle, time, index);\n\n particle.rgb.r =\n particle.data.colorB.r +\n (particle.data.colorA.r - particle.data.colorB.r) * this.energy;\n particle.rgb.g =\n particle.data.colorB.g +\n (particle.data.colorA.g - particle.data.colorB.g) * this.energy;\n particle.rgb.b =\n particle.data.colorB.b +\n (particle.data.colorA.b - particle.data.colorB.b) * this.energy;\n\n particle.rgb.r = Math.floor(particle.rgb.r);\n particle.rgb.g = Math.floor(particle.rgb.g);\n particle.rgb.b = Math.floor(particle.rgb.b);\n } else {\n particle.rgb.r = particle.data.colorA.r;\n particle.rgb.g = particle.data.colorA.g;\n particle.rgb.b = particle.data.colorA.b;\n }\n }\n}\n","import Attraction from './Attraction';\n\nexport default class Repulsion extends Attraction {\n\n\t/**\n\t * The oppisite of Proton.Attraction - turns the force\n\t *\n\t * @memberof! Proton#\n\t * @augments Proton#Proton.Attraction\n\t * @constructor\n\t * @alias Proton.Repulsion\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t *\n\t * @property {Number} force\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(targetPosition, force, radius, life, easing) {\n\t\tsuper(targetPosition, force, radius, life, easing);\n\n\t\tthis.force *= -1;\n\t\tthis.name = 'Repulsion';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#Proton.Repulsion\n\t * @instance\n\t *\n\t * @todo add description for 'force' and 'radius'\n\t *\n\t * @param {Proton.Vector2D} targetPosition the attraction point coordinates\n\t * @param {Number} [force=100]\n\t * @param {Number} [radius=1000]\n\t * @param {Number} [life=Infinity] \t\t\t\tthis behaviour's life\n\t * @param {String} [easing=ease.easeLinear] \tthis behaviour's easing\n\t */\n\treset(targetPosition, force, radius, life, easing) {\n\t\tsuper.reset(targetPosition, force, radius, life, easing);\n\t\tthis.force *= -1;\n\t}\n}\n","import Util from '../utils/Util';\nimport Vector2D from '../math/Vector2D';\nimport Behaviour from './Behaviour';\n\nexport default class GravityWell extends Behaviour {\n\n\t/**\n\t * @memberof! Proton#\n\t * @augments Behaviour\n\t * @constructor\n\t * @alias GravityWell\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t *\n\t * @property {String} name The Behaviour name\n\t */\n\tconstructor(centerPoint, force, life, easing) {\n\t\tsuper(life, easing);\n\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tthis.name = 'GravityWell';\n\t}\n\n\t/**\n\t * Reset this behaviour's parameters\n\t *\n\t * @method reset\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Vector2D} [centerPoint=new Vector2D] The point in the center\n\t * @param {Number} [force=100]\t\t\t\t\tThe force\n\t * @param {Number} [life=Infinity]\t\t\t\tthis behaviour's life\n\t * @param {String} [easing=easeLinear]\tthis behaviour's easing\n\t */\n\treset(centerPoint, force, life, easing) {\n\t\tthis.distanceVec = new Vector2D();\n\t\tthis.centerPoint = Util.initValue(centerPoint, new Vector2D);\n\t\tthis.force = Util.initValue(this.normalizeValue(force), 100);\n\n\t\tlife && super.reset(life, easing);\n\t};\n\n\t/**\n\t * @inheritdoc\n\t */\n\tinitialize(particle) {\n\t};\n\n\t/**\n\t * Apply this behaviour for all particles every time\n\t *\n\t * @method applyBehaviour\n\t * @memberof Proton#GravityWell\n\t * @instance\n\t *\n\t * @param {Particle} particle\n\t * @param {Number} the integrate time 1/ms\n\t * @param {Int} the particle index\n\t */\n\tapplyBehaviour(particle, time, index) {\n\t\tthis.distanceVec.set(this.centerPoint.x - particle.p.x, this.centerPoint.y - particle.p.y);\n\t\tconst distanceSq = this.distanceVec.lengthSq();\n\n\t\tif (distanceSq !== 0) {\n\t\t\tconst distance = this.distanceVec.length();\n\t\t\tconst factor = (this.force * time) / (distanceSq * distance);\n\n\t\t\tparticle.v.x += factor * this.distanceVec.x;\n\t\t\tparticle.v.y += factor * this.distanceVec.y;\n\t\t}\n\t}\n}","import Util from \"../utils/Util\";\nimport Initialize from \"./Initialize\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default {\n initialize(emitter, particle, initializes) {\n const length = initializes.length;\n let i;\n\n for (i = 0; i < length; i++) {\n if (initializes[i] instanceof Initialize) {\n initializes[i].init(emitter, particle);\n } else {\n this.init(emitter, particle, initializes[i]);\n }\n }\n\n this.bindEmitter(emitter, particle);\n },\n\n // init\n init(emitter, particle, initialize) {\n Util.setProp(particle, initialize);\n Util.setVectorVal(particle, initialize);\n },\n\n bindEmitter(emitter, particle) {\n if (emitter.bindEmitter) {\n particle.p.add(emitter.p);\n particle.v.add(emitter.v);\n particle.a.add(emitter.a);\n\n particle.v.rotate(MathUtil.degreeTransform(emitter.rotation));\n }\n }\n};\n","import Util from \"../utils/Util\";\nimport Puid from \"../utils/Puid\";\nimport Particle from \"../core/Particle\";\nimport EventDispatcher from \"../events/EventDispatcher\";\n\nimport Rate from \"../initialize/Rate\";\nimport InitializeUtil from \"../initialize/InitializeUtil\";\n\nexport default class Emitter extends Particle {\n /**\n * You can use this emit particles.\n *\n * It will dispatch follow events:\n * PARTICLE_CREATED\n * PARTICLE_UPDATA\n * PARTICLE_DEAD\n *\n * @class Emitter\n * @constructor\n * @param {Object} conf the parameters object;\n * for example {damping:0.01,bindEmitter:false}\n */\n constructor(conf = {}) {\n super(conf);\n\n this.particles = [];\n this.behaviours = [];\n this.initializes = [];\n\n this.emitTime = 0;\n this.emitSpeed = 0;\n this.totalTime = -1;\n\n /**\n * The friction coefficient for all particle emit by This;\n * @property damping\n * @type {Number}\n * @default 0.006\n */\n this.damping = 0.006;\n\n /**\n * If bindEmitter the particles can bind this emitter's property;\n * @property bindEmitter\n * @type {Boolean}\n * @default true\n */\n this.bindEmitter = true;\n\n /**\n * The number of particles per second emit (a [particle]/b [s]);\n * @property rate\n * @type {Rate}\n * @default Rate(1, .1)\n */\n this.rate = new Rate(1, 0.1);\n\n this.name = \"Emitter\";\n this.id = Puid.id(this.name);\n }\n\n /**\n * start emit particle\n * @method emit\n * @param {Number} emitTime begin emit time;\n * @param {String} life the life of this emitter\n */\n emit(totalTime, life) {\n this.stoped = false;\n this.emitTime = 0;\n this.totalTime = Util.initValue(totalTime, Infinity);\n\n if (life === true || life === \"life\" || life === \"destroy\") {\n this.life = totalTime === \"once\" ? 1 : this.totalTime;\n } else if (!isNaN(life)) {\n this.life = life;\n }\n\n this.rate.init();\n }\n\n /**\n * stop emiting\n * @method stop\n */\n stop() {\n this.totalTime = -1;\n this.emitTime = 0;\n this.stoped = true;\n }\n\n preEmit(time) {\n let oldStoped = this.stoped;\n let oldEmitTime = this.emitTime;\n let oldTotalTime = this.totalTime;\n\n this.stoped = false;\n this.emitTime = 0;\n this.totalTime = time;\n this.rate.init();\n\n const step = 0.0167;\n while (time > step) {\n time -= step;\n this.update(step);\n }\n\n this.stoped = oldStoped;\n this.emitTime = oldEmitTime + Math.max(time, 0);\n this.totalTime = oldTotalTime;\n }\n\n /**\n * remove current all particles\n * @method removeAllParticles\n */\n removeAllParticles() {\n let i = this.particles.length;\n while (i--) this.particles[i].dead = true;\n }\n\n /**\n * add initialize to this emitter\n * @method addSelfInitialize\n */\n addSelfInitialize(initialize) {\n if (initialize[\"init\"]) {\n initialize.init(this);\n } else {\n this.initAll();\n }\n }\n\n /**\n * add the Initialize to particles;\n *\n * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3);\n * @method addInitialize\n * @param {Initialize} initialize like this new Radius(1, 12)\n */\n addInitialize(...rest) {\n let i = rest.length;\n while (i--) this.initializes.push(rest[i]);\n }\n\n /**\n * remove the Initialize\n * @method removeInitialize\n * @param {Initialize} initialize a initialize\n */\n removeInitialize(initializer) {\n const index = this.initializes.indexOf(initializer);\n if (index > -1) this.initializes.splice(index, 1);\n }\n\n /**\n * remove all Initializes\n * @method removeInitializers\n */\n removeAllInitializers() {\n Util.emptyArray(this.initializes);\n }\n\n /**\n * add the Behaviour to particles;\n *\n * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3);\n * @method addBehaviour\n * @param {Behaviour} behaviour like this new Color('random')\n */\n addBehaviour(...rest) {\n let i = arguments.length;\n while (i--) {\n let behaviour = rest[i];\n this.behaviours.push(behaviour);\n if (behaviour.parents) behaviour.parents.push(this);\n }\n }\n\n /**\n * remove the Behaviour\n * @method removeBehaviour\n * @param {Behaviour} behaviour a behaviour\n */\n removeBehaviour(behaviour) {\n let index = this.behaviours.indexOf(behaviour);\n this.behaviours.splice(index, 1);\n\n if (behaviour.parents) {\n index = behaviour.parents.indexOf(behaviour);\n behaviour.parents.splice(index, 1);\n }\n\n return index;\n }\n\n /**\n * remove all behaviours\n * @method removeAllBehaviours\n */\n removeAllBehaviours() {\n Util.emptyArray(this.behaviours);\n }\n\n // emitter update\n update(time) {\n this.age += time;\n if (this.age >= this.life || this.dead) this.destroy();\n\n this.emitting(time);\n this.integrate(time);\n }\n\n integrate(time) {\n if (!this.parent) return;\n\n const damping = 1 - this.damping;\n this.parent.integrator.calculate(this, time, damping);\n\n const length = this.particles.length;\n let i, particle;\n\n for (i = length - 1; i >= 0; i--) {\n particle = this.particles[i];\n\n // particle update\n particle.update(time, i);\n this.parent.integrator.calculate(particle, time, damping);\n this.dispatch(\"PARTICLE_UPDATE\", particle);\n\n // check dead\n if (particle.dead) {\n this.dispatch(\"PARTICLE_DEAD\", particle);\n\n this.parent.pool.expire(particle);\n this.particles.splice(i, 1);\n }\n }\n }\n\n dispatch(event, target) {\n this.parent && this.parent.dispatchEvent(event, target);\n this.bindEvent && this.dispatchEvent(event, target);\n }\n\n emitting(time) {\n if (this.totalTime === \"once\") {\n let i;\n const length = this.rate.getValue(99999);\n\n if (length > 0) this.emitSpeed = length;\n for (i = 0; i < length; i++) this.createParticle();\n this.totalTime = \"none\";\n } else {\n this.emitTime += time;\n\n if (this.emitTime < this.totalTime) {\n const length = this.rate.getValue(time);\n let i;\n\n if (length > 0) this.emitSpeed = length;\n for (i = 0; i < length; i++) this.createParticle();\n }\n }\n }\n\n /**\n * create single particle;\n *\n * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun})\n * @method removeAllParticles\n */\n createParticle(initialize, behaviour) {\n const particle = this.parent.pool.get(Particle);\n this.setupParticle(particle, initialize, behaviour);\n this.dispatch(\"PARTICLE_CREATED\", particle);\n\n return particle;\n }\n\n setupParticle(particle, initialize, behaviour) {\n let initializes = this.initializes;\n let behaviours = this.behaviours;\n\n if (initialize) initializes = Util.toArray(initialize);\n if (behaviour) behaviours = Util.toArray(behaviour);\n\n particle.reset();\n InitializeUtil.initialize(this, particle, initializes);\n particle.addBehaviours(behaviours);\n particle.parent = this;\n\n this.particles.push(particle);\n }\n\n remove() {\n this.stop();\n Util.destroyAll(this.particles);\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n this.dead = true;\n this.remove();\n this.removeAllInitializers();\n this.removeAllBehaviours();\n this.parent && this.parent.removeEmitter(this);\n }\n}\n\nEventDispatcher.bind(Emitter);\n","import Emitter from \"./Emitter\";\n\nexport default class BehaviourEmitter extends Emitter {\n /**\n * The BehaviourEmitter class inherits from Proton.Emitter\n *\n * use the BehaviourEmitter you can add behaviours to self;\n * @class Proton.BehaviourEmitter\n * @constructor\n * @param {Object} conf the parameters object;\n */\n constructor(conf) {\n super(conf);\n\n this.selfBehaviours = [];\n }\n\n /**\n * add the Behaviour to emitter;\n *\n * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3);\n * @method addSelfBehaviour\n * @param {Proton.Behaviour} behaviour like this new Proton.Color('random')\n */\n addSelfBehaviour(...rest) {\n let i,\n length = rest.length;\n\n for (i = 0; i < length; i++) {\n this.selfBehaviours.push(rest[i]);\n }\n }\n\n /**\n * remove the Behaviour for self\n * @method removeSelfBehaviour\n * @param {Proton.Behaviour} behaviour a behaviour\n */\n removeSelfBehaviour(behaviour) {\n const index = this.selfBehaviours.indexOf(behaviour);\n if (index > -1) this.selfBehaviours.splice(index, 1);\n }\n\n update(time) {\n super.update(time);\n\n if (!this.sleep) {\n const length = this.selfBehaviours.length;\n let i;\n\n for (i = 0; i < length; i++) {\n this.selfBehaviours[i].applyBehaviour(this, time, i);\n }\n }\n }\n}\n","import Util from \"../utils/Util\";\nimport Emitter from \"./Emitter\";\n\nexport default class FollowEmitter extends Emitter {\n /**\n * The FollowEmitter class inherits from Proton.Emitter\n *\n * use the FollowEmitter will emit particle when mousemoving\n *\n * @class Proton.FollowEmitter\n * @constructor\n * @param {Element} mouseTarget mouseevent's target;\n * @param {Number} ease the easing of following speed;\n * @default 0.7\n * @param {Object} conf the parameters object;\n */\n constructor(mouseTarget, ease, conf) {\n super(conf);\n\n this.mouseTarget = Util.initValue(mouseTarget, window);\n this.ease = Util.initValue(ease, 0.7);\n\n this._allowEmitting = false;\n this.initEventHandler();\n }\n\n initEventHandler() {\n this.mousemoveHandler = e => this.mousemove.call(this, e);\n this.mousedownHandler = e => this.mousedown.call(this, e);\n this.mouseupHandler = e => this.mouseup.call(this, e);\n\n this.mouseTarget.addEventListener(\n \"mousemove\",\n this.mousemoveHandler,\n false\n );\n }\n\n /**\n * start emit particle\n * @method emit\n */\n emit() {\n this._allowEmitting = true;\n }\n\n /**\n * stop emiting\n * @method stop\n */\n stop() {\n this._allowEmitting = false;\n }\n\n mousemove(e) {\n if (e.layerX || e.layerX === 0) {\n this.p.x += (e.layerX - this.p.x) * this.ease;\n this.p.y += (e.layerY - this.p.y) * this.ease;\n } else if (e.offsetX || e.offsetX === 0) {\n this.p.x += (e.offsetX - this.p.x) * this.ease;\n this.p.y += (e.offsetY - this.p.y) * this.ease;\n }\n\n if (this._allowEmitting) super.emit(\"once\");\n }\n\n /**\n * Destory this Emitter\n * @method destroy\n */\n destroy() {\n super.destroy();\n this.mouseTarget.removeEventListener(\n \"mousemove\",\n this.mousemoveHandler,\n false\n );\n }\n}\n","import Pool from \"../core/Pool\";\nimport Util from \"../utils/Util\";\n\nexport default class BaseRenderer {\n constructor(element, stroke) {\n this.pool = new Pool();\n this.element = element;\n this.stroke = stroke;\n this.circleConf = { isCircle: true };\n\n this.initHandler();\n this.name = \"BaseRenderer\";\n }\n\n setStroke(color = \"#000000\", thinkness = 1) {\n this.stroke = { color, thinkness };\n }\n\n initHandler() {\n this._protonUpdateHandler = () => {\n this.onProtonUpdate.call(this);\n };\n\n this._protonUpdateAfterHandler = () => {\n this.onProtonUpdateAfter.call(this);\n };\n\n this._emitterAddedHandler = emitter => {\n this.onEmitterAdded.call(this, emitter);\n };\n\n this._emitterRemovedHandler = emitter => {\n this.onEmitterRemoved.call(this, emitter);\n };\n\n this._particleCreatedHandler = particle => {\n this.onParticleCreated.call(this, particle);\n };\n\n this._particleUpdateHandler = particle => {\n this.onParticleUpdate.call(this, particle);\n };\n\n this._particleDeadHandler = particle => {\n this.onParticleDead.call(this, particle);\n };\n }\n\n init(proton) {\n this.parent = proton;\n\n proton.addEventListener(\"PROTON_UPDATE\", this._protonUpdateHandler);\n proton.addEventListener(\n \"PROTON_UPDATE_AFTER\",\n this._protonUpdateAfterHandler\n );\n\n proton.addEventListener(\"EMITTER_ADDED\", this._emitterAddedHandler);\n proton.addEventListener(\"EMITTER_REMOVED\", this._emitterRemovedHandler);\n\n proton.addEventListener(\n \"PARTICLE_CREATED\",\n this._particleCreatedHandler\n );\n proton.addEventListener(\"PARTICLE_UPDATE\", this._particleUpdateHandler);\n proton.addEventListener(\"PARTICLE_DEAD\", this._particleDeadHandler);\n }\n\n resize(width, height) {}\n\n destroy() {\n this.remove();\n }\n\n remove(proton) {\n this.parent.removeEventListener(\n \"PROTON_UPDATE\",\n this._protonUpdateHandler\n );\n this.parent.removeEventListener(\n \"PROTON_UPDATE_AFTER\",\n this._protonUpdateAfterHandler\n );\n\n this.parent.removeEventListener(\n \"EMITTER_ADDED\",\n this._emitterAddedHandler\n );\n this.parent.removeEventListener(\n \"EMITTER_REMOVED\",\n this._emitterRemovedHandler\n );\n\n this.parent.removeEventListener(\n \"PARTICLE_CREATED\",\n this._particleCreatedHandler\n );\n this.parent.removeEventListener(\n \"PARTICLE_UPDATE\",\n this._particleUpdateHandler\n );\n this.parent.removeEventListener(\n \"PARTICLE_DEAD\",\n this._particleDeadHandler\n );\n\n this.parent = null;\n }\n\n onProtonUpdate() {}\n onProtonUpdateAfter() {}\n\n onEmitterAdded(emitter) {}\n onEmitterRemoved(emitter) {}\n\n onParticleCreated(particle) {}\n onParticleUpdate(particle) {}\n onParticleDead(particle) {}\n}\n","import ImgUtil from \"../utils/ImgUtil\";\nimport ColorUtil from \"../utils/ColorUtil\";\nimport MathUtil from \"../math/MathUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class CanvasRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.context = this.element.getContext(\"2d\");\n this.bufferCache = {};\n this.name = \"CanvasRenderer\";\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n onProtonUpdate() {\n this.context.clearRect(0, 0, this.element.width, this.element.height);\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.color = particle.color || \"#ff0000\";\n }\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n if (particle.body instanceof Image) this.drawImage(particle);\n } else {\n this.drawCircle(particle);\n }\n }\n\n onParticleDead(particle) {\n particle.body = null;\n }\n\n // private\n addImg2Body(img, particle) {\n particle.body = img;\n }\n\n // private drawCircle\n drawImage(particle) {\n const w = (particle.body.width * particle.scale) | 0;\n const h = (particle.body.height * particle.scale) | 0;\n const x = particle.p.x - w / 2;\n const y = particle.p.y - h / 2;\n\n if (!!particle.color) {\n if (!particle.data[\"buffer\"])\n particle.data.buffer = this.createBuffer(particle.body);\n\n const bufContext = particle.data.buffer.getContext(\"2d\");\n bufContext.clearRect(\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height\n );\n bufContext.globalAlpha = particle.alpha;\n bufContext.drawImage(particle.body, 0, 0);\n\n bufContext.globalCompositeOperation = \"source-atop\";\n bufContext.fillStyle = ColorUtil.rgbToHex(particle.rgb);\n bufContext.fillRect(\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height\n );\n bufContext.globalCompositeOperation = \"source-over\";\n bufContext.globalAlpha = 1;\n\n this.context.drawImage(\n particle.data.buffer,\n 0,\n 0,\n particle.data.buffer.width,\n particle.data.buffer.height,\n x,\n y,\n w,\n h\n );\n } else {\n this.context.save();\n\n this.context.globalAlpha = particle.alpha;\n this.context.translate(particle.p.x, particle.p.y);\n this.context.rotate(MathUtil.degreeTransform(particle.rotation));\n this.context.translate(-particle.p.x, -particle.p.y);\n this.context.drawImage(\n particle.body,\n 0,\n 0,\n particle.body.width,\n particle.body.height,\n x,\n y,\n w,\n h\n );\n\n this.context.globalAlpha = 1;\n this.context.restore();\n }\n }\n\n // private drawCircle --\n drawCircle(particle) {\n if (particle.rgb) {\n this.context.fillStyle = `rgba(${particle.rgb.r},${particle.rgb.g},${particle.rgb.b},${particle.alpha})`;\n } else {\n this.context.fillStyle = particle.color;\n }\n\n // draw circle\n this.context.beginPath();\n this.context.arc(\n particle.p.x,\n particle.p.y,\n particle.radius,\n 0,\n Math.PI * 2,\n true\n );\n\n if (this.stroke) {\n this.context.strokeStyle = this.stroke.color;\n this.context.lineWidth = this.stroke.thinkness;\n this.context.stroke();\n }\n\n this.context.closePath();\n this.context.fill();\n }\n\n // private createBuffer\n createBuffer(image) {\n if (image instanceof Image) {\n const size = image.width + \"_\" + image.height;\n let canvas = this.bufferCache[size];\n\n if (!canvas) {\n canvas = document.createElement(\"canvas\");\n canvas.width = image.width;\n canvas.height = image.height;\n this.bufferCache[size] = canvas;\n }\n\n return canvas;\n }\n }\n}\n","import DomUtil from \"../utils/DomUtil\";\nimport ImgUtil from \"../utils/ImgUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class DomRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.stroke = null;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.transform3d = false;\n this.name = \"DomRenderer\";\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n this.element.appendChild(particle.body);\n }\n }\n\n onParticleUpdate(particle) {\n if (this.bodyReady(particle)) {\n if (this.transform3d)\n DomUtil.transform3d(\n particle.body,\n particle.p.x,\n particle.p.y,\n particle.scale,\n particle.rotation\n );\n else\n DomUtil.transform(\n particle.body,\n particle.p.x,\n particle.p.y,\n particle.scale,\n particle.rotation\n );\n\n particle.body.style.opacity = particle.alpha;\n if (particle.body.isCircle) {\n particle.body.style.backgroundColor = particle.color || \"#ff0000\";\n }\n }\n }\n\n onParticleDead(particle) {\n if (this.bodyReady(particle)) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n }\n\n bodyReady(particle) {\n return (\n typeof particle.body === \"object\" &&\n particle.body &&\n !particle.body.isInner\n );\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = this.pool.get(img, particle);\n DomUtil.resize(particle.body, img.width, img.height);\n\n this.element.appendChild(particle.body);\n }\n\n createBody(body, particle) {\n if (body.isCircle) return this.createCircle(particle);\n else return this.createSprite(body, particle);\n }\n\n // private --\n createCircle(particle) {\n const dom = DomUtil.createDiv(\n `${particle.id}_dom`,\n 2 * particle.radius,\n 2 * particle.radius\n );\n dom.style.borderRadius = `${particle.radius}px`;\n\n if (this.stroke) {\n dom.style.borderColor = this.stroke.color;\n dom.style.borderWidth = `${this.stroke.thinkness}px`;\n }\n dom.isCircle = true;\n\n return dom;\n }\n\n createSprite(body, particle) {\n const url = typeof body === \"string\" ? body : body.src;\n const dom = DomUtil.createDiv(\n `${particle.id}_dom`,\n body.width,\n body.height\n );\n dom.style.backgroundImage = `url(${url})`;\n\n return dom;\n }\n}\n","import BaseRenderer from \"./BaseRenderer\";\n\nexport default class EaselRenderer extends BaseRenderer {\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.name = \"EaselRenderer\";\n }\n\n onParticleCreated(particle) {\n if (particle.body) {\n this.createSprite(particle);\n } else {\n this.createCircle(particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n onParticleUpdate(particle) {\n if (particle.body) {\n particle.body.x = particle.p.x;\n particle.body.y = particle.p.y;\n\n particle.body.alpha = particle.alpha;\n particle.body.scaleX = particle.body.scaleY = particle.scale;\n particle.body.rotation = particle.rotation;\n }\n }\n\n onParticleDead(particle) {\n if (particle.body) {\n particle.body.parent && particle.body.parent.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n if (particle.graphics) this.pool.expire(particle.graphics);\n }\n\n // private\n createSprite(particle) {\n particle.body = this.pool.get(particle.body);\n\n if (particle.body.parent) return;\n if (particle.body[\"image\"]) {\n particle.body.regX = particle.body.image.width / 2;\n particle.body.regY = particle.body.image.height / 2;\n }\n }\n\n createCircle(particle) {\n const graphics = this.pool.get(createjs.Graphics);\n\n if (this.stroke) {\n if (this.stroke instanceof String) graphics.beginStroke(this.stroke);\n else graphics.beginStroke(\"#000000\");\n }\n graphics\n .beginFill(particle.color || \"#ff0000\")\n .drawCircle(0, 0, particle.radius);\n\n const shape = this.pool.get(createjs.Shape, [graphics]);\n\n particle.body = shape;\n particle.graphics = graphics;\n }\n}\n","import Rectangle from \"../math/Rectangle\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class PixelRenderer extends BaseRenderer {\n constructor(element, rectangle) {\n super(element);\n\n this.context = this.element.getContext(\"2d\");\n this.imageData = null;\n this.rectangle = null;\n this.rectangle = rectangle;\n this.createImageData(rectangle);\n\n this.name = \"PixelRenderer\";\n }\n\n resize(width, height) {\n this.element.width = width;\n this.element.height = height;\n }\n\n createImageData(rectangle) {\n this.rectangle = rectangle\n ? rectangle\n : new Rectangle(0, 0, this.element.width, this.element.height);\n this.imageData = this.context.createImageData(\n this.rectangle.width,\n this.rectangle.height\n );\n this.context.putImageData(\n this.imageData,\n this.rectangle.x,\n this.rectangle.y\n );\n }\n\n onProtonUpdate() {\n this.context.clearRect(\n this.rectangle.x,\n this.rectangle.y,\n this.rectangle.width,\n this.rectangle.height\n );\n this.imageData = this.context.getImageData(\n this.rectangle.x,\n this.rectangle.y,\n this.rectangle.width,\n this.rectangle.height\n );\n }\n\n onProtonUpdateAfter() {\n this.context.putImageData(\n this.imageData,\n this.rectangle.x,\n this.rectangle.y\n );\n }\n\n onParticleCreated(particle) {}\n\n onParticleUpdate(particle) {\n if (this.imageData) {\n this.setPixel(\n this.imageData,\n Math.floor(particle.p.x - this.rectangle.x),\n Math.floor(particle.p.y - this.rectangle.y),\n particle\n );\n }\n }\n\n setPixel(imagedata, x, y, particle) {\n const rgb = particle.rgb;\n if (x < 0 || x > this.element.width || y < 0 || y > this.elementwidth)\n return;\n\n const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4;\n\n imagedata.data[i] = rgb.r;\n imagedata.data[i + 1] = rgb.g;\n imagedata.data[i + 2] = rgb.b;\n imagedata.data[i + 3] = particle.alpha * 255;\n }\n\n onParticleDead(particle) {}\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport MathUtil from \"../math/MathUtil\";\nimport BaseRenderer from \"./BaseRenderer\";\n\nexport default class PixiRenderer extends BaseRenderer {\n constructor(element, stroke) {\n super(element);\n\n this.stroke = stroke;\n this.setColor = false;\n this.pool.create = (body, particle) => this.createBody(body, particle);\n this.createFromImage = PIXI.Sprite.from || PIXI.Sprite.fromImage;\n\n this.name = \"PixiRenderer\";\n }\n\n onProtonUpdate() {}\n\n /**\n * @param particle\n */\n onParticleCreated(particle) {\n if (particle.body) {\n particle.body = this.pool.get(particle.body, particle);\n } else {\n particle.body = this.pool.get(this.circleConf, particle);\n }\n\n this.element.addChild(particle.body);\n }\n\n /**\n * @param particle\n */\n onParticleUpdate(particle) {\n this.transform(particle, particle.body);\n if (this.setColor)\n particle.body.tint = ColorUtil.getHex16FromParticle(particle);\n }\n\n /**\n * @param particle\n */\n onParticleDead(particle) {\n this.element.removeChild(particle.body);\n this.pool.expire(particle.body);\n particle.body = null;\n }\n\n destroy(particles) {\n super.destroy();\n this.pool.destroy();\n\n let i = particles.length;\n while (i--) {\n let particle = particles[i];\n if (particle.body) {\n this.element.removeChild(particle.body);\n }\n }\n }\n\n transform(particle, target) {\n target.x = particle.p.x;\n target.y = particle.p.y;\n\n target.alpha = particle.alpha;\n\n target.scale.x = particle.scale;\n target.scale.y = particle.scale;\n\n // using cached version of MathUtil.PI_180 for slight performance increase.\n target.rotation = particle.rotation * MathUtil.PI_180; // MathUtil.PI_180;\n }\n\n createBody(body, particle) {\n if (body.isCircle) return this.createCircle(particle);\n else return this.createSprite(body);\n }\n\n createSprite(body) {\n const sprite = body.isInner\n ? this.createFromImage(body.src)\n : new PIXI.Sprite(body);\n\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n\n return sprite;\n }\n\n createCircle(particle) {\n const graphics = new PIXI.Graphics();\n\n if (this.stroke) {\n const stroke = this.stroke instanceof String ? this.stroke : 0x000000;\n graphics.beginStroke(stroke);\n }\n\n graphics.beginFill(particle.color || 0x008ced);\n graphics.drawCircle(0, 0, particle.radius);\n graphics.endFill();\n\n return graphics;\n }\n}\n","import Mat3 from \"../math/Mat3\";\n\nexport default class MStack {\n constructor() {\n this.mats = [];\n this.size = 0;\n\n for (let i = 0; i < 20; i++)\n this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0]));\n }\n\n set(m, i) {\n if (i === 0) Mat3.set(m, this.mats[0]);\n else Mat3.multiply(this.mats[i - 1], m, this.mats[i]);\n\n this.size = Math.max(this.size, i + 1);\n }\n\n push(m) {\n if (this.size === 0) Mat3.set(m, this.mats[0]);\n else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]);\n\n this.size++;\n }\n\n pop() {\n if (this.size > 0) this.size--;\n }\n\n top() {\n return this.mats[this.size - 1];\n }\n}\n","import Mat3 from '../math/Mat3';\nimport BaseRenderer from './BaseRenderer';\n\nimport Util from '../utils/Util';\nimport ImgUtil from '../utils/ImgUtil';\nimport MStack from '../utils/MStack';\nimport DomUtil from '../utils/DomUtil';\nimport WebGLUtil from '../utils/WebGLUtil';\nimport MathUtil from '../math/MathUtil';\n\nexport default class WebGLRenderer extends BaseRenderer {\n\n constructor(element) {\n super(element);\n\n this.gl = this.element.getContext('experimental-webgl', { antialias: true, stencil: false, depth: false });\n if (!this.gl) alert('Sorry your browser do not suppest WebGL!');\n\n this.initVar();\n this.setMaxRadius();\n this.initShaders();\n this.initBuffers();\n\n this.gl.blendEquation(this.gl.FUNC_ADD);\n this.gl.blendFunc(this.gl.SRC_ALPHA, this.gl.ONE_MINUS_SRC_ALPHA);\n this.gl.enable(this.gl.BLEND);\n\n this.addImg2Body = this.addImg2Body.bind(this);\n\n this.name = 'WebGLRenderer';\n }\n\n init(proton) {\n super.init(proton);\n this.resize(this.element.width, this.element.height);\n }\n\n resize(width, height) {\n this.umat[4] = -2;\n this.umat[7] = 1;\n\n this.smat[0] = 1 / width;\n this.smat[4] = 1 / height;\n\n this.mstack.set(this.umat, 0);\n this.mstack.set(this.smat, 1);\n\n this.gl.viewport(0, 0, width, height);\n this.element.width = width;\n this.element.height = height;\n }\n\n setMaxRadius(radius) {\n this.circleCanvasURL = this.createCircle(radius);\n }\n\n getVertexShader() {\n const vsSource = ['uniform vec2 viewport;', 'attribute vec2 aVertexPosition;', 'attribute vec2 aTextureCoord;', 'uniform mat3 tMat;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'void main() {', 'vec3 v = tMat * vec3(aVertexPosition, 1.0);', 'gl_Position = vec4(v.x, v.y, 0, 1);', 'vTextureCoord = aTextureCoord;', 'alpha = tMat[0][2];', '}'].join('\\n');\n return vsSource;\n }\n\n getFragmentShader() {\n const fsSource = ['precision mediump float;', 'varying vec2 vTextureCoord;', 'varying float alpha;', 'uniform sampler2D uSampler;', 'uniform vec4 color;', 'uniform bool useTexture;', 'uniform vec3 uColor;', 'void main() {', 'vec4 textureColor = texture2D(uSampler, vTextureCoord);', 'gl_FragColor = textureColor * vec4(uColor, 1.0);', 'gl_FragColor.w *= alpha;', '}'].join('\\n');\n return fsSource;\n }\n\n initVar() {\n this.mstack = new MStack();\n this.umat = Mat3.create([2, 0, 1, 0, -2, 0, -1, 1, 1]);\n this.smat = Mat3.create([1 / 100, 0, 1, 0, 1 / 100, 0, 0, 0, 1]);\n this.texturebuffers = {};\n }\n\n blendEquation(A) {\n this.gl.blendEquation(this.gl[A]);\n }\n\n blendFunc(A, B) {\n this.gl.blendFunc(this.gl[A], this.gl[B]);\n }\n\n getShader(gl, str, fs) {\n const shader = fs ? gl.createShader(gl.FRAGMENT_SHADER) : gl.createShader(gl.VERTEX_SHADER);\n\n gl.shaderSource(shader, str);\n gl.compileShader(shader);\n\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n alert(gl.getShaderInfoLog(shader));\n return null;\n }\n\n return shader;\n }\n\n initShaders() {\n const fragmentShader = this.getShader(this.gl, this.getFragmentShader(), true);\n const vertexShader = this.getShader(this.gl, this.getVertexShader(), false);\n\n this.sprogram = this.gl.createProgram();\n this.gl.attachShader(this.sprogram, vertexShader);\n this.gl.attachShader(this.sprogram, fragmentShader);\n this.gl.linkProgram(this.sprogram);\n\n if (!this.gl.getProgramParameter(this.sprogram, this.gl.LINK_STATUS))\n alert('Could not initialise shaders');\n\n this.gl.useProgram(this.sprogram);\n this.sprogram.vpa = this.gl.getAttribLocation(this.sprogram, 'aVertexPosition');\n this.sprogram.tca = this.gl.getAttribLocation(this.sprogram, 'aTextureCoord');\n this.gl.enableVertexAttribArray(this.sprogram.tca);\n this.gl.enableVertexAttribArray(this.sprogram.vpa);\n\n this.sprogram.tMatUniform = this.gl.getUniformLocation(this.sprogram, 'tMat');\n this.sprogram.samplerUniform = this.gl.getUniformLocation(this.sprogram, 'uSampler');\n this.sprogram.useTex = this.gl.getUniformLocation(this.sprogram, 'useTexture');\n this.sprogram.color = this.gl.getUniformLocation(this.sprogram, 'uColor');\n this.gl.uniform1i(this.sprogram.useTex, 1);\n };\n\n initBuffers() {\n const vs = [0, 3, 1, 0, 2, 3];\n let idx;\n\n this.unitIBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(vs), this.gl.STATIC_DRAW);\n\n let i;\n let ids = [];\n for (i = 0; i < 100; i++) ids.push(i);\n idx = new Uint16Array(ids);\n\n this.unitI33 = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitI33);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n\n ids = [];\n for (i = 0; i < 100; i++) ids.push(i, i + 1, i + 2);\n idx = new Uint16Array(ids);\n\n this.stripBuffer = this.gl.createBuffer();\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.stripBuffer);\n this.gl.bufferData(this.gl.ELEMENT_ARRAY_BUFFER, idx, this.gl.STATIC_DRAW);\n };\n\n createCircle(raidus) {\n this.circleCanvasRadius = WebGLUtil.nhpot(Util.initValue(raidus, 32));\n const canvas = DomUtil.createCanvas('circle_canvas', this.circleCanvasRadius * 2, this.circleCanvasRadius * 2);\n const context = canvas.getContext('2d');\n\n context.beginPath();\n context.arc(this.circleCanvasRadius, this.circleCanvasRadius, this.circleCanvasRadius, 0, Math.PI * 2, true);\n context.closePath();\n context.fillStyle = '#FFF';\n context.fill();\n\n return canvas.toDataURL();\n };\n\n drawImg2Canvas(particle) {\n const _w = particle.body.width;\n const _h = particle.body.height;\n\n const _width = WebGLUtil.nhpot(particle.body.width);\n const _height = WebGLUtil.nhpot(particle.body.height);\n\n const _scaleX = particle.body.width / _width;\n const _scaleY = particle.body.height / _height;\n\n if (!this.texturebuffers[particle.data.src])\n this.texturebuffers[particle.data.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()];\n\n particle.data.texture = this.texturebuffers[particle.data.src][0];\n particle.data.vcBuffer = this.texturebuffers[particle.data.src][1];\n particle.data.tcBuffer = this.texturebuffers[particle.data.src][2];\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _scaleX, 0.0, 0.0, _scaleY, _scaleY, _scaleY]), this.gl.STATIC_DRAW);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer);\n this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _w, 0.0, 0.0, _h, _w, _h]), this.gl.STATIC_DRAW);\n\n const context = particle.data.canvas.getContext('2d');\n const data = context.getImageData(0, 0, _width, _height);\n\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture);\n this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR);\n this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST);\n this.gl.generateMipmap(this.gl.TEXTURE_2D);\n\n particle.data.textureLoaded = true;\n particle.data.textureWidth = _w;\n particle.data.textureHeight = _h;\n }\n\n onProtonUpdate() {\n // this.gl.clearColor(0, 0, 0, 1);\n // this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\n }\n\n onParticleCreated(particle) {\n particle.data.textureLoaded = false;\n particle.data.tmat = Mat3.create();\n particle.data.tmat[8] = 1;\n particle.data.imat = Mat3.create();\n particle.data.imat[8] = 1;\n\n if (particle.body) {\n ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle);\n } else {\n ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle);\n particle.data.oldScale = particle.radius / this.circleCanvasRadius;\n }\n }\n\n // private\n addImg2Body(img, particle) {\n if (particle.dead) return;\n particle.body = img;\n particle.data.src = img.src;\n particle.data.canvas = ImgUtil.getCanvasFromCache(img);\n particle.data.oldScale = 1;\n\n this.drawImg2Canvas(particle);\n }\n\n onParticleUpdate(particle) {\n if (particle.data.textureLoaded) {\n this.updateMatrix(particle);\n\n this.gl.uniform3f(this.sprogram.color, particle.rgb.r / 255, particle.rgb.g / 255, particle.rgb.b / 255);\n this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top());\n\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer);\n this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0);\n this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture);\n this.gl.uniform1i(this.sprogram.samplerUniform, 0);\n this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer);\n\n this.gl.drawElements(this.gl.TRIANGLES, 6, this.gl.UNSIGNED_SHORT, 0);\n\n this.mstack.pop();\n }\n }\n\n onParticleDead(particle) { }\n\n updateMatrix(particle) {\n const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.data.textureWidth / 2, -particle.data.textureHeight / 2);\n const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y);\n\n const angel = particle.rotation * (MathUtil.PI_180);\n const rotationMatrix = WebGLUtil.makeRotation(angel);\n\n const scale = particle.scale * particle.data.oldScale;\n const scaleMatrix = WebGLUtil.makeScale(scale, scale);\n let matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix);\n\n matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix);\n matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix);\n\n Mat3.inverse(matrix, particle.data.imat);\n matrix[2] = particle.alpha;\n\n this.mstack.push(matrix);\n }\n}","import BaseRenderer from \"./BaseRenderer\";\n\nexport default class CustomRenderer extends BaseRenderer {\n constructor(element) {\n super(element);\n\n this.name = \"CustomRenderer\";\n }\n}\n","import Zone from \"./Zone\";\nimport Util from \"../utils/Util\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class LineZone extends Zone {\n constructor(x1, y1, x2, y2, direction) {\n super();\n\n if (x2 - x1 >= 0) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n } else {\n this.x1 = x2;\n this.y1 = y2;\n this.x2 = x1;\n this.y2 = y1;\n }\n\n this.dx = this.x2 - this.x1;\n this.dy = this.y2 - this.y1;\n\n this.minx = Math.min(this.x1, this.x2);\n this.miny = Math.min(this.y1, this.y2);\n this.maxx = Math.max(this.x1, this.x2);\n this.maxy = Math.max(this.y1, this.y2);\n\n this.dot = this.x2 * this.y1 - this.x1 * this.y2;\n this.xxyy = this.dx * this.dx + this.dy * this.dy;\n\n this.gradient = this.getGradient();\n this.length = this.getLength();\n this.direction = Util.initValue(direction, \">\");\n }\n\n getPosition() {\n this.random = Math.random();\n\n this.vector.x =\n this.x1 + this.random * this.length * Math.cos(this.gradient);\n this.vector.y =\n this.y1 + this.random * this.length * Math.sin(this.gradient);\n\n return this.vector;\n }\n\n getDirection(x, y) {\n const A = this.dy;\n const B = -this.dx;\n const C = this.dot;\n const D = B === 0 ? 1 : B;\n\n if ((A * x + B * y + C) * D > 0) return true;\n else return false;\n }\n\n getDistance(x, y) {\n const A = this.dy;\n const B = -this.dx;\n const C = this.dot;\n const D = A * x + B * y + C;\n\n return D / Math.sqrt(this.xxyy);\n }\n\n getSymmetric(v) {\n const tha2 = v.getGradient();\n const tha1 = this.getGradient();\n const tha = 2 * (tha1 - tha2);\n\n const oldx = v.x;\n const oldy = v.y;\n\n v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n\n return v;\n }\n\n getGradient() {\n return Math.atan2(this.dy, this.dx);\n }\n\n rangeOut(particle) {\n const angle = Math.abs(this.getGradient());\n\n if (angle <= MathUtil.PI / 4) {\n if (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true;\n } else {\n if (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true;\n }\n\n return false;\n }\n\n getLength() {\n return Math.sqrt(this.dx * this.dx + this.dy * this.dy);\n }\n\n crossing(particle) {\n if (this.crossType === \"dead\") {\n if (\n this.direction === \">\" ||\n this.direction === \"R\" ||\n this.direction === \"right\" ||\n this.direction === \"down\"\n ) {\n if (!this.rangeOut(particle)) return;\n if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true;\n } else {\n if (!this.rangeOut(particle)) return;\n if (!this.getDirection(particle.p.x, particle.p.y))\n particle.dead = true;\n }\n } else if (this.crossType === \"bound\") {\n if (!this.rangeOut(particle)) return;\n\n if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) {\n if (this.dx === 0) {\n particle.v.x *= -1;\n } else if (this.dy === 0) {\n particle.v.y *= -1;\n } else {\n this.getSymmetric(particle.v);\n }\n }\n } else if (this.crossType === \"cross\") {\n if (this.alert) {\n console.error(\"Sorry, LineZone does not support cross method!\");\n this.alert = false;\n }\n }\n }\n}\n","import Zone from \"./Zone\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default class CircleZone extends Zone {\n constructor(x, y, radius) {\n super();\n\n this.x = x;\n this.y = y;\n this.radius = radius;\n\n this.angle = 0;\n this.center = { x, y };\n }\n\n getPosition() {\n this.angle = MathUtil.PIx2 * Math.random();\n this.randomRadius = Math.random() * this.radius;\n\n this.vector.x = this.x + this.randomRadius * Math.cos(this.angle);\n this.vector.y = this.y + this.randomRadius * Math.sin(this.angle);\n\n return this.vector;\n }\n\n setCenter(x, y) {\n this.center.x = x;\n this.center.y = y;\n }\n\n crossing(particle) {\n const d = particle.p.distanceTo(this.center);\n\n if (this.crossType === \"dead\") {\n if (d - particle.radius > this.radius) particle.dead = true;\n } else if (this.crossType === \"bound\") {\n if (d + particle.radius >= this.radius) this.getSymmetric(particle);\n } else if (this.crossType === \"cross\") {\n if (this.alert) {\n console.error(\"Sorry, CircleZone does not support cross method!\");\n this.alert = false;\n }\n }\n }\n\n getSymmetric(particle) {\n let tha2 = particle.v.getGradient();\n let tha1 = this.getGradient(particle);\n\n let tha = 2 * (tha1 - tha2);\n let oldx = particle.v.x;\n let oldy = particle.v.y;\n\n particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha);\n particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha);\n }\n\n getGradient(particle) {\n return (\n -MathUtil.PI_2 +\n Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x)\n );\n }\n}\n","import Zone from \"./Zone\";\n\nexport default class RectZone extends Zone {\n constructor(x, y, width, height) {\n super();\n\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }\n\n getPosition() {\n this.vector.x = this.x + Math.random() * this.width;\n this.vector.y = this.y + Math.random() * this.height;\n\n return this.vector;\n }\n\n crossing(particle) {\n // particle dead zone\n if (this.crossType === \"dead\") {\n if (particle.p.x + particle.radius < this.x) particle.dead = true;\n else if (particle.p.x - particle.radius > this.x + this.width)\n particle.dead = true;\n\n if (particle.p.y + particle.radius < this.y) particle.dead = true;\n else if (particle.p.y - particle.radius > this.y + this.height)\n particle.dead = true;\n }\n\n // particle bound zone\n else if (this.crossType === \"bound\") {\n if (particle.p.x - particle.radius < this.x) {\n particle.p.x = this.x + particle.radius;\n particle.v.x *= -1;\n } else if (particle.p.x + particle.radius > this.x + this.width) {\n particle.p.x = this.x + this.width - particle.radius;\n particle.v.x *= -1;\n }\n\n if (particle.p.y - particle.radius < this.y) {\n particle.p.y = this.y + particle.radius;\n particle.v.y *= -1;\n } else if (particle.p.y + particle.radius > this.y + this.height) {\n particle.p.y = this.y + this.height - particle.radius;\n particle.v.y *= -1;\n }\n }\n\n // particle cross zone\n else if (this.crossType === \"cross\") {\n if (particle.p.x + particle.radius < this.x && particle.v.x <= 0)\n particle.p.x = this.x + this.width + particle.radius;\n else if (\n particle.p.x - particle.radius > this.x + this.width &&\n particle.v.x >= 0\n )\n particle.p.x = this.x - particle.radius;\n\n if (particle.p.y + particle.radius < this.y && particle.v.y <= 0)\n particle.p.y = this.y + this.height + particle.radius;\n else if (\n particle.p.y - particle.radius > this.y + this.height &&\n particle.v.y >= 0\n )\n particle.p.y = this.y - particle.radius;\n }\n }\n}\n","import Zone from \"./Zone\";\nimport Util from \"../utils/Util\";\n\nexport default class ImageZone extends Zone {\n constructor(imageData, x, y, d) {\n super();\n\n this.reset(imageData, x, y, d);\n }\n\n reset(imageData, x, y, d) {\n this.imageData = imageData;\n this.x = Util.initValue(x, 0);\n this.y = Util.initValue(y, 0);\n this.d = Util.initValue(d, 2);\n\n this.vectors = [];\n this.setVectors();\n }\n\n setVectors() {\n let i, j;\n const length1 = this.imageData.width;\n const length2 = this.imageData.height;\n\n for (i = 0; i < length1; i += this.d) {\n for (j = 0; j < length2; j += this.d) {\n let index = ((j >> 0) * length1 + (i >> 0)) * 4;\n\n if (this.imageData.data[index + 3] > 0) {\n this.vectors.push({ x: i + this.x, y: j + this.y });\n }\n }\n }\n\n return this.vector;\n }\n\n getBound(x, y) {\n var index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n if (this.imageData.data[index + 3] > 0) return true;\n else return false;\n }\n\n getPosition() {\n const vector = Util.getRandFromArray(this.vectors);\n return this.vector.copy(vector);\n }\n\n getColor(x, y) {\n x -= this.x;\n y -= this.y;\n var i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4;\n\n return {\n r: this.imageData.data[i],\n g: this.imageData.data[i + 1],\n b: this.imageData.data[i + 2],\n a: this.imageData.data[i + 3]\n };\n }\n\n crossing(particle) {\n if (this.crossType === \"dead\") {\n if (this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n particle.dead = true;\n else particle.dead = false;\n } else if (this.crossType === \"bound\") {\n if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y))\n particle.v.negate();\n }\n }\n}\n","import ColorUtil from \"../utils/ColorUtil\";\nimport CircleZone from \"../zone/CircleZone\";\nimport PointZone from \"../zone/PointZone\";\nimport LineZone from \"../zone/LineZone\";\nimport RectZone from \"../zone/RectZone\";\nimport MathUtil from \"../math/MathUtil\";\n\nexport default {\n addEventListener(proton, func) {\n proton.addEventListener(\"PROTON_UPDATE_AFTER\", () => func());\n },\n\n getStyle(color = \"#ff0000\") {\n const rgb = ColorUtil.hexToRgb(color);\n return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`;\n },\n\n drawZone(proton, canvas, zone, clear) {\n const context = canvas.getContext(\"2d\");\n const style = this.getStyle();\n\n this.addEventListener(proton, () => {\n if (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n if (zone instanceof PointZone) {\n context.beginPath();\n context.fillStyle = style;\n context.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true);\n context.fill();\n context.closePath();\n } else if (zone instanceof LineZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.moveTo(zone.x1, zone.y1);\n context.lineTo(zone.x2, zone.y2);\n context.stroke();\n context.closePath();\n } else if (zone instanceof RectZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.drawRect(zone.x, zone.y, zone.width, zone.height);\n context.stroke();\n context.closePath();\n } else if (zone instanceof CircleZone) {\n context.beginPath();\n context.strokeStyle = style;\n context.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true);\n context.stroke();\n context.closePath();\n }\n });\n },\n\n drawEmitter(proton, canvas, emitter, clear) {\n const context = canvas.getContext(\"2d\");\n const style = this.getStyle();\n\n this.addEventListener(proton, () => {\n if (clear) context.clearRect(0, 0, canvas.width, canvas.height);\n\n context.beginPath();\n context.fillStyle = style;\n context.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true);\n context.fill();\n context.closePath();\n });\n }\n};\n","import Proton from \"./core/Proton\";\nimport Particle from \"./core/Particle\";\nimport Pool from \"./core/Pool\";\n\nimport Util from \"./utils/Util\";\nimport ColorUtil from \"./utils/ColorUtil\";\nimport MathUtil from \"./math/MathUtil\";\nimport Vector2D from \"./math/Vector2D\";\nimport Polar2D from \"./math/Polar2D\";\nimport Mat3 from \"./math/Mat3\";\nimport Span from \"./math/Span\";\nimport ArraySpan from \"./math/ArraySpan\";\nimport Rectangle from \"./math/Rectangle\";\nimport ease from \"./math/ease\";\n\nimport Rate from \"./initialize/Rate\";\nimport Initialize from \"./initialize/Initialize\";\nimport Life from \"./initialize/Life\";\nimport Position from \"./initialize/Position\";\nimport Velocity from \"./initialize/Velocity\";\nimport Mass from \"./initialize/Mass\";\nimport Radius from \"./initialize/Radius\";\nimport Body from \"./initialize/Body\";\n\nimport Behaviour from \"./behaviour/Behaviour\";\nimport Force from \"./behaviour/Force\";\nimport Attraction from \"./behaviour/Attraction\";\nimport RandomDrift from \"./behaviour/RandomDrift\";\nimport Gravity from \"./behaviour/Gravity\";\nimport Collision from \"./behaviour/Collision\";\nimport CrossZone from \"./behaviour/CrossZone\";\nimport Alpha from \"./behaviour/Alpha\";\nimport Scale from \"./behaviour/Scale\";\nimport Rotate from \"./behaviour/Rotate\";\nimport Color from \"./behaviour/Color\";\nimport Repulsion from \"./behaviour/Repulsion\";\nimport GravityWell from \"./behaviour/GravityWell\";\n\nimport Emitter from \"./emitter/Emitter\";\nimport BehaviourEmitter from \"./emitter/BehaviourEmitter\";\nimport FollowEmitter from \"./emitter/FollowEmitter\";\n\nimport CanvasRenderer from \"./render/CanvasRenderer\";\nimport DomRenderer from \"./render/DomRenderer\";\nimport EaselRenderer from \"./render/EaselRenderer\";\nimport PixelRenderer from \"./render/PixelRenderer\";\nimport PixiRenderer from \"./render/PixiRenderer\";\nimport WebGLRenderer from \"./render/WebGLRenderer\";\nimport CustomRenderer from \"./render/CustomRenderer\";\n\nimport Zone from \"./zone/Zone\";\nimport LineZone from \"./zone/LineZone\";\nimport CircleZone from \"./zone/CircleZone\";\nimport PointZone from \"./zone/PointZone\";\nimport RectZone from \"./zone/RectZone\";\nimport ImageZone from \"./zone/ImageZone\";\n\nimport Debug from \"./debug/Debug\";\n\n// namespace\nProton.Particle = Proton.P = Particle;\nProton.Pool = Pool;\n\nProton.Util = Util;\nProton.ColorUtil = ColorUtil;\nProton.MathUtil = MathUtil;\nProton.Vector2D = Proton.Vector = Vector2D;\nProton.Polar2D = Proton.Polar = Polar2D;\nProton.ArraySpan = ArraySpan;\nProton.Rectangle = Rectangle;\nProton.Rate = Rate;\nProton.ease = ease;\nProton.Span = Span;\nProton.Mat3 = Mat3;\nProton.getSpan = (a, b, center) => new Span(a, b, center);\nProton.createArraySpan = ArraySpan.createArraySpan;\n\nProton.Initialize = Proton.Init = Initialize;\nProton.Life = Proton.L = Life;\nProton.Position = Proton.P = Position;\nProton.Velocity = Proton.V = Velocity;\nProton.Mass = Proton.M = Mass;\nProton.Radius = Proton.R = Radius;\nProton.Body = Proton.B = Body;\n\nProton.Behaviour = Behaviour;\nProton.Force = Proton.F = Force;\nProton.Attraction = Proton.A = Attraction;\nProton.RandomDrift = Proton.RD = RandomDrift;\nProton.Gravity = Proton.G = Gravity;\nProton.Collision = Collision;\nProton.CrossZone = CrossZone;\nProton.Alpha = Proton.A = Alpha;\nProton.Scale = Proton.S = Scale;\nProton.Rotate = Rotate;\nProton.Color = Color;\nProton.Repulsion = Repulsion;\nProton.GravityWell = GravityWell;\n\nProton.Emitter = Emitter;\nProton.BehaviourEmitter = BehaviourEmitter;\nProton.FollowEmitter = FollowEmitter;\n\nProton.Zone = Zone;\nProton.LineZone = LineZone;\nProton.CircleZone = CircleZone;\nProton.PointZone = PointZone;\nProton.RectZone = RectZone;\nProton.ImageZone = ImageZone;\n\nProton.CanvasRenderer = CanvasRenderer;\nProton.DomRenderer = DomRenderer;\nProton.EaselRenderer = EaselRenderer;\nProton.PixiRenderer = PixiRenderer;\nProton.PixelRenderer = PixelRenderer;\nProton.WebGLRenderer = Proton.WebGlRenderer = WebGLRenderer;\nProton.CustomRenderer = CustomRenderer;\n\nProton.Debug = Debug;\n\nObject.assign(Proton, ease);\n\n// export\nexport default Proton;\n"],"names":["PI","MathUtil","num","this","Infinity","a","b","Math","floor","random","center","f","isInt","randomAToB","toString","slice","Span","isArray","Util","getRandFromArray","randomFloating","c","undefined","pan","getValue","initValue","length","i","tx","ty","angleInRadians","cos","s","sin","sx","sy","a00","a01","a02","a10","a11","a12","a20","a21","a22","b00","b01","b02","b10","b11","b12","b20","b21","b22","id","width","height","position","dom","document","createElement","style","opacity","transform","resize","marginLeft","marginTop","div","x","y","scale","rotate","willChange","css3","key","val","bkey","charAt","toUpperCase","substr","imgsCache","canvasCache","canvasId","context","image","rect","drawImage","imagedata","getImageData","clearRect","img","callback","param","src","Image","onload","e","target","WebGLUtil","canvas","DomUtil","createCanvas","getContext","value","defaults","Object","prototype","call","arr","obj","ignore","indexOf","constructor","args","bind","apply","concat","particle","conf","hasProp","p","v","copy","props","prop","hasOwnProperty","getSpanValue","ImgUtil","destroy","IdsMap","Puid","type","uid","getIdFromCache","_index","_cache","isBody","isInner","Pool","params","__puid","getId","cache","pop","createOrClone","getCache","push","total","create","classApply","clone","count","Stats","body","add","emitter","getEmitter","renderer","getRenderer","str","proton","emitters","emitSpeed","getEmitterPos","initializes","concatArr","behaviours","name","getCreatedNumber","getCount","pool","container","innerHTML","cssText","join","addEventListener","_this","bg","color","parentNode","appendChild","emitterIndex","renderers","rendererIndex","result","cpool","round","EventDispatcher","listener","_listeners","removeEventListener","splice","listeners","handler","dispatchEvent","hasEventListener","removeAllEventListeners","Integration","particles","time","damping","eulerIntegrate","sleep","old","multiplyScalar","mass","clear","Proton","render","init","index","remove","parent","EMITTER_ADDED","EMITTER_REMOVED","PROTON_UPDATE","USE_CLOCK","oldTime","Date","getTime","elapsed","amendChangeTabsBug","emittersUpdate","PROTON_UPDATE_AFTER","update","destroyAll","destroyOther","getAllParticles","integrationType","stats","EULER","integrator","MEASURE","RK2","PARTICLE_CREATED","PARTICLE_UPDATE","PARTICLE_SLEEP","PARTICLE_DEAD","Rgb","r","g","pow","PI_2","sqrt","ease","easeLinear","Vector2D","atan2","w","addVectors","subVectors","set","divideScalar","distanceToSquared","tha","dx","dy","alpha","Particle","N180_PI","life","age","dead","sprite","energy","radius","rotation","easing","rgb","reset","emptyObject","data","removeAllBehaviours","applyBehaviours","max","applyBehaviour","behaviour","parents","initialize","addBehaviour","emptyArray","setProp","h","hex16","substring","parseInt","rbg","Number","Polar2D","getX","getY","abs","Mat3","mat3","mat","Float32Array","mat1","mat2","m","vec","ArraySpan","_arr","randomColor","toArray","Rectangle","right","bottom","Rate","startTime","nextTime","timePan","numPan","numpan","timepan","setSpanValue","Initialize","Life","lifePan","Zone","vector","crossType","alert","PointZone","error","Position","zone","getPosition","Velocity","rpan","thapan","rPan","thaPan","vr","polar2d","normalizeVelocity","PI_180","Mass","massPan","Radius","oldRadius","Body","imageTarget","Behaviour","getEasing","force","removeBehaviour","Force","fx","fy","normalizeForce","calculate","Attraction","targetPosition","normalizeValue","radiusSq","attractionForce","lengthSq","sub","normalize","RandomDrift","driftX","driftY","delay","panFoce","addXY","Gravity","Collision","collisionPool","delta","newPool","otherParticle","overlap","totalMass","averageMass1","averageMass2","distance","CrossZone","crossing","Alpha","same","alphaA","alphaB","Scale","scaleA","scaleB","Rotate","rotationA","rotationB","getDirection","influence","Color","createArraySpan","colorA","ColorUtil","hexToRgb","colorB","Repulsion","GravityWell","centerPoint","distanceVec","distanceSq","factor","bindEmitter","setVectorVal","degreeTransform","Emitter","totalTime","stoped","emitTime","isNaN","rate","oldStoped","oldEmitTime","oldTotalTime","initAll","rest","initializer","arguments","emitting","integrate","dispatch","expire","event","bindEvent","createParticle","get","setupParticle","addBehaviours","stop","removeAllInitializers","removeEmitter","BehaviourEmitter","selfBehaviours","FollowEmitter","mousemoveHandler","_this2","mousemove","mousedownHandler","mousedown","mouseupHandler","mouseup","mouseTarget","_allowEmitting","layerX","layerY","offsetX","offsetY","babelHelpers.get","window","initEventHandler","BaseRenderer","thinkness","stroke","_protonUpdateHandler","onProtonUpdate","_protonUpdateAfterHandler","onProtonUpdateAfter","_emitterAddedHandler","onEmitterAdded","_emitterRemovedHandler","onEmitterRemoved","_particleCreatedHandler","onParticleCreated","_particleUpdateHandler","onParticleUpdate","_particleDeadHandler","onParticleDead","element","circleConf","isCircle","initHandler","CanvasRenderer","addImg2Body","drawCircle","buffer","createBuffer","bufContext","globalAlpha","globalCompositeOperation","fillStyle","rgbToHex","fillRect","save","translate","restore","beginPath","arc","strokeStyle","lineWidth","closePath","fill","size","bufferCache","DomRenderer","bodyReady","transform3d","backgroundColor","removeChild","babelHelpers.typeof","createCircle","createSprite","createDiv","borderRadius","borderColor","borderWidth","url","backgroundImage","createBody","EaselRenderer","addChild","scaleX","scaleY","graphics","regX","regY","createjs","Graphics","String","beginStroke","beginFill","shape","Shape","PixelRenderer","rectangle","imageData","createImageData","putImageData","setPixel","elementwidth","PixiRenderer","setColor","tint","getHex16FromParticle","createFromImage","PIXI","Sprite","anchor","endFill","from","fromImage","MStack","mats","multiply","WebGLRenderer","umat","smat","mstack","gl","viewport","circleCanvasURL","texturebuffers","A","blendEquation","B","blendFunc","fs","shader","createShader","FRAGMENT_SHADER","VERTEX_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","fragmentShader","getShader","getFragmentShader","vertexShader","getVertexShader","sprogram","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","useProgram","vpa","getAttribLocation","tca","enableVertexAttribArray","tMatUniform","getUniformLocation","samplerUniform","useTex","uniform1i","idx","unitIBuffer","bindBuffer","ELEMENT_ARRAY_BUFFER","bufferData","Uint16Array","STATIC_DRAW","ids","unitI33","stripBuffer","raidus","circleCanvasRadius","toDataURL","_w","_h","_width","_height","_scaleX","_scaleY","createTexture","texture","vcBuffer","tcBuffer","ARRAY_BUFFER","bindTexture","TEXTURE_2D","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_NEAREST","generateMipmap","textureLoaded","textureWidth","textureHeight","tmat","imat","oldScale","drawImg2Canvas","updateMatrix","uniform3f","uniformMatrix3fv","top","vertexAttribPointer","FLOAT","drawElements","TRIANGLES","UNSIGNED_SHORT","moveOriginMatrix","translationMatrix","angel","rotationMatrix","scaleMatrix","matrix","inverse","antialias","stencil","depth","initVar","setMaxRadius","initShaders","initBuffers","FUNC_ADD","SRC_ALPHA","ONE_MINUS_SRC_ALPHA","enable","BLEND","CustomRenderer","LineZone","x1","gradient","y1","dot","xxyy","tha2","getGradient","oldx","oldy","maxx","minx","maxy","miny","direction","rangeOut","getDistance","getSymmetric","x2","y2","min","getLength","CircleZone","angle","PIx2","randomRadius","d","distanceTo","RectZone","ImageZone","vectors","setVectors","j","length1","length2","getBound","negate","func","getStyle","moveTo","lineTo","drawRect","P","Vector","Polar","getSpan","Init","L","V","M","R","F","RD","G","S","WebGlRenderer","Debug","assign"],"mappings":";;;;;;;;;gRAAA,IAAMA,EAAK,UAGLC,EAAW,IACTD,OACO,EAALA,OACAA,EAAK,SACHA,EAAK,YACJ,IAAMA,YACJ,wBAEAE,UACAA,IAAQC,KAAKC,UAAYF,IAXvBE,EAAAA,uBAcFC,EAAGC,8CAEEC,KAAKC,MAAMD,KAAKE,UAAYH,EAAID,IAAMA,EAD/BA,EAAIE,KAAKE,UAAYH,EAAID,4BAIjCK,EAAQC,EAAGC,UACfT,KAAKU,WAAWH,EAASC,EAAGD,EAASC,EAAGC,qDAKnCP,UACJA,EAAIL,EAAM,wBAGZE,aACKA,EAAIY,SAAS,kCAKpB,KACC,SAA4B,SAAhBP,KAAKE,UAAyB,GAAGK,SAAS,KAAKC,OACvD,4oCCnCI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O2I,MAAQ3I,EAAOqf,EAAI1W,GAC1B3I,EAAOgJ,WAAahJ,EAAOwV,EAAIxM,GAC/BhJ,EAAOwJ,YAAcxJ,EAAOsf,GAAK9V,GACjCxJ,EAAO8J,QAAU9J,EAAOuf,EAAIzV,GAC5B9J,EAAO+J,UAAYA,GACnB/J,EAAOyK,UAAYA,GACnBzK,EAAO2K,MAAQ3K,EAAOwV,EAAI7K,GAC1B3K,EAAO+K,MAAQ/K,EAAOwf,EAAIzU,GAC1B/K,EAAOkL,OAASA,GAChBlL,EAAOuL,MAAQA,GACfvL,EAAO6L,UAAYA,GACnB7L,EAAO8L,YAAcA,GAErB9L,EAAOsM,QAAUA,GACjBtM,EAAOgO,iBAAmBA,GAC1BhO,EAAOkO,cAAgBA,GAEvBlO,EAAO+G,KAAOA,GACd/G,EAAOkc,SAAWA,GAClBlc,EAAOwd,WAAaA,GACpBxd,EAAOmH,UAAYA,GACnBnH,EAAO8d,SAAWA,GAClB9d,EAAO+d,UAAYA,GAEnB/d,EAAOwQ,eAAiBA,GACxBxQ,EAAO8R,YAAcA,GACrB9R,EAAO6S,cAAgBA,GACvB7S,EAAOkU,aAAeA,GACtBlU,EAAO2T,cAAgBA,GACvB3T,EAAOgV,cAAgBhV,EAAOyf,cAAgBzK,GAC9ChV,EAAOic,eAAiBA,GAExBjc,EAAO0f,MAAQA,GAEfhmB,OAAOimB,OAAO3f,EAAQqC"} \ No newline at end of file diff --git a/example/behaviour/attraction/attraction1.html b/example/behaviour/attraction/attraction1.html old mode 100644 new mode 100755 index 1bf26a1..c413a81 --- a/example/behaviour/attraction/attraction1.html +++ b/example/behaviour/attraction/attraction1.html @@ -1,162 +1,176 @@ - + - - + behaviour-attraction1 - - + + - + - - + + - - - \ No newline at end of file + + diff --git a/example/behaviour/attraction/attraction2.html b/example/behaviour/attraction/attraction2.html old mode 100644 new mode 100755 index 952496d..2f29bde --- a/example/behaviour/attraction/attraction2.html +++ b/example/behaviour/attraction/attraction2.html @@ -1,177 +1,205 @@ - + - - + behaviour-attraction2 - - + + - + - - + + - - - \ No newline at end of file + + diff --git a/example/behaviour/collision/collision.html b/example/behaviour/collision/collision.html old mode 100644 new mode 100755 index 22a00b8..e25cb77 --- a/example/behaviour/collision/collision.html +++ b/example/behaviour/collision/collision.html @@ -1,154 +1,197 @@ - + - - + behaviour-Collision - - + + - + - +
- +
- - - \ No newline at end of file + + diff --git a/example/behaviour/collision/collisionBall.html b/example/behaviour/collision/collisionBall.html old mode 100644 new mode 100755 index e2163df..4883003 --- a/example/behaviour/collision/collisionBall.html +++ b/example/behaviour/collision/collisionBall.html @@ -1,118 +1,134 @@ - + - - + behaviour-collisionBall - - + + - + - - -
- press + + +
+ press
- - - \ No newline at end of file + + diff --git a/example/behaviour/color/color.html b/example/behaviour/color/color.html old mode 100644 new mode 100755 index 9030cc8..a66492f --- a/example/behaviour/color/color.html +++ b/example/behaviour/color/color.html @@ -1,101 +1,123 @@ - + - - + proton.js-behaviour-custom - - + + - + - - + + - - - \ No newline at end of file + + diff --git a/example/behaviour/custom/circle.html b/example/behaviour/custom/circle.html old mode 100644 new mode 100755 index 394111e..8ff38fe --- a/example/behaviour/custom/circle.html +++ b/example/behaviour/custom/circle.html @@ -1,205 +1,229 @@ - + - - + behaviour-custom - - + + - + - +
- +
+ - + - - - \ No newline at end of file + + diff --git a/example/behaviour/custom/js/color.min.js b/example/behaviour/custom/js/color.min.js old mode 100644 new mode 100755 diff --git a/example/behaviour/force/force.html b/example/behaviour/force/force.html old mode 100644 new mode 100755 index fce3da4..75e70ef --- a/example/behaviour/force/force.html +++ b/example/behaviour/force/force.html @@ -1,176 +1,217 @@ - + - - + proton.js-behaviour-Force - - + + - + - - + + - - - \ No newline at end of file + + diff --git a/example/behaviour/force/image/star.png b/example/behaviour/force/image/star.png old mode 100644 new mode 100755 diff --git a/example/behaviour/force/image/star1.png b/example/behaviour/force/image/star1.png old mode 100644 new mode 100755 diff --git a/example/behaviour/force/image/star2.png b/example/behaviour/force/image/star2.png old mode 100644 new mode 100755 diff --git a/example/behaviour/force/image/star3.png b/example/behaviour/force/image/star3.png old mode 100644 new mode 100755 diff --git a/example/behaviour/force/star.html b/example/behaviour/force/star.html old mode 100644 new mode 100755 diff --git a/example/behaviour/gravitywell/linebug.html b/example/behaviour/gravitywell/linebug.html old mode 100644 new mode 100755 diff --git a/example/behaviour/randomDirft/image/bone.png b/example/behaviour/randomDirft/image/bone.png old mode 100644 new mode 100755 diff --git a/example/behaviour/randomDirft/randomdirft1.html b/example/behaviour/randomDirft/randomdirft1.html old mode 100644 new mode 100755 diff --git a/example/behaviour/randomDirft/randomdirft2.html b/example/behaviour/randomDirft/randomdirft2.html old mode 100644 new mode 100755 diff --git a/example/behaviour/randomDirft/randomdirft3.html b/example/behaviour/randomDirft/randomdirft3.html old mode 100644 new mode 100755 diff --git a/example/behaviour/repulsion/fireflies.html b/example/behaviour/repulsion/fireflies.html old mode 100644 new mode 100755 diff --git a/example/behaviour/repulsion/image/bg.jpg b/example/behaviour/repulsion/image/bg.jpg old mode 100644 new mode 100755 diff --git a/example/behaviour/repulsion/image/star.gif b/example/behaviour/repulsion/image/star.gif old mode 100644 new mode 100755 diff --git a/example/behaviour/repulsion/repulsion.html b/example/behaviour/repulsion/repulsion.html old mode 100644 new mode 100755 diff --git a/example/behaviour/rotate/image/arrow.png b/example/behaviour/rotate/image/arrow.png old mode 100644 new mode 100755 diff --git a/example/behaviour/rotate/rotate.html b/example/behaviour/rotate/rotate.html old mode 100644 new mode 100755 diff --git a/example/emitter/followEmitter/followEmitter.html b/example/emitter/followEmitter/followEmitter.html old mode 100644 new mode 100755 diff --git a/example/emitter/followEmitter/image/bubble.png b/example/emitter/followEmitter/image/bubble.png old mode 100644 new mode 100755 diff --git a/example/emitter/followEmitter/mouseDown.html b/example/emitter/followEmitter/mouseDown.html old mode 100644 new mode 100755 diff --git a/example/game/colliejs/collie.html b/example/game/colliejs/collie.html old mode 100644 new mode 100755 diff --git a/example/game/colliejs/image/bird.png b/example/game/colliejs/image/bird.png old mode 100644 new mode 100755 diff --git a/example/game/colliejs/image/blood.png b/example/game/colliejs/image/blood.png old mode 100644 new mode 100755 diff --git a/example/game/colliejs/image/blood2.png b/example/game/colliejs/image/blood2.png old mode 100644 new mode 100755 diff --git a/example/game/colliejs/image/ground2.png b/example/game/colliejs/image/ground2.png old mode 100644 new mode 100755 diff --git a/example/game/colliejs/image/sky.png b/example/game/colliejs/image/sky.png old mode 100644 new mode 100755 diff --git a/example/game/colliejs/image/yame_walk2.png b/example/game/colliejs/image/yame_walk2.png old mode 100644 new mode 100755 diff --git a/example/game/colliejs/js/collie.min.js b/example/game/colliejs/js/collie.min.js old mode 100644 new mode 100755 diff --git a/example/game/crafty/images/bomb.png b/example/game/crafty/images/bomb.png old mode 100644 new mode 100755 diff --git a/example/game/crafty/images/fighter.png b/example/game/crafty/images/fighter.png old mode 100644 new mode 100755 diff --git a/example/game/crafty/images/fire.png b/example/game/crafty/images/fire.png old mode 100644 new mode 100755 diff --git a/example/game/crafty/images/meteorolite.png b/example/game/crafty/images/meteorolite.png old mode 100644 new mode 100755 diff --git a/example/game/crafty/js/crafty.js b/example/game/crafty/js/crafty.js old mode 100644 new mode 100755 diff --git a/example/game/easeljs/easeljs.html b/example/game/easeljs/easeljs.html old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/c1.png b/example/game/easeljs/image/c1.png old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/c2.png b/example/game/easeljs/image/c2.png old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/c3.png b/example/game/easeljs/image/c3.png old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/c4.png b/example/game/easeljs/image/c4.png old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/p1.png b/example/game/easeljs/image/p1.png old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/p2.png b/example/game/easeljs/image/p2.png old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/p3.png b/example/game/easeljs/image/p3.png old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/p4.png b/example/game/easeljs/image/p4.png old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/p5.png b/example/game/easeljs/image/p5.png old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/sky.png b/example/game/easeljs/image/sky.png old mode 100644 new mode 100755 diff --git a/example/game/easeljs/image/spritesheet_grant.png b/example/game/easeljs/image/spritesheet_grant.png old mode 100644 new mode 100755 diff --git a/example/game/phaser/imgs/bg.jpg b/example/game/phaser/imgs/bg.jpg new file mode 100755 index 0000000000000000000000000000000000000000..a77a61c5a234ef35231e9697a087509c3b822275 GIT binary patch literal 61945 zcmeFZcU+T8^Emnh5(qt^9#ABNA|Rnh1O);lKnP$6p`)~fCQS$yY=Ec;7CHi=0RjS| zLMRG~y#RvJ5fr-=6$?cL+ua29J@5N{@BQ7+ZU5Y}=j3^IXZP9J*`1l4nO*t$;O8^Z zG19j15D0R1hIAkZLPFv&2oeN2nBZ0LfGy<_Y>*e==XrG}U_wi9NC3d4f91i4Fu7lO z&X*hKhbYV z5VR8Y`)$pL31VWXVKJqmi@u*fA&4#T8z&sY7W|zTxCGkrk`PSr*SLlLP8%%xU$nut{GB!d z*zZ1Iy9NIAE#kS<9pnJsJo@K0Nyv9FLbT*cJ~3VrU+nKKQkH~JG^%-XHY7py1T`JHr#7(U5=u7%iMXCSf52o<9Ut zLuoh|!Dg%s!YDaQmN$ZHwB8TK>Os%qQnGE`<(q<|d+?}zG6n>5Wrr`D7pSV3x>uuD zbM6OP4bnC}O(7Wc^*+pecHzgTv5vp=N|vqkQj*vyV;cSO@)n1&^T)nTbBkI+GVw|4 z1xuvfPZnCfkA9rc^I33%Rg-qMo2KCq+E>Z%^Iu_M>e;(WuPn&k>=-^VMHbpoVUT_D zXV1)c%%+uBvTYnj;WNbe+oyh{+d5mPAos0`9&uS>Ha1*Lh ziSS}dL}lk5_`~HredC$SO;-~gjy-zv@?8W*{DHFNLQ1=p{pY(AUzfQeSHYf@X`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lHPCvKT?L3C&-GR%iN?9pv*ol%D;;C zM;@Q^>h`sjtE}Ncn8;PbePYQwh?^qjxS{^OkxHqG3vC>kk4)MW>8_b7Zc#yX4<%hg zGmcohjp#9Bgli$5*5b~KLw|4iv)E^*v*y45=fBvQc1e0S6;2k0a8&>zkHi%BHf5{faI!c9s0^Mce-WuxUYbylP=SR`qV|0`3xGy&Qq2C1?$1z3okbv~d!O|pZu zRFu-%Xb>HzqZ+tkgRC1#-VsgWYqAuVB7SPfL7a_lAJW2|?nNIV-G9{mg-u-I=;Ug} z`esW+C^3SDpCtyh-((OH4g#<#vC~FzsZQQ=M*8jDz5huD&{p85-gZ)erP#ATxw$~} zMfo_rxb0WgFG&MR5oU|Zpemk+P~P3IC~!@pFGvWLCbutDeV>RT++GW(qH4J zvTRd^FvWO!41tkVtk{X=LFU6VGr0R*dfbjJXz5KCFB{qN)d z4_L$1BShy9!H=?g{8Auo%ECHMkaXc4GC||yyM!?sE_-waM?M?dVs)EeW=a#AW=k?45;U~*YPL7`{1xrXgzLob3^_~&oB!_jzum)q;YGKt ztiX++C%=#h@4Z3(0w6ZsF{E*F>Do;?k032*lY;4UBt9oycu_WtgO6UoGzF1y}KmdO72ctrvkB+qK?Uc@o!|-dImwnk$gody(f2W!t`p z%1yngQ~@XO_5;h$Z~FS)aFt(%h$IA5fPPni!N4VWgB1woxAEl1jA7G}v(>dP)a%sd zC7^0(E4~iP&Sc}%^78mR&NgD-5ZAG))qss0p3ViTjU=1`%1Y1j=e8&bmoJiRDo&8i zaBLpWdf%hB45==Hd}a0W7mWWK`d-sl-rN5VFzfx$7IN)500000NkvXXu0mjf3=7xF literal 0 HcmV?d00001 diff --git "a/example/game/phaser/imgs/dot\347\232\204\345\211\257\346\234\254.png" "b/example/game/phaser/imgs/dot\347\232\204\345\211\257\346\234\254.png" new file mode 100755 index 0000000000000000000000000000000000000000..542bad4a912b0468c599ce6343fee03c8b3351e6 GIT binary patch literal 39605 zcmeFa1yo$iwy@i{yF(zj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/imgs/logo.png b/example/game/phaser/imgs/logo.png new file mode 100755 index 0000000000000000000000000000000000000000..fcc63a677ece4957308106dffc2044bc04ded617 GIT binary patch literal 11503 zcmW++WmKD86AbQ9++F)3MT)xxm*7^4OYq|E?oymk+}(=17Kh>#cPQ@mrQe?<=RD^m z+1cH@J2N*@RapiDl>`+40AR?;N~r+=Fip_U8pw#ySA@YbWdMK*ASWfR;gNloDQR6rI7A4~vp*TX$~ z7{C@8Am%L6RN~aOqm#fbt~F}wn1qgX?oG5A9`d#pdEr1KV7GlUBnLPD!OZpZ6=3wU zIeK7yB9camrnQeMH+mhIRTQxy0p(TdqN4N7_3_dUqh4MvD4fFs@DrtA(fD9QRL>|N z7tpPEaj;iFzn+WxJl!DT>z;*-r%`n7CWlNZf-~~md)`ub4H2aG2jA?Q*|TfUYd4jwIx06L(;;pN?+4R0jl)jtu80GTphfgoHx8l0d)AJdgoQmn5@r z*x3M~flU}V5(yTufLxA7?$wV~KtaTspLxh}QS_|F#D5wn&pw~rt73`s?2TLI=9T6b zgHor7UK|M*+mfW#bl^8&6Dr>7vjX%GJ!m;$SA#0q>~I^{;eSSM!sKBG5W>G_e(-)A zmaP0d=Nw()8ll;OxXc#0X&J!#hdKH{5^#X9mIffi)=Q6phHpc_UdWx0E%rA?aY}-E z4NmF_CJ3qaQTes8@NwREE~L5_S`DoX1DR7;`Cm<}Xym7WK4v)!IC(|XBW_hF^21cWJ6`y(ibX8qC=vk+P|oDac?zQvY+@K#(4V=m zp{Ze+<5D#;HsWKGRn)-Jy~=&Ej@+tUjt|#4f<_XC6Ia740KtyfY)#$VATasVqPN*n zls1O+SF(EjFZ?F!So{O|9yc?mFe3$W=|lr{!Wfa|TIn7jz2+bm9?R@OPqOlH;p+=c zJEiKrDk&!Q#cSHvZc$ub2lL9G+yj}^{YV&=h9;3`Mo84zS1;mfG=*cIr zwsBDWw$_GKFUxYMt{_j=qn0IpYWXL5%g~1TMt42LGDfe;vjIO(6Vek+or*t11rZ7- z|Bk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*;0(uY=P5pVgJ`Wl$$$|qFm;9-fPZv zc_;GFgJT-J^5U*121L4x^-RVms5~P$THeC(PAmg*dsb*-2HeUihU@XP<~3F#JOQJl tfR;q=fgT_DD-H%EkJ;;Cj@)-FOzxL~!f@AP=tX9LoV2o3wS-a7{{YBq6*m9? literal 0 HcmV?d00001 diff --git a/example/game/phaser/phaser.html b/example/game/phaser/phaser.html new file mode 100755 index 0000000..1a6b2d1 --- /dev/null +++ b/example/game/phaser/phaser.html @@ -0,0 +1,122 @@ + + + + + + + + + + + + + diff --git a/example/game/pixijs/assets/Pixie.png b/example/game/pixijs/assets/Pixie.png old mode 100644 new mode 100755 diff --git a/example/game/pixijs/assets/iP4_BGtile.jpg b/example/game/pixijs/assets/iP4_BGtile.jpg old mode 100644 new mode 100755 diff --git a/example/game/pixijs/assets/iP4_ground.png b/example/game/pixijs/assets/iP4_ground.png old mode 100644 new mode 100755 diff --git a/example/game/pixijs/pixi-game.html b/example/game/pixijs/pixi-game.html old mode 100644 new mode 100755 index 0593ce7..4bc601b --- a/example/game/pixijs/pixi-game.html +++ b/example/game/pixijs/pixi-game.html @@ -30,7 +30,6 @@

- @@ -210,6 +209,7 @@ emitter.emit(); proton.addEmitter(emitter); + emitter.preEmit(1.2); } @@ -271,4 +271,4 @@ - \ No newline at end of file + diff --git a/example/game/quarkjs/images/body_walk.png b/example/game/quarkjs/images/body_walk.png old mode 100644 new mode 100755 diff --git a/example/game/quarkjs/images/head_idle.png b/example/game/quarkjs/images/head_idle.png old mode 100644 new mode 100755 diff --git a/example/game/quarkjs/images/rain.png b/example/game/quarkjs/images/rain.png old mode 100644 new mode 100755 diff --git a/example/game/quarkjs/js/Rain.js b/example/game/quarkjs/js/Rain.js old mode 100644 new mode 100755 diff --git a/example/game/quarkjs/js/Squirrel.js b/example/game/quarkjs/js/Squirrel.js old mode 100644 new mode 100755 diff --git a/example/game/quarkjs/js/quark.base-1.0.0.min.js b/example/game/quarkjs/js/quark.base-1.0.0.min.js old mode 100644 new mode 100755 diff --git a/example/game/quarkjs/squirrel.html b/example/game/quarkjs/squirrel.html old mode 100644 new mode 100755 index 734533e..12bf185 --- a/example/game/quarkjs/squirrel.html +++ b/example/game/quarkjs/squirrel.html @@ -1,228 +1,260 @@ - - - - + + Squirrel - Quark Framework Tutorials - + - - - + -
+ +
+ frames++; + } + }); + + //初始化timer并启动 + timer = new Q.Timer(1000 / 60); + timer.addListener(stage); + timer.start(); + + //注册舞台事件,使舞台上的元素能接收交互事件 + em = new Q.EventManager(); + var events = Q.supportTouch ? ["touchend"] : ["mouseup"]; + em.registerStage(stage, events, true, true); + + //创建一只松鼠,并添加到舞台 + squirrelone = new Squirrel({ + id: "squirrelone", + x: 330, + y: 450, + autoSize: true + }); + stage.addChild(squirrelone); - + //为松鼠添加touchend或mouseup事件侦听,控制其跳跃。 + squirrelone.addEventListener(events[0], function(e) { + emitter.emit("once"); + emitter.p.x = squirrelone.x + 10; + emitter.p.y = squirrelone.y; + squirrelone.jump(e); + }); - \ No newline at end of file + //提示信息 + var tip = Q.createDOM("span", { + id: "tip", + style: { + position: "absolute", + left: "340px", + top: "550px", + font: "bold 16px Arial", + color: "#fff" + } + }); + tip.innerHTML = "Click me!"; + container.appendChild(tip); + } + + ///////////////////// + function Main() { + //add proton engine + createProton(); + createRain(); + createRender(); + + setInterval(function() { + fpsContainer.innerHTML = "FPS:" + frames; + frames = 0; + }, 1000); + } + + function createProton() { + proton = new Proton(); + proton.stats.add(2, document.getElementById("container")); + + emitter = new Proton.Emitter(); + emitter.rate = new Proton.Rate( + Proton.getSpan(10, 20), + Proton.getSpan(0.2, 0.5) + ); + emitter.addInitialize(new Proton.Mass(1)); + emitter.addInitialize(new Proton.Body(Squirrel)); + emitter.addInitialize(new Proton.Life(1, 2)); + emitter.addInitialize( + new Proton.Velocity( + Proton.getSpan(5, 9), + Proton.getSpan(-20, 20), + "polar" + ) + ); + + emitter.addBehaviour(new Proton.Gravity(8)); + emitter.addBehaviour(new Proton.Scale(Proton.getSpan(0.5, 1), 0)); + emitter.addBehaviour(new Proton.Alpha(1, 0.5)); + emitter.addBehaviour( + new Proton.Rotate(0, Proton.getSpan(-2, 2), "add") + ); + proton.addEmitter(emitter); + } + + function createRain() { + var rainEmitter = new Proton.Emitter(); + rainEmitter.rate = new Proton.Rate( + Proton.getSpan(5, 10), + Proton.getSpan(0.2, 0.5) + ); + rainEmitter.addInitialize(new Proton.Mass(1)); + rainEmitter.addInitialize(new Proton.Body(Rain)); + rainEmitter.addInitialize( + new Proton.Position(new Proton.LineZone(0, -40, 800, -40)) + ); + rainEmitter.addInitialize(new Proton.Life(10, 12)); + + rainEmitter.addBehaviour(new Proton.Gravity(3)); + rainEmitter.addBehaviour(new Proton.Scale(Proton.getSpan(0.3, 1))); + rainEmitter.addBehaviour( + new Proton.CrossZone( + new Proton.LineZone(-150, 620, 900, 620, "down"), + "dead" + ) + ); + proton.addEmitter(rainEmitter); + rainEmitter.emit(); + } + + function createRender() { + var renderer = new Proton.CustomRenderer(); + renderer.onProtonUpdate = function() {}; + + renderer.onParticleCreated = function(particle) { + var squirrel = renderer.pool.get(particle.body, [ + { + id: "target" + particle.id, + x: particle.p.x, + y: particle.p.y, + autoSize: true + } + ]); + + // var squirrel = new particle.body({ + // id: "target" + particle.id, + // x: particle.p.x, + // y: particle.p.y, + // autoSize: true + // }); + stage.addChild(squirrel); + stage.addChild(squirrelone); + transformSprite(squirrel, particle); + particle.sprite = squirrel; + }; + + renderer.onParticleUpdate = function(particle) { + transformSprite(particle.sprite, particle); + }; + + renderer.onParticleDead = function(particle) { + stage.removeChild(particle.sprite); + renderer.pool.expire(particle.sprite); + }; + + proton.addRenderer(renderer); + } + + function transformSprite(particleSprite, particle) { + particleSprite.x = particle.p.x; + particleSprite.y = particle.p.y; + particleSprite.regX = 0.5; + particleSprite.regY = 0.5; + particleSprite.scaleX = particle.scale; + particleSprite.scaleY = particle.scale; + particleSprite.alpha = particle.alpha; + particleSprite.rotation = particle.rotation; + } + + + diff --git a/example/helloworld/emitter/emitter.html b/example/helloworld/emitter/emitter.html old mode 100644 new mode 100755 index 9578c3b..8760af4 --- a/example/helloworld/emitter/emitter.html +++ b/example/helloworld/emitter/emitter.html @@ -1,95 +1,112 @@ - + - - proton.js-emitter-Emitter - - - - - - - + + proton.js-emitter-Emitter + + + + + + + - - + - - \ No newline at end of file + proton.addRenderer(renderer); + } + + function tick() { + requestAnimationFrame(tick); + + stats.begin(); + emitter.rotation += 1.5; + proton.update(); + stats.end(); + } + + + diff --git a/example/index.html b/example/index.html old mode 100644 new mode 100755 diff --git a/example/initialize/imagetarget/Spitfire.html b/example/initialize/imagetarget/Spitfire.html old mode 100644 new mode 100755 diff --git a/example/initialize/imagetarget/fire2.html b/example/initialize/imagetarget/fire2.html old mode 100644 new mode 100755 diff --git a/example/initialize/imagetarget/image/pt.jpg b/example/initialize/imagetarget/image/pt.jpg old mode 100644 new mode 100755 diff --git a/example/initialize/imagetarget/image/rock.png b/example/initialize/imagetarget/image/rock.png old mode 100644 new mode 100755 diff --git a/example/initialize/imagetarget/imagetarget.html b/example/initialize/imagetarget/imagetarget.html old mode 100644 new mode 100755 diff --git a/example/initialize/position/bg-particle.html b/example/initialize/position/bg-particle.html old mode 100644 new mode 100755 diff --git a/example/lib/TweenLite.min.js b/example/lib/TweenLite.min.js old mode 100644 new mode 100755 diff --git a/example/lib/color.min.js b/example/lib/color.min.js old mode 100644 new mode 100755 diff --git a/example/lib/easeljs-0.8.2.min.js b/example/lib/easeljs-0.8.2.min.js old mode 100644 new mode 100755 diff --git a/example/lib/jquery-1.9.1.min.js b/example/lib/jquery-1.9.1.min.js old mode 100644 new mode 100755 diff --git a/example/lib/phaser.min.js b/example/lib/phaser.min.js new file mode 100755 index 0000000..9b32445 --- /dev/null +++ b/example/lib/phaser.min.js @@ -0,0 +1 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Phaser",[],e):"object"==typeof exports?exports.Phaser=e():t.Phaser=e()}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1371)}([function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function s(t,e,s,r){for(var a in e)if(e.hasOwnProperty(a)){var h=i(e,a,s);if(!1!==h){if(n((r||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function r(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0),n.LEFT=new n(-1,0),n.UP=new n(0,-1),n.DOWN=new n(0,1),n.ONE=new n(1,1),t.exports=n},function(t,e,i){var n=i(0),s=i(46),r=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=s.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=r},function(t,e,i){var n=i(0),s=i(20),r=i(21),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.systems.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},s.register("GameObjectFactory",o,"add"),t.exports=o},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=i,o=0;o>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},getComponentCount:function(t,e){for(var i=0,n=0;n=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=u},function(t,e,i){t.exports={Alpha:i(250),Animation:i(482),BlendMode:i(253),ComputedSize:i(525),Crop:i(526),Depth:i(254),Flip:i(527),GetBounds:i(528),Mask:i(258),Origin:i(545),PathFollower:i(546),Pipeline:i(151),ScrollFactor:i(261),Size:i(547),Texture:i(548),TextureCrop:i(549),Tint:i(550),ToJSON:i(262),Transform:i(263),TransformMatrix:i(32),Visible:i(264)}},function(t,e,i){var n=i(0),s=i(262),r=i(111),o=i(9),a=i(90),h=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new r(this)),this},setData:function(t,e){return this.data||(this.data=new r(this)),this.data.set(t,e),this},getData:function(t){return this.data||(this.data=new r(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},update:function(){},toJSON:function(){return s(this)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(t){if(void 0===t&&(t=!1),this.scene&&!this.ignoreDestroy){this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this);var e=this.scene.sys;t||(e.displayList.remove(this),e.updateList.remove(this)),this.input&&(e.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),t||e.queueDepthSort(),this.active=!1,this.visible=!1,this.scene=void 0,this.parentContainer=void 0,this.removeAllListeners()}}});h.RENDER_MASK=15,t.exports=h},function(t,e,i){var n=i(166),s=i(6);t.exports=function(t,e,i){var r=s(t,e,null);if(null===r)return i;if(Array.isArray(r))return n.RND.pick(r);if("object"==typeof r){if(r.hasOwnProperty("randInt"))return n.RND.integerInRange(r.randInt[0],r.randInt[1]);if(r.hasOwnProperty("randFloat"))return n.RND.realInRange(r.randFloat[0],r.randFloat[1])}else if("function"==typeof r)return r(e);return r}},function(t,e,i){var n=i(0),s=i(20),r=i(21),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.displayList,this.updateList,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.systems.events.once(r.DESTROY,this.destroy,this)},start:function(){this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(r.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},s.register("GameObjectCreator",o,"make"),t.exports=o},function(t,e,i){var n=i(7),s=function(){var t,e,i,r,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l=400&&t.status<=599&&(n=!1),this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=s.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=s.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=s.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(r.FILE_COMPLETE,e,i,t),this.loader.emit(r.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});c.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},function(t,e){var i={},n={},s={register:function(t,e,n,s){void 0===s&&(s=!1),i[t]={plugin:e,mapping:n,custom:s}},registerCustom:function(t,e,i,s){n[t]={plugin:e,mapping:i,data:s}},hasCore:function(t){return i.hasOwnProperty(t)},hasCustom:function(t){return n.hasOwnProperty(t)},getCore:function(t){return i[t]},getCustom:function(t){return n[t]},getCustomClass:function(t){return n.hasOwnProperty(t)?n[t].plugin:null},remove:function(t){i.hasOwnProperty(t)&&delete i[t]},removeCustom:function(t){n.hasOwnProperty(t)&&delete n[t]},destroyCorePlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]},destroyCustomPlugins:function(){for(var t in n)n.hasOwnProperty(t)&&delete n[t]}};t.exports=s},function(t,e,i){t.exports={BOOT:i(676),CREATE:i(677),DESTROY:i(678),PAUSE:i(679),POST_UPDATE:i(680),PRE_UPDATE:i(681),READY:i(682),RENDER:i(683),RESUME:i(684),SHUTDOWN:i(685),SLEEP:i(686),START:i(687),TRANSITION_COMPLETE:i(688),TRANSITION_INIT:i(689),TRANSITION_OUT:i(690),TRANSITION_START:i(691),TRANSITION_WAKE:i(692),UPDATE:i(693),WAKE:i(694)}},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e){var i={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null};t.exports=i},function(t,e,i){var n=i(2);t.exports=function(t,e,i,s,r,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===s&&(s=o.height);var a=n(r,"isNotEmpty",!1),h=n(r,"isColliding",!1),l=n(r,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(s+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+s>o.height&&(s=Math.max(o.height-e,0));for(var u=[],c=e;c=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n={VERSION:"3.20.1",BlendModes:i(52),ScaleModes:i(228),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(55),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Transform,s.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),r.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.initPipeline()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]}});t.exports=a},function(t,e){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n=i(0),s=i(23),r=i(3),o=new n({initialize:function(t,e,i,n,s,r){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===s&&(s=0),void 0===r&&(r=0),this.matrix=new Float32Array([t,e,i,n,s,r,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||r?s.TAU-(r>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3];return n[0]=s*i+o*e,n[1]=r*i+a*e,n[2]=s*-e+o*i,n[3]=r*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,s=i[0],r=i[1],o=i[2],a=i[3],h=i[4],l=i[5],u=n[0],c=n[1],d=n[2],f=n[3],p=n[4],g=n[5],v=void 0===e?this:e;return v.a=u*s+c*o,v.b=u*r+c*a,v.c=d*s+f*o,v.d=d*r+f*a,v.e=p*s+g*o+h,v.f=p*r+g*a+l,v},multiplyWithOffset:function(t,e,i){var n=this.matrix,s=t.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=e*r+i*a+n[4],u=e*o+i*h+n[5],c=s[0],d=s[1],f=s[2],p=s[3],g=s[4],v=s[5];return n[0]=c*r+d*a,n[1]=c*o+d*h,n[2]=f*r+p*a,n[3]=f*o+p*h,n[4]=g*r+v*a+l,n[5]=g*o+v*h+u,this},transform:function(t,e,i,n,s,r){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=s*a+r*l+c,o[5]=s*h+r*u+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,s=n[0],r=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*s+e*o+h,i.y=t*r+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=e*s-i*n;return t[0]=s/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-s*r)/a,t[5]=-(e*o-i*r)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,s,r){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=s,o[5]=r,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}else if(s||r){var h=Math.sqrt(s*s+r*r);t.rotation=.5*Math.PI-(r>0?Math.acos(-s/h):-Math.acos(s/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,s){var r=this.matrix,o=Math.sin(i),a=Math.cos(i);return r[4]=t,r[5]=e,r[0]=a*n,r[1]=o*n,r[2]=-o*s,r[3]=a*s,this},applyInverse:function(t,e,i){void 0===i&&(i=new r);var n=this.matrix,s=n[0],o=n[1],a=n[2],h=n[3],l=n[4],u=n[5],c=1/(s*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=s*c*e+-o*c*t+(-u*s+l*o)*c,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=o},function(t,e,i){var n=i(0),s=i(160),r=i(276),o=i(161),a=i(277),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,s){return void 0===n&&(n=255),void 0===s&&(s=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(s)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=s(e,i,n),this._color32=r(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),s=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,s)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e){t.exports=function(t,e,i,n,s,r){var o;void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=1);var a=0,h=t.length;if(1===r)for(o=s;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(23);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.fillColor,r=n||e.fillAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.fillStyle="rgba("+o+","+a+","+h+","+r+")"}},function(t,e,i){(function(e){var i={};t.exports=i,function(){i._nextId=0,i._seed=0,i._nowStartTime=+new Date,i.extend=function(t,e){var n,s;"boolean"==typeof e?(n=2,s=e):(n=1,s=!0);for(var r=n;r0;e--){var n=Math.floor(i.random()*(e+1)),s=t[e];t[e]=t[n],t[n]=s}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===toString.call(t)},i.clamp=function(t,e,i){return ti?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if(window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return e=void 0!==e?e:0,i=void 0!==i?i:1,e+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i=e&&t.y<=i&&t.y+t.height>=i}},function(t,e,i){t.exports={DESTROY:i(617),FADE_IN_COMPLETE:i(618),FADE_IN_START:i(619),FADE_OUT_COMPLETE:i(620),FADE_OUT_START:i(621),FLASH_COMPLETE:i(622),FLASH_START:i(623),PAN_COMPLETE:i(624),PAN_START:i(625),POST_RENDER:i(626),PRE_RENDER:i(627),SHAKE_COMPLETE:i(628),SHAKE_START:i(629),ZOOM_COMPLETE:i(630),ZOOM_START:i(631)}},function(t,e){t.exports=function(t,e,i,n){var s=i||e.strokeColor,r=n||e.strokeAlpha,o=(16711680&s)>>>16,a=(65280&s)>>>8,h=255&s;t.strokeStyle="rgba("+o+","+a+","+h+","+r+")",t.lineWidth=e.lineWidth}},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){var n=i(137),s=i(24);t.exports=function(t,e,i,r,o){for(var a=null,h=null,l=null,u=null,c=s(t,e,i,r,null,o),d=0;d0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e,i){var n=i(0),s=i(256),r=i(148),o=i(46),a=i(149),h=i(3),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return r(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return Math.sqrt(s*s+r*r)}},function(t,e,i){t.exports={COMPLETE:i(866),DECODED:i(867),DECODED_ALL:i(868),DESTROY:i(869),DETUNE:i(870),GLOBAL_DETUNE:i(871),GLOBAL_MUTE:i(872),GLOBAL_RATE:i(873),GLOBAL_VOLUME:i(874),LOOP:i(875),LOOPED:i(876),MUTE:i(877),PAUSE_ALL:i(878),PAUSE:i(879),PLAY:i(880),RATE:i(881),RESUME_ALL:i(882),RESUME:i(883),SEEK:i(884),STOP_ALL:i(885),STOP:i(886),UNLOCKED:i(887),VOLUME:i(888)}},function(t,e,i){var n=i(0),s=i(18),r=i(19),o=i(8),a=i(2),h=i(6),l=i(7),u=new n({Extends:r,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,responseType:"text",key:e,url:i,xhrSettings:n,config:o};r.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=s.FILE_POPULATED)},onProcess:function(){if(this.state!==s.FILE_POPULATED){this.state=s.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",function(t,e,i,n){if(Array.isArray(t))for(var s=0;s0&&(o.angle+=t.angularVelocity,r.rotateAbout(o.position,i,t.position,o.position))}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=r.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,r.add(t.position,e))},n.rotate=function(t,e,i){if(i){var s=Math.cos(e),r=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*s-a*r),y:i.y+(o*r+a*s)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,r){var o=0,a=0;r=r||t.position;for(var u=0;u0&&(o+=c.area,a+=c.inertia),c.position.x=r.x+(c.position.x-r.x)*e,c.position.y=r.y+(c.position.y-r.y)*i,h.update(c.bounds,c.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=r.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(f.position.x+=t.velocity.x,f.position.y+=t.velocity.y),0!==t.angularVelocity&&(s.rotate(f.vertices,t.angularVelocity,t.position),l.rotate(f.axes,t.angularVelocity),d>0&&r.rotateAbout(f.position,t.angularVelocity,t.position,f.position)),h.update(f.bounds,f.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,s=e.y-t.position.y;t.torque+=n*i.y-s*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i80*i){n=h=t[0],a=l=t[1];for(var T=i;Th&&(h=u),f>l&&(l=f);g=0!==(g=Math.max(h-n,l-a))?1/g:0}return o(y,x,i,n,a,g),x}function s(t,e,i,n,s){var r,o;if(s===_(t,e,i,n)>0)for(r=e;r=e;r-=n)o=b(r,t[r],t[r+1],o);return o&&y(o,o.next)&&(E(o),o=o.next),o}function r(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!y(n,n.next)&&0!==m(n.prev,n,n.next))n=n.next;else{if(E(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,s,c,d){if(t){!d&&c&&function(t,e,i,n){var s=t;do{null===s.z&&(s.z=f(s.x,s.y,e,i,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,n,s,r,o,a,h,l=1;do{for(i=t,t=null,r=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(s=i,i=i.nextZ,a--):(s=n,n=n.nextZ,h--),r?r.nextZ=s:t=s,s.prevZ=r,r=s;i=n}r.nextZ=null,l*=2}while(o>1)}(s)}(t,n,s,c);for(var p,g,v=t;t.prev!==t.next;)if(p=t.prev,g=t.next,c?h(t,n,s,c):a(t))e.push(p.i/i),e.push(t.i/i),e.push(g.i/i),E(t),t=g.next,v=g.next;else if((t=g)===v){d?1===d?o(t=l(t,e,i),e,i,n,s,c,2):2===d&&u(t,e,i,n,s,c):o(r(t),e,i,n,s,c,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(m(e,i,n)>=0)return!1;for(var s=t.next.next;s!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,s.x,s.y)&&m(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function h(t,e,i,n){var s=t.prev,r=t,o=t.next;if(m(s,r,o)>=0)return!1;for(var a=s.xr.x?s.x>o.x?s.x:o.x:r.x>o.x?r.x:o.x,u=s.y>r.y?s.y>o.y?s.y:o.y:r.y>o.y?r.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.prevZ,v=t.nextZ;p&&p.z>=c&&v&&v.z<=d;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,p.x,p.y)&&m(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;v&&v.z<=d;){if(v!==t.prev&&v!==t.next&&g(s.x,s.y,r.x,r.y,o.x,o.y,v.x,v.y)&&m(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function l(t,e,i){var n=t;do{var s=n.prev,r=n.next.next;!y(s,r)&&x(s,n,n.next,r)&&T(s,r)&&T(r,s)&&(e.push(s.i/i),e.push(n.i/i),e.push(r.i/i),E(n),E(n.next),n=t=r),n=n.next}while(n!==t);return n}function u(t,e,i,n,s,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var u=w(h,l);return h=r(h,h.next),u=r(u,u.next),o(h,e,i,n,s,a),void o(u,e,i,n,s,a)}l=l.next}h=h.next}while(h!==t)}function c(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,s=t.x,r=t.y,o=-1/0;do{if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){var a=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=s&&a>o){if(o=a,a===s){if(r===n.y)return n;if(r===n.next.y)return n.next}i=n.x=n.x&&n.x>=u&&s!==n.x&&g(ri.x)&&T(n,t)&&(i=n,d=h),n=n.next;return i}(t,e)){var i=w(e,t);r(i,i.next)}}function f(t,e,i,n,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*s)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(r-a)-(s-o)*(n-a)>=0}function v(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&x(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&T(t,e)&&T(e,t)&&function(t,e){var i=t,n=!1,s=(t.x+e.x)/2,r=(t.y+e.y)/2;do{i.y>r!=i.next.y>r&&i.next.y!==i.y&&s<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function m(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,i,n){return!!(y(t,e)&&y(i,n)||y(t,n)&&y(i,e))||m(t,e,i)>0!=m(t,e,n)>0&&m(i,n,t)>0!=m(i,n,e)>0}function T(t,e){return m(t.prev,t,t.next)<0?m(t,e,t.next)>=0&&m(t,t.prev,e)>=0:m(t,e,t.prev)<0||m(t,t.next,e)<0}function w(t,e){var i=new S(t.i,t.x,t.y),n=new S(e.i,e.x,e.y),s=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,n.next=i,i.prev=n,r.next=n,n.prev=r,n}function b(t,e,i,n){var s=new S(t,e,i);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function E(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function S(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function _(t,e,i,n){for(var s=0,r=e,o=i-n;r0&&(n+=t[s-1].length,i.holes.push(n))}return i}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e){t.exports=function(t,e,i,n){var s=t.length;if(e<0||e>s||e>=i||i>s||e+i>s){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(944),a=new n({Extends:r,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,o],initialize:function(t,e,i,n,o){r.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new s.Animation(this),this.setTexture(n,o),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e,i){return this.anims.play(t,e,i),this},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=a},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=t.strokeTint,a=n.getTintAppendFloatAlphaAndSwap(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,u=e.lineWidth,c=u/2,d=h[0]-s,f=h[1]-r;e.closePath||(l-=2);for(var p=2;p=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=u},function(t,e,i){var n=i(0),s=i(18),r=i(19),o=i(8),a=i(2),h=i(7),l=new n({Extends:r,initialize:function t(e,i,n,s,o){var l,u="png";if(h(i)){var c=i;i=a(c,"key"),n=a(c,"url"),l=a(c,"normalMap"),s=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,responseType:"blob",key:i,url:n,xhrSettings:s,config:o};if(r.call(this,e,d),l){var f=new t(e,this.key,l,s,o);f.type="normalMap",this.setLink(f),e.addFile(f)}},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){r.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(t.data),t.onProcessError()},r.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var t,e=this.linkFile;e&&e.state===s.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",function(t,e,i){if(Array.isArray(t))for(var n=0;nthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new r),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){(void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,s){(void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===s&&(s=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,s)&&(this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y));return this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){return this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight,this},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=o},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e,i){var n=i(0),s=i(54),r=i(247),o=i(248),a=i(46),h=i(145),l=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],s=e;si&&(e=i/2);var n=Math.max(1,Math.round(i/e));return s(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),s=0;i.push(0);for(var r=1;r<=t;r++)s+=(e=this.getPoint(r/t,this._tmpVec2B)).distance(n),i.push(s),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=this.defaultDivisions);for(var e=[],i=0;i<=t;i++){var n=this.getUtoTmapping(i/t,null,t);e.push(this.getPoint(n))}return e},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,s=this.getLengths(i),r=0,o=s.length;n=e?Math.min(e,s[o-1]):t*s[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=s[r=Math.floor(h+(l-h)/2)]-n)<0)h=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(s[r=l]===n)return r/(o-1);var u=s[r];return(r+(n-u)/(s[r+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){t.exports={ADD:i(845),COMPLETE:i(846),FILE_COMPLETE:i(847),FILE_KEY_COMPLETE:i(848),FILE_LOAD_ERROR:i(849),FILE_LOAD:i(850),FILE_PROGRESS:i(851),POST_PROCESS:i(852),PROGRESS:i(853),START:i(854)}},function(t,e,i){var n=i(164),s=i(178);t.exports=function(t,e){var i=n.Power0;if("string"==typeof t)if(n.hasOwnProperty(t))i=n[t];else{var r="";t.indexOf(".")&&("in"===(r=t.substr(t.indexOf(".")+1)).toLowerCase()?r="easeIn":"out"===r.toLowerCase()?r="easeOut":"inout"===r.toLowerCase()&&(r="easeInOut")),t=s(t.substr(0,t.indexOf(".")+1)+r),n.hasOwnProperty(t)&&(i=n[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,s=t.y3-t.y1,r=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+s*s,u=n*r+s*o,c=n*a+s*h,d=r*r+o*o,f=r*a+o*h,p=l*d-u*u,g=0===p?0:1/p,v=(d*c-u*f)*g,m=(l*f-u*c)*g;return v>=0&&m>=0&&v+m<1}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.x1,r=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,u=e.x2,c=e.y2,d=(u-h)*(r-l)-(c-l)*(s-h),f=(o-s)*(r-l)-(a-r)*(s-h),p=(c-l)*(o-s)-(u-h)*(a-r);if(0===p)return!1;var g=d/p,v=f/p;return g>=0&&g<=1&&v>=0&&v<=1&&(i.x=s+g*(o-s),i.y=r+g*(a-r),!0)}},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e,i){var n={};t.exports=n;var s=i(101),r=i(37);n.create=function(t,e){for(var i=[],n=0;n0)return!1}return!0},n.scale=function(t,e,i,r){if(1===e&&1===i)return t;var o,a;r=r||n.centre(t);for(var h=0;h=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h0&&(r|=2),3===r)return!1;return 0!==r||null},n.hull=function(t){var e,i,n=[],r=[];for((t=t.slice(0)).sort(function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y}),i=0;i=2&&s.cross3(r[r.length-2],r[r.length-1],e)<=0;)r.pop();r.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&s.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),r.pop(),n.concat(r)}},function(t,e,i){var n=i(22);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){t.exports={DESTROY:i(555),VIDEO_COMPLETE:i(556),VIDEO_CREATED:i(557),VIDEO_ERROR:i(558),VIDEO_LOOP:i(559),VIDEO_PLAY:i(560),VIDEO_SEEKED:i(561),VIDEO_SEEKING:i(562),VIDEO_STOP:i(563),VIDEO_TIMEOUT:i(564),VIDEO_UNLOCKED:i(565)}},function(t,e,i){var n=i(0),s=i(12),r=i(35),o=i(9),a=i(48),h=i(11),l=i(32),u=i(159),c=i(3),d=new n({Extends:o,Mixins:[s.Alpha,s.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.resolution=1,this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._cx=0,this._cy=0,this._cw=0,this._ch=0,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoom=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new c);var n=.5*this.width,s=.5*this.height;return i.x=t-n,i.y=e-s,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],s=e[2],r=e[3],o=i*r-n*s;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,u=this.scrollY,c=this.width,d=this.height,f=this.culledObjects,p=t.length;o=1/o,f.length=0;for(var g=0;gC&&w_&&bs&&(t=s),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,s=Math.max(n,n+e.height-i);return ts&&(t=s),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=r(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=u(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,s){return void 0===s&&(s=!1),this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,s?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras;var i=this.scaleManager.resolution;return this.resolution=i,this._cx=this._x*i,this._cy=this._y*i,this._cw=this._width*i,this._ch=this._height*i,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t){return void 0===t&&(t=1),0===t&&(t=.001),this.zoom=t,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this._cx=t*this.resolution,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._cy=t*this.resolution,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this._cw=t*this.resolution,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this._ch=t*this.resolution,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return this._zoom},set:function(t){this._zoom=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoom}},displayHeight:{get:function(){return this.height/this.zoom}}});t.exports=d},function(t,e,i){t.exports={ENTER_FULLSCREEN:i(670),FULLSCREEN_FAILED:i(671),FULLSCREEN_UNSUPPORTED:i(672),LEAVE_FULLSCREEN:i(673),ORIENTATION_CHANGE:i(674),RESIZE:i(675)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},function(t,e,i){var n=i(0),s=i(22),r=i(16),o=new n({initialize:function(t,e,i,n,s,r,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(r,o,n,s)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var s=this.data,r=s.cut;r.x=i,r.y=n,r.w=t,r.h=e,r.r=i+t,r.b=n+e,s.sourceSize.w=t,s.sourceSize.h=e,s.spriteSourceSize.w=t,s.spriteSourceSize.h=e,s.radius=.5*Math.sqrt(t*t+e*e);var o=s.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,s,r){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=s,a.h=r,a.r=i+s,a.b=n+r,this.x=i,this.y=n,this.width=s,this.height=r,this.halfWidth=.5*s,this.halfHeight=.5*r,this.centerX=Math.floor(s/2),this.centerY=Math.floor(r/2),this.updateUVs()},setCropUVs:function(t,e,i,n,r,o,a){var h=this.cutX,l=this.cutY,u=this.cutWidth,c=this.cutHeight,d=this.realWidth,f=this.realHeight,p=h+(e=s(e,0,d)),g=l+(i=s(i,0,f)),v=n=s(n,0,d-e),m=r=s(r,0,f-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,T=e+(n=s(n,0,u-e)),w=i+(r=s(r,0,c-i));if(!(x.rT||x.y>w)){var b=Math.max(x.x,e),E=Math.max(x.y,i),S=Math.min(x.r,T)-b,_=Math.min(x.b,w)-E;v=S,m=_,p=o?h+(u-(b-x.x)-S):h+(b-x.x),g=a?l+(c-(E-x.y)-_):l+(E-x.y),e=b,i=E,n=S,r=_}else p=0,g=0,v=0,m=0}else o&&(p=h+(u-e-n)),a&&(g=l+(c-i-r));var A=this.source.width,C=this.source.height;return t.u0=Math.max(0,p/A),t.v0=Math.max(0,g/C),t.u1=Math.min(1,(p+v)/A),t.v1=Math.min(1,(g+m)/C),t.x=e,t.y=i,t.cx=p,t.cy=g,t.cw=v,t.ch=m,t.width=n,t.height=r,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,s=this.data.drawImage;s.width=i,s.height=n;var r=this.source.width,o=this.source.height;return this.u0=t/r,this.v0=e/o,this.u1=(t+i)/r,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=r(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},function(t,e,i){var n=i(0),s=i(96),r=i(374),o=i(375),a=i(46),h=i(152),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return s(this,t,e)},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,s=(i-t.y)/t.height;return(n*=n)+(s*=s)<.25}},function(t,e,i){var n=i(235),s=i(0),r=i(90),o=i(2),a=i(6),h=i(7),l=i(368),u=i(107),c=i(68),d=new s({initialize:function(t,e,i){i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?h(e[0])&&(i=e,e=null):h(e)&&(i=e,e=null),this.scene=t,this.children=new u(e),this.isParent=!0,this.classType=o(i,"classType",c),this.name=o(i,"name",""),this.active=o(i,"active",!0),this.maxSize=o(i,"maxSize",-1),this.defaultKey=o(i,"defaultKey",null),this.defaultFrame=o(i,"defaultFrame",null),this.runChildUpdate=o(i,"runChildUpdate",!1),this.createCallback=o(i,"createCallback",null),this.removeCallback=o(i,"removeCallback",null),this.createMultipleCallback=o(i,"createMultipleCallback",null),i&&this.createMultiple(i)},create:function(t,e,i,n,s,r){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===s&&(s=!0),void 0===r&&(r=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=s,o.setActive(r),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;u--)if((l=d[u]).active===i){if(++c===e)break}else l=null;return l?("number"==typeof s&&(l.x=s),"number"==typeof r&&(l.y=r),l):n?this.create(s,r,o,a,h):null},get:function(t,e,i,n,s){return this.getFirst(!1,!0,t,e,i,n,s)},getFirstAlive:function(t,e,i,n,s,r){return this.getFirst(!0,t,e,i,n,s,r)},getFirstDead:function(t,e,i,n,s,r){return this.getFirst(!1,t,e,i,n,s,r)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;it.max.x&&(t.max.x=s.x),s.xt.max.y&&(t.max.y=s.y),s.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach(function(t){e.set(t)}),this.entries.forEach(function(t){e.set(t)}),e},intersect:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)&&e.set(i)}),e},difference:function(t){var e=new n;return this.entries.forEach(function(i){t.contains(i)||e.set(i)}),e},size:{get:function(){return this.entries.length},set:function(t){return t0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){(function(e){var i={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){var t=navigator.userAgent;/Windows/.test(t)?i.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?i.macOS=!0:/Android/.test(t)?i.android=!0:/Linux/.test(t)?i.linux=!0:/iP[ao]d|iPhone/i.test(t)?(i.iOS=!0,navigator.appVersion.match(/OS (\d+)/),i.iOSVersion=parseInt(RegExp.$1,10),i.iPhone=-1!==t.toLowerCase().indexOf("iphone"),i.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?i.kindle=!0:/CrOS/.test(t)&&(i.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(i.android=!1,i.iOS=!1,i.macOS=!1,i.windows=!0,i.windowsPhone=!0);var n=/Silk/.test(t);return(i.windows||i.macOS||i.linux&&!n||i.chromeOS)&&(i.desktop=!0),(i.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(i.desktop=!1),navigator.standalone&&(i.webApp=!0),void 0!==window.cordova&&(i.cordova=!0),void 0!==e&&e.versions&&e.versions.node&&(i.node=!0),i.node&&"object"==typeof e.versions&&(i.nodeWebkit=!!e.versions["node-webkit"],i.electron=!!e.versions.electron),void 0!==window.ejecta&&(i.ejecta=!0),/Crosswalk/.test(t)&&(i.crosswalk=!0),i.pixelRatio=window.devicePixelRatio||1,i}()}).call(this,i(696))},function(t,e,i){var n,s=i(114),r={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?r.edge=!0:/Chrome\/(\d+)/.test(n)&&!s.windowsPhone?(r.chrome=!0,r.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(r.firefox=!0,r.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&s.iOS?r.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(r.ie=!0,r.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?r.opera=!0:/Safari/.test(n)&&!s.windowsPhone?r.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(r.ie=!0,r.trident=!0,r.tridentVersion=parseInt(RegExp.$1,10),r.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(r.silk=!0),r)},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e,i){t.exports={ADD:i(743),ERROR:i(744),LOAD:i(745),READY:i(746),REMOVE:i(747)}},function(t,e){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement)return t;return i||(i=document.body),i.appendChild(t),t}},function(t,e,i){var n=i(79);t.exports=function(t,e,i,s){var r;if(void 0===s&&(s=t),!Array.isArray(e))return-1!==(r=t.indexOf(e))?(n(t,r),i&&i.call(s,e),e):null;for(var o=e.length-1;o>=0;){var a=e[o];-1!==(r=t.indexOf(a))?(n(t,r),i&&i.call(s,a)):e.pop(),o--}return e}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e,i){var n=i(0),s=i(66),r=i(9),o=i(59),a=i(17),h=i(1),l=new n({Extends:r,initialize:function(t){r.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,function(){this.pauseOnBlur&&this.onBlur()},this),t.events.on(a.FOCUS,function(){this.pauseOnBlur&&this.onFocus()},this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var r=s(e),o=i.spritemap[n];r.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:r})}return i},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once(o.COMPLETE,n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound(function(t){t.pause()}),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound(function(t){t.resume()}),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound(function(t){t.stop()}),this.emit(o.STOP_ALL,this)},unlock:h,onBlur:h,onFocus:h,update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach(function(i){i.update(t,e)})},destroy:function(){this.removeAllListeners(),this.forEachActiveSound(function(t){t.destroy()}),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach(function(n,s){n&&!n.pendingRemove&&t.call(e||i,n,s,i.sounds)})},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound(function(t){t.calculateRate()}),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=l},function(t,e,i){var n=i(0),s=i(9),r=i(59),o=i(16),a=i(1),h=new n({Extends:s,initialize:function(t,e,i){s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),!1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0}},t),this.markers[t.name]=t,!0))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name)&&(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),!0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),!1))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!0,!0)},resume:function(){return!(!this.isPaused||this.isPlaying)&&(this.isPlaying=!0,this.isPaused=!1,!0)},stop:function(){return!(!this.isPaused&&!this.isPlaying)&&(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),!0)},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(r.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},function(t,e,i){var n=i(180),s=i(0),r=i(1),o=i(126),a=new s({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=r,this.removeCallback=r,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o.inplace(this.list,e),this):this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,s){return n.GetFirst(this.list,t,e,i,s)},getAll:function(t,e,i,s){return n.GetAll(this.list,t,e,i,s)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){for(var i=[null],n=2;n0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(181),s=i(366);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=s(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=s(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;il&&(r=l),o>l&&(o=l),a=s,h=r;;)if(a0&&o.length0&&a.lengthe.right||t.y>e.bottom)}},function(t,e,i){var n=i(6),s={},r={register:function(t,e,i,n,r){s[t]={plugin:e,mapping:i,settingsKey:n,configKey:r}},getPlugin:function(t){return s[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,r=e.game.config;for(var o in s){var a=s[o].plugin,h=s[o].mapping,l=s[o].settingsKey,u=s[o].configKey;n(i,l,r[u])&&(t[h]=new a(t))}},remove:function(t){s.hasOwnProperty(t)&&delete s[t]}};t.exports=r},function(t,e,i){t.exports={ANY_KEY_DOWN:i(1187),ANY_KEY_UP:i(1188),COMBO_MATCH:i(1189),DOWN:i(1190),KEY_DOWN:i(1191),KEY_UP:i(1192),UP:i(1193)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e){t.exports=function(t,e,i,n,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===s&&(s=0),{responseType:t,async:e,user:i,password:n,timeout:s,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0}}},function(t,e,i){var n=i(0),s=i(211),r=i(68),o=new n({Extends:r,Mixins:[s.Acceleration,s.Angular,s.Bounce,s.Debug,s.Drag,s.Enable,s.Friction,s.Gravity,s.Immovable,s.Mass,s.Size,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t,e,i,n,s),this.body=null}});t.exports=o},function(t,e,i){var n={};t.exports=n;var s=i(86),r=i(37),o=i(62),a=i(102),h=i(101),l=i(1360);n.rectangle=function(t,e,i,n,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:s.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(a.chamfer){var l=a.chamfer;h.vertices=s.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(r.extend({},h,a))},n.trapezoid=function(t,e,i,n,a,h){h=h||{};var l,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-n+" L "+c+" "+-n+" L "+d+" 0":"L 0 0 L "+c+" "+-n+" L "+d+" 0";var f={label:"Trapezoid Body",position:{x:t,y:e},vertices:s.fromPath(l)};if(h.chamfer){var p=h.chamfer;f.vertices=s.chamfer(f.vertices,p.radius,p.quality,p.qualityMin,p.qualityMax),delete h.chamfer}return o.create(r.extend({},f,h))},n.circle=function(t,e,i,s,o){s=s||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),n.polygon(t,e,h,i,r.extend({},a,s))},n.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return n.circle(t,e,a,h);for(var l=2*Math.PI/i,u="",c=.5*l,d=0;d0&&s.area(S)1?(f=o.create(r.extend({parts:p.slice(0)},n)),o.setPosition(f,{x:t,y:e}),f):p[0]}},function(t,e,i){t.exports={CalculateFacesAt:i(214),CalculateFacesWithin:i(51),Copy:i(1281),CreateFromTiles:i(1282),CullTiles:i(1283),Fill:i(1284),FilterTiles:i(1285),FindByIndex:i(1286),FindTile:i(1287),ForEachTile:i(1288),GetTileAt:i(137),GetTileAtWorldXY:i(1289),GetTilesWithin:i(24),GetTilesWithinShape:i(1290),GetTilesWithinWorldXY:i(1291),HasTileAt:i(455),HasTileAtWorldXY:i(1292),IsInLayerBounds:i(103),PutTileAt:i(215),PutTileAtWorldXY:i(1293),PutTilesAt:i(1294),Randomize:i(1295),RemoveTileAt:i(456),RemoveTileAtWorldXY:i(1296),RenderDebug:i(1297),ReplaceByIndex:i(454),SetCollision:i(1298),SetCollisionBetween:i(1299),SetCollisionByExclusion:i(1300),SetCollisionByProperty:i(1301),SetCollisionFromCollisionGroup:i(1302),SetTileIndexCallback:i(1303),SetTileLocationCallback:i(1304),Shuffle:i(1305),SwapByIndex:i(1306),TileToWorldX:i(138),TileToWorldXY:i(1307),TileToWorldY:i(139),WeightedRandomize:i(1308),WorldToTileX:i(63),WorldToTileXY:i(1309),WorldToTileY:i(64)}},function(t,e,i){var n=i(103);t.exports=function(t,e,i,s){if(void 0===i&&(i=!1),n(t,e,s)){var r=s.data[e][t]||null;return null===r?null:-1===r.index?i?r:null:r}return null}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.x+e.scrollX*(1-s.scrollFactorX),n*=s.scaleX),r+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,s=i.tilemapLayer,r=0;return s&&(void 0===e&&(e=s.scene.cameras.main),r=s.y+e.scrollY*(1-s.scrollFactorY),n*=s.scaleY),r+t*n}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o={}),void 0===a&&(a={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=n,this.tileMargin=s,this.tileSpacing=r,this.tileProperties=o,this.tileData=a,this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t1?2-s:s,o=r*Math.cos(i),a=r*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){var n=i(22),s=i(0),r=i(9),o=i(109),a=i(251),h=i(252),l=i(6),u=new s({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,l(i,"frames",[]),l(i,"defaultTextureKey",null)),this.frameRate=l(i,"frameRate",null),this.duration=l(i,"duration",null),null===this.duration&&null===this.frameRate?(this.frameRate=24,this.duration=this.frameRate/this.frames.length*1e3):this.duration&&null===this.frameRate?this.frameRate=this.frames.length/(this.duration/1e3):this.duration=this.frames.length/this.frameRate*1e3,this.msPerFrame=1e3/this.frameRate,this.skipMissedFrames=l(i,"skipMissedFrames",!0),this.delay=l(i,"delay",0),this.repeat=l(i,"repeat",0),this.repeatDelay=l(i,"repeatDelay",0),this.yoyo=l(i,"yoyo",!1),this.showOnStart=l(i,"showOnStart",!1),this.hideOnComplete=l(i,"hideOnComplete",!1),this.paused=!1,this.manager.on(o.PAUSE_ALL,this.pause,this),this.manager.on(o.RESUME_ALL,this.resume,this)},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),s=this.frames.slice(t);this.frames=n.concat(i,s)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=a[0],a[0].prevFrame=s;var v=1/(a.length-1);for(r=0;r=this.frames.length&&(e=0),t.currentAnim!==this&&(t.currentAnim=this,t.frameRate=this.frameRate,t.duration=this.duration,t.msPerFrame=this.msPerFrame,t.skipMissedFrames=this.skipMissedFrames,t._delay=this.delay,t._repeat=this.repeat,t._repeatDelay=this.repeatDelay,t._yoyo=this.yoyo);var i=this.frames[e];0!==e||t.forward||(i=this.getLastFrame()),t.updateFrame(i)},getFrameByProgress:function(t){return t=n(t,0,1),a(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t._yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?t._reverse&&t.forward?t.forward=!1:this.repeatAnimation(t):this.completeAnimation(t):this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t._reverse===!e&&t.repeatCounter>0)return t.forward=e,void this.repeatAnimation(t);if(t._reverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else this.completeAnimation(t)},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t._yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?t._reverse&&!t.forward?(t.currentFrame=this.getLastFrame(),this.repeatAnimation(t)):(t.forward=!0,this.repeatAnimation(t)):this.completeAnimation(t):this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.updateFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop)return this.completeAnimation(t);if(t._repeatDelay>0&&!1===t.pendingRepeat)t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t._repeatDelay;else if(t.repeatCounter--,t.updateFrame(t.currentFrame[t.forward?"nextFrame":"prevFrame"]),t.isPlaying){this.getNextTick(t),t.pendingRepeat=!1;var e=t.currentFrame,i=t.parent;this.emit(o.ANIMATION_REPEAT,this,e),i.emit(o.SPRITE_ANIMATION_KEY_REPEAT+this.key,this,e,t.repeatCounter,i),i.emit(o.SPRITE_ANIMATION_REPEAT,this,e,t.repeatCounter,i)}},setFrame:function(t){t.forward?this.nextFrame(t):this.previousFrame(t)},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach(function(e){t.frames.push(e.toJSON())}),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),n=0;n1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[n-1],t.nextFrame=this.frames[n+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.removeAllListeners(),this.manager.off(o.PAUSE_ALL,this.pause,this),this.manager.off(o.RESUME_ALL,this.resume,this),this.manager.remove(this.key);for(var t=0;t=1)return i.x=t.x,i.y=t.y,i;var r=n(t)*e;return e>.5?(r-=t.width+t.height)<=t.width?(i.x=t.right-r,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(r-t.width)):r<=t.width?(i.x=t.x+r,i.y=t.y):(i.x=t.right,i.y=t.y+(r-t.width)),i}},function(t,e,i){var n=i(56),s=i(4);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,u=0;u=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+r*h),e.y=t.y1+(s*a+o*h),e}},function(t,e){t.exports=function(t,e,i,n,s){var r=n+Math.atan2(t.y-i,t.x-e);return t.x=e+s*Math.cos(r),t.y=i+s*Math.sin(r),t}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var r=Math.ceil((s=e-t.length)/2);t=new Array(s-r+1).join(i)+t+new Array(r+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){var n=i(275),s=i(278),r=i(280),o=i(281);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return s(t);case"object":return r(t)}}},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){var n=i(160);t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var r=Math.floor(6*t),o=6*t-r,a=Math.floor(i*(1-e)*255),h=Math.floor(i*(1-o*e)*255),l=Math.floor(i*(1-(1-o)*e)*255),u=i=Math.floor(i*=255),c=i,d=i,f=r%6;return 0===f?(c=l,d=a):1===f?(u=h,d=a):2===f?(u=a,d=l):3===f?(u=a,c=h):4===f?(u=l,c=a):5===f&&(c=a,d=h),s?s.setTo?s.setTo(u,c,d,s.alpha,!1):(s.r=u,s.g=c,s.b=d,s.color=n(u,c,d),s):{r:u,g:c,b:d,color:n(u,c,d)}}},function(t,e){var i,n="";t.exports={disable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!1),t},enable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z;return this.x=i*o-n*r,this.y=n*s-e*o,this.z=e*r-i*s,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=e*s[0]+i*s[3]+n*s[6],this.y=e*s[1]+i*s[4]+n*s[7],this.z=e*s[2]+i*s[5]+n*s[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12],this.y=s[1]*e+s[5]*i+s[9]*n+s[13],this.z=s[2]*e+s[6]*i+s[10]*n+s[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=e*s[0]+i*s[4]+n*s[8]+s[12],o=e*s[1]+i*s[5]+n*s[9]+s[13],a=e*s[2]+i*s[6]+n*s[10]+s[14],h=e*s[3]+i*s[7]+n*s[11]+s[15];return this.x=r/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},project:function(t){var e=this.x,i=this.y,n=this.z,s=t.val,r=s[0],o=s[1],a=s[2],h=s[3],l=s[4],u=s[5],c=s[6],d=s[7],f=s[8],p=s[9],g=s[10],v=s[11],m=s[12],y=s[13],x=s[14],T=1/(e*h+i*d+n*v+s[15]);return this.x=(e*r+i*l+n*f+m)*T,this.y=(e*o+i*u+n*p+y)*T,this.z=(e*a+i*c+n*g+x)*T,this},unproject:function(t,e){var i=t.x,n=t.y,s=t.z,r=t.w,o=this.x-i,a=r-this.y-1-n,h=this.z;return this.x=2*o/s-1,this.y=2*a/r-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},function(t,e,i){t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e,i){var n=i(11);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,r,o=Number.MAX_VALUE,a=Number.MAX_VALUE,h=Number.MIN_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER,u=0;u0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){t&&(this.settings.data=t),this.settings.status=s.START,this.settings.active=!0,this.settings.visible=!0,this.events.emit(o.START,this),this.events.emit(o.READY,this,t)},shutdown:function(t){this.events.off(o.TRANSITION_INIT),this.events.off(o.TRANSITION_START),this.events.off(o.TRANSITION_COMPLETE),this.events.off(o.TRANSITION_OUT),this.settings.status=s.SHUTDOWN,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.SHUTDOWN,this,t)},destroy:function(){this.settings.status=s.DESTROYED,this.settings.active=!1,this.settings.visible=!1,this.events.emit(o.DESTROY,this),this.events.removeAllListeners();for(var t=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],e=0;e0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=u},function(t,e,i){var n=i(180),s=i(52),r=i(0),o=i(12),a=i(90),h=i(13),l=i(11),u=i(931),c=i(370),d=i(3),f=new r({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Transform,o.Visible,u],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._displayList=t.sys.displayList,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(s.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.list.length>0)for(var e=this.list,i=new l,n=0;n-1},setAll:function(t,e,i,s){return n.SetAll(this.list,t,e,i,s),this},each:function(t,e){var i,n=[null],s=this.list.slice(),r=s.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[],this._displayList=null}});t.exports=f},function(t,e,i){var n=i(127),s=i(0),r=i(936),o=new s({Extends:n,Mixins:[r],initialize:function(t,e,i,s,r,o,a){n.call(this,t,e,i,s,r,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){var n=i(91),s=i(0),r=i(189),o=i(250),a=i(253),h=i(254),l=i(258),u=i(151),c=i(263),d=i(264),f=i(261),p=i(32),g=i(95),v=i(13),m=i(2),y=i(6),x=i(23),T=i(942),w=new s({Extends:v,Mixins:[o,a,h,l,u,c,d,f,T],initialize:function(t,e){var i=y(e,"x",0),n=y(e,"y",0);v.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this._tempMatrix1=new p,this._tempMatrix2=new p,this._tempMatrix3=new p,this.setDefaultStyles(e)},setDefaultStyles:function(t){return y(t,"lineStyle",null)&&(this.defaultStrokeWidth=y(t,"lineStyle.width",1),this.defaultStrokeColor=y(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=y(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),y(t,"fillStyle",null)&&(this.defaultFillColor=y(t,"fillStyle.color",16777215),this.defaultFillAlpha=y(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(r.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(r.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,s){return void 0===s&&(s=1),this.commandBuffer.push(r.GRADIENT_FILL_STYLE,s,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,s,o){return void 0===o&&(o=1),this.commandBuffer.push(r.GRADIENT_LINE_STYLE,t,o,e,i,n,s),this},setTexture:function(t,e,i){if(void 0===i&&(i=0),void 0===t)this.commandBuffer.push(r.CLEAR_TEXTURE);else{var n=this.scene.sys.textures.getFrame(t,e);n&&(2===i&&(i=3),this.commandBuffer.push(r.SET_TEXTURE,n,i))}return this},beginPath:function(){return this.commandBuffer.push(r.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(r.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(r.FILL_PATH),this},fill:function(){return this.commandBuffer.push(r.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(r.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(r.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,x.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(r.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var s=this._lineWidth/2,r=t-s,o=t+s;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(r,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(r,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,s){void 0===s&&(s=20);var r=s,o=s,a=s,h=s;return"number"!=typeof s&&(r=m(s,"tl",20),o=m(s,"tr",20),a=m(s,"bl",20),h=m(s,"br",20)),this.beginPath(),this.moveTo(t+r,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-x.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,x.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,x.TAU,Math.PI),this.lineTo(t,e+r),this.arc(t+r,e+r,r,-Math.PI,-x.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(r.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.FILL_TRIANGLE,t,e,i,n,s,o),this},strokeTriangle:function(t,e,i,n,s,o){return this.commandBuffer.push(r.STROKE_TRIANGLE,t,e,i,n,s,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(r.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(r.MOVE_TO,t,e),this},strokePoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var s=1;s-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,s,r=this.scene.sys,o=r.game.renderer;if(void 0===e&&(e=r.scale.width),void 0===i&&(i=r.scale.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(r.textures.exists(t)){var a=(n=r.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(s=a.getContext("2d"))}else s=(n=r.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(s=t.getContext("2d"));return s&&(this.renderCanvas(o,this,0,w.TargetCamera,null,s,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e){t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,SET_TEXTURE:19,CLEAR_TEXTURE:20,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.width/2,r=t.height/2;return i.x=t.x+s*Math.cos(e),i.y=t.y+r*Math.sin(e),i}},function(t,e,i){var n=i(0),s=i(12),r=i(13),o=i(378),a=i(124),h=i(380),l=i(952),u=new n({Extends:r,Mixins:[s.Depth,s.Mask,s.Pipeline,s.Transform,s.Visible,l],initialize:function(t,e,i,n){if(r.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var s=0;s0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,s=0;ss.width&&(t=s.width-this.frame.cutX),this.frame.cutY+e>s.height&&(e=s.height-this.frame.cutY),this.frame.setSize(t,e,this.frame.cutX,this.frame.cutY)}this.updateDisplayOrigin();var r=this.input;return r&&!r.customHitArea&&(r.hitArea.width=t,r.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,s,r){void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.frame.cutWidth),void 0===r&&(r=this.frame.cutHeight);var o=255&(t>>16|0),a=255&(t>>8|0),h=255&(0|t),l=this.gl,u=this.frame;if(this.camera.preRender(1,1),l){var c=this.camera._cx,f=this.camera._cy,p=this.camera._cw,g=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(c,f,p,g,g);var v=this.pipeline;v.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),v.drawFillRect(i,n,s,r,d.getTintFromFloats(o/255,a/255,h/255,1),e),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),v.projOrtho(0,v.width,v.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.context.fillStyle="rgba("+o+","+a+","+h+","+e+")",this.context.fillRect(i+u.cutX,n+u.cutY,s,r),this.renderer.setContext();return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.gl;if(t){var e=this.renderer;e.setFramebuffer(this.framebuffer,!0),this.frame.cutWidth===this.canvas.width&&this.frame.cutHeight===this.canvas.height||t.scissor(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT),e.setFramebuffer(null,!0)}else{var i=this.context;i.save(),i.setTransform(1,0,0,1,0,0),i.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),i.restore()}this.dirty=!1}return this},erase:function(t,e,i){this._eraseMode=!0;var s=this.renderer.currentBlendMode;return this.renderer.setBlendMode(n.ERASE),this.draw(t,e,i,1,16777215),this.renderer.setBlendMode(s),this._eraseMode=!1,this},draw:function(t,e,i,n,s){void 0===n&&(n=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16),Array.isArray(t)||(t=[t]);var r=this.gl;if(this.camera.preRender(1,1),r){var o=this.camera._cx,a=this.camera._cy,h=this.camera._cw,l=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(o,a,h,l,l);var u=this.pipeline;u.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),this.batchList(t,e,i,n,s),u.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),u.projOrtho(0,u.width,u.height,0,-1e3,1e3)}else this.renderer.setContext(this.context),this.batchList(t,e,i,n,s),this.renderer.setContext();return this.dirty=!0,this},drawFrame:function(t,e,i,n,s,r){void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16);var o=this.gl,a=this.textureManager.getFrame(t,e);if(a){if(this.camera.preRender(1,1),o){var h=this.camera._cx,l=this.camera._cy,u=this.camera._cw,c=this.camera._ch;this.renderer.setFramebuffer(this.framebuffer,!1),this.renderer.pushScissor(h,l,u,c,c);var d=this.pipeline;d.projOrtho(0,this.texture.width,0,this.texture.height,-1e3,1e3),d.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,r,s,this.camera.matrix,null),d.flush(),this.renderer.setFramebuffer(null,!1),this.renderer.popScissor(),d.projOrtho(0,d.width,d.height,0,-1e3,1e3)}else this.batchTextureFrame(a,i+this.frame.cutX,n+this.frame.cutY,s,r);this.dirty=!0}return this},batchList:function(t,e,i,n,s){for(var r=0;rl){if(0===c){for(var g=f;g.length&&(g=g.slice(0,-1),!((p=e.measureText(g).width)<=l)););if(!g.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var v=d.substr(g.length);u[c]=v,h+=g}var m=u[c].length?c:c+1,y=u.slice(m).join(" ").replace(/[ \n]*$/gi,"");s[o+1]=y+" "+(s[o+1]||""),r=s.length;break}h+=f,l-=p}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",s=t.split(this.splitRegExp),r=0;ro?(h>0&&(n+="\n"),n+=a[h]+" ",o=i-l):(o-=l,n+=a[h],h0&&(d+=h.lineSpacing*g),i.rtl)c=f-c;else if("right"===i.align)c+=o-h.lineWidths[g];else if("center"===i.align)c+=(o-h.lineWidths[g])/2;else if("justify"===i.align){if(h.lineWidths[g]/h.width>=.85){var v=h.width-h.lineWidths[g],m=e.measureText(" ").width,y=a[g].trim(),x=y.split(" ");v+=(a[g].length-y.length)*m;for(var T=Math.floor(v/m),w=0;T>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--T;a[g]=x.join(" ")}}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[g],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[g],c,d))}e.restore(),this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var b=this.input;return b&&!b.customHitArea&&(b.hitArea.width=this.width,b.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&c(this.canvas),s.remove(this.canvas),this.texture.destroy()}});t.exports=p},function(t,e,i){var n=i(25),s=i(0),r=i(12),o=i(17),a=i(13),h=i(308),l=i(162),u=i(968),c=i(3),d=new s({Extends:a,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Crop,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Tint,r.Transform,r.Visible,u],initialize:function(t,e,i,s,r,l,u){var d=t.sys.game.renderer;a.call(this,t,"TileSprite");var f=t.sys.textures.get(l),p=f.get(u);s&&r?(s=Math.floor(s),r=Math.floor(r)):(s=p.width,r=p.height),this._tilePosition=new c,this._tileScale=new c(1,1),this.dirty=!1,this.renderer=d,this.canvas=n.create(this,s,r),this.context=this.canvas.getContext("2d"),this.displayTexture=f,this.displayFrame=p,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(p.width),this.potHeight=h(p.height),this.fillCanvas=n.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(s,r),this.setFrame(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)},this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){return this.displayFrame=this.displayTexture.get(t),this.displayFrame.cutWidth&&this.displayFrame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,n=this.potWidth,s=this.potHeight;this.renderer.gl||(n=t.cutWidth,s=t.cutHeight),e.clearRect(0,0,n,s),i.width=n,i.height=s,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,s),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,n=this._tileScale.y,s=this._tilePosition.x,r=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-s,-r),e.fillStyle=this.fillPattern,e.fillRect(s,r,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),n.remove(this.canvas),n.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},function(t,e,i){var n=i(0),s=i(22),r=i(12),o=i(90),a=i(17),h=i(13),l=i(59),u=i(193),c=i(971),d=new n({Extends:h,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,c],initialize:function(t,e,i,n){h.call(this,t,"Video"),this.video=null,this.videoTexture=null,this.videoTextureSource=null,this.snapshotTexture=null,this.flipY=!1,this._key=u(),this.touchLocked=!0,this.playWhenUnlocked=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={play:this.playHandler.bind(this),error:this.loadErrorHandler.bind(this),end:this.completeHandler.bind(this),time:this.timeUpdateHandler.bind(this),seeking:this.seekingHandler.bind(this),seeked:this.seekedHandler.bind(this)},this._crop=this.resetCropObject(),this.markers={},this._markerIn=-1,this._markerOut=Number.MAX_SAFE_INTEGER,this._lastUpdate=0,this._cacheKey="",this._isSeeking=!1,this.setPosition(e,i),this.initPipeline(),n&&this.changeSource(n,!1);var s=t.sys.game.events;s.on(a.PAUSE,this.globalPause,this),s.on(a.RESUME,this.globalResume,this);var r=t.sys.sound;r&&r.on(l.GLOBAL_MUTE,this.globalMute,this)},play:function(t,e,i){if(this.touchLocked&&this.playWhenUnlocked||this.isPlaying())return this;var n=this.video;if(!n)return console.warn("Video not loaded"),this;void 0===t&&(t=n.loop);var s=this.scene.sys.sound;s&&s.mute&&this.setMute(!0),isNaN(e)||(this._markerIn=e),!isNaN(i)&&i>e&&(this._markerOut=i),n.loop=t;var r=this._callbacks,o=n.play();return void 0!==o?o.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this)):(n.addEventListener("playing",r.play,!0),n.readyState<2&&(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval))),n.addEventListener("ended",r.end,!0),n.addEventListener("timeupdate",r.time,!0),n.addEventListener("seeking",r.seeking,!0),n.addEventListener("seeked",r.seeked,!0),this},changeSource:function(t,e,i,n,s){void 0===e&&(e=!0),this.video&&this.stop();var r=this.scene.sys.cache.video.get(t);return r?(this.video=r,this._cacheKey=t,this._codePaused=r.paused,this._codeMuted=r.muted,this.videoTexture?(this.scene.sys.textures.remove(this._key),this.videoTexture=this.scene.sys.textures.create(this._key,r,r.videoWidth,r.videoHeight),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,r.videoWidth,r.videoHeight),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,r.videoWidth,r.videoHeight)):this.updateTexture(),r.currentTime=0,this._lastUpdate=0,e&&this.play(i,n,s)):this.video=null,this},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,n,s,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=this.height),void 0===s&&(s=i),void 0===r&&(r=n);var o=this.video,a=this.snapshotTexture;return a?(a.setSize(s,r),o&&a.context.drawImage(o,t,e,i,n,0,0,s,r)):(a=this.scene.sys.textures.createCanvas(u(),s,r),this.snapshotTexture=a,o&&a.context.drawImage(o,t,e,i,n,0,0,s,r)),a.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},loadURL:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var n=document.createElement("video");return n.controls=!1,i&&(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")),n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),n.addEventListener("error",this._callbacks.error,!0),n.src=t,n.load(),this.video=n,this},playPromiseSuccessHandler:function(){this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn)},playPromiseErrorHandler:function(t){this.scene.sys.input.once("pointerdown",this.unlockHandler,this),this.touchLocked=!0,this.playWhenUnlocked=!0,this.emit(o.VIDEO_ERROR,this,t)},playHandler:function(){this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this.video.removeEventListener("playing",this._callbacks.play,!0)},loadErrorHandler:function(t){this.stop(),this.emit(o.VIDEO_ERROR,this,t)},unlockHandler:function(){this.touchLocked=!1,this.playWhenUnlocked=!1,this.emit(o.VIDEO_UNLOCKED,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn),this.video.play(),this.emit(o.VIDEO_PLAY,this)},completeHandler:function(){this.emit(o.VIDEO_COMPLETE,this)},timeUpdateHandler:function(){this.video&&this.video.currentTime=this._markerOut&&(t.loop?(t.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=e,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))}},checkVideoProgress:function(){this.video.readyState>=2?this.updateTexture():(this.retry--,this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):this.emit(o.VIDEO_TIMEOUT,this))},updateTexture:function(){var t=this.video,e=t.videoWidth,i=t.videoHeight;if(this.videoTexture){var n=this.videoTextureSource;n.source!==t&&(n.source=t,n.width=e,n.height=i),n.update()}else this.videoTexture=this.scene.sys.textures.create(this._key,t,e,i),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,e,i),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,e,i)},getVideoKey:function(){return this._cacheKey},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var n=i*t;this.setCurrentTime(n)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],n=parseFloat(t.substr(1));"+"===i?t=e.currentTime+n:"-"===i&&(t=e.currentTime-n)}e.currentTime=t,this._lastUpdate=t}return this},isSeeking:function(){return this._isSeeking},seekingHandler:function(){this._isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this._isSeeking=!1,this.emit(o.VIDEO_SEEKED,this),this.video&&this.updateTexture()},getProgress:function(){var t=this.video;if(t){var e=t.currentTime,i=t.duration;if(i!==1/0&&!isNaN(i))return e/i}return 0},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&this.video.pause()},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&this.video.play()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&(t?e.paused||e.pause():t||e.paused&&!this._systemPaused&&e.play()),this},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=s(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&this.scene.sys.textures.renameTexture(this._key,t),this._key=t,this.flipY=e,this.videoTextureSource&&this.videoTextureSource.setFlipY(e),this.videoTexture},stop:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i],!0);t.pause()}return this._retryID&&window.clearTimeout(this._retryID),this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},destroy:function(t){void 0===t&&(t=!1),this.stop(),t&&this.removeVideoElement();var e=this.scene.sys.game.events;e.off(a.PAUSE,this.globalPause,this),e.off(a.RESUME,this.globalResume,this);var i=this.scene.sys.sound;i&&i.off(l.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}});t.exports=d},function(t,e,i){var n=i(0),s=i(198),r=i(395),o=i(46),a=new n({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return s(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n=0&&w<=1&&i.push(new n(r,o))}else if(T>0){var b=(-x-Math.sqrt(T))/(2*y);r=a+b*p,o=h+b*g,b>=0&&b<=1&&i.push(new n(r,o));var E=(-x+Math.sqrt(T))/(2*y);r=a+E*p,o=h+E*g,E>=0&&E<=1&&i.push(new n(r,o))}}return i}},function(t,e,i){var n=i(54),s=new(i(4));t.exports=function(t,e,i){if(void 0===i&&(i=s),n(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(n(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var r=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=r*r+o*o,u=r,c=o;if(l>0){var d=(a*r+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*r+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){var n=i(4),s=i(84),r=i(410);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),u=[new n,new n,new n,new n],c=[s(o,t,u[0]),s(a,t,u[1]),s(h,t,u[2]),s(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[d]);return i}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var s,r,o,a,h,l,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,f=t.y2-t.y1,p=u*u+c*c,g=u*d+c*f,v=d*d+f*f,m=p*v-g*g,y=0===m?0:1/m,x=t.x1,T=t.y1,w=0;w=0&&r>=0&&s+r<1&&(n.push({x:e[w].x,y:e[w].y}),i)));w++);return n}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var s=Math.cos(n),r=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*s-a*r+e,t.y1=o*r+a*s+i,o=t.x2-e,a=t.y2-i,t.x2=o*s-a*r+e,t.y2=o*r+a*s+i,o=t.x3-e,a=t.y3-i,t.x3=o*s-a*r+e,t.y3=o*r+a*s+i,t}},function(t,e,i){t.exports={BUTTON_DOWN:i(1173),BUTTON_UP:i(1174),CONNECTED:i(1175),DISCONNECTED:i(1176),GAMEPAD_BUTTON_DOWN:i(1177),GAMEPAD_BUTTON_UP:i(1178)}},function(t,e,i){var n=i(16),s=i(133);t.exports=function(t,e){var i=void 0===t?s():n({},t);if(e)for(var r in e)void 0!==e[r]&&(i[r]=e[r]);return i}},function(t,e,i){var n=i(0),s=i(18),r=i(19),o=i(8),a=i(2),h=i(7),l=i(342),u=new n({Extends:r,initialize:function(t,e,i,n){var s="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),s=a(o,"extension",s)}var l={type:"xml",cache:t.cacheManager.xml,extension:s,responseType:"text",key:e,url:i,xhrSettings:n};r.call(this,t,l)},onProcess:function(){this.state=s.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",function(t,e,i){if(Array.isArray(t))for(var n=0;n0&&(s.totalDuration+=s.t2*s.repeat),s.totalDuration>t&&(t=s.totalDuration),s.delay0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=e},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=h.PENDING_ADD,this._pausedState=h.INIT,!1;for(var t=this.data,e=this.totalTargets,i=0;i0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=h.LOOP_DELAY):(this.state=h.ACTIVE,this.dispatchTweenEvent(r.TWEEN_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=h.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(r.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===h.PAUSED?this:(this.paused=!0,this._pausedState=this.state,this.state=h.PAUSED,this)},play:function(t){void 0===t&&(t=!1);var e=this.state;return e!==h.INIT||this.parentIsTimeline?e===h.ACTIVE||e===h.PENDING_ADD&&this._pausedState===h.PENDING_ADD?this:this.parentIsTimeline||e!==h.PENDING_REMOVE&&e!==h.REMOVED?(this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?this.state=h.ACTIVE:(this.countdown=this.calculatedOffset,this.state=h.OFFSET_DELAY)):this.paused?(this.paused=!1,this.makeActive()):(this.resetTweenData(t),this.state=h.ACTIVE,this.makeActive()),this):(this.seek(0),this.parent.makeActive(this),this):(this.resetTweenData(!1),this.state=h.ACTIVE,this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,n=this.totalTargets,s=0;s0&&(r.elapsed=r.delay,r.state=h.DELAY),r.getActiveValue&&(o[a]=r.getActiveValue(r.target,r.key,r.start))}},resume:function(){return this.state===h.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t,e){if(void 0===e&&(e=16.6),this.totalDuration>=36e5)return console.warn("Tween.seek duration too long"),this;this.state===h.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var i=this.data,n=this.totalTargets,s=0;s0&&(r.elapsed=r.delay,r.state=h.DELAY)}this.calcDuration();var c=!1;this.state===h.PAUSED&&(c=!0,this.state=h.ACTIVE),this.isSeeking=!0;do{this.update(0,e)}while(this.totalProgress0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},setStateFromStart:function(t,e,i){return e.repeatCounter>0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},updateTweenData:function(t,e,i){var n=e.target;switch(e.state){case h.PLAYING_FORWARD:case h.PLAYING_BACKWARD:if(!n){e.state=h.COMPLETE;break}var s=e.elapsed,o=e.duration,a=0;(s+=i)>o&&(a=s-o,s=o);var l=e.state===h.PLAYING_FORWARD,u=s/o;if(e.elapsed=s,e.progress=u,1===u)l?(e.current=e.end,n[e.key]=e.end,e.hold>0?(e.elapsed=e.hold-a,e.state=h.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,a)):(e.current=e.start,n[e.key]=e.start,e.state=this.setStateFromStart(t,e,a));else{var c=l?e.ease(u):e.ease(1-u);e.current=e.start+(e.end-e.start)*c,n[e.key]=e.current}this.dispatchTweenDataEvent(r.TWEEN_UPDATE,t.callbacks.onUpdate,e);break;case h.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PENDING_RENDER);break;case h.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PLAYING_FORWARD,this.dispatchTweenDataEvent(r.TWEEN_REPEAT,t.callbacks.onRepeat,e));break;case h.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case h.PENDING_RENDER:n?(e.start=e.getStartValue(n,e.key,n[e.key],e.index,t.totalTargets,t),e.end=e.getEndValue(n,e.key,e.start,e.index,t.totalTargets,t),e.current=e.start,n[e.key]=e.start,e.state=h.PLAYING_FORWARD):e.state=h.COMPLETE}return e.state!==h.COMPLETE}});l.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onUpdate","onYoyo"],a.register("tween",function(t){return this.scene.sys.tweens.add(t)}),o.register("tween",function(t){return this.scene.sys.tweens.create(t)}),t.exports=l},function(t,e,i){t.exports={TIMELINE_COMPLETE:i(1326),TIMELINE_LOOP:i(1327),TIMELINE_PAUSE:i(1328),TIMELINE_RESUME:i(1329),TIMELINE_START:i(1330),TIMELINE_UPDATE:i(1331),TWEEN_ACTIVE:i(1332),TWEEN_COMPLETE:i(1333),TWEEN_LOOP:i(1334),TWEEN_REPEAT:i(1335),TWEEN_START:i(1336),TWEEN_UPDATE:i(1337),TWEEN_YOYO:i(1338)}},function(t,e){t.exports=function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p){return{target:t,index:e,key:i,getActiveValue:r,getEndValue:n,getStartValue:s,ease:o,duration:0,totalDuration:0,delay:0,yoyo:l,hold:0,repeat:0,repeatDelay:0,flipX:f,flipY:p,progress:0,elapsed:0,repeatCounter:0,start:0,current:0,end:0,t1:0,t2:0,gen:{delay:a,duration:h,hold:u,repeat:c,repeatDelay:d},state:0}}},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e,i){var n=i(57);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=i(57);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n=i(0),s=i(10),r=new n({initialize:function(t){this.name="WebGLPipeline",this.game=t.game,this.view=t.game.canvas,this.resolution=1,this.width=0,this.height=0,this.gl=t.gl,this.vertexCount=0,this.vertexCapacity=t.vertexCapacity,this.renderer=t.renderer,this.vertexData=t.vertices?t.vertices:new ArrayBuffer(t.vertexCapacity*t.vertexSize),this.vertexBuffer=this.renderer.createVertexBuffer(t.vertices?t.vertices:this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=this.renderer.createProgram(t.vertShader,t.fragShader),this.attributes=t.attributes,this.vertexSize=t.vertexSize,this.topology=t.topology,this.bytes=new Uint8Array(this.vertexData),this.vertexComponentCount=s.getComponentCount(t.attributes,this.gl),this.flushLocked=!1,this.active=!1},boot:function(){},addAttribute:function(t,e,i,n,r){return this.attributes.push({name:t,size:e,type:this.renderer.glFormats[i],normalized:n,offset:r}),this.vertexComponentCount=s.getComponentCount(this.attributes,this.gl),this},shouldFlush:function(){return this.vertexCount>=this.vertexCapacity},resize:function(t,e,i){return this.width=t*i,this.height=e*i,this.resolution=i,this},bind:function(){var t=this.gl,e=this.vertexBuffer,i=this.attributes,n=this.program,s=this.renderer,r=this.vertexSize;s.setProgram(n),s.setVertexBuffer(e);for(var o=0;o=0?(t.enableVertexAttribArray(h),t.vertexAttribPointer(h,a.size,a.type,a.normalized,r,a.offset)):-1!==h&&t.disableVertexAttribArray(h)}return this},onBind:function(){return this},onPreRender:function(){return this},onRender:function(){return this},onPostRender:function(){return this},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t=this.gl,e=this.vertexCount,i=this.topology,n=this.vertexSize;if(0!==e)return t.bufferSubData(t.ARRAY_BUFFER,0,this.bytes.subarray(0,e*n)),t.drawArrays(i,0,e),this.vertexCount=0,this.flushLocked=!1,this;this.flushLocked=!1},destroy:function(){var t=this.gl;return t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),delete this.program,delete this.vertexBuffer,delete this.gl,this},setFloat1:function(t,e){return this.renderer.setFloat1(this.program,t,e),this},setFloat2:function(t,e,i){return this.renderer.setFloat2(this.program,t,e,i),this},setFloat3:function(t,e,i,n){return this.renderer.setFloat3(this.program,t,e,i,n),this},setFloat4:function(t,e,i,n,s){return this.renderer.setFloat4(this.program,t,e,i,n,s),this},setFloat1v:function(t,e){return this.renderer.setFloat1v(this.program,t,e),this},setFloat2v:function(t,e){return this.renderer.setFloat2v(this.program,t,e),this},setFloat3v:function(t,e){return this.renderer.setFloat3v(this.program,t,e),this},setFloat4v:function(t,e){return this.renderer.setFloat4v(this.program,t,e),this},setInt1:function(t,e){return this.renderer.setInt1(this.program,t,e),this},setInt2:function(t,e,i){return this.renderer.setInt2(this.program,t,e,i),this},setInt3:function(t,e,i,n){return this.renderer.setInt3(this.program,t,e,i,n),this},setInt4:function(t,e,i,n,s){return this.renderer.setInt4(this.program,t,e,i,n,s),this},setMatrix2:function(t,e,i){return this.renderer.setMatrix2(this.program,t,e,i),this},setMatrix3:function(t,e,i){return this.renderer.setMatrix3(this.program,t,e,i),this},setMatrix4:function(t,e,i){return this.renderer.setMatrix4(this.program,t,e,i),this}});t.exports=r},function(t,e,i){var n=i(0),s=i(65),r=i(2),o=i(490),a=i(751),h=i(752),l=i(32),u=i(10),c=i(231),d=new n({Extends:c,Mixins:[o],initialize:function(t){var e=t.renderer.config;c.call(this,{game:t.game,renderer:t.renderer,gl:t.renderer.gl,topology:r(t,"topology",t.renderer.gl.TRIANGLES),vertShader:r(t,"vertShader",h),fragShader:r(t,"fragShader",a),vertexCapacity:r(t,"vertexCapacity",6*e.batchSize),vertexSize:r(t,"vertexSize",5*Float32Array.BYTES_PER_ELEMENT+4*Uint8Array.BYTES_PER_ELEMENT),attributes:[{name:"inPosition",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:0},{name:"inTexCoord",size:2,type:t.renderer.gl.FLOAT,normalized:!1,offset:2*Float32Array.BYTES_PER_ELEMENT},{name:"inTintEffect",size:1,type:t.renderer.gl.FLOAT,normalized:!1,offset:4*Float32Array.BYTES_PER_ELEMENT},{name:"inTint",size:4,type:t.renderer.gl.UNSIGNED_BYTE,normalized:!0,offset:5*Float32Array.BYTES_PER_ELEMENT}]}),this.vertexViewF32=new Float32Array(this.vertexData),this.vertexViewU32=new Uint32Array(this.vertexData),this.maxQuads=e.batchSize,this.batches=[],this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.tintEffect=2,this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[],this.mvpInit()},onBind:function(){return c.prototype.onBind.call(this),this.mvpUpdate(),this},resize:function(t,e,i){return c.prototype.resize.call(this,t,e,i),this.projOrtho(0,this.width,this.height,0,-1e3,1e3),this},setTexture2D:function(t,e){return void 0===t&&(t=this.renderer.blankTexture.glTexture),void 0===e&&(e=0),this.requireTextureBatch(t,e)&&this.pushBatch(t,e),this},requireTextureBatch:function(t,e){var i=this.batches,n=i.length;return!(n>0)||!((e>0?i[n-1].textures[e-1]:i[n-1].texture)===t)},pushBatch:function(t,e){if(0===e)this.batches.push({first:this.vertexCount,texture:t,textures:[]});else{var i=[];i[e-1]=t,this.batches.push({first:this.vertexCount,texture:null,textures:i})}},flush:function(){if(this.flushLocked)return this;this.flushLocked=!0;var t,e,i,n=this.gl,s=this.vertexCount,r=this.topology,o=this.vertexSize,a=this.renderer,h=this.batches,l=h.length,u=0,c=null;if(0===l||0===s)return this.flushLocked=!1,this;n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,s*o));for(var d=0;d0){for(e=0;e0){for(e=0;e0&&(a.setTexture2D(c.texture,0,!1),n.drawArrays(r,c.first,u)),this.vertexCount=0,h.length=0,this.flushLocked=!1,this},batchSprite:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix1,s=this._tempMatrix2,r=this._tempMatrix3,o=t.frame,a=o.glTexture,h=o.u0,l=o.v0,c=o.u1,d=o.v1,f=o.x,p=o.y,g=o.cutWidth,v=o.cutHeight,m=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,T=-y+f,w=-x+p;if(t.isCropped){var b=t._crop;b.flipX===t.flipX&&b.flipY===t.flipY||o.updateCropUVs(b,t.flipX,t.flipY),h=b.u0,l=b.v0,c=b.u1,d=b.v1,g=b.width,v=b.height,T=-y+(f=b.x),w=-x+(p=b.y)}var E=1,S=1;t.flipX&&(m||(T+=-o.realWidth+2*y),E=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(m||(w+=-o.realHeight+2*x),S=-1),s.applyITRS(t.x,t.y,t.rotation,t.scaleX*E,t.scaleY*S),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),s.e=t.x,s.f=t.y,n.multiply(s,r)):(s.e-=e.scrollX*t.scrollFactorX,s.f-=e.scrollY*t.scrollFactorY,n.multiply(s,r));var _=T+g,A=w+v,C=r.getX(T,w),M=r.getY(T,w),P=r.getX(T,A),O=r.getY(T,A),R=r.getX(_,A),L=r.getY(_,A),D=r.getX(_,w),k=r.getY(_,w),F=u.getTintAppendFloatAlpha(t._tintTL,e.alpha*t._alphaTL),I=u.getTintAppendFloatAlpha(t._tintTR,e.alpha*t._alphaTR),B=u.getTintAppendFloatAlpha(t._tintBL,e.alpha*t._alphaBL),N=u.getTintAppendFloatAlpha(t._tintBR,e.alpha*t._alphaBR);e.roundPixels&&(C=Math.round(C),M=Math.round(M),P=Math.round(P),O=Math.round(O),R=Math.round(R),L=Math.round(L),D=Math.round(D),k=Math.round(k)),this.setTexture2D(a,0);var Y=t._isTinted&&t.tintFill;this.batchQuad(C,M,P,O,R,L,D,k,h,l,c,d,F,I,B,N,Y,a,0)},batchQuad:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y){var x=!1;this.vertexCount+6>this.vertexCapacity&&(this.flush(),x=!0,this.setTexture2D(m,y));var T=this.vertexViewF32,w=this.vertexViewU32,b=this.vertexCount*this.vertexComponentCount-1;return T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=i,T[++b]=n,T[++b]=h,T[++b]=c,T[++b]=v,w[++b]=p,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=t,T[++b]=e,T[++b]=h,T[++b]=l,T[++b]=v,w[++b]=d,T[++b]=s,T[++b]=r,T[++b]=u,T[++b]=c,T[++b]=v,w[++b]=g,T[++b]=o,T[++b]=a,T[++b]=u,T[++b]=l,T[++b]=v,w[++b]=f,this.vertexCount+=6,x},batchTri:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g){var v=!1;this.vertexCount+3>this.vertexCapacity&&(this.flush(),this.setTexture2D(p,g),v=!0);var m=this.vertexViewF32,y=this.vertexViewU32,x=this.vertexCount*this.vertexComponentCount-1;return m[++x]=t,m[++x]=e,m[++x]=o,m[++x]=a,m[++x]=f,y[++x]=u,m[++x]=i,m[++x]=n,m[++x]=o,m[++x]=l,m[++x]=f,y[++x]=c,m[++x]=s,m[++x]=r,m[++x]=h,m[++x]=l,m[++x]=f,y[++x]=d,this.vertexCount+=3,v},batchTexture:function(t,e,i,n,s,r,o,a,h,l,u,c,d,f,p,g,v,m,y,x,T,w,b,E,S,_,A,C,M,P,O){this.renderer.setPipeline(this,t);var R=this._tempMatrix1,L=this._tempMatrix2,D=this._tempMatrix3,k=m/i+A,F=y/n+C,I=(m+x)/i+A,B=(y+T)/n+C,N=o,Y=a,X=-g,z=-v;if(t.isCropped){var U=t._crop;N=U.width,Y=U.height,o=U.width,a=U.height;var G=m=U.x,W=y=U.y;c&&(G=x-U.x-U.width),d&&!e.isRenderTexture&&(W=T-U.y-U.height),k=G/i+A,F=W/n+C,I=(G+U.width)/i+A,B=(W+U.height)/n+C,X=-g+m,z=-v+y}d^=!O&&e.isRenderTexture?1:0,c&&(N*=-1,X+=o),d&&(Y*=-1,z+=a);var V=X+N,H=z+Y;L.applyITRS(s,r,u,h,l),R.copyFrom(M.matrix),P?(R.multiplyWithOffset(P,-M.scrollX*f,-M.scrollY*p),L.e=s,L.f=r,R.multiply(L,D)):(L.e-=M.scrollX*f,L.f-=M.scrollY*p,R.multiply(L,D));var j=D.getX(X,z),q=D.getY(X,z),K=D.getX(X,H),J=D.getY(X,H),Z=D.getX(V,H),Q=D.getY(V,H),$=D.getX(V,z),tt=D.getY(V,z);M.roundPixels&&(j=Math.round(j),q=Math.round(q),K=Math.round(K),J=Math.round(J),Z=Math.round(Z),Q=Math.round(Q),$=Math.round($),tt=Math.round(tt)),this.setTexture2D(e,0),this.batchQuad(j,q,K,J,Z,Q,$,tt,k,F,I,B,w,b,E,S,_,e,0)},batchTextureFrame:function(t,e,i,n,s,r,o){this.renderer.setPipeline(this);var a=this._tempMatrix1.copyFrom(r),h=this._tempMatrix2,l=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),f=h.getY(e,i),p=h.getX(e,c),g=h.getY(e,c),v=h.getX(l,c),m=h.getY(l,c),y=h.getX(l,i),x=h.getY(l,i);this.setTexture2D(t.glTexture,0),n=u.getTintAppendFloatAlpha(n,s),this.batchQuad(d,f,p,g,v,m,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,0)},drawFillRect:function(t,e,i,n,s,r){var o=t+i,a=e+n;this.setTexture2D();var h=u.getTintAppendFloatAlphaAndSwap(s,r);this.batchQuad(t,e,t,a,o,a,o,e,0,0,1,1,h,h,h,h,2)},batchFillRect:function(t,e,i,n,s,r){this.renderer.setPipeline(this);var o=this._tempMatrix3;r&&r.multiply(s,o);var a=t+i,h=e+n,l=o.getX(t,e),u=o.getY(t,e),c=o.getX(t,h),d=o.getY(t,h),f=o.getX(a,h),p=o.getY(a,h),g=o.getX(a,e),v=o.getY(a,e),m=this.currentFrame,y=m.u0,x=m.v0,T=m.u1,w=m.v1;this.batchQuad(l,u,c,d,f,p,g,v,y,x,T,w,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.fillTint.BR,this.tintEffect)},batchFillTriangle:function(t,e,i,n,s,r,o,a){this.renderer.setPipeline(this);var h=this._tempMatrix3;a&&a.multiply(o,h);var l=h.getX(t,e),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),f=h.getX(s,r),p=h.getY(s,r),g=this.currentFrame,v=g.u0,m=g.v0,y=g.u1,x=g.v1;this.batchTri(l,u,c,d,f,p,v,m,y,x,this.fillTint.TL,this.fillTint.TR,this.fillTint.BL,this.tintEffect)},batchStrokeTriangle:function(t,e,i,n,s,r,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=s,l[2].y=r,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.setPipeline(this);var n=this._tempMatrix3;i&&i.multiply(e,n);for(var r,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,u=this.fillTint.TR,c=this.fillTint.BL,d=this.tintEffect,f=0;f0&&H[4]?this.batchQuad(D,k,P,O,H[0],H[1],H[2],H[3],U,G,W,V,B,N,Y,X,I):(j[0]=D,j[1]=k,j[2]=P,j[3]=O,j[4]=1),h&&j[4]?this.batchQuad(C,M,R,L,j[0],j[1],j[2],j[3],U,G,W,V,B,N,Y,X,I):(H[0]=C,H[1]=M,H[2]=R,H[3]=L,H[4]=1)}}});t.exports=d},function(t,e,i){var n={};t.exports=n;var s=i(37);n.on=function(t,e,i){for(var n,s=e.split(" "),r=0;r0){i||(i={}),n=e.split(" ");for(var l=0;l0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,lineWidth:2,strokeStyle:"#ffffff",type:"line",anchors:!0};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(s.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&r.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}}},function(t,e,i){t.exports={Angle:i(502),Call:i(503),GetFirst:i(504),GetLast:i(505),GridAlign:i(506),IncAlpha:i(566),IncX:i(567),IncXY:i(568),IncY:i(569),PlaceOnCircle:i(570),PlaceOnEllipse:i(571),PlaceOnLine:i(572),PlaceOnRectangle:i(573),PlaceOnTriangle:i(574),PlayAnimation:i(575),PropertyValueInc:i(34),PropertyValueSet:i(28),RandomCircle:i(576),RandomEllipse:i(577),RandomLine:i(578),RandomRectangle:i(579),RandomTriangle:i(580),Rotate:i(581),RotateAround:i(582),RotateAroundDistance:i(583),ScaleX:i(584),ScaleXY:i(585),ScaleY:i(586),SetAlpha:i(587),SetBlendMode:i(588),SetDepth:i(589),SetHitArea:i(590),SetOrigin:i(591),SetRotation:i(592),SetScale:i(593),SetScaleX:i(594),SetScaleY:i(595),SetTint:i(596),SetVisible:i(597),SetX:i(598),SetXY:i(599),SetY:i(600),ShiftPosition:i(601),Shuffle:i(602),SmootherStep:i(603),SmoothStep:i(604),Spread:i(605),ToggleVisible:i(606),WrapInRectangle:i(607)}},function(t,e,i){var n=i(143),s=[];s[n.BOTTOM_CENTER]=i(237),s[n.BOTTOM_LEFT]=i(238),s[n.BOTTOM_RIGHT]=i(239),s[n.CENTER]=i(240),s[n.LEFT_CENTER]=i(242),s[n.RIGHT_CENTER]=i(243),s[n.TOP_CENTER]=i(244),s[n.TOP_LEFT]=i(245),s[n.TOP_RIGHT]=i(246);t.exports=function(t,e,i,n,r){return s[i](t,e,n,r)}},function(t,e,i){var n=i(38),s=i(74),r=i(39),o=i(75);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(38),s=i(40),r=i(39),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(38),s=i(42),r=i(39),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(241),s=i(74),r=i(77);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,s(e)+i,r(e)+o),t}},function(t,e,i){var n=i(75),s=i(76);t.exports=function(t,e,i){return n(t,e),s(t,i)}},function(t,e,i){var n=i(77),s=i(40),r=i(76),o=i(41);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)-i),r(t,n(e)+a),t}},function(t,e,i){var n=i(77),s=i(42),r=i(76),o=i(43);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,s(e)+i),r(t,n(e)+a),t}},function(t,e,i){var n=i(74),s=i(44),r=i(75),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(40),s=i(44),r=i(41),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)-i),o(t,s(e)-a),t}},function(t,e,i){var n=i(42),s=i(44),r=i(43),o=i(45);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),r(t,n(e)+i),o(t,s(e)-a),t}},function(t,e,i){var n=i(144),s=i(87),r=i(23),o=i(4);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=s(e,0,r.PI2);return n(t,a,i)}},function(t,e,i){var n=i(249),s=i(144),r=i(87),o=i(23);t.exports=function(t,e,i,a){void 0===a&&(a=[]),e||(e=n(t)/i);for(var h=0;he.length&&(r=e.length),i?(n=e[r-1][i],(s=e[r][i])-t<=t-n?e[r]:e[r-1]):(n=e[r-1],(s=e[r])-t<=t-n?s:n)}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e,i){var n=i(52),s={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=s},function(t,e){var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.scene.sys.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e,i){var n=i(147),s=i(110);t.exports=function(t,e,i,r){void 0===r&&(r=[]),e||(e=s(t)/i);for(var o=0;o=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n-h&&(c-=h,n+=l),fd.right&&(f=u(f,f+(g-d.right),this.lerp.x)),vd.bottom&&(p=u(p,p+(v-d.bottom),this.lerp.y))):(f=u(f,g-h,this.lerp.x),p=u(p,v-l,this.lerp.y))}this.useBounds&&(f=this.clampX(f),p=this.clampY(p)),this.roundPixels&&(h=Math.round(h),l=Math.round(l)),this.scrollX=f,this.scrollY=p;var m=f+n,y=p+s;this.midPoint.set(m,y);var x=e/o,T=i/o;this.worldView.setTo(m-x/2,y-T/2,x,T),a.applyITRS(this.x+h,this.y+l,this.rotation,o,o),a.translate(-h,-l),this.shakeEffect.preRender()},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,s,r){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===s&&(s=0),void 0===r&&(r=s),this._follow=t,this.roundPixels=e,i=o(i,0,1),n=o(n,0,1),this.lerp.set(i,n),this.followOffset.set(s,r);var a=this.width/2,h=this.height/2,l=t.x-s,u=t.y-r;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.clearRenderToTexture(),this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=f},function(t,e,i){var n=i(33);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,i,n){return e+e+i+i+n+n});var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var s=parseInt(i[1],16),r=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(s,r,o)}return e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a=0,h=0===r?0:o/r,l=r;return r!==s&&(r===t?a=(e-i)/o+(e16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){var n=i(33);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var n=i(33);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var s=parseInt(i[1],10),r=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(s,r,o,255*a)}return e}},function(t,e,i){t.exports={Fade:i(632),Flash:i(633),Pan:i(634),Shake:i(667),Zoom:i(668)}},function(t,e,i){t.exports={In:i(635),Out:i(636),InOut:i(637)}},function(t,e,i){t.exports={In:i(638),Out:i(639),InOut:i(640)}},function(t,e,i){t.exports={In:i(641),Out:i(642),InOut:i(643)}},function(t,e,i){t.exports={In:i(644),Out:i(645),InOut:i(646)}},function(t,e,i){t.exports={In:i(647),Out:i(648),InOut:i(649)}},function(t,e,i){t.exports={In:i(650),Out:i(651),InOut:i(652)}},function(t,e,i){t.exports=i(653)},function(t,e,i){t.exports={In:i(654),Out:i(655),InOut:i(656)}},function(t,e,i){t.exports={In:i(657),Out:i(658),InOut:i(659)}},function(t,e,i){t.exports={In:i(660),Out:i(661),InOut:i(662)}},function(t,e,i){t.exports={In:i(663),Out:i(664),InOut:i(665)}},function(t,e,i){t.exports=i(666)},function(t,e,i){var n=i(0),s=i(29),r=i(296),o=i(2),a=i(6),h=i(7),l=i(166),u=i(1),c=i(172),d=i(159),f=new n({initialize:function(t){void 0===t&&(t={});this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.resolution=a(t,"resolution",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.resolution=a(e,"resolution",this.resolution),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",s.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMouseCapture=a(t,"input.mouse.capture",!0),this.inputTouch=a(t,"input.touch",r.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio"),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.antialias=a(i,"antialias",!0),this.antialiasGL=a(i,"antialiasGL",!0),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",2e3),this.maxLights=a(i,"maxLights",10);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),0===n&&this.transparent&&(this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",u),this.postBoot=a(t,"callbacks.postBoot",u),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path",""),this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",32),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),p=c.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?p=f.default:Array.isArray(f.defaultMerge)&&(p=p.concat(f.defaultMerge)))),this.defaultPlugins=p;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),window&&(window.FORCE_WEBGL?this.renderType=s.WEBGL:window.FORCE_CANVAS&&(this.renderType=s.CANVAS))}});t.exports=f},function(t,e,i){t.exports={os:i(114),browser:i(115),features:i(165),input:i(697),audio:i(698),video:i(699),fullscreen:i(700),canvasFeatures:i(297)}},function(t,e,i){var n,s,r,o=i(25),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",s="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(r=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");if(e.globalCompositeOperation="multiply",e.drawImage(r,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+s},r.src=n+"AP804Oa6"+s,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},function(t,e){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},function(t,e){t.exports=function(t,e,i,n){var s=t-i,r=e-n;return s*s+r*r}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t0?Math.ceil(t):Math.floor(t)}},function(t,e,i){var n=i(3);t.exports=function(t,e,i,s,r,o,a,h){void 0===h&&(h=new n);var l=Math.sin(r),u=Math.cos(r),c=u*o,d=l*o,f=-l*a,p=u*a,g=1/(c*p+f*-d);return h.x=p*g*t+-f*g*e+(s*f-i*p)*g,h.y=c*g*e+-d*g*t+(-s*c+i*d)*g,h}},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+s*s)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,s=t.w-this.w||0;return e*e+i*i+n*n+s*s},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12]*s,this.y=r[1]*e+r[5]*i+r[9]*n+r[13]*s,this.z=r[2]*e+r[6]*i+r[10]*n+r[14]*s,this.w=r[3]*e+r[7]*i+r[11]*n+r[15]*s,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,s=t.x,r=t.y,o=t.z,a=t.w,h=a*e+r*n-o*i,l=a*i+o*e-s*n,u=a*n+s*i-r*e,c=-s*e-r*i-o*n;return this.x=h*a+c*-s+l*-o-u*-r,this.y=l*a+c*-r+u*-s-h*-o,this.z=u*a+c*-o+h*-r-l*-s,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=l*r-o*h,c=-l*s+o*a,d=h*s-r*a,f=e*u+i*c+n*d;return f?(f=1/f,t[0]=u*f,t[1]=(-l*i+n*h)*f,t[2]=(o*i-n*r)*f,t[3]=c*f,t[4]=(l*e-n*a)*f,t[5]=(-o*e+n*s)*f,t[6]=d*f,t[7]=(-h*e+i*a)*f,t[8]=(r*e-i*s)*f,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=r*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*r,t[3]=o*a-s*l,t[4]=e*l-n*a,t[5]=n*s-e*o,t[6]=s*h-r*a,t[7]=i*a-e*h,t[8]=e*r-i*s,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*r-o*h)+i*(-l*s+o*a)+n*(h*s-r*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=t.val,d=c[0],f=c[1],p=c[2],g=c[3],v=c[4],m=c[5],y=c[6],x=c[7],T=c[8];return e[0]=d*i+f*r+p*h,e[1]=d*n+f*o+p*l,e[2]=d*s+f*a+p*u,e[3]=g*i+v*r+m*h,e[4]=g*n+v*o+m*l,e[5]=g*s+v*a+m*u,e[6]=y*i+x*r+T*h,e[7]=y*n+x*o+T*l,e[8]=y*s+x*a+T*u,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*r,e[1]=l*n+h*o,e[2]=l*s+h*a,e[3]=l*r-h*i,e[4]=l*o-h*n,e[5]=l*a-h*s,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,s=t.w,r=e+e,o=i+i,a=n+n,h=e*r,l=e*o,u=e*a,c=i*o,d=i*a,f=n*a,p=s*r,g=s*o,v=s*a,m=this.val;return m[0]=1-(c+f),m[3]=l+v,m[6]=u-g,m[1]=l-v,m[4]=1-(h+f),m[7]=d+p,m[2]=u+g,m[5]=d-p,m[8]=1-(h+c),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],s=e[1],r=e[2],o=e[3],a=e[4],h=e[5],l=e[6],u=e[7],c=e[8],d=e[9],f=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],x=n*h-s*a,T=n*l-r*a,w=n*u-o*a,b=s*l-r*h,E=s*u-o*h,S=r*u-o*l,_=c*v-d*g,A=c*m-f*g,C=c*y-p*g,M=d*m-f*v,P=d*y-p*v,O=f*y-p*m,R=x*O-T*P+w*M+b*C-E*A+S*_;return R?(R=1/R,i[0]=(h*O-l*P+u*M)*R,i[1]=(l*C-a*O-u*A)*R,i[2]=(a*P-h*C+u*_)*R,i[3]=(r*P-s*O-o*M)*R,i[4]=(n*O-r*C+o*A)*R,i[5]=(s*C-n*P-o*_)*R,i[6]=(v*S-m*E+y*b)*R,i[7]=(m*w-g*S-y*T)*R,i[8]=(g*E-v*w+y*x)*R,this):null}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this},zero:function(){var t=this.val;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=0,this},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],s=t[6],r=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=s,t[11]=t[14],t[12]=n,t[13]=r,t[14]=o,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15],m=e*o-i*r,y=e*a-n*r,x=e*h-s*r,T=i*a-n*o,w=i*h-s*o,b=n*h-s*a,E=l*p-u*f,S=l*g-c*f,_=l*v-d*f,A=u*g-c*p,C=u*v-d*p,M=c*v-d*g,P=m*M-y*C+x*A+T*_-w*S+b*E;return P?(P=1/P,t[0]=(o*M-a*C+h*A)*P,t[1]=(n*C-i*M-s*A)*P,t[2]=(p*b-g*w+v*T)*P,t[3]=(c*w-u*b-d*T)*P,t[4]=(a*_-r*M-h*S)*P,t[5]=(e*M-n*_+s*S)*P,t[6]=(g*x-f*b-v*y)*P,t[7]=(l*b-c*x+d*y)*P,t[8]=(r*C-o*_+h*E)*P,t[9]=(i*_-e*C-s*E)*P,t[10]=(f*w-p*x+v*m)*P,t[11]=(u*x-l*w-d*m)*P,t[12]=(o*S-r*A-a*E)*P,t[13]=(e*A-i*S+n*E)*P,t[14]=(p*y-f*T-g*m)*P,t[15]=(l*T-u*y+c*m)*P,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return t[0]=o*(c*v-d*g)-u*(a*v-h*g)+p*(a*d-h*c),t[1]=-(i*(c*v-d*g)-u*(n*v-s*g)+p*(n*d-s*c)),t[2]=i*(a*v-h*g)-o*(n*v-s*g)+p*(n*h-s*a),t[3]=-(i*(a*d-h*c)-o*(n*d-s*c)+u*(n*h-s*a)),t[4]=-(r*(c*v-d*g)-l*(a*v-h*g)+f*(a*d-h*c)),t[5]=e*(c*v-d*g)-l*(n*v-s*g)+f*(n*d-s*c),t[6]=-(e*(a*v-h*g)-r*(n*v-s*g)+f*(n*h-s*a)),t[7]=e*(a*d-h*c)-r*(n*d-s*c)+l*(n*h-s*a),t[8]=r*(u*v-d*p)-l*(o*v-h*p)+f*(o*d-h*u),t[9]=-(e*(u*v-d*p)-l*(i*v-s*p)+f*(i*d-s*u)),t[10]=e*(o*v-h*p)-r*(i*v-s*p)+f*(i*h-s*o),t[11]=-(e*(o*d-h*u)-r*(i*d-s*u)+l*(i*h-s*o)),t[12]=-(r*(u*g-c*p)-l*(o*g-a*p)+f*(o*c-a*u)),t[13]=e*(u*g-c*p)-l*(i*g-n*p)+f*(i*c-n*u),t[14]=-(e*(o*g-a*p)-r*(i*g-n*p)+f*(i*a-n*o)),t[15]=e*(o*c-a*u)-r*(i*c-n*u)+l*(i*a-n*o),this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],s=t[3],r=t[4],o=t[5],a=t[6],h=t[7],l=t[8],u=t[9],c=t[10],d=t[11],f=t[12],p=t[13],g=t[14],v=t[15];return(e*o-i*r)*(c*v-d*g)-(e*a-n*r)*(u*v-d*p)+(e*h-s*r)*(u*g-c*p)+(i*a-n*o)*(l*v-d*f)-(i*h-s*o)*(l*g-c*f)+(n*h-s*a)*(l*p-u*f)},multiply:function(t){var e=this.val,i=e[0],n=e[1],s=e[2],r=e[3],o=e[4],a=e[5],h=e[6],l=e[7],u=e[8],c=e[9],d=e[10],f=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=t.val,x=y[0],T=y[1],w=y[2],b=y[3];return e[0]=x*i+T*o+w*u+b*p,e[1]=x*n+T*a+w*c+b*g,e[2]=x*s+T*h+w*d+b*v,e[3]=x*r+T*l+w*f+b*m,x=y[4],T=y[5],w=y[6],b=y[7],e[4]=x*i+T*o+w*u+b*p,e[5]=x*n+T*a+w*c+b*g,e[6]=x*s+T*h+w*d+b*v,e[7]=x*r+T*l+w*f+b*m,x=y[8],T=y[9],w=y[10],b=y[11],e[8]=x*i+T*o+w*u+b*p,e[9]=x*n+T*a+w*c+b*g,e[10]=x*s+T*h+w*d+b*v,e[11]=x*r+T*l+w*f+b*m,x=y[12],T=y[13],w=y[14],b=y[15],e[12]=x*i+T*o+w*u+b*p,e[13]=x*n+T*a+w*c+b*g,e[14]=x*s+T*h+w*d+b*v,e[15]=x*r+T*l+w*f+b*m,this},multiplyLocal:function(t){var e=[],i=this.val,n=t.val;return e[0]=i[0]*n[0]+i[1]*n[4]+i[2]*n[8]+i[3]*n[12],e[1]=i[0]*n[1]+i[1]*n[5]+i[2]*n[9]+i[3]*n[13],e[2]=i[0]*n[2]+i[1]*n[6]+i[2]*n[10]+i[3]*n[14],e[3]=i[0]*n[3]+i[1]*n[7]+i[2]*n[11]+i[3]*n[15],e[4]=i[4]*n[0]+i[5]*n[4]+i[6]*n[8]+i[7]*n[12],e[5]=i[4]*n[1]+i[5]*n[5]+i[6]*n[9]+i[7]*n[13],e[6]=i[4]*n[2]+i[5]*n[6]+i[6]*n[10]+i[7]*n[14],e[7]=i[4]*n[3]+i[5]*n[7]+i[6]*n[11]+i[7]*n[15],e[8]=i[8]*n[0]+i[9]*n[4]+i[10]*n[8]+i[11]*n[12],e[9]=i[8]*n[1]+i[9]*n[5]+i[10]*n[9]+i[11]*n[13],e[10]=i[8]*n[2]+i[9]*n[6]+i[10]*n[10]+i[11]*n[14],e[11]=i[8]*n[3]+i[9]*n[7]+i[10]*n[11]+i[11]*n[15],e[12]=i[12]*n[0]+i[13]*n[4]+i[14]*n[8]+i[15]*n[12],e[13]=i[12]*n[1]+i[13]*n[5]+i[14]*n[9]+i[15]*n[13],e[14]=i[12]*n[2]+i[13]*n[6]+i[14]*n[10]+i[15]*n[14],e[15]=i[12]*n[3]+i[13]*n[7]+i[14]*n[11]+i[15]*n[15],this.fromArray(e)},translate:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[12]=s[0]*e+s[4]*i+s[8]*n+s[12],s[13]=s[1]*e+s[5]*i+s[9]*n+s[13],s[14]=s[2]*e+s[6]*i+s[10]*n+s[14],s[15]=s[3]*e+s[7]*i+s[11]*n+s[15],this},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){var e=t.x,i=t.y,n=t.z,s=this.val;return s[0]=s[0]*e,s[1]=s[1]*e,s[2]=s[2]*e,s[3]=s[3]*e,s[4]=s[4]*i,s[5]=s[5]*i,s[6]=s[6]*i,s[7]=s[7]*i,s[8]=s[8]*n,s[9]=s[9]*n,s[10]=s[10]*n,s[11]=s[11]*n,this},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),s=1-i,r=t.x,o=t.y,a=t.z,h=s*r,l=s*o;return this.fromArray([h*r+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*r,0,h*a-n*o,l*a+n*r,s*a*a+i,0,0,0,0,1]),this},rotate:function(t,e){var i=this.val,n=e.x,s=e.y,r=e.z,o=Math.sqrt(n*n+s*s+r*r);if(Math.abs(o)<1e-6)return null;n*=o=1/o,s*=o,r*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,u=i[0],c=i[1],d=i[2],f=i[3],p=i[4],g=i[5],v=i[6],m=i[7],y=i[8],x=i[9],T=i[10],w=i[11],b=n*n*l+h,E=s*n*l+r*a,S=r*n*l-s*a,_=n*s*l-r*a,A=s*s*l+h,C=r*s*l+n*a,M=n*r*l+s*a,P=s*r*l-n*a,O=r*r*l+h;return i[0]=u*b+p*E+y*S,i[1]=c*b+g*E+x*S,i[2]=d*b+v*E+T*S,i[3]=f*b+m*E+w*S,i[4]=u*_+p*A+y*C,i[5]=c*_+g*A+x*C,i[6]=d*_+v*A+T*C,i[7]=f*_+m*A+w*C,i[8]=u*M+p*P+y*O,i[9]=c*M+g*P+x*O,i[10]=d*M+v*P+T*O,i[11]=f*M+m*P+w*O,this},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this},fromRotationTranslation:function(t,e){var i=this.val,n=t.x,s=t.y,r=t.z,o=t.w,a=n+n,h=s+s,l=r+r,u=n*a,c=n*h,d=n*l,f=s*h,p=s*l,g=r*l,v=o*a,m=o*h,y=o*l;return i[0]=1-(f+g),i[1]=c+y,i[2]=d-m,i[3]=0,i[4]=c-y,i[5]=1-(u+g),i[6]=p+v,i[7]=0,i[8]=d+m,i[9]=p-v,i[10]=1-(u+f),i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this},fromQuat:function(t){var e=this.val,i=t.x,n=t.y,s=t.z,r=t.w,o=i+i,a=n+n,h=s+s,l=i*o,u=i*a,c=i*h,d=n*a,f=n*h,p=s*h,g=r*o,v=r*a,m=r*h;return e[0]=1-(d+p),e[1]=u+m,e[2]=c-v,e[3]=0,e[4]=u-m,e[5]=1-(l+p),e[6]=f+g,e[7]=0,e[8]=c+v,e[9]=f-g,e[10]=1-(l+d),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},frustum:function(t,e,i,n,s,r){var o=this.val,a=1/(e-t),h=1/(n-i),l=1/(s-r);return o[0]=2*s*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*s*h,o[6]=0,o[7]=0,o[8]=(e+t)*a,o[9]=(n+i)*h,o[10]=(r+s)*l,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s*2*l,o[15]=0,this},perspective:function(t,e,i,n){var s=this.val,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this},perspectiveLH:function(t,e,i,n){var s=this.val;return s[0]=2*i/t,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=2*i/e,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=-n/(i-n),s[11]=1,s[12]=0,s[13]=0,s[14]=i*n/(i-n),s[15]=0,this},ortho:function(t,e,i,n,s,r){var o=this.val,a=t-e,h=i-n,l=s-r;return a=0===a?a:1/a,h=0===h?h:1/h,l=0===l?l:1/l,o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this},lookAt:function(t,e,i){var n=this.val,s=t.x,r=t.y,o=t.z,a=i.x,h=i.y,l=i.z,u=e.x,c=e.y,d=e.z;if(Math.abs(s-u)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(o-d)<1e-6)return this.identity();var f=s-u,p=r-c,g=o-d,v=1/Math.sqrt(f*f+p*p+g*g),m=h*(g*=v)-l*(p*=v),y=l*(f*=v)-a*g,x=a*p-h*f;(v=Math.sqrt(m*m+y*y+x*x))?(m*=v=1/v,y*=v,x*=v):(m=0,y=0,x=0);var T=p*x-g*y,w=g*m-f*x,b=f*y-p*m;return(v=Math.sqrt(T*T+w*w+b*b))?(T*=v=1/v,w*=v,b*=v):(T=0,w=0,b=0),n[0]=m,n[1]=T,n[2]=f,n[3]=0,n[4]=y,n[5]=w,n[6]=p,n[7]=0,n[8]=x,n[9]=b,n[10]=g,n[11]=0,n[12]=-(m*s+y*r+x*o),n[13]=-(T*s+w*r+b*o),n[14]=-(f*s+p*r+g*o),n[15]=1,this},yawPitchRoll:function(t,e,i){this.zero(),s.zero(),r.zero();var n=this.val,o=s.val,a=r.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),o[0]=1,o[15]=1,o[5]=l,o[10]=l,o[9]=-h,o[6]=h,h=Math.sin(t),l=Math.cos(t),a[5]=1,a[15]=1,a[0]=l,a[2]=-h,a[8]=h,a[10]=l,this.multiplyLocal(s),this.multiplyLocal(r),this},setWorldMatrix:function(t,e,i,n,o){return this.yawPitchRoll(t.y,t.x,t.z),s.scaling(i.x,i.y,i.z),r.xyz(e.x,e.y,e.z),this.multiplyLocal(s),this.multiplyLocal(r),void 0!==n&&this.multiplyLocal(n),void 0!==o&&this.multiplyLocal(o),this}}),s=new n,r=new n;t.exports=n},function(t,e,i){var n=i(0),s=i(171),r=i(315),o=new Int8Array([1,2,0]),a=new Float32Array([0,0,0]),h=new s(1,0,0),l=new s(0,1,0),u=new s,c=new r,d=new n({initialize:function(t,e,i,n){"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n;return s>0&&(s=1/Math.sqrt(s),this.x=t*s,this.y=e*s,this.z=i*s,this.w=n*s),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,s=this.z,r=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=s+e*(t.z-s),this.w=r+e*(t.w-r),this},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(h).cross(t).length()<1e-6&&u.copy(l).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?(this.x=0,this.y=0,this.z=0,this.w=1,this):(u.copy(t).cross(e),this.x=u.x,this.y=u.y,this.z=u.z,this.w=1+i,this.normalize())},setAxes:function(t,e,i){var n=c.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(c).normalize()},identity:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.x=i*t.x,this.y=i*t.y,this.z=i*t.z,this.w=Math.cos(e),this},multiply:function(t){var e=this.x,i=this.y,n=this.z,s=this.w,r=t.x,o=t.y,a=t.z,h=t.w;return this.x=e*h+s*r+i*a-n*o,this.y=i*h+s*o+n*r-e*a,this.z=n*h+s*a+e*o-i*r,this.w=s*h-e*r-i*o-n*a,this},slerp:function(t,e){var i=this.x,n=this.y,s=this.z,r=this.w,o=t.x,a=t.y,h=t.z,l=t.w,u=i*o+n*a+s*h+r*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1-u>1e-6){var f=Math.acos(u),p=Math.sin(f);c=Math.sin((1-e)*f)/p,d=Math.sin(e*f)/p}return this.x=c*i+d*o,this.y=c*n+d*a,this.z=c*s+d*h,this.w=c*r+d*l,this},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,s=t*t+e*e+i*i+n*n,r=s?1/s:0;return this.x=-t*r,this.y=-e*r,this.z=-i*r,this.w=n*r,this},conjugate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+s*r,this.y=i*o+n*r,this.z=n*o-i*r,this.w=s*o-e*r,this},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o-n*r,this.y=i*o+s*r,this.z=n*o+e*r,this.w=s*o-i*r,this},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,s=this.w,r=Math.sin(t),o=Math.cos(t);return this.x=e*o+i*r,this.y=i*o-e*r,this.z=n*o+s*r,this.w=s*o-n*r,this},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this.x=(i[7]-i[5])*e,this.y=(i[2]-i[6])*e,this.z=(i[3]-i[1])*e;else{var s=0;i[4]>i[0]&&(s=1),i[8]>i[3*s+s]&&(s=2);var r=o[s],h=o[r];e=Math.sqrt(i[3*s+s]-i[3*r+r]-i[3*h+h]+1),a[s]=.5*e,e=.5/e,a[r]=(i[3*r+s]+i[3*s+r])*e,a[h]=(i[3*h+s]+i[3*s+h])*e,this.x=a[0],this.y=a[1],this.z=a[2],this.w=(i[3*h+r]-i[3*r+h])*e}return this}});t.exports=d},function(t,e,i){var n=i(319),s=i(25),r=i(29),o=i(165);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===r.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==r.HEADLESS)if(e.renderType===r.CANVAS||e.renderType!==r.CANVAS&&!o.webGL){if(!o.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=r.CANVAS}else e.renderType=r.WEBGL;e.antialias||s.disableSmoothing();var a,h,l=t.scale.baseSize,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=s.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==r.HEADLESS&&(a=i(483),h=i(486),e.renderType===r.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach(function(e){t.style["image-rendering"]=e}),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){var n=i(29);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===n.CANVAS?i="Canvas":e.renderType===n.HEADLESS&&(i="Headless");var s,r=e.audio,o=t.device.audio;if(s=!o.webAudio||r&&r.disableWebAudio?r&&r.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio":"Web Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+n.VERSION+" / https://phaser.io");else{var a,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach(function(t){h=h.concat("%c "),l.push("background: "+t),a=t}),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: #fff"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+n.VERSION+" ("+i+" | "+s+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},function(t,e,i){var n=i(0),s=i(6),r=i(1),o=i(322),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=s(e,"min",5),this.targetFps=s(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=r,this.forceSetTimeOut=s(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=s(e,"deltaHistory",10),this.panicMax=s(e,"panicMax",120),this.rawDelta=0,this.now=0},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,r=Math.min(r,this._target)),r>this._min&&(r=n[i],r=Math.min(r,this._min)),n[i]=r,this.deltaIndex++,this.deltaIndex>s&&(this.deltaIndex=0);for(var o=0,a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running?this.sleep():t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step()},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=r,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1),r=new n({initialize:function(){this.isRunning=!1,this.callback=s,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.max(16+t.lastTime-i,0);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=s}});t.exports=r},function(t,e,i){var n=i(17);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach(function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")});e&&document.addEventListener(e,function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)},!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){var n=i(325),s=i(25),r=i(6);t.exports=function(t){var e=r(t,"data",[]),i=r(t,"canvas",null),o=r(t,"palette",n),a=r(t,"pixelWidth",1),h=r(t,"pixelHeight",a),l=r(t,"resizeCanvas",!0),u=r(t,"clearCanvas",!0),c=r(t,"preRender",null),d=r(t,"postRender",null),f=Math.floor(Math.abs(e[0].length*a)),p=Math.floor(Math.abs(e.length*h));i||(i=s.create2D(this,f,p),l=!1,u=!1),l&&(i.width=f,i.height=p);var g=i.getContext("2d");u&&g.clearRect(0,0,f,p),c&&c(i,g);for(var v=0;vi;)n-=i;ni.length-2?i.length-1:r+1],c=i[r>i.length-3?i.length-1:r+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}},function(t,e,i){var n=i(114);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e,i){var n=i(174);t.exports=function(t,e){var i=window.screen,s=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);if(s&&"string"==typeof s.type)return s.type;if("string"==typeof s)return s;if(i)return i.height>i.width?n.PORTRAIT:n.LANDSCAPE;if("number"==typeof window.orientation)return 0===window.orientation||180===window.orientation?n.PORTRAIT:n.LANDSCAPE;if(window.matchMedia){if(window.matchMedia("(orientation: portrait)").matches)return n.PORTRAIT;if(window.matchMedia("(orientation: landscape)").matches)return n.LANDSCAPE}return e>t?n.PORTRAIT:n.LANDSCAPE}},function(t,e){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},function(t,e){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){var n=i(0),s=i(176),r=i(9),o=i(53),a=i(17),h=i(344),l=i(345),u=i(346),c=i(347),d=i(32),f=i(313),p=new n({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new r,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new c(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var n=new u(this,i);n.smoothFactor=e.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var n=0;n10&&(t=10-this.pointersTotal);for(var i=0;i-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.useQueue||t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(r.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},function(t,e,i){var n=i(0),s=i(165),r=i(53),o=i(0),a=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.capture=t.inputMouseCapture,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",function(t){return t.preventDefault(),!1}),this},requestPointerLock:function(){if(s.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){s.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onMouseMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseMove(e),t.capture&&e.preventDefault())},this.onMouseDown=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseDown(n),t.capture&&n.target===e&&n.preventDefault())},this.onMouseDownWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseDown(i)},this.onMouseUp=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onMouseUp(i),t.capture&&i.target===e&&i.preventDefault())},this.onMouseUpWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onMouseUp(i)},this.onMouseOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onMouseOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)},this.onMouseWheel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onMouseWheel(e)};var n=this.target;if(n){var r={passive:!0},o={passive:!1};n.addEventListener("mousemove",this.onMouseMove,this.capture?o:r),n.addEventListener("mousedown",this.onMouseDown,this.capture?o:r),n.addEventListener("mouseup",this.onMouseUp,this.capture?o:r),n.addEventListener("mouseover",this.onMouseOver,this.capture?o:r),n.addEventListener("mouseout",this.onMouseOut,this.capture?o:r),n.addEventListener("wheel",this.onMouseWheel,this.capture?o:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o)),s.pointerLock&&(this.pointerLockChange=function(e){var i=t.target;t.locked=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i,t.manager.onPointerLockChange(e)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&(window.removeEventListener("mousedown",this.onMouseDownWindow),window.removeEventListener("mouseup",this.onMouseUpWindow)),s.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},function(t,e,i){var n=i(298),s=i(0),r=i(58),o=i(167),a=i(307),h=i(3),l=new s({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=this.x,i=this.y;1!==t.resolution&&(e+=t._x,i+=t._y);var n=t.getWorldPoint(e,i);return this.worldX=n.x,this.worldY=n.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,s=this.midPoint.y;if(t!==i||e!==s){var r=a(this.motionFactor,i,t),h=a(this.motionFactor,s,e);o(r,t,.1)&&(r=t),o(h,e,.1)&&(h=e),this.midPoint.set(r,h);var l=t-r,u=e-h;this.velocity.set(l,u),this.angle=n(r,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=t.timeStamp),this.isDown=!1,this.wasTouch=!1},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=t.timeStamp),this.isDown=!0,this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?r(this.downX,this.downY,this.x,this.y):r(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,s=this.position.x,r=this.position.y,o=0;o0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,s=t.scaleMode,r=t.resolution,o=t.zoom,a=t.autoRound;if("string"==typeof e){var h=this.parentSize.width;0===h&&(h=window.innerWidth);var l=parseInt(e,10)/100;e=Math.floor(h*l)}if("string"==typeof i){var c=this.parentSize.height;0===c&&(c=window.innerHeight);var d=parseInt(i,10)/100;i=Math.floor(c*d)}this.resolution=1,this.scaleMode=s,this.autoRound=a,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,a&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),o===n.ZOOM.MAX_ZOOM&&(o=this.getMaxZoom()),this.zoom=o,1!==o&&(this._resetZoom=!0),this.baseSize.setSize(e*r,i*r),a&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*o,t.minHeight*o),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*o,t.maxHeight*o),this.displaySize.setSize(e,i),this.orientation=u(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=this.resolution,n=e.width*i,s=e.height*i;return(t.width!==n||t.height!==s)&&(t.setSize(n,s),!0)},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e(t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound,n=this.resolution;i&&(t=Math.floor(t),e=Math.floor(e));var s=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t,e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(s,r)},resize:function(t,e){var i=this.zoom,n=this.resolution,s=this.autoRound;s&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,o=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t*n,e*n),s&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i*n,e*i*n),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var a=this.canvas.style,h=t*i,l=e*i;return s&&(h=Math.floor(h),l=Math.floor(l)),h===t&&l===e||(a.width=h+"px",a.height=l+"px"),this.refresh(r,o)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,s=i.style;s.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",s.marginLeft=n.marginLeft,s.marginTop=n.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,this.resolution,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=u(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,s=this.gameSize.width,r=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===n.SCALE_MODE.NONE?(this.displaySize.setSize(s*o*1,r*o*1),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===n.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(1*this.displaySize.width,1*this.displaySize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width/1,e=this.displaySize.height/1,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=p(this.parentSize.width,this.gameSize.width,0,!0),e=p(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==n.CENTER.NO_CENTER){var e=this.canvas,i=e.style,s=e.getBoundingClientRect(),r=s.width,o=s.height,a=Math.floor((this.parentSize.width-r)/2),h=Math.floor((this.parentSize.height-o)/2);t===n.CENTER.CENTER_HORIZONTALLY?h=0:t===n.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i,n=this.getFullscreenTarget();this._requestedFullscreenChange=!0,(i=e.keyboard?n[e.request](Element.ALLOW_KEYBOARD_INPUT):n[e.request](t))?i.then(this.fullscreenSuccessHandler.bind(this)).catch(this.fullscreenErrorHandler.bind(this)):e.active?this.fullscreenSuccessHandler():this.fullscreenErrorHandler()}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas));return this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&(this._requestedFullscreenChange=!0,document[t.cancel]()),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;if(e.orientationChange=function(){t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available){e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)};["webkit","moz",""].forEach(function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)}),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1)}},onFullScreenChange:function(){this._requestedFullscreenChange||this.stopFullscreen(),this._requestedFullscreenChange=!1},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1);["webkit","moz",""].forEach(function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)}),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=v},function(t,e,i){var n=i(22),s=i(0),r=i(93),o=i(3),a=new s({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(r(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(r(t,this.snapTo.x)),this._height=this.getNewHeight(r(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,s=0===e?1:t/e;return i&&this.aspectRatio>s||!i&&this.aspectRatio0&&(t=(e=r(e,n.y))*this.aspectRatio)):(i&&this.aspectRatios)&&(t=(e=r(e,n.y))*this.aspectRatio,n.x>0&&(e=(t=r(t,n.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},function(t,e,i){var n=i(0),s=i(121),r=i(21),o=i(17),a=i(6),h=i(81),l=i(1),u=i(352),c=i(177),d=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;t.init&&(t.init.call(t,n.data),n.status=s.INIT,n.isTransition&&i.events.emit(r.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=s.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>s.START&&n.settings.status<=s.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=s.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),s=this.getAt(i);this.scenes[e]=s,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e=r.x&&t=r.y&&e=r.x&&t=r.y&&e-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=n,o.data[2]=s,o.data[3]=r,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,n,s,r,o){return void 0===n&&(n=0),void 0===s&&(s=0),void 0===r&&(r=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,n,s,r,o),this},getData:function(t,e,i,n){return t=s(Math.floor(t),0,this.width-1),e=s(Math.floor(e),0,this.height-1),i=s(i,1,this.width-t),n=s(n,1,this.height-e),this.context.getImageData(t,e,i,n)},getPixel:function(t,e,i){i||(i=new r);var n=this.getIndex(t,e);if(n>-1){var s=this.data,o=s[n+0],a=s[n+1],h=s[n+2],l=s[n+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=s(t,0,this.width),a=s(t+i,0,this.width),h=s(e,0,this.height),l=s(e+n,0,this.height),u=new r,c=[],d=h;d0)&&(!!n.prototype.pause.call(this)&&(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(r.PAUSE,this),!0)))},resume:function(){return!this.manager.isLocked(this,"resume")&&(!(this.startTime>0)&&(!!n.prototype.resume.call(this)&&(!!this.pickAndPlayAudioTag()&&(this.emit(r.RESUME,this),!0))))},stop:function(){return!this.manager.isLocked(this,"stop")&&(!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(r.STOP,this),!0))},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=n-this.manager.loopEndOffset?(this.audio.currentTime=i+Math.max(0,s-n),s=this.audio.currentTime):s=n)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(r.COMPLETE,this);this.previousTime=s}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=this.currentConfig.volume*this.manager.volume)},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(r.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(r.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,r.RATE,t)||(this.calculateRate(),this.emit(r.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,r.DETUNE,t)||(this.calculateRate(),this.emit(r.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(r.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(r.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this}});t.exports=o},function(t,e,i){var n=i(122),s=i(0),r=i(9),o=i(362),a=i(1),h=new s({Extends:r,initialize:function(t){r.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){var n=i(123),s=i(0),r=i(9),o=i(16),a=new s({Extends:r,initialize:function(t,e,i){void 0===i&&(i={}),r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!1},updateMarker:function(t){return!1},removeMarker:function(t){return null},play:function(t,e){return!1},pause:function(){return!1},resume:function(){return!1},stop:function(){return!1},destroy:function(){this.manager.remove(this),n.prototype.destroy.call(this)}});t.exports=a},function(t,e,i){var n=i(364),s=i(122),r=i(0),o=i(59),a=i(365),h=new r({Extends:s,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),s.call(this,t),this.locked&&this.unlock()},createAudioContext:function(t){var e=t.config.audio;return e&&e.context?(e.context.resume(),e.context):new AudioContext},add:function(t,e){var i=new a(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var s=this.game.cache.audio,r=i.length,a=0;a>4,u[h++]=(15&i)<<4|s>>2,u[h++]=(3&s)<<6|63&r;return l}},function(t,e,i){var n=i(123),s=i(0),r=i(59),o=new s({Extends:n,initialize:function(t,e,i){void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),this.audioBuffer?(this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)):console.warn("Audio cache entry missing: "+e)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(r.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime-1;r--)n[s][r]=t[r][s]}return n}},function(t,e){function i(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function n(t,e){return te?1:0}var s=function(t,e,r,o,a){for(void 0===r&&(r=0),void 0===o&&(o=t.length-1),void 0===a&&(a=n);o>r;){if(o-r>600){var h=o-r+1,l=e-r+1,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),f=Math.max(r,Math.floor(e-l*c/h+d)),p=Math.min(o,Math.floor(e+(h-l)*c/h+d));s(t,e,f,p,a)}var g=t[e],v=r,m=o;for(i(t,r,e),a(t[o],g)>0&&i(t,r,o);v0;)m--}0===a(t[r],g)?i(t,r,m):i(t,++m,o),m<=e&&(r=m+1),e<=m&&(o=m-1)}};t.exports=s},function(t,e,i){var n=i(6),s=i(112),r=function(t,e,i){for(var n=[],s=0;s0?s.delayedPlay(d,r,o):s.load(r)}return t}},function(t,e,i){var n=i(11);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=Math.min(t.x,e.x),r=Math.min(t.y,e.y),o=Math.max(t.right,e.right)-s,a=Math.max(t.bottom,e.bottom)-r;return i.setTo(s,r,o,a)}},function(t,e,i){var n=i(0),s=i(12),r=i(934),o=i(13),a=i(7),h=i(175),l=i(314),u=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Origin,s.ScrollFactor,s.Transform,s.Visible,r],initialize:function(t,e,i,n,s,r){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new l,this.rotate3dAngle="deg",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof n?"#"===n[0]?this.setElement(n.substr(1),s,r):this.createElement(n,s,r):n&&this.setElement(n,s,r)},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e>>16,y=(65280&p)>>>8,x=255&p,c.strokeStyle="rgba("+m+","+y+","+x+","+d+")",c.lineWidth=v,T+=3;break;case n.FILL_STYLE:g=l[T+1],f=l[T+2],m=(16711680&g)>>>16,y=(65280&g)>>>8,x=255&g,c.fillStyle="rgba("+m+","+y+","+x+","+f+")",T+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:h||c.fill();break;case n.STROKE_PATH:h||c.stroke();break;case n.FILL_RECT:h?c.rect(l[T+1],l[T+2],l[T+3],l[T+4]):c.fillRect(l[T+1],l[T+2],l[T+3],l[T+4]),T+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.fill(),T+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(l[T+1],l[T+2]),c.lineTo(l[T+3],l[T+4]),c.lineTo(l[T+5],l[T+6]),c.closePath(),h||c.stroke(),T+=6;break;case n.LINE_TO:c.lineTo(l[T+1],l[T+2]),T+=2;break;case n.MOVE_TO:c.moveTo(l[T+1],l[T+2]),T+=2;break;case n.LINE_FX_TO:c.lineTo(l[T+1],l[T+2]),T+=5;break;case n.MOVE_FX_TO:c.moveTo(l[T+1],l[T+2]),T+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(l[T+1],l[T+2]),T+=2;break;case n.SCALE:c.scale(l[T+1],l[T+2]),T+=2;break;case n.ROTATE:c.rotate(l[T+1]),T+=1;break;case n.GRADIENT_FILL_STYLE:T+=5;break;case n.GRADIENT_LINE_STYLE:T+=6;break;case n.SET_TEXTURE:T+=2}c.restore()}}},function(t,e,i){var n=i(0),s=i(2),r=new n({initialize:function(t,e,i,n,r){if("object"==typeof t){var o=t;t=s(o,"x",0),e=s(o,"y",0),i=s(o,"power",0),n=s(o,"epsilon",100),r=s(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===r&&(r=50);this.x=t,this.y=e,this.active=!0,this._gravity=r,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,s=i*i+n*n;if(0!==s){var r=Math.sqrt(s);s0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),void 0===t?(i.follow&&(this.x+=i.follow.x+i.followOffset.x),this.x+=i.x.onEmit(this,"x")):this.x+=t,void 0===e?(i.follow&&(this.y+=i.follow.y+i.followOffset.y),this.y+=i.y.onEmit(this,"y")):this.y+=e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=s(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,u=Math.atan2(l-this.y,h-this.x),c=r(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=s(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,n){var s=this.velocityX,r=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;s+=t.gravityX*i,r+=t.gravityY*i,o&&(s+=o*i),a&&(r+=a*i),s>h?s=h:s<-h&&(s=-h),r>l?r=l:r<-l&&(r=-l),this.velocityX=s,this.velocityY=r;for(var u=0;ue.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,r=1-this.lifeCurrent/this.life;return this.lifeT=r,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",r,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",r,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",r,this.angle),this.rotation=s(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",r,this.alpha),this.tint=n.tint.onUpdate(this,"tint",r,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){var n=i(52),s=i(0),r=i(12),o=i(381),a=i(382),h=i(951),l=i(2),u=i(182),c=i(383),d=i(99),f=i(379),p=i(384),g=i(11),v=i(126),m=i(3),y=i(57),x=new s({Mixins:[r.BlendMode,r.Mask,r.ScrollFactor,r.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=f,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",4294967295),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new m,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,s=0;s0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];s.splice(d.index,1),r.push(d.particle),u&&u.call(c,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},function(t,e,i){var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s){void 0===n&&(n=!1),void 0===s&&(s=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=s,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;i0&&(s=-h.PI2+s%h.PI2):s>h.PI2?s=h.PI2:s<0&&(s=h.PI2+s%h.PI2);for(var u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=s*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=s+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e,i){var n=i(0),s=i(977),r=i(65),o=i(11),a=i(30),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,s,r){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==s&&this.setFillStyle(s,r),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),s=0;sc+v)){var m=g.getPoint((u-c)/v);o.push(m);break}c+=v}return o}},function(t,e,i){var n=i(56),s=i(55);t.exports=function(t){for(var e=t.points,i=0,r=0;r0&&r.push(i([0,0],n[0])),e=0;e1&&r.push(i([0,0],n[n.length-1])),t.setTo(r)}},function(t,e,i){var n=i(0),s=i(11),r=i(30),o=i(998),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===o&&(o=128),r.call(this,t,"Rectangle",new s(0,0,n,o)),this.setPosition(e,i),this.setSize(n,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(1001),s=i(0),r=i(65),o=i(30),a=new s({Extends:o,Mixins:[n],initialize:function(t,e,i,n,s,r,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===s&&(s=32),void 0===r&&(r=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=s,this._outerRadius=r,this.setPosition(e,i),this.setSize(2*r,2*r),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,s=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l=1)return i.x=r.x1,i.y=r.y1,i;var h=s(r),l=s(o),u=s(a),c=(h+l+u)*e,d=0;return ch+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){var n=i(56),s=i(4);t.exports=function(t,e,i,r){void 0===r&&(r=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),u=n(a),c=n(h),d=l+u+c;e||(e=d/i);for(var f=0;fl+u?(g=(p-=l+u)/c,v.x=h.x1+(h.x2-h.x1)*g,v.y=h.y1+(h.y2-h.y1)*g):(g=(p-=l)/u,v.x=a.x1+(a.x2-a.x1)*g,v.y=a.y1+(a.y2-a.y1)*g),r.push(v)}return r}},function(t,e){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var n=e.split("."),s=t,r=t,o=0;o0?(h=this.lightPool.pop()).set(t,e,i,a[0],a[1],a[2],o):h=new s(t,e,i,a[0],a[1],a[2],o),this.lights.push(h),h},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&(this.lightPool.push(t),this.lights.splice(e,1)),this},shutdown:function(){for(;this.lights.length>0;)this.lightPool.push(this.lights.pop());this.ambientColor={r:.1,g:.1,b:.1},this.culledLights.length=0,this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=o},function(t,e,i){var n=i(46),s=i(16),r={Circle:i(1062),Ellipse:i(1072),Intersects:i(407),Line:i(1091),Point:i(1112),Polygon:i(1126),Rectangle:i(422),Triangle:i(1156)};r=s(!1,r,n),t.exports=r},function(t,e,i){t.exports={CircleToCircle:i(408),CircleToRectangle:i(409),GetCircleToCircle:i(1082),GetCircleToRectangle:i(1083),GetLineToCircle:i(201),GetLineToRectangle:i(203),GetRectangleIntersection:i(1084),GetRectangleToRectangle:i(1085),GetRectangleToTriangle:i(1086),GetTriangleToCircle:i(1087),GetTriangleToLine:i(414),GetTriangleToTriangle:i(1088),LineToCircle:i(202),LineToLine:i(84),LineToRectangle:i(410),PointToLine:i(418),PointToLineSegment:i(1089),RectangleToRectangle:i(129),RectangleToTriangle:i(411),RectangleToValues:i(1090),TriangleToCircle:i(413),TriangleToLine:i(415),TriangleToTriangle:i(416)}},function(t,e,i){var n=i(58);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,s=Math.abs(t.x-e.x-i),r=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(s>o||r>a)return!1;if(s<=i||r<=n)return!0;var h=s-i,l=r-n;return h*h+l*l<=t.radius*t.radius}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,s=t.x2,r=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||s>=o&&s<=h&&r>=a&&r<=l)return!0;if(i=o){if((u=n+(r-n)*(o-i)/(s-i))>a&&u<=l)return!0}else if(i>h&&s<=h&&(u=n+(r-n)*(h-i)/(s-i))>=a&&u<=l)return!0;if(n=a){if((u=i+(s-i)*(a-n)/(r-n))>=o&&u<=h)return!0}else if(n>l&&r<=l&&(u=i+(s-i)*(l-n)/(r-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(84),s=i(47),r=i(204),o=i(412);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e,i){var n=i(202),s=i(83);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottome.right||t.righte.bottom||t.bottom0||(c=s(e),(d=n(t,c,!0)).length>0)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=1);var n=e.x1,s=e.y1,r=e.x2,o=e.y2,a=t.x,h=t.y,l=(r-n)*(r-n)+(o-s)*(o-s);if(0===l)return!1;var u=((a-n)*(r-n)+(h-s)*(o-s))/l;if(u<0)return Math.sqrt((n-a)*(n-a)+(s-h)*(s-h))<=i;if(u>=0&&u<=1){var c=((s-h)*(r-n)-(n-a)*(o-s))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((r-a)*(r-a)+(o-h)*(o-h))<=i}},function(t,e,i){var n=i(23),s=i(57),r=i(85);t.exports=function(t){var e=r(t)-n.TAU;return s(e,-Math.PI,Math.PI)}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e,i){var n=i(11);n.Area=i(1131),n.Ceil=i(1132),n.CeilAll=i(1133),n.CenterOn=i(163),n.Clone=i(1134),n.Contains=i(47),n.ContainsPoint=i(1135),n.ContainsRect=i(423),n.CopyFrom=i(1136),n.Decompose=i(412),n.Equals=i(1137),n.FitInside=i(1138),n.FitOutside=i(1139),n.Floor=i(1140),n.FloorAll=i(1141),n.FromPoints=i(173),n.GetAspectRatio=i(206),n.GetCenter=i(1142),n.GetPoint=i(147),n.GetPoints=i(255),n.GetSize=i(1143),n.Inflate=i(1144),n.Intersection=i(1145),n.MarchingAnts=i(266),n.MergePoints=i(1146),n.MergeRect=i(1147),n.MergeXY=i(1148),n.Offset=i(1149),n.OffsetPoint=i(1150),n.Overlaps=i(1151),n.Perimeter=i(110),n.PerimeterPoint=i(1152),n.Random=i(150),n.RandomOutside=i(1153),n.SameDimensions=i(1154),n.Scale=i(1155),n.Union=i(370),t.exports=n},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(s.BUTTON_DOWN,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(s.BUTTON_UP,e,this,t),this.pad.emit(s.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=r},function(t,e,i){var n=i(428),s=i(429),r=i(0),o=i(9),a=i(3),h=new r({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],r=0;r=2&&(this.leftStick.set(r[0].getValue(),r[1].getValue()),s>=4&&this.rightStick.set(r[2].getValue(),r[3].getValue()))},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t=r;for(i=0;i=r;)this._elapsed-=r,this.step(s)}},step:function(t){var e,i,n=this.bodies.entries,s=n.length;for(e=0;e0){var l=this.tree,u=this.staticTree;for(n=(i=h.entries).length,t=0;t-1&&p>g&&(t.velocity.normalize().scale(g),p=g),t.speed=p},separate:function(t,e,i,n,s){if(!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,s);if(t.isCircle!==e.isCircle){var r=t.isCircle?e:t,o=t.isCircle?t:e,a={x:r.x,y:r.y,right:r.right,bottom:r.bottom},h=o.center;if((h.ya.bottom)&&(h.xa.right))return this.separateCircle(t,e,s)}var l=!1,c=!1;this.forceX||Math.abs(this.gravity.y+t.gravity.y)r.right&&(s=h(o.x,o.y,r.right,r.y)-o.radius):o.y>r.bottom&&(o.xr.right&&(s=h(o.x,o.y,r.right,r.bottom)-o.radius)),s*=-1}else s=t.halfWidth+e.halfWidth-h(t.center.x,t.center.y,e.center.x,e.center.y);if(i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s&&(t.onOverlap||e.onOverlap)&&this.emit(u.OVERLAP,t.gameObject,e.gameObject,t,e),0!==s;var a=t.center.x-e.center.x,l=t.center.y-e.center.y,c=Math.sqrt(Math.pow(a,2)+Math.pow(l,2)),d=(e.center.x-t.center.x)/c||0,f=(e.center.y-t.center.y)/c||0,v=2*(t.velocity.x*d+t.velocity.y*f-e.velocity.x*d-e.velocity.y*f)/(t.mass+e.mass);t.immovable||(t.velocity.x=t.velocity.x-v*t.mass*d,t.velocity.y=t.velocity.y-v*t.mass*f),e.immovable||(e.velocity.x=e.velocity.x+v*e.mass*d,e.velocity.y=e.velocity.y+v*e.mass*f);var m=e.velocity.x-t.velocity.x,y=e.velocity.y-t.velocity.y,x=Math.atan2(y,m),T=this._frameTime;return t.immovable||e.immovable||(s/=2),t.immovable||(t.x+=t.velocity.x*T-s*Math.cos(x),t.y+=t.velocity.y*T-s*Math.sin(x)),e.immovable||(e.x+=e.velocity.x*T+s*Math.cos(x),e.y+=e.velocity.y*T+s*Math.sin(x)),t.velocity.x*=t.bounce.x,t.velocity.y*=t.bounce.y,e.velocity.x*=e.bounce.x,e.velocity.y*=e.bounce.y,(t.onCollide||e.onCollide)&&this.emit(u.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?h(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!0)},collide:function(t,e,i,n,s){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===s&&(s=i),this.collideObjects(t,e,i,n,s,!1)},collideObjects:function(t,e,i,n,s,r){var o,a;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,n,s,r){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,s,r);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,s,r);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,s,r)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,s,r);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,s,r)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,s,r);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,s,r)}},collideSpriteVsSprite:function(t,e,i,n,s,r){return!(!t.body||!e.body)&&(this.separate(t.body,e.body,n,s,r)&&(i&&i.call(s,t,e),this._total++),!0)},collideSpriteVsGroup:function(t,e,i,n,s,r){var o,h,l,u=t.body;if(0!==e.length&&u&&u.enable)if(this.useTree){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===a.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(h=d.length,o=0;oc.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var f=e.getTilesWithinWorldXY(a,h,l,u);return 0!==f.length&&this.collideSpriteVsTilesHandler(t,f,i,n,s,r,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,s,r,o){for(var a,h,l=t.body,c={left:0,right:0,top:0,bottom:0},d=!1,f=0;f0&&t>i&&(t=i)),0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),this.gameObject.x+=t,this.gameObject.y+=e}t<0?this.facing=s.FACING_LEFT:t>0&&(this.facing=s.FACING_RIGHT),e<0?this.facing=s.FACING_UP:e>0&&(this.facing=s.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ())},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.customBoundsRectangle,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,s=this.worldBounce?-this.worldBounce.y:-this.bounce.y,r=!1;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,r=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=s,this.blocked.down=!0,r=!0),r&&(this.blocked.none=!1),r},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this.updateCenter(),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.offset.set(s-this.halfWidth,r-this.halfHeight)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.prevFrame.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter()},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i){void 0===t&&(t=!0),this.collideWorldBounds=t;var n=void 0!==e,s=void 0!==i;return(n||s)&&(this.worldBounce||(this.worldBounce=new l),n&&(this.worldBounce.x=e),s&&(this.worldBounce.y=i)),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=u},function(t,e,i){var n=new(i(0))({initialize:function(t,e,i,n,s,r,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=s,this.processCallback=r,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){var n=i(50);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsX()+e.deltaAbsX()+s;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(r=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?r=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.right=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?r=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.left=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=r,e.overlapX=r,r}},function(t,e,i){var n=i(50);t.exports=function(t,e,i,s){var r=0,o=t.deltaAbsY()+e.deltaAbsY()+s;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(r=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?r=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.down=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?r=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType===n.STATIC_BODY&&(t.blocked.none=!1,t.blocked.up=!0),t.physicsType===n.STATIC_BODY&&(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=r,e.overlapY=r,r}},function(t,e,i){var n=i(367);function s(t){if(!(this instanceof s))return new s(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(t,e,i,s,r){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=s||(o=e+Math.ceil((i-e)/s/2)*s,n(t,o,e,i,r),a.push(e,o,o,i))}s.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!p(t,e))return i;for(var s,r,o,a,h=[];e;){for(s=0,r=e.children.length;s=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,n);var r=this._chooseSplitIndex(i,s,n),a=g(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,s,r,o,h,l,u,d,f,p,g,v,m,y;for(l=u=1/0,n=e;n<=i-e;n++)s=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),f=s,p=r,void 0,void 0,void 0,void 0,g=Math.max(f.minX,p.minX),v=Math.max(f.minY,p.minY),m=Math.min(f.maxX,p.maxX),y=Math.min(f.maxY,p.maxY),o=Math.max(0,m-g)*Math.max(0,y-v),h=c(s)+c(r),o=e;s--)r=t.children[s],h(u,t.leaf?o(r):r),c+=d(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=s},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n=i(54),s=i(0),r=i(50),o=i(47),a=i(3),h=new s({initialize:function(t,e){var i=e.width?e.width:64,n=e.height?e.height:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-e.displayOriginX,e.y-e.displayOriginY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(e.x+this.halfWidth,e.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=r.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&n.getCenter){var s=n.displayWidth/2,r=n.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(s-this.halfWidth,r-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e){t.exports={NEVER:0,LITE:1,PASSIVE:2,ACTIVE:4,FIXED:8}},function(t,e){t.exports={NONE:0,A:1,B:2,BOTH:3}},function(t,e,i){var n={};t.exports=n;var s=i(233);n._motionWakeThreshold=.18,n._motionSleepThreshold=.08,n._minBias=.9,n.update=function(t,e){for(var i=e*e*e,s=0;s0&&r.motion=r.sleepThreshold&&n.set(r,!0)):r.sleepCounter>0&&(r.sleepCounter-=1)}else n.set(r,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,s=0;sn._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||s.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&s.trigger(t,"sleepEnd"))}},function(t,e,i){var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){var n=i(24);t.exports=function(t,e,i,s,r,o,a){for(var h=n(i,s,r,o,null,a),l=0;l-1}return!1}},function(t,e,i){var n=i(73),s=i(103),r=i(214);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!1),void 0===o&&(o=!0),!s(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new n(a,-1,t,e,h.width,h.height),o&&h&&h.collides&&r(t,e,a),h):null}},function(t,e,i){var n=i(31),s=i(217),r=i(458),o=i(459),a=i(470);t.exports=function(t,e,i,h,l,u){var c;switch(e){case n.ARRAY_2D:c=s(t,i,h,l,u);break;case n.CSV:c=r(t,i,h,l,u);break;case n.TILED_JSON:c=o(t,i,u);break;case n.WELTMEISTER:c=a(t,i,u);break;default:console.warn("Unrecognized tilemap data format: "+e),c=null}return c}},function(t,e,i){var n=i(31),s=i(217);t.exports=function(t,e,i,r,o){var a=e.trim().split("\n").map(function(t){return t.split(",")}),h=s(t,a,i,r,o);return h.format=n.CSV,h}},function(t,e,i){var n=i(31),s=i(105),r=i(460),o=i(462),a=i(463),h=i(466),l=i(468),u=i(469);t.exports=function(t,e,i){if("orthogonal"!==e.orientation)return console.warn("Only orthogonal map types are supported in this version of Phaser"),null;var c=new s({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:e.orientation,format:n.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});c.layers=r(e,i),c.images=o(e);var d=a(e);return c.tilesets=d.tilesets,c.imageCollections=d.imageCollections,c.objects=h(e),c.tiles=l(c),u(c),c}},function(t,e,i){var n=i(461),s=i(2),r=i(104),o=i(218),a=i(73);t.exports=function(t,e){for(var i=s(t,"infinite",!1),h=[],l=0;l0?((f=new a(c,d.gid,C,M,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,g[M][C]=f):(p=e?null:new a(c,-1,C,M,t.tilewidth,t.tileheight),g[M][C]=p),++v===w.width&&(S++,v=0)}}else{c=new r({name:u.name,x:s(u,"offsetx",0)+u.x,y:s(u,"offsety",0)+u.y,width:u.width,height:u.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:u.opacity,visible:u.visible,properties:s(u,"properties",{})});for(var P=[],O=0,R=u.data.length;O0?((f=new a(c,d.gid,v,g.length,t.tilewidth,t.tileheight)).rotation=d.rotation,f.flipX=d.flipped,P.push(f)):(p=e?null:new a(c,-1,v,g.length,t.tilewidth,t.tileheight),P.push(p)),++v===u.width&&(g.push(P),v=0,P=[])}c.data=g,h.push(c)}}return h}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),s=0;s>>0;return n}},function(t,e,i){var n=i(2);t.exports=function(t){for(var e=[],i=0;i1){if(Array.isArray(l.tiles)){for(var c={},d={},f=0;f=this.firstgid&&ta&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new s({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=r(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(104),s=i(73);t.exports=function(t,e){for(var i=[],r=0;r-1?new s(a,f,c,u,o.tilesize,o.tilesize):e?null:new s(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(140);t.exports=function(t){for(var e=[],i=[],s=0;s-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,s,r,o){if(void 0===t)return null;if(void 0!==e&&null!==e||(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===a.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(s,r),u.setImage(h),u):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===s&&(s=0),void 0===r&&(r=0),void 0===o&&(o=0),(u=new p(t,o,i,n,s,r)).setImage(h),this.tilesets.push(u),u)},convertLayerToStatic:function(t){if(null===(t=this.getLayer(t)))return null;var e=t.tilemapLayer;if(!(e&&e instanceof r))return null;var i=new c(e.scene,e.tilemap,e.layerIndex,e.tileset,e.x,e.y);return this.scene.sys.displayList.add(i),e.destroy(),i},copy:function(t,e,i,n,s,r,o,a){return a=this.getLayer(a),this._isStaticCall(a,"copy")?this:null!==a?(f.Copy(t,e,i,n,s,r,o,a),this):null},createBlankDynamicLayer:function(t,e,i,n,s,o,a,l){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=this.width),void 0===o&&(o=this.height),void 0===a&&(a=this.tileWidth),void 0===l&&(l=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var u,c=new h({name:t,tileWidth:a,tileHeight:l,width:s,height:o}),f=0;f-1&&this.putTileAt(e,r.x,r.y,i,r.tilemapLayer)}return n},removeTileAt:function(t,e,i,n,s){return s=this.getLayer(s),this._isStaticCall(s,"removeTileAt")?null:null===s?null:f.RemoveTileAt(t,e,i,n,s)},removeTileAtWorldXY:function(t,e,i,n,s,r){return r=this.getLayer(r),this._isStaticCall(r,"removeTileAtWorldXY")?null:null===r?null:f.RemoveTileAtWorldXY(t,e,i,n,s,r)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(f.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,n=0;n=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return a.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return a.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,s){return a.CreateFromTiles(t,e,i,n,s,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,s,r,o){return a.Copy(t,e,i,n,s,r,o,this.layer),this},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],o.prototype.destroy.call(this))},fill:function(t,e,i,n,s,r){return a.Fill(t,e,i,n,s,r,this.layer),this},filterTiles:function(t,e,i,n,s,r,o){return a.FilterTiles(t,e,i,n,s,r,o,this.layer)},findByIndex:function(t,e,i){return a.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,s,r,o){return a.FindTile(t,e,i,n,s,r,o,this.layer)},forEachTile:function(t,e,i,n,s,r,o){return a.ForEachTile(t,e,i,n,s,r,o,this.layer),this},getTileAt:function(t,e,i){return a.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return a.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,s){return a.GetTilesWithin(t,e,i,n,s,this.layer)},getTilesWithinShape:function(t,e,i){return a.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,s,r){return a.GetTilesWithinWorldXY(t,e,i,n,s,r,this.layer)},hasTileAt:function(t,e){return a.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return a.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return a.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,s){return a.PutTileAtWorldXY(t,e,i,n,s,this.layer)},putTilesAt:function(t,e,i,n){return a.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,s){return a.Randomize(t,e,i,n,s,this.layer),this},removeTileAt:function(t,e,i,n){return a.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,s){return a.RemoveTileAtWorldXY(t,e,i,n,s,this.layer)},renderDebug:function(t,e){return a.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,s,r){return a.ReplaceByIndex(t,e,i,n,s,r,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,n){return a.SetCollision(t,e,i,this.layer,n),this},setCollisionBetween:function(t,e,i,n){return a.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return a.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return a.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return a.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return a.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,s,r){return a.SetTileLocationCallback(t,e,i,n,s,r,this.layer),this},shuffle:function(t,e,i,n){return a.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,s,r){return a.SwapByIndex(t,e,i,n,s,r,this.layer),this},tileToWorldX:function(t,e){return a.TileToWorldX(t,e,this.layer)},tileToWorldY:function(t,e){return a.TileToWorldY(t,e,this.layer)},tileToWorldXY:function(t,e,i,n){return a.TileToWorldXY(t,e,i,n,this.layer)},weightedRandomize:function(t,e,i,n,s){return a.WeightedRandomize(t,e,i,n,s,this.layer),this},worldToTileX:function(t,e,i){return a.WorldToTileX(t,e,i,this.layer)},worldToTileY:function(t,e,i){return a.WorldToTileY(t,e,i,this.layer)},worldToTileXY:function(t,e,i,n,s){return a.WorldToTileXY(t,e,i,n,s,this.layer)}});t.exports=h},function(t,e,i){var n=i(0),s=i(12),r=i(17),o=i(13),a=i(1316),h=i(136),l=i(32),u=i(10),c=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Depth,s.Flip,s.GetBounds,s.Origin,s.Pipeline,s.Transform,s.Visible,s.ScrollFactor,a],initialize:function(t,e,i,n,s,a){o.call(this,t,"StaticTilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.culledTiles=[],this.skipCull=!1,this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=h.CullTiles,this.renderer=t.sys.game.renderer,this.vertexBuffer=[],this.bufferData=[],this.vertexViewF32=[],this.vertexViewU32=[],this.dirty=[],this.vertexCount=[],this._renderOrder=0,this._tempMatrix=new l,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(s,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.updateVBOData(),this.initPipeline("TextureTintPipeline"),t.sys.game.events.on(r.CONTEXT_RESTORED,function(){this.updateVBOData()},this)},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var s=0;sv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(1===p)for(o=0;o=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(2===p)for(o=u-1;o>=0;o--)for(a=0;av||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));else if(3===p)for(o=u-1;o>=0;o--)for(a=l-1;a>=0;a--)!(r=f[o][a])||r.indexv||!r.visible||(x=this.batchTile(x,r,h,c,d,t,e));this.dirty[e]=!1,null===m?(m=i.createVertexBuffer(y,n.STATIC_DRAW),this.vertexBuffer[e]=m):(i.setVertexBuffer(m),n.bufferSubData(n.ARRAY_BUFFER,0,y))}return this},batchTile:function(t,e,i,n,s,r,o){var a=i.getTileTextureCoordinates(e.index);if(!a)return t;var h=i.tileWidth,l=i.tileHeight,c=h/2,d=l/2,f=a.x/n,p=a.y/s,g=(a.x+h)/n,v=(a.y+l)/s,m=this._tempMatrix,y=-c,x=-d;e.flipX&&(h*=-1,y+=i.tileWidth),e.flipY&&(l*=-1,x+=i.tileHeight);var T=y+h,w=x+l;m.applyITRS(c+e.pixelX,d+e.pixelY,e.rotation,1,1);var b=u.getTintAppendFloatAlpha(16777215,r.alpha*this.alpha*e.alpha),E=m.getX(y,x),S=m.getY(y,x),_=m.getX(y,w),A=m.getY(y,w),C=m.getX(T,w),M=m.getY(T,w),P=m.getX(T,x),O=m.getY(T,x);r.roundPixels&&(E=Math.round(E),S=Math.round(S),_=Math.round(_),A=Math.round(A),C=Math.round(C),M=Math.round(M),P=Math.round(P),O=Math.round(O));var R=this.vertexViewF32[o],L=this.vertexViewU32[o];return R[++t]=E,R[++t]=S,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=b,R[++t]=_,R[++t]=A,R[++t]=f,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=E,R[++t]=S,R[++t]=f,R[++t]=p,R[++t]=0,L[++t]=b,R[++t]=C,R[++t]=M,R[++t]=g,R[++t]=v,R[++t]=0,L[++t]=b,R[++t]=P,R[++t]=O,R[++t]=g,R[++t]=p,R[++t]=0,L[++t]=b,this.vertexCount[o]+=6,t},setRenderOrder:function(t){if("string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=0&&t<4){this._renderOrder=t;for(var e=0;e0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=r},function(t,e,i){var n=i(1325);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){var n=i(6);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){var n=i(223),s=i(14),r=i(88),o=i(82),a=i(141),h=i(6),l=i(222),u=i(224),c=i(226);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),f=h(e,"to",1),p=[{value:d}],g=a(e,"delay",i.delay),v=a(e,"duration",i.duration),m=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),m),x=a(e,"hold",i.hold),T=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),b=r(e,"yoyo",i.yoyo),E=[],S=l("value",f),_=c(p[0],0,"value",S.getEnd,S.getStart,S.getActive,y,g,v,b,x,T,w,!1,!1);_.start=d,_.current=d,_.to=f,E.push(_);var A=new u(t,E,p);A.offset=s(e,"offset",null),A.completeDelay=s(e,"completeDelay",0),A.loop=Math.round(s(e,"loop",0)),A.loopDelay=Math.round(s(e,"loopDelay",0)),A.paused=r(e,"paused",!1),A.useFrames=r(e,"useFrames",!1);for(var C=h(e,"callbackScope",A),M=[A,null],P=u.TYPES,O=0;O0?Math.floor(v/p.length):h(e,"duration",g.duration),g.delay=h(e,"delay",g.delay),g.easeParams=c(e,"easeParams",g.easeParams),g.ease=a(c(e,"ease",g.ease),g.easeParams),g.hold=h(e,"hold",g.hold),g.repeat=h(e,"repeat",g.repeat),g.repeatDelay=h(e,"repeatDelay",g.repeatDelay),g.yoyo=o(e,"yoyo",g.yoyo),g.flipX=o(e,"flipX",g.flipX),g.flipY=o(e,"flipY",g.flipY);for(var m=0;m0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):(this.state=a.ACTIVE,this.dispatchTimelineEvent(r.TIMELINE_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=a.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=a.PENDING_REMOVE,this.dispatchTimelineEvent(r.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,n=0;n=this.nextTick&&this.currentAnim.setFrame(this)}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),e.setSizeToFrame(),t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin(),e},updateFrame:function(t){var e=this.setCurrentFrame(t);if(this.isPlaying){t.setAlpha&&(e.alpha=t.alpha);var i=this.currentAnim;e.emit(r.SPRITE_ANIMATION_KEY_UPDATE+i.key,i,t,e),e.emit(r.SPRITE_ANIMATION_UPDATE,i,t,e),3===this._pendingStop&&this._pendingStopValue===t&&this.currentAnim.completeAnimation(this)}},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},setYoyo:function(t){return void 0===t&&(t=!1),this._yoyo=t,this.parent},getYoyo:function(){return this._yoyo},destroy:function(){this.animationManager.off(r.REMOVE_ANIMATION,this.remove,this),this.animationManager=null,this.parent=null,this.currentAnim=null,this.currentFrame=null}});t.exports=o},function(t,e,i){var n=i(484),s=i(48),r=i(0),o=i(29),a=i(485),h=i(92),l=i(32),u=new r({initialize:function(t){this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.config={clearBeforeRender:t.config.clearBeforeRender,backgroundColor:t.config.backgroundColor,resolution:t.config.resolution,antialias:t.config.antialias,roundPixels:t.config.roundPixels},this.gameCanvas=t.canvas;var e={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=this.game.config.context?this.game.config.context:this.gameCanvas.getContext("2d",e),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=a(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new l,this._tempMatrix2=new l,this._tempMatrix3=new l,this._tempMatrix4=new l,this.init()},init:function(){this.game.scale.on(h.RESIZE,this.onResize,this);var t=this.game.scale.baseSize;this.resize(t.width,t.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),t.save(),this.drawCount=0},render:function(t,e,i,n){var r=e.list,o=r.length,a=n._cx,h=n._cy,l=n._cw,u=n._ch,c=n.renderToTexture?n.context:t.sys.context;c.save(),this.game.scene.customViewports&&(c.beginPath(),c.rect(a,h,l,u),c.clip()),this.currentContext=c;var d=n.mask;d&&d.preRenderCanvas(this,null,n._maskCamera),n.transparent||(c.fillStyle=n.backgroundColor.rgba,c.fillRect(a,h,l,u)),c.globalAlpha=n.alpha,c.globalCompositeOperation="source-over",this.drawCount+=r.length,n.renderToTexture&&n.emit(s.PRE_RENDER,n),n.matrix.copyToContext(c);for(var f=0;f=0?y=-(y+d):y<0&&(y=Math.abs(y)-d)),t.flipY&&(x>=0?x=-(x+f):x<0&&(x=Math.abs(x)-f))}var w=1,b=1;t.flipX&&(p||(y+=-e.realWidth+2*v),w=-1),t.flipY&&(p||(x+=-e.realHeight+2*m),b=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*w,t.scaleY*b),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y,o.multiply(a,h)):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY,o.multiply(a,h)),r.save(),h.setToContext(r),r.globalCompositeOperation=this.blendModes[t.blendMode],r.globalAlpha=s,r.imageSmoothingEnabled=!(!this.antialias||e.source.scaleMode),r.drawImage(e.source.image,u,c,d,f,y,x,d/g,f/g),r.restore()}},destroy:function(){this.gameCanvas=null,this.gameContext=null,this.game=null}});t.exports=u},function(t,e,i){var n=i(25),s=i(33),r=i(2);t.exports=function(t,e){var i=r(e,"callback"),o=r(e,"type","image/png"),a=r(e,"encoder",.92),h=Math.abs(Math.round(r(e,"x",0))),l=Math.abs(Math.round(r(e,"y",0))),u=r(e,"width",t.width),c=r(e,"height",t.height);if(r(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new s(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||u!==t.width||c!==t.height){var f=n.createWebGL(this,u,c);f.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);var p=new Image;p.onerror=function(){i.call(null),n.remove(f)},p.onload=function(){i.call(null,p),n.remove(f)},p.src=f.toDataURL(o,a)}else{var g=new Image;g.onerror=function(){i.call(null)},g.onload=function(){i.call(null,g)},g.src=t.toDataURL(o,a)}}},function(t,e,i){var n=i(52),s=i(297);t.exports=function(){var t=[],e=s.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t[n.ERASE]="destination-out",t[n.SOURCE_IN]="source-in",t[n.SOURCE_OUT]="source-out",t[n.SOURCE_ATOP]="source-atop",t[n.DESTINATION_OVER]="destination-over",t[n.DESTINATION_IN]="destination-in",t[n.DESTINATION_OUT]="destination-out",t[n.DESTINATION_ATOP]="destination-atop",t[n.LIGHTER]="lighter",t[n.COPY]="copy",t[n.XOR]="xor",t}},function(t,e,i){var n=i(91),s=i(48),r=i(0),o=i(29),a=i(17),h=i(116),l=i(1),u=i(92),c=i(79),d=i(117),f=i(32),p=i(10),g=i(487),v=i(488),m=i(489),y=i(232),x=new r({initialize:function(t){var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,resolution:e.resolution,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights},this.game=t,this.type=o.WEBGL,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.nativeTextures=[],this.contextLost=!1,this.pipelines=null,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTextureUnit=0,this.currentTextures=new Array(16),this.currentFramebuffer=null,this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=l,this.contextRestoredHandler=l,this.gl=null,this.supportedExtensions=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.drawingBufferHeight=0,this.blankTexture=null,this.defaultCamera=new n(0,0,0,0),this._tempMatrix1=new f,this._tempMatrix2=new f,this._tempMatrix3=new f,this._tempMatrix4=new f,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.init(this.config)},init:function(t){var e,i=this.game,n=this.canvas,s=t.backgroundColor;if(!(e=i.config.context?i.config.context:n.getContext("webgl",t.contextCreation)||n.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var r=this;this.contextLostHandler=function(t){r.contextLost=!0,r.game.events.emit(a.CONTEXT_LOST,r),t.preventDefault()},this.contextRestoredHandler=function(){r.contextLost=!1,r.init(r.config),r.game.events.emit(a.CONTEXT_RESTORED,r)},n.addEventListener("webglcontextlost",this.contextLostHandler,!1),n.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var h=0;h<=27;h++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var l=e.getSupportedExtensions();t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE));var u="WEBGL_compressed_texture_",c="WEBKIT_"+u;this.compression.ETC1=e.getExtension(u+"etc1")||e.getExtension(c+"etc1"),this.compression.PVRTC=e.getExtension(u+"pvrtc")||e.getExtension(c+"pvrtc"),this.compression.S3TC=e.getExtension(u+"s3tc")||e.getExtension(c+"s3tc"),this.supportedExtensions=l,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(s.redGL,s.greenGL,s.blueGL,s.alphaGL);for(var f=0;f0&&n>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==n}a&&(this.flush(),r.scissor(t,s-e-n,i,n))},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},setPipeline:function(t,e){return this.currentPipeline===t&&this.currentPipeline.vertexBuffer===this.currentVertexBuffer&&this.currentPipeline.program===this.currentProgram||(this.flush(),this.currentPipeline=t,this.currentPipeline.bind()),this.currentPipeline.onBind(e),this.currentPipeline},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},rebindPipeline:function(t){var e=this.gl;e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),this.hasActiveStencilMask()?e.clear(e.DEPTH_BUFFER_BIT):(e.disable(e.STENCIL_TEST),e.clear(e.DEPTH_BUFFER_BIT|e.STENCIL_BUFFER_BIT)),e.viewport(0,0,this.width,this.height),this.setBlendMode(0,!0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,this.blankTexture.glTexture),this.currentActiveTextureUnit=0,this.currentTextures[0]=this.blankTexture.glTexture,this.currentPipeline=t,this.currentPipeline.bind(),this.currentPipeline.onBind()},clearPipeline:function(){this.flush(),this.currentPipeline=null,this.currentProgram=null,this.currentVertexBuffer=null,this.currentIndexBuffer=null,this.setBlendMode(0,!0)},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(n.equation),n.func.length>2?i.blendFuncSeparate(n.func[0],n.func[1],n.func[2],n.func[3]):i.blendFunc(n.func[0],n.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(t){void 0===t&&(t=!1),!t&&0===this.currentActiveTextureUnit&&this.currentTextures[0]||this.setTexture2D(this.blankTexture.glTexture,0)},setTexture2D:function(t,e,i){void 0===i&&(i=!0);var n=this.gl;return t!==this.currentTextures[e]&&(i&&this.flush(),this.currentActiveTextureUnit!==e&&(n.activeTexture(n.TEXTURE0+e),this.currentActiveTextureUnit=e),n.bindTexture(n.TEXTURE_2D,t),this.currentTextures[e]=t),this},setFramebuffer:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.width,s=this.height;return t!==this.currentFramebuffer&&(t&&t.renderTexture?(n=t.renderTexture.width,s=t.renderTexture.height):this.flush(),i.bindFramebuffer(i.FRAMEBUFFER,t),i.viewport(0,0,n,s),e&&(t?(this.drawingBufferHeight=s,this.pushScissor(0,0,n,s)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t),this},setProgram:function(t){var e=this.gl;return t!==this.currentProgram&&(this.flush(),e.useProgram(t),this.currentProgram=t),this},setVertexBuffer:function(t){var e=this.gl;return t!==this.currentVertexBuffer&&(this.flush(),e.bindBuffer(e.ARRAY_BUFFER,t),this.currentVertexBuffer=t),this},setIndexBuffer:function(t){var e=this.gl;return t!==this.currentIndexBuffer&&(this.flush(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.currentIndexBuffer=t),this},createTextureFromSource:function(t,e,i,n){var s=this.gl,r=s.NEAREST,a=s.CLAMP_TO_EDGE;return e=t?t.width:e,i=t?t.height:i,h(e,i)&&(a=s.REPEAT),n===o.ScaleModes.LINEAR&&this.config.antialias&&(r=s.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,r,r,a,a,s.RGBA,t):this.createTexture2D(0,r,r,a,a,s.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,s,r,o,a,h,l,u,c){l=void 0===l||null===l||l,void 0===u&&(u=!1),void 0===c&&(c=!1);var d=this.gl,f=d.createTexture();return this.setTexture2D(f,0),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MIN_FILTER,e),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_MAG_FILTER,i),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_S,s),d.texParameteri(d.TEXTURE_2D,d.TEXTURE_WRAP_T,n),d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),null===o||void 0===o?d.texImage2D(d.TEXTURE_2D,t,r,a,h,0,r,d.UNSIGNED_BYTE,null):(u||(a=o.width,h=o.height),d.texImage2D(d.TEXTURE_2D,t,r,r,d.UNSIGNED_BYTE,o)),this.setTexture2D(null,0),f.isAlphaPremultiplied=l,f.isRenderTexture=!1,f.width=a,f.height=h,this.nativeTextures.push(f),f},createFramebuffer:function(t,e,i,n){var s,r=this.gl,o=r.createFramebuffer();if(this.setFramebuffer(o),n){var a=r.createRenderbuffer();r.bindRenderbuffer(r.RENDERBUFFER,a),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,i,0),(s=r.checkFramebufferStatus(r.FRAMEBUFFER))!==r.FRAMEBUFFER_COMPLETE){throw new Error("Framebuffer incomplete. Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[s])}return o.renderTexture=i,this.setFramebuffer(null),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),s=i.createShader(i.VERTEX_SHADER),r=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(s,t),i.shaderSource(r,e),i.compileShader(s),i.compileShader(r),!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Failed to compile Vertex Shader:\n"+i.getShaderInfoLog(s));if(!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Failed to compile Fragment Shader:\n"+i.getShaderInfoLog(r));if(i.attachShader(n,s),i.attachShader(n,r),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Failed to link program:\n"+i.getProgramInfoLog(n));return n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setVertexBuffer(n),i.bufferData(i.ARRAY_BUFFER,t,e),this.setVertexBuffer(null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return this.setIndexBuffer(n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),this.setIndexBuffer(null),n},deleteTexture:function(t){var e=this.nativeTextures.indexOf(t);return-1!==e&&c(this.nativeTextures,e),this.gl.deleteTexture(t),this.currentTextures[0]!==t||this.game.pendingDestroy||this.setBlankTexture(!0),this},deleteFramebuffer:function(t){return this.gl.deleteFramebuffer(t),this},deleteProgram:function(t){return this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t._cx,i=t._cy,n=t._cw,r=t._ch,o=this.pipelines.TextureTintPipeline,a=t.backgroundColor;if(t.renderToTexture){this.flush(),this.pushScissor(e,i,n,-r),this.setFramebuffer(t.framebuffer);var h=this.gl;h.clearColor(0,0,0,0),h.clear(h.COLOR_BUFFER_BIT),o.projOrtho(e,n+e,i,r+i,-1e3,1e3),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n+e,r+i,p.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL),t.emit(s.PRE_RENDER,t)}else this.pushScissor(e,i,n,r),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),a.alphaGL>0&&o.drawFillRect(e,i,n,r,p.getTintFromFloats(a.redGL,a.greenGL,a.blueGL,1),a.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=this.pipelines.TextureTintPipeline;if(t.flashEffect.postRenderWebGL(e,p.getTintFromFloats),t.fadeEffect.postRenderWebGL(e,p.getTintFromFloats),t.dirty=!1,this.popScissor(),t.renderToTexture){e.flush(),this.setFramebuffer(null),t.emit(s.POST_RENDER,t),e.projOrtho(0,e.width,e.height,0,-1e3,1e3);var i=p.getTintAppendFloatAlpha;(t.pipeline?t.pipeline:e).batchTexture(t,t.glTexture,t.width,t.height,t.x,t.y,t.width,t.height,t.zoom,t.zoom,t.rotation,t.flipX,!t.flipY,1,1,0,0,0,0,t.width,t.height,i(t._tintTL,t._alphaTL),i(t._tintTR,t._alphaTR),i(t._tintBL,t._alphaBL),i(t._tintBR,t._alphaBR),t._isTinted&&t.tintFill,0,0,this.defaultCamera,null),this.setBlankTexture(!0)}t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera))},preRender:function(){if(!this.contextLost){var t=this.gl,e=this.pipelines;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var i=this.config.backgroundColor;t.clearColor(i.redGL,i.greenGL,i.blueGL,i.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}for(var n in t.enable(t.SCISSOR_TEST),e)e[n].onPreRender();this.currentScissor=[0,0,this.width,this.height],this.scissorStack=[this.currentScissor],this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.setPipeline(this.pipelines.TextureTintPipeline)}},render:function(t,e,i,n){if(!this.contextLost){var s=e.list,r=s.length,a=this.pipelines;for(var h in a)a[h].onRender(t,n);if(this.preRenderCamera(n),0===r)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(n);this.currentType="";for(var l=this.currentMask,u=0;u0&&r>0&&(this.setTexture2D(e,0),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.width=s,e.height=r,this.setTexture2D(null,0)),e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=this.gl,s=t.videoWidth,r=t.videoHeight,o=n.CLAMP_TO_EDGE;!e&&h(s,r)&&(o=n.REPEAT);var a=this.config.antialias?n.LINEAR:n.NEAREST;return this.createTexture2D(0,a,a,o,o,n.RGBA,t,s,r,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var n=this.gl,s=t.videoWidth,r=t.videoHeight;return s>0&&r>0&&(this.setTexture2D(e,0),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.width=s,e.height=r,this.setTexture2D(null,0)),e},setTextureFilter:function(t,e){var i=this.gl,n=[i.LINEAR,i.NEAREST][e];return this.setTexture2D(t,0),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,n),this.setTexture2D(null,0),this},setFloat1:function(t,e,i){return this.setProgram(t),this.gl.uniform1f(this.gl.getUniformLocation(t,e),i),this},setFloat2:function(t,e,i,n){return this.setProgram(t),this.gl.uniform2f(this.gl.getUniformLocation(t,e),i,n),this},setFloat3:function(t,e,i,n,s){return this.setProgram(t),this.gl.uniform3f(this.gl.getUniformLocation(t,e),i,n,s),this},setFloat4:function(t,e,i,n,s,r){return this.setProgram(t),this.gl.uniform4f(this.gl.getUniformLocation(t,e),i,n,s,r),this},setFloat1v:function(t,e,i){return this.setProgram(t),this.gl.uniform1fv(this.gl.getUniformLocation(t,e),i),this},setFloat2v:function(t,e,i){return this.setProgram(t),this.gl.uniform2fv(this.gl.getUniformLocation(t,e),i),this},setFloat3v:function(t,e,i){return this.setProgram(t),this.gl.uniform3fv(this.gl.getUniformLocation(t,e),i),this},setFloat4v:function(t,e,i){return this.setProgram(t),this.gl.uniform4fv(this.gl.getUniformLocation(t,e),i),this},setInt1:function(t,e,i){return this.setProgram(t),this.gl.uniform1i(this.gl.getUniformLocation(t,e),i),this},setInt2:function(t,e,i,n){return this.setProgram(t),this.gl.uniform2i(this.gl.getUniformLocation(t,e),i,n),this},setInt3:function(t,e,i,n,s){return this.setProgram(t),this.gl.uniform3i(this.gl.getUniformLocation(t,e),i,n,s),this},setInt4:function(t,e,i,n,s,r){return this.setProgram(t),this.gl.uniform4i(this.gl.getUniformLocation(t,e),i,n,s,r),this},setMatrix2:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix2fv(this.gl.getUniformLocation(t,e),i,n),this},setMatrix3:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix3fv(this.gl.getUniformLocation(t,e),i,n),this},setMatrix4:function(t,e,i,n){return this.setProgram(t),this.gl.uniformMatrix4fv(this.gl.getUniformLocation(t,e),i,n),this},getMaxTextures:function(){return this.config.maxTextures},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){for(var t=0;t0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,n=Math.cos(i),s=Math.sin(i);e[1]=s,e[3]=-s,e[0]=e[4]=n}else e[0]=e[4]=1,e[1]=e[3]=0;this.renderer.setMatrix3(this.program,"uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},batchSprite:function(t,e,i){if(this.active){var n=t.texture.dataSource[t.frame.sourceIndex];n&&(this.renderer.setPipeline(this),this.setTexture2D(n.glTexture,1),this.setNormalMapRotation(t.rotation),r.prototype.batchSprite.call(this,t,e,i))}}});a.LIGHT_COUNT=o,t.exports=a},function(t,e){var i={modelMatrixDirty:!1,viewMatrixDirty:!1,projectionMatrixDirty:!1,modelMatrix:null,viewMatrix:null,projectionMatrix:null,mvpInit:function(){return this.modelMatrixDirty=!0,this.viewMatrixDirty=!0,this.projectionMatrixDirty=!0,this.modelMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this},mvpUpdate:function(){var t=this.program;return this.modelMatrixDirty&&(this.renderer.setMatrix4(t,"uModelMatrix",!1,this.modelMatrix),this.modelMatrixDirty=!1),this.viewMatrixDirty&&(this.renderer.setMatrix4(t,"uViewMatrix",!1,this.viewMatrix),this.viewMatrixDirty=!1),this.projectionMatrixDirty&&(this.renderer.setMatrix4(t,"uProjectionMatrix",!1,this.projectionMatrix),this.projectionMatrixDirty=!1),this},modelIdentity:function(){var t=this.modelMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.modelMatrixDirty=!0,this},modelScale:function(t,e,i){var n=this.modelMatrix;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this.modelMatrixDirty=!0,this},modelTranslate:function(t,e,i){var n=this.modelMatrix;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this.modelMatrixDirty=!0,this},modelRotateX:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this.modelMatrixDirty=!0,this},modelRotateY:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this.modelMatrixDirty=!0,this},modelRotateZ:function(t){var e=this.modelMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this.modelMatrixDirty=!0,this},viewIdentity:function(){var t=this.viewMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.viewMatrixDirty=!0,this},viewScale:function(t,e,i){var n=this.viewMatrix;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this.viewMatrixDirty=!0,this},viewTranslate:function(t,e,i){var n=this.viewMatrix;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this.viewMatrixDirty=!0,this},viewRotateX:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[4],r=e[5],o=e[6],a=e[7],h=e[8],l=e[9],u=e[10],c=e[11];return e[4]=s*n+h*i,e[5]=r*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-s*i,e[9]=l*n-r*i,e[10]=u*n-o*i,e[11]=c*n-a*i,this.viewMatrixDirty=!0,this},viewRotateY:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[8],l=e[9],u=e[10],c=e[11];return e[0]=s*n-h*i,e[1]=r*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=s*i+h*n,e[9]=r*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*n,this.viewMatrixDirty=!0,this},viewRotateZ:function(t){var e=this.viewMatrix,i=Math.sin(t),n=Math.cos(t),s=e[0],r=e[1],o=e[2],a=e[3],h=e[4],l=e[5],u=e[6],c=e[7];return e[0]=s*n+h*i,e[1]=r*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-s*i,e[5]=l*n-r*i,e[6]=u*n-o*i,e[7]=c*n-a*i,this.viewMatrixDirty=!0,this},viewLoad2D:function(t){var e=this.viewMatrix;return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=0,e[4]=t[2],e[5]=t[3],e[6]=0,e[7]=0,e[8]=t[4],e[9]=t[5],e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this.viewMatrixDirty=!0,this},viewLoad:function(t){var e=this.viewMatrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],this.viewMatrixDirty=!0,this},projIdentity:function(){var t=this.projectionMatrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this.projectionMatrixDirty=!0,this},projOrtho:function(t,e,i,n,s,r){var o=this.projectionMatrix,a=1/(t-e),h=1/(i-n),l=1/(s-r);return o[0]=-2*a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=-2*h,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2*l,o[11]=0,o[12]=(t+e)*a,o[13]=(n+i)*h,o[14]=(r+s)*l,o[15]=1,this.projectionMatrixDirty=!0,this},projPersp:function(t,e,i,n){var s=this.projectionMatrix,r=1/Math.tan(t/2),o=1/(i-n);return s[0]=r/e,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=r,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=(n+i)*o,s[11]=-1,s[12]=0,s[13]=0,s[14]=2*n*i*o,s[15]=0,this.projectionMatrixDirty=!0,this}};t.exports=i},function(t,e,i){t.exports={Bounce:i(1398),Collision:i(1399),Force:i(1400),Friction:i(1401),Gravity:i(1402),Mass:i(1403),Static:i(1404),Sensor:i(1405),SetBody:i(1406),Sleep:i(1407),Transform:i(1420),Velocity:i(1421)}},function(t,e){var i={};t.exports=i,i.create=function(t,e){var n=t.bodyA,s=t.bodyB,r={id:i.id(n,s),bodyA:n,bodyB:s,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||s.isSensor,timeCreated:e,timeUpdated:e,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return i.update(r,t,e),r},i.update=function(t,e,n){if(t.collision=e,e.collided){var s=e.supports,r=t.activeContacts,o=e.parentA,a=e.parentB;t.inverseMass=o.inverseMass+a.inverseMass,t.friction=Math.min(o.friction,a.friction),t.frictionStatic=Math.max(o.frictionStatic,a.frictionStatic),t.restitution=Math.max(o.restitution,a.restitution),t.slop=Math.max(o.slop,a.slop);for(var h=0;h>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,s=0;s>16)+(65280&t)+((255&t)<<16)},n={_tintTL:16777215,_tintTR:16777215,_tintBL:16777215,_tintBR:16777215,_isTinted:!1,tintFill:!1,clearTint:function(){return this.setTint(16777215),this._isTinted=!1,this},setTint:function(t,e,n,s){return void 0===t&&(t=16777215),void 0===e&&(e=t,n=t,s=t),this._tintTL=i(t),this._tintTR=i(e),this._tintBL=i(n),this._tintBR=i(s),this._isTinted=!0,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tintTopLeft:{get:function(){return this._tintTL},set:function(t){this._tintTL=i(t),this._isTinted=!0}},tintTopRight:{get:function(){return this._tintTR},set:function(t){this._tintTR=i(t),this._isTinted=!0}},tintBottomLeft:{get:function(){return this._tintBL},set:function(t){this._tintBL=i(t),this._isTinted=!0}},tintBottomRight:{get:function(){return this._tintBR},set:function(t){this._tintBR=i(t),this._isTinted=!0}},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this._isTinted}}};t.exports=n},function(t,e){t.exports="changedata"},function(t,e){t.exports="changedata-"},function(t,e){t.exports="removedata"},function(t,e){t.exports="setdata"},function(t,e){t.exports="destroy"},function(t,e){t.exports="complete"},function(t,e){t.exports="created"},function(t,e){t.exports="error"},function(t,e){t.exports="loop"},function(t,e){t.exports="play"},function(t,e){t.exports="seeked"},function(t,e){t.exports="seeking"},function(t,e){t.exports="stop"},function(t,e){t.exports="timeout"},function(t,e){t.exports="unlocked"},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"alpha",e,i,s,r)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"x",e,i,s,r)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r,o,a){return void 0!==i&&null!==i||(i=e),n(t,"x",e,s,o,a),n(t,"y",i,r,o,a)}},function(t,e,i){var n=i(34);t.exports=function(t,e,i,s,r){return n(t,"y",e,i,s,r)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var s=i,r=(n-i)/t.length,o=0;o0?s(o,i):i<0&&r(o,Math.abs(i));for(var a=0;a1)if(0===s){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.001&&(e.zoom=.001))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=r},function(t,e,i){t.exports={Camera:i(274),BaseCamera:i(91),CameraManager:i(669),Effects:i(282),Events:i(48)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(22),s=i(0),r=i(48),o=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===s&&(s=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=s,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?r.FADE_OUT_START:r.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,n,s),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed=1?1:1/e*(1+(e*t|0))}},function(t,e,i){var n=i(22),s=i(0),r=i(48),o=i(3),a=new s({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,s){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===s&&(s=this.camera.scene),!i&&this.isRunning?this.camera:(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=s,this.camera.emit(r.SHAKE_START,this.camera,this,t,e),this.camera)},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed0&&(o.preRender(1),t.render(n,e,i,o))}},resetAll:function(){for(var t=0;t1)for(var i=1;i=1)&&(s.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(s.mspointer=!0),navigator.getGamepads&&(s.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?s.wheelEvent="wheel":"onmousewheel"in window?s.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(s.wheelEvent="DOMMouseScroll"),s)},function(t,e,i){var n=i(115),s={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){s.audioData=!!window.Audio,s.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(s.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(s.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(s.mp3=!0),t.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(s.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(s.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(s.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(n.edge)s.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),r=parseInt(RegExp.$2,10);(10===i&&r>=11||i>10)&&(s.dolby=!0)}}catch(t){}return s}()},function(t,e){var i={h264:!1,hls:!1,mp4:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264=!0,i.mp4=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hls=!0))}catch(t){}return i}()},function(t,e){var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){var t,e="Fullscreen",n="FullScreen",s=["request"+e,"request"+n,"webkitRequest"+e,"webkitRequest"+n,"msRequest"+e,"msRequest"+n,"mozRequest"+n,"mozRequest"+e];for(t=0;tMath.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){var n=i(299);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){var n=i(23);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e?t:(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e1?t[i]-(n(s-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(s-r,t[r?r-1:0],t[r],t[i1?n(t[i],t[i-1],i-s):n(t[r],t[r+1>i?i:r+1],s-r)}},function(t,e,i){var n=i(155);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){t.exports={GetNext:i(308),IsSize:i(116),IsValue:i(721)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){t.exports={Ceil:i(309),Floor:i(93),To:i(723)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},function(t,e,i){var n=new(i(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},function(t,e){t.exports=function(t){for(var e=0,i=0;i1?void 0!==n?(s=(n-t)/(n-i))<0&&(s=0):s=1:s<0&&(s=0),s}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,s=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*s,t.y=Math.sin(i)*s,t.z=n*e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var s=[],r=[],o=0;o0&&t<=e*i&&(r=t>e-1?t-(o=Math.floor(t/e))*e:t,s.set(r,o)),s}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){var n=i(171),s=i(316),r=i(317),o=new s,a=new r,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e){t.exports="addtexture"},function(t,e){t.exports="onerror"},function(t,e){t.exports="onload"},function(t,e){t.exports="ready"},function(t,e){t.exports="removetexture"},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_FORWARD_DIFFUSE_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.rgb * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);"," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.rgb * outTint.a, outTint.a);"," vec4 color = texture;",""," if (outTintEffect == 0.0)"," {"," // Multiply texture tint"," color = texture * texel;"," }"," else if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.rgb * outTint.a, texture.a);"," color.a = texture.a * texel.a;"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_TEXTURE_TINT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform mat4 uModelMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * uViewMatrix * uModelMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}","",""].join("\n")},function(t,e,i){t.exports={GenerateTexture:i(324),Palettes:i(754)}},function(t,e,i){t.exports={ARNE16:i(325),C64:i(755),CGA:i(756),JMP:i(757),MSX:i(758)}},function(t,e){t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e){t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e,i){t.exports={Path:i(760),CubicBezier:i(326),Curve:i(80),Ellipse:i(327),Line:i(328),QuadraticBezier:i(329),Spline:i(330)}},function(t,e,i){var n=i(0),s=i(326),r=i(327),o=i(5),a=i(328),h=i(761),l=i(329),u=i(11),c=i(330),d=i(3),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,r,o){var a,h,l,u=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(r,o),l=new d(t,e)),this.add(new s(u,a,h,l))},quadraticBezierTo:function(t,e,i,n){var s,r,o=this.getEndPoint();return t instanceof d?(s=t,r=e):(s=new d(i,n),r=new d(t,e)),this.add(new l(o,s,r))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),s=0;s=i){var r=n[s]-i,o=this.curves[s],a=o.getLength(),h=0===a?0:1-r/a;return o.getPointAt(h,e)}s++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new c(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e,i){var n=i(33),s=i(334);t.exports=function(t,e,i){var r=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;r=s(l,h,t+1/3),o=s(l,h,t),a=s(l,h,t-1/3)}return(new n).setGLTo(r,o,a,1)}},function(t,e,i){var n=i(161);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],s=0;s<=359;s++)i.push(n(s/359,t,e));return i}},function(t,e,i){var n=i(113),s=function(t,e,i,s,r,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:n(t,s,l),g:n(e,r,l),b:n(i,o,l)}};t.exports={RGBWithRGB:s,ColorWithRGB:function(t,e,i,n,r,o){return void 0===r&&(r=100),void 0===o&&(o=0),s(t.r,t.g,t.b,e,i,n,r,o)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),s(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){var n=i(169),s=i(33);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new s(n(t,e),n(t,e),n(t,e))}},function(t,e,i){var n=i(333);t.exports=function(t,e,i,s,r){return void 0===s&&(s=255),void 0===r&&(r="#"),"#"===r?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+n(s)+n(t)+n(e)+n(i)}},function(t,e,i){t.exports={BitmapMask:i(259),GeometryMask:i(260)}},function(t,e,i){var n={AddToDOM:i(118),DOMContentLoaded:i(335),GetScreenOrientation:i(336),GetTarget:i(341),ParseXML:i(342),RemoveFromDOM:i(175),RequestAnimationFrame:i(322)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(795)}},function(t,e,i){var n=i(0),s=i(9),r=i(20),o=new n({Extends:s,initialize:function(){s.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});r.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){var n=i(118),s=i(270),r=i(273),o=i(25),a=i(0),h=i(295),l=i(797),u=i(318),c=i(111),d=i(320),f=i(296),p=i(335),g=i(9),v=i(17),m=i(343),y=i(20),x=i(348),T=i(349),w=i(351),b=i(117),E=i(354),S=i(321),_=i(323),A=i(358),C=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new g,this.anims=new s(this),this.textures=new E(this),this.cache=new r(this),this.registry=new c(this),this.input=new m(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=f,this.scale=new T(this,this.config),this.sound=null,this.sound=A.create(this),this.loop=new S(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,p(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),u(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(b.READY,this.texturesReady,this),this.events.emit(v.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(v.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),_(this);var t=this.events;t.on(v.HIDDEN,this.onHidden,this),t.on(v.VISIBLE,this.onVisible,this),t.on(v.BLUR,this.onBlur,this),t.on(v.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(v.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(v.POST_RENDER,n,t,e)},headlessStep:function(t,e){var i=this.events;i.emit(v.PRE_STEP,t,e),i.emit(v.STEP,t,e),this.scene.update(t,e),i.emit(v.POST_STEP,t,e),i.emit(v.PRE_RENDER),i.emit(v.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(v.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(v.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.events.emit(v.DESTROY),this.events.removeAllListeners(),this.scene.destroy(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=C},function(t,e,i){var n=i(118);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===e?n.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){t.exports="start"},function(t,e,i){var n=i(2),s=i(178);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var r=[];if(e&&r.push(s(e+"Physics")),i)for(var o in i)o=s(o.concat("Physics")),-1===r.indexOf(o)&&r.push(o);return r}}},function(t,e,i){var n=i(2);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){t.exports={game:"game",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var s,r=i.getElementsByTagName("SubTexture"),o=0;og||c<-g)&&(c=0),c<0&&(c=g+c),-1!==d&&(g=c+(d+1));for(var v=f,m=f,y=0,x=0,T=0;Tr&&(y=w-r),b>o&&(x=b-o),t.add(T,e,i+v,s+m,h-y,l-x),(v+=h+p)+h>r&&(v=f,m+=l+p)}return t}},function(t,e,i){var n=i(2);t.exports=function(t,e,i){var s=n(i,"frameWidth",null),r=n(i,"frameHeight",s);if(!s)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=n(i,"startFrame",0),l=n(i,"endFrame",-1),u=n(i,"margin",0),c=n(i,"spacing",0),d=e.cutX,f=e.cutY,p=e.cutWidth,g=e.cutHeight,v=e.realWidth,m=e.realHeight,y=Math.floor((v-u+c)/(s+c)),x=Math.floor((m-u+c)/(r+c)),T=y*x,w=e.x,b=s-w,E=s-(v-p-w),S=e.y,_=r-S,A=r-(m-g-S);(h>T||h<-T)&&(h=0),h<0&&(h=T+h),-1!==l&&(T=h+(l+1));for(var C=u,M=u,P=0,O=e.sourceIndex,R=0;R0){var r=i-t.length;if(r<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(s,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>r&&(e.splice(r),o=r);for(var a=0;a0){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),s&&s.call(r,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),s&&s.call(r,l)}return e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i0){var n=t[i-1],s=t.indexOf(n);t[i]=n,t[s]=e}return t}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&it.length-1)throw new Error("Index out of bounds");var r=n(t,e);return i&&i.call(s,r),r}},function(t,e,i){var n=i(67);t.exports=function(t,e,i,s,r){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===r&&(r=t),n(t,e,i)){var o=i-e,a=t.splice(e,o);if(s)for(var h=0;h0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){var n=i(67);t.exports=function(t,e,i,s,r){if(void 0===s&&(s=0),void 0===r&&(r=t.length),n(t,s,r))for(var o=s;ov&&(r=v),o>m&&(o=m);var O=v+g.xAdvance,R=m+u;a_&&(_=C),C_&&(_=C),C0!=t>0,this._alpha=t}}});t.exports=r},function(t,e,i){var n=i(1),s=i(1);n=i(932),s=i(933),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){var r=e.list;if(0!==r.length){var o=e.localTransform;s?(o.loadIdentity(),o.multiply(s),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e.alphaTopLeft,l=e.alphaTopRight,u=e.alphaBottomLeft,c=e.alphaBottomRight,d=e.scrollFactorX,f=e.scrollFactorY,p=r,g=r.length,v=0;v0||e.cropHeight>0;l&&(h.flush(),t.pushScissor(e.x,e.y,e.cropWidth*e.scaleX,e.cropHeight*e.scaleY));var u=h._tempMatrix1,c=h._tempMatrix2,d=h._tempMatrix3,f=h._tempMatrix4;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(s.matrix),r?(u.multiplyWithOffset(r,-s.scrollX*e.scrollFactorX,-s.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d)):(c.e-=s.scrollX*e.scrollFactorX,c.f-=s.scrollY*e.scrollFactorY,u.multiply(c,d));var p=e.frame,g=p.glTexture,v=p.cutX,m=p.cutY,y=g.width,x=g.height,T=e._isTinted&&e.tintFill,w=n.getTintAppendFloatAlpha(e._tintTL,s.alpha*e._alphaTL),b=n.getTintAppendFloatAlpha(e._tintTR,s.alpha*e._alphaTR),E=n.getTintAppendFloatAlpha(e._tintBL,s.alpha*e._alphaBL),S=n.getTintAppendFloatAlpha(e._tintBR,s.alpha*e._alphaBR);h.setTexture2D(g,0);var _,A,C=0,M=0,P=0,O=0,R=e.letterSpacing,L=0,D=0,k=0,F=0,I=e.scrollX,B=e.scrollY,N=e.fontData,Y=N.chars,X=N.lineHeight,z=e.fontSize/N.size,U=0,G=e._align,W=0,V=0;e.getTextBounds(!1);var H=e._bounds.lines;1===G?V=(H.longest-H.lengths[0])/2:2===G&&(V=H.longest-H.lengths[0]);for(var j=s.roundPixels,q=e.displayCallback,K=e.callbackData,J=0;J0&&e.cropHeight>0&&(h.beginPath(),h.rect(0,0,e.cropWidth,e.cropHeight),h.clip());for(var N=0;N0&&(Y=Y%b-b):Y>b?Y=b:Y<0&&(Y=b+Y%b),null===A&&(A=new o(F+Math.cos(N)*B,I+Math.sin(N)*B,v),E.push(A),k+=.01);k<1+z;)w=Y*k+N,x=F+Math.cos(w)*B,T=I+Math.sin(w)*B,A.points.push(new r(x,T,v)),k+=.01;w=Y+N,x=F+Math.cos(w)*B,T=I+Math.sin(w)*B,A.points.push(new r(x,T,v));break;case n.FILL_RECT:u.setTexture2D(M),u.batchFillRect(p[++P],p[++P],p[++P],p[++P],f,c);break;case n.FILL_TRIANGLE:u.setTexture2D(M),u.batchFillTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],f,c);break;case n.STROKE_TRIANGLE:u.setTexture2D(M),u.batchStrokeTriangle(p[++P],p[++P],p[++P],p[++P],p[++P],p[++P],v,f,c);break;case n.LINE_TO:null!==A?A.points.push(new r(p[++P],p[++P],v)):(A=new o(p[++P],p[++P],v),E.push(A));break;case n.MOVE_TO:A=new o(p[++P],p[++P],v),E.push(A);break;case n.SAVE:a.push(f.copyToArray());break;case n.RESTORE:f.copyFromArray(a.pop());break;case n.TRANSLATE:F=p[++P],I=p[++P],f.translate(F,I);break;case n.SCALE:F=p[++P],I=p[++P],f.scale(F,I);break;case n.ROTATE:f.rotate(p[++P]);break;case n.SET_TEXTURE:var U=p[++P],G=p[++P];u.currentFrame=U,u.setTexture2D(U.glTexture,0),u.tintEffect=G,M=U.glTexture;break;case n.CLEAR_TEXTURE:u.currentFrame=t.blankTexture,u.tintEffect=2,M=t.blankTexture.glTexture}}}},function(t,e,i){var n=i(1),s=i(1);n=i(945),s=i(946),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(1),s=i(1);n=i(948),s=i(949),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e){t.exports=function(t,e,i,n,s){this.pipeline.batchSprite(e,n,s)}},function(t,e){t.exports=function(t,e,i,n,s){t.batchSprite(e,e.frame,n,s)}},function(t,e,i){t.exports={GravityWell:i(378),Particle:i(379),ParticleEmitter:i(380),ParticleEmitterManager:i(191),Zones:i(955)}},function(t,e,i){var n=i(0),s=i(310),r=i(82),o=i(2),a=i(57),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if("number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&(this.has(t,"random")||this.hasBoth(t,"start","end")||this.hasBoth(t,"min","max"))){this.start=this.has(t,"start")?t.start:t.min,this.end=this.has(t,"end")?t.end:t.max;var i=this.hasBoth(t,"min","max")||!!t.random;if(i){var n=t.random;Array.isArray(n)&&(this.start=n[0],this.end=n[1]),this.onEmit=this.randomRangedValueEmit}if(this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var s=this.has(t,"ease")?t.ease:"Linear";this.ease=r(s),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=s(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){var n=i(1),s=i(1);n=i(953),s=i(954),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){var o=e.emitters.list,a=o.length;if(0!==a){var h=this.pipeline,l=h._tempMatrix1.copyFrom(s.matrix),u=h._tempMatrix2,c=h._tempMatrix3,d=h._tempMatrix4.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);l.multiply(d),t.setPipeline(h);var f=s.roundPixels,p=e.defaultFrame.glTexture,g=n.getTintAppendFloatAlphaAndSwap;h.setTexture2D(p,0);for(var v=0;v?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){var n=i(6);t.exports=function(t,e){var i=e.width,s=e.height,r=Math.floor(i/2),o=Math.floor(s/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=n(e,"offset.x",0),u=n(e,"offset.y",0),c=n(e,"spacing.x",0),d=n(e,"spacing.y",0),f=n(e,"lineSpacing",0),p=n(e,"charsPerRow",null);null===p&&(p=t.sys.textures.getFrame(h).width/i)>a.length&&(p=a.length);for(var g=l,v=u,m={retroFont:!0,font:h,size:i,lineHeight:s+f,chars:{}},y=0,x=0;x0&&r.maxLines1&&(d+=f*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:f,lineHeight:c}}},function(t,e,i){var n=i(1),s=i(1);n=i(964),s=i(965),t.exports={renderWebGL:n,renderCanvas:s}},function(t,e,i){var n=i(10);t.exports=function(t,e,i,s,r){if(0!==e.width&&0!==e.height){var o=e.frame,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha;this.pipeline.batchTexture(e,o.glTexture,a,h,e.x,e.y,a/e.style.resolution,h/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e._tintTL,s.alpha*e._alphaTL),l(e._tintTR,s.alpha*e._alphaTR),l(e._tintBL,s.alpha*e._alphaBL),l(e._tintBR,s.alpha*e._alphaBR),e._isTinted&&e.tintFill,0,0,s,r)}}},function(t,e){t.exports=function(t,e,i,n,s){0!==e.width&&0!==e.height&&t.batchSprite(e,e.frame,n,s)}},function(t,e,i){var n=i(0),s=i(14),r=i(6),o=i(967),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this._font,this.setStyle(e,!1,!0);var i=r(e,"metrics",!1);this.metrics=i?{ascent:r(i,"ascent",0),descent:r(i,"descent",0),fontSize:r(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?r(t,a[n][0],o):s(t,a[n][0],o)}var h=r(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=r(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,n="",s="";if("string"!=typeof t)i=r(t,"fontFamily","Courier"),n=r(t,"fontSize","16px"),s=r(t,"fontStyle","");else{var o=t.split(" "),a=0;s=o.length>2?o[a++]:"",n=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&s===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=s,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,s,r){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===s&&(s=!1),void 0===r&&(r=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=s,this.shadowFill=r,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){var n=i(25);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var s=Math.ceil(i.measureText(t.testString).width*t.baselineX),r=s,o=2*r;r=r*t.baselineY|0,e.width=s,e.height=o,i.fillStyle="#f00",i.fillRect(0,0,s,o),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,r);var a={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,s,o))return a.ascent=r,a.descent=r+6,a.fontSize=a.ascent+a.descent,n.remove(e),a;var h,l,u=i.getImageData(0,0,s,o).data,c=u.length,d=4*s,f=0,p=!1;for(h=0;hr;h--){for(l=0;l0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.fillColor,e.fillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0)for(u=o.fillTint,c=n.getTintAppendFloatAlphaAndSwap(e.altFillColor,e.altFillAlpha*d),u.TL=c,u.TR=c,u.BL=c,u.BR=c,C=0;C0){var R=o.strokeTint,L=n.getTintAppendFloatAlphaAndSwap(e.outlineFillColor,e.outlineFillAlpha*d);for(R.TL=L,R.TR=L,R.BL=L,R.BR=L,A=1;A0)for(n(h,e),A=0;A0)for(n(h,e,e.altFillColor,e.altFillAlpha*c),A=0;A0){for(s(h,e,e.outlineFillColor,e.outlineFillAlpha*c),_=1;_o.vertexCapacity&&o.flush(),o.setTexture2D(u,0);for(var m=o.vertexViewF32,y=o.vertexViewU32,x=o.vertexCount*o.vertexComponentCount-1,T=0,w=e.tintFill,b=0;b0?Math.PI*t.radius*t.radius:0}},function(t,e,i){var n=i(78);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e,i){var n=i(54);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(54);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e,i){var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(95);n.Area=i(1073),n.Circumference=i(376),n.CircumferencePoint=i(190),n.Clone=i(1074),n.Contains=i(96),n.ContainsPoint=i(1075),n.ContainsRect=i(1076),n.CopyFrom=i(1077),n.Equals=i(1078),n.GetBounds=i(1079),n.GetPoint=i(374),n.GetPoints=i(375),n.Offset=i(1080),n.OffsetPoint=i(1081),n.Random=i(152),t.exports=n},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(95);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(96);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(96);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){var n=i(11);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){var n=i(4),s=i(408);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,f=e.y,p=e.radius;if(u===f)0==(a=(o=-2*f)*o-4*(r=1)*(d*d+(h=(p*p-c*c-d*d+l*l)/(2*(l-d)))*h-2*d*h+f*f-p*p))?i.push(new n(h,-o/(2*r))):a>0&&(i.push(new n(h,(-o+Math.sqrt(a))/(2*r))),i.push(new n(h,(-o-Math.sqrt(a))/(2*r))));else{var g=(l-d)/(u-f),v=(p*p-c*c-d*d+l*l-f*f+u*u)/(2*(u-f));0==(a=(o=2*u*g-2*v*g-2*l)*o-4*(r=g*g+1)*(l*l+u*u+v*v-c*c-2*u*v))?(h=-o/(2*r),i.push(new n(h,v-h*g))):a>0&&(h=(-o+Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)),h=(-o-Math.sqrt(a))/(2*r),i.push(new n(h,v-h*g)))}}return i}},function(t,e,i){var n=i(201),s=i(409);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();n(r,t,i),n(o,t,i),n(a,t,i),n(h,t,i)}return i}},function(t,e,i){var n=i(11),s=i(129);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e,i){var n=i(203),s=i(129);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();n(r,e,i),n(o,e,i),n(a,e,i),n(h,e,i)}return i}},function(t,e,i){var n=i(411),s=i(203);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(r,t,i),s(o,t,i),s(a,t,i)}return i}},function(t,e,i){var n=i(201),s=i(413);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e)){var r=t.getLineA(),o=t.getLineB(),a=t.getLineC();n(r,e,i),n(o,e,i),n(a,e,i)}return i}},function(t,e,i){var n=i(416),s=i(414);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var r=e.getLineA(),o=e.getLineB(),a=e.getLineC();s(t,r,i),s(t,o,i),s(t,a,i)}return i}},function(t,e,i){var n=i(418);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),s=Math.max(e.x1,e.x2),r=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=s&&t.y>=r&&t.y<=o}},function(t,e){t.exports=function(t,e,i,n,s,r){return void 0===r&&(r=0),!(e>t.right+r||it.bottom+r||si&&(i=h.x),h.xr&&(r=h.y),h.yn(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){var n=i(163);t.exports=function(t,e,i){var s=t.centerX,r=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),n(t,s,r)}},function(t,e,i){var n=i(11),s=i(129);t.exports=function(t,e,i){return void 0===i&&(i=new n),s(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,s=t.y,r=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){var n=i(4),s=i(35);t.exports=function(t,e,i){void 0===i&&(i=new n),e=s(e);var r=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=r>0?t.height/2:t.height/-2;return Math.abs(a*r)-1&&(s.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=s.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,n=this.manager,s=n.pointers,r=n.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,s=0;s0&&(n=!0)}return this._updatedThisFrame=!0,n},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,this.manager.resetCursor(i),t.input=null;var n=this._draggable.indexOf(t);return n>-1&&this._draggable.splice(n,1),(n=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(n,1),(n=this._over[0].indexOf(t))>-1&&this._over[0].splice(n,1),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,s}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,s=this._eventContainer;n.cancelled=!1;for(var r=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=s?i=!0:n>0&&e>=t.downTime+n&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold||0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],n=0;n0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var u=t.x-a.dragStartXGlobal,c=t.y-a.dragStartYGlobal,f=o.getParentRotation(),p=u*Math.cos(f)+c*Math.sin(f),g=c*Math.cos(f)-u*Math.sin(f);p*=1/o.parentContainer.scaleX,g*=1/o.parentContainer.scaleY,s=p+a.dragStartX,r=g+a.dragStartY}else s=t.x-a.dragX,r=t.y-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,s,r),this.emit(d.DRAG,t,o,s,r)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var r=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var s=this.manager,r=this._eventData,o=this._eventContainer;r.cancelled=!1;var a=!1;this.sortGameObjects(e);for(var h=0;h0){for(this.sortGameObjects(s),e=0;e0){for(this.sortGameObjects(r),e=0;e-1&&this._draggable.splice(s,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,s=!1,r=!1,o=!1,h=!1,l=!0;if(m(e)){var u=e;e=p(u,"hitArea",null),i=p(u,"hitAreaCallback",null),n=p(u,"draggable",!1),s=p(u,"dropZone",!1),r=p(u,"cursor",!1),o=p(u,"useHandCursor",!1),h=p(u,"pixelPerfect",!1);var c=p(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d=e}}},function(t,e,i){t.exports={Events:i(131),KeyboardManager:i(344),KeyboardPlugin:i(1194),Key:i(431),KeyCodes:i(120),KeyCombo:i(432),JustDown:i(1199),JustUp:i(1200),DownDuration:i(1201),UpDuration:i(1202)}},function(t,e){t.exports="keydown"},function(t,e){t.exports="keyup"},function(t,e){t.exports="keycombomatch"},function(t,e){t.exports="down"},function(t,e){t.exports="keydown-"},function(t,e){t.exports="keyup-"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),s=i(9),r=i(131),o=i(17),a=i(6),h=i(53),l=i(130),u=i(431),c=i(120),d=i(432),f=i(1198),p=i(93),g=new n({Extends:s,initialize:function(t){s.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.useQueue?this.sceneInputPlugin.pluginEvents.on(h.UPDATE,this.update,this):this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n={};if("string"==typeof t){t=t.split(",");for(var s=0;s-1?n[s]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),n[t]||(n[t]=new u(this,t),e&&this.addCapture(t),n[t].setEmitOnRepeat(i)),n[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,n=this.keys;if(t instanceof u){var s=n.indexOf(t);s>-1&&(i=this.keys[s],this.keys[s]=void 0)}else"string"==typeof t&&(t=c[t.toUpperCase()]);return n[t]&&(i=n[t],n[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(this.enabled&&t.isDown){var i=p(this.time-t.timeDown,e);if(i>t._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n0&&e.maxKeyDelay>0){var r=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=r&&(s=!0,i=n(t,e))}else s=!0,i=n(t,e);return!s&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e,i){var n=i(120),s={};for(var r in n)s[n[r]]=r;t.exports=s},function(t,e){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},function(t,e){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i'),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=s.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){r.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){r.revokeObjectURL(o.data),o.onProcessError()},r.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",function(t,e,i,n,s){if(Array.isArray(t))for(var r=0;r0},isLoading:function(){return this.state===s.LOADER_LOADING||this.state===s.LOADER_PROCESSING},isReady:function(){return this.state===s.LOADER_IDLE||this.state===s.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=s.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(c.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===s.LOADER_LOADING&&this.list.size>0&&this.inflight.sizei&&(n=t,i=e)}),n},moveTo:function(t,e,i,n,s){void 0===n&&(n=60),void 0===s&&(s=0);var o=Math.atan2(i-t.y,e-t.x);return s>0&&(n=r(t.x,t.y,e,i)/(s/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(s(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,n,s,r){return u(this.world,t,e,i,n,s,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(d.UPDATE,this.world.update,this.world),t.off(d.POST_UPDATE,this.world.postUpdate,this.world),t.off(d.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(d.START,this.start,this),this.scene=null,this.systems=null}});c.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){var i={enableBody:function(t,e,i,n,s){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),s&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){t.exports=function(t,e,i,n,s,r,o){void 0===r&&(r=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+n,l.maxY=i+s,o&&(h=t.staticTree.search(l)),r&&t.useTree)a=t.tree.search(l);else if(r){var u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+n,bottom:i+s,isCircle:!1},d=t.intersects;u.iterate(function(t){d(t,c)&&a.push(t)})}return h.concat(a)}},function(t,e){t.exports="collide"},function(t,e){t.exports="overlap"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="tilecollide"},function(t,e){t.exports="tileoverlap"},function(t,e){t.exports="worldbounds"},function(t,e){t.exports="worldstep"},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e,i){var n=i(1256),s=i(1258),r=i(448);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=o.top,d=o.right,f=o.bottom,p=i.faceLeft||i.faceRight,g=i.faceTop||i.faceBottom;if(l||(p=!0,g=!0),!p&&!g)return!1;var v=0,m=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX()0&&u&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>r&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){var n=i(1259);t.exports=function(t,e,i,s,r,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y0&&u&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>r&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){var n=i(445);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.x,a=e.velocity.x;if(t.immovable||e.immovable)t.immovable?(e.x+=r,e.velocity.x=o-a*e.bounce.x,t.moves&&(e.y+=(t.y-t.prev.y)*t.friction.y)):(t.x-=r,t.velocity.x=a-o*t.bounce.x,e.moves&&(t.y+=(e.y-e.prev.y)*e.friction.y));else{r*=.5,t.x-=r,e.x+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.x=u+h*t.bounce.x,e.velocity.x=u+l*e.bounce.x}return!0}},function(t,e,i){var n=i(446);t.exports=function(t,e,i,s){var r=n(t,e,i,s);if(i||0===r||t.immovable&&e.immovable||t.customSeparateY||e.customSeparateY)return 0!==r||t.embedded&&e.embedded;var o=t.velocity.y,a=e.velocity.y;if(t.immovable||e.immovable)t.immovable?(e.y+=r,e.velocity.y=o-a*e.bounce.y,t.moves&&(e.x+=(t.x-t.prev.x)*t.friction.x)):(t.y-=r,t.velocity.y=a-o*t.bounce.y,e.moves&&(t.x+=(e.x-e.prev.x)*e.friction.x));else{r*=.5,t.y-=r,e.y+=r;var h=Math.sqrt(a*a*e.mass/t.mass)*(a>0?1:-1),l=Math.sqrt(o*o*t.mass/e.mass)*(o>0?1:-1),u=.5*(h+l);h-=u,l-=u,t.velocity.y=u+h*t.bounce.y,e.velocity.y=u+l*e.bounce.y}return!0}},function(t,e,i){t.exports={COLLIDE:i(1376),PAUSE:i(1377),RESUME:i(1378)}},function(t,e,i){t.exports={Acceleration:i(1380),BodyScale:i(1381),BodyType:i(1382),Bounce:i(1383),CheckAgainst:i(1384),Collides:i(1385),Debug:i(1386),Friction:i(1387),Gravity:i(1388),Offset:i(1389),SetGameObject:i(1390),Velocity:i(1391)}},function(t,e,i){var n={};t.exports=n;var s=i(101),r=i(37);n.fromVertices=function(t){for(var e={},i=0;i0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,s=e.y+e.height/2,r=n.rectangle(i,s,e.width,e.height,t);return this.setBody(r,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),h(t,"isStatic")||(t.isStatic=!0),h(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,r=this.tile.getLeft(),o=this.tile.getTop(),u=this.tile.getCollisionGroup(),c=a(u,"objects",[]),d=[],f=0;f1&&(t.parts=d,this.setBody(s.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0}});t.exports=u},function(t,e,i){var n={};t.exports=n;var s=i(1268),r=i(492),o=i(102);n.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l1?1:0;d1?1:0;p0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n={};t.exports=n;var s=i(86),r=i(101);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,f=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&f<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){var p=l.axisBody,g=p===t?e:t,v=[p.axes[i.axisNumber]];if(h=n._overlapAxes(p.vertices,g.vertices,v),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlaps?s=a:a=0?o.index-1:u.length-1],l.x=s.x-c.x,l.y=s.y-c.y,h=-r.dot(i,l),a=s,s=u[(o.index+1)%u.length],l.x=s.x-c.x,l.y=s.y-c.y,(n=-r.dot(i,l))r?(s.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),r=s.topologicalSort(i),o=[],a=0;a0&&!h.silent&&s.info(o.join(" "))}else s.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),r=i.name;if(!(r in(e=e||{}))){t=n.resolve(t)||t,e[r]=s.map(t.uses||[],function(e){n.isPlugin(e)&&n.register(e);var r=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,r.range)?(s.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(r),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(s.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),r.name});for(var o=0;o=s[2];if("^"===i.operator)return s[0]>0?o[0]===s[0]&&r.number>=i.number:s[1]>0?o[1]===s[1]&&o[2]>=s[2]:o[2]===s[2]}return t===e||"*"===t}},function(t,e,i){var n={};t.exports=n;var s=i(213),r=(i(234),i(37));n.create=function(t){var e=s.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return r.extend(e,i,t)}},function(t,e,i){t.exports={BasePlugin:i(453),DefaultPlugins:i(172),PluginCache:i(20),PluginManager:i(348),ScenePlugin:i(1273)}},function(t,e,i){var n=i(453),s=i(0),r=i(21),o=new s({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(r.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},function(t,e,i){var n=i(16),s=i(174),r={Center:i(337),Events:i(92),Orientation:i(338),ScaleManager:i(349),ScaleModes:i(339),Zoom:i(340)};r=n(!1,r=n(!1,r=n(!1,r=n(!1,r,s.CENTER),s.ORIENTATION),s.SCALE_MODE),s.ZOOM),t.exports=r},function(t,e,i){var n=i(121),s=i(16),r={Events:i(21),SceneManager:i(351),ScenePlugin:i(1276),Settings:i(353),Systems:i(177)};r=s(!1,r,n),t.exports=r},function(t,e,i){var n=i(22),s=i(0),r=i(21),o=i(2),a=i(20),h=new s({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(r.BOOT,this.boot,this),t.sys.events.on(r.START,this.pluginStart,this)},boot:function(){this.systems.events.once(r.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(r.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var s=o(t,"onUpdate",null);s&&(this._onUpdate=s,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=n,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake():this.manager.start(e,o(t,"data")),this.systems.events.emit(r.TRANSITION_OUT,i,n),this.systems.events.on(r.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(r.UPDATE,this.step,this),t.events.emit(r.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(r.SHUTDOWN,this.shutdown,this),t.off(r.POST_UPDATE,this.step,this),t.off(r.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(r.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},function(t,e,i){t.exports={List:i(124),Map:i(157),ProcessQueue:i(183),RTree:i(447),Set:i(107),Size:i(350)}},function(t,e,i){var n=i(16),s=i(1279),r={CanvasTexture:i(355),Events:i(117),FilterMode:s,Frame:i(94),Parsers:i(357),Texture:i(179),TextureManager:i(354),TextureSource:i(356)};r=n(!1,r,s),t.exports=r},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){t.exports={Components:i(136),Parsers:i(1310),Formats:i(31),ImageCollection:i(464),ParseToTilemap:i(220),Tile:i(73),Tilemap:i(473),TilemapCreator:i(1319),TilemapFactory:i(1320),Tileset:i(140),LayerData:i(104),MapData:i(105),ObjectLayer:i(467),DynamicTilemapLayer:i(474),StaticTilemapLayer:i(475)}},function(t,e,i){var n=i(24),s=i(51);t.exports=function(t,e,i,r,o,a,h,l){t<0&&(t=0),e<0&&(e=0),void 0===h&&(h=!0);for(var u=n(t,e,i,r,null,l),c=o-t,d=a-e,f=0;f=0&&p=0&&g=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);else if(2===r)for(a=x;a>=y;a--)for(o=v;c[a]&&o=y;a--)for(o=m;c[a]&&o>=v;o--)(h=c[a][o])&&-1!==h.index&&h.visible&&0!==h.alpha&&i.push(h);return u.tilesDrawn=i.length,u.tilesTotal=d*f,i}},function(t,e,i){var n=i(24),s=i(51),r=i(72);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=n(e,i,o,a,null,l),d=0;d=0;r--)for(s=n.width-1;s>=0;s--)if((o=n.data[r][s])&&o.index===t){if(a===e)return o;a+=1}}else for(r=0;re)){for(var l=t;l<=e;l++)r(l,i,a);if(h)for(var u=0;u=t&&d.index<=e&&n(d,i)}o&&s(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(72),s=i(51),r=i(216);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a0&&n(a,t)}}e&&s(0,0,i.width,i.height,i)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var s=0,r=t.length;s1||e.scaleY>1)&&(u.imageSmoothingEnabled=!1);for(var f=0;f0&&(t.currentPipeline&&t.currentPipeline.vertexCount>0&&t.flush(),r.vertexBuffer=e.vertexBuffer[a],t.setPipeline(r),t.setTexture2D(s[a].glTexture,0),t.gl.drawArrays(r.topology,0,e.vertexCount[a]));r.vertexBuffer=o,r.viewIdentity(),r.modelIdentity()}},function(t,e){t.exports=function(t,e,i,n,s){e.cull(n);var r=e.culledTiles,o=r.length;if(0!==o){var a=t._tempMatrix1,h=t._tempMatrix2,l=t._tempMatrix3;h.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),a.copyFrom(n.matrix);var u=t.currentContext,c=e.gidMap;u.save(),s?(a.multiplyWithOffset(s,-n.scrollX*e.scrollFactorX,-n.scrollY*e.scrollFactorY),h.e=e.x,h.f=e.y,a.multiply(h,l),l.copyToContext(u)):(h.e-=n.scrollX*e.scrollFactorX,h.f-=n.scrollY*e.scrollFactorY,h.copyToContext(u));var d=n.alpha*e.alpha;(!t.antialias||e.scaleX>1||e.scaleY>1)&&(u.imageSmoothingEnabled=!1);for(var f=0;f-1&&this._active.splice(s,1),n.destroy()}for(i=0;i=n.delay)){var s=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=s,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t-1&&(e.state=u.REMOVED,s.splice(r,1)):(e.state=u.REMOVED,n.splice(r,1))}for(i.length=0,i=this._add,t=0;tE&&(E=A),b[S][_]=A}}}var C=r?n(r):null;return o?function(t,e,n,s){var r,o=0,a=s%v,h=Math.floor(s/v);if(a>=0&&a=0&&h>2],r+=i[(3&n[o])<<4|n[o+1]>>4],r+=i[(15&n[o+1])<<2|n[o+2]>>6],r+=i[63&n[o+2]];return s%3==2?r=r.substring(0,r.length-1)+"=":s%3==1&&(r=r.substring(0,r.length-2)+"=="),r}},function(t,e,i){t.exports={Clone:i(66),Extend:i(16),GetAdvancedValue:i(14),GetFastValue:i(2),GetMinMaxValue:i(1345),GetValue:i(6),HasAll:i(1346),HasAny:i(383),HasValue:i(99),IsPlainObject:i(7),Merge:i(106),MergeRight:i(1347),Pick:i(465),SetValue:i(403)}},function(t,e,i){var n=i(6),s=i(22);t.exports=function(t,e,i,r,o){void 0===o&&(o=i);var a=n(t,e,o);return s(a,i,r)}},function(t,e){t.exports=function(t,e){for(var i=0;i=t.pos.x+t.size.x||this.pos.x+this.size.x<=t.pos.x||this.pos.y>=t.pos.y+t.size.y||this.pos.y+this.size.y<=t.pos.y)},resetSize:function(t,e,i,n){return this.pos.x=t,this.pos.y=e,this.size.x=i,this.size.y=n,this},toJSON:function(){return{name:this.name,size:{x:this.size.x,y:this.size.y},pos:{x:this.pos.x,y:this.pos.y},vel:{x:this.vel.x,y:this.vel.y},accel:{x:this.accel.x,y:this.accel.y},friction:{x:this.friction.x,y:this.friction.y},maxVel:{x:this.maxVel.x,y:this.maxVel.y},gravityFactor:this.gravityFactor,bounciness:this.bounciness,minBounceVelocity:this.minBounceVelocity,type:this.type,checkAgainst:this.checkAgainst,collides:this.collides}},fromJSON:function(){},check:function(){},collideWith:function(t,e){this.parent&&this.parent._collideCallback&&this.parent._collideCallback.call(this.parent._callbackScope,this,t,e)},handleMovementTrace:function(){return!0},destroy:function(){this.world.remove(this),this.enabled=!1,this.world=null,this.gameObject=null,this.parent=null}});t.exports=h},function(t,e,i){var n=i(0),s=i(1379),r=new n({initialize:function(t,e){void 0===t&&(t=32),this.tilesize=t,this.data=Array.isArray(e)?e:[],this.width=Array.isArray(e)?e[0].length:0,this.height=Array.isArray(e)?e.length:0,this.lastSlope=55,this.tiledef=s},trace:function(t,e,i,n,s,r){var o={collision:{x:!1,y:!1,slope:!1},pos:{x:t+i,y:e+n},tile:{x:0,y:0}};if(!this.data)return o;var a=Math.ceil(Math.max(Math.abs(i),Math.abs(n))/this.tilesize);if(a>1)for(var h=i/a,l=n/a,u=0;u0?r:0,m=n<0?f:0,y=Math.max(Math.floor(i/f),0),x=Math.min(Math.ceil((i+o)/f),g);u=Math.floor((t.pos.x+v)/f);var T=Math.floor((e+v)/f);if((l>0||u===T||T<0||T>=p)&&(T=-1),u>=0&&u1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,T,c));c++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.x=!0,t.tile.x=d,t.pos.x=u*f-v+m,e=t.pos.x,a=0;break}}if(s){var w=s>0?o:0,b=s<0?f:0,E=Math.max(Math.floor(t.pos.x/f),0),S=Math.min(Math.ceil((t.pos.x+r)/f),p);c=Math.floor((t.pos.y+w)/f);var _=Math.floor((i+w)/f);if((l>0||c===_||_<0||_>=g)&&(_=-1),c>=0&&c1&&d<=this.lastSlope&&this.checkDef(t,d,e,i,a,h,r,o,u,_));u++)if(1===(d=this.data[c][u])||d>this.lastSlope||d>1&&this.checkDef(t,d,e,i,a,h,r,o,u,c)){if(d>1&&d<=this.lastSlope&&t.collision.slope)break;t.collision.y=!0,t.tile.y=d,t.pos.y=c*f-w+b;break}}},checkDef:function(t,e,i,n,s,r,o,a,h,l){var u=this.tiledef[e];if(!u)return!1;var c=this.tilesize,d=(h+u[0])*c,f=(l+u[1])*c,p=(u[2]-u[0])*c,g=(u[3]-u[1])*c,v=u[4],m=i+s+(g<0?o:0)-d,y=n+r+(p>0?a:0)-f;if(p*y-g*m>0){if(s*-g+r*p<0)return v;var x=Math.sqrt(p*p+g*g),T=g/x,w=-p/x,b=m*T+y*w,E=T*b,S=w*b;return E*E+S*S>=s*s+r*r?v||p*(y-r)-g*(m-s)<.5:(t.pos.x=i+s-E,t.pos.y=n+r-S,t.collision.slope={x:p,y:g,nx:T,ny:w},!0)}return!1}});t.exports=r},function(t,e,i){var n=i(0),s=i(1355),r=i(1356),o=i(1357),a=new n({initialize:function(t){this.world=t,this.sys=t.scene.sys},body:function(t,e,i,n){return new s(this.world,t,e,i,n)},existing:function(t){var e=t.x-t.frame.centerX,i=t.y-t.frame.centerY,n=t.width,s=t.height;return t.body=this.world.create(e,i,n,s),t.body.parent=t,t.body.gameObject=t,t},image:function(t,e,i,n){var s=new r(this.world,t,e,i,n);return this.sys.displayList.add(s),s},sprite:function(t,e,i,n){var s=new o(this.world,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},destroy:function(){this.world=null,this.sys=null}});t.exports=a},function(t,e,i){var n=i(0),s=i(1263),r=new n({Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){this.body=t.create(e,i,n,s),this.body.parent=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=r},function(t,e,i){var n=i(0),s=i(1263),r=i(98),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(0),s=i(1263),r=i(68),o=new n({Extends:r,Mixins:[s.Acceleration,s.BodyScale,s.BodyType,s.Bounce,s.CheckAgainst,s.Collides,s.Debug,s.Friction,s.Gravity,s.Offset,s.SetGameObject,s.Velocity],initialize:function(t,e,i,n,s){r.call(this,t.scene,e,i,n,s),this.body=t.create(e-this.frame.centerX,i-this.frame.centerY,this.width,this.height),this.body.parent=this,this.body.gameObject=this,this.size=this.body.size,this.offset=this.body.offset,this.vel=this.body.vel,this.accel=this.body.accel,this.friction=this.body.friction,this.maxVel=this.body.maxVel}});t.exports=o},function(t,e,i){var n=i(1352),s=i(0),r=i(450),o=i(1353),a=i(9),h=i(1262),l=i(2),u=i(99),c=i(107),d=i(1393),f=i(31),p=i(451),g=new s({Extends:a,initialize:function(t,e){a.call(this),this.scene=t,this.bodies=new c,this.gravity=l(e,"gravity",0),this.cellSize=l(e,"cellSize",64),this.collisionMap=new o,this.timeScale=l(e,"timeScale",1),this.maxStep=l(e,"maxStep",.05),this.enabled=!0,this.drawDebug=l(e,"debug",!1),this.debugGraphic;var i=l(e,"maxVelocity",100);if(this.defaults={debugShowBody:l(e,"debugShowBody",!0),debugShowVelocity:l(e,"debugShowVelocity",!0),bodyDebugColor:l(e,"debugBodyColor",16711935),velocityDebugColor:l(e,"debugVelocityColor",65280),maxVelocityX:l(e,"maxVelocityX",i),maxVelocityY:l(e,"maxVelocityY",i),minBounceVelocity:l(e,"minBounceVelocity",40),gravityFactor:l(e,"gravityFactor",1),bounciness:l(e,"bounciness",0)},this.walls={left:null,right:null,top:null,bottom:null},this.delta=0,this._lastId=0,l(e,"setBounds",!1)){var n=e.setBounds;if("boolean"==typeof n)this.setBounds();else{var s=l(n,"x",0),r=l(n,"y",0),h=l(n,"width",t.sys.scale.width),u=l(n,"height",t.sys.scale.height),d=l(n,"thickness",64),f=l(n,"left",!0),p=l(n,"right",!0),g=l(n,"top",!0),v=l(n,"bottom",!0);this.setBounds(s,r,h,u,d,f,p,g,v)}}this.drawDebug&&this.createDebugGraphic()},setCollisionMap:function(t,e){if("string"==typeof t){var i=this.scene.cache.tilemap.get(t);if(!i||i.format!==f.WELTMEISTER)return console.warn("The specified key does not correspond to a Weltmeister tilemap: "+t),null;for(var n,s=i.data.layer,r=0;rr.ACTIVE&&d(this,t,e))},setCollidesNever:function(t){for(var e=0;e=0&&h<=1&&l>=0&&l<=1}function s(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function r(t,e,i){return s(t,e,i)>0}function o(t,e,i){return s(t,e,i)>=0}function a(t,e,i){return s(t,e,i)<0}function h(t,e,i){return s(t,e,i)<=0}t.exports={decomp:function(t){var e=function t(e){var i=[],n=[],s=[],r=[];var o=Number.MAX_VALUE;for(var a=0;a0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],s=0;su)return console.warn("quickDecomp: max level ("+u+") reached."),i;for(var L=0;L_&&(_+=e.length),S=Number.MAX_VALUE,_3&&n>=0;--n)c(f(t,n-1),f(t,n),f(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var n=t[i],s=i-1;s>=0;--s)E(n,t[s],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);return!r(f(t,e-1),f(t,e),f(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(var n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var l=[],u=[];function c(t,e,i,n){if(n){var r=l,o=u;r[0]=e[0]-t[0],r[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=r[0]*o[0]+r[1]*o[1],h=Math.sqrt(r[0]*r[0]+r[1]*r[1]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))g&&(g=y),a.translate(m,{x:.5*x,y:.5*y}),c=m.bounds.max.x+r,s.addBody(u,m),l=m,f+=1}else c+=r}d+=g+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u0)for(l=0;l0&&(d=f[l-1+(h-1)*e],s.addConstraint(t,r.create(o.extend({bodyA:d,bodyB:c},a)))),n&&ld||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*f,y:0}),h(t+(u?o*f:0)+o*r,n,o,l,u,c)})},n.newtonsCradle=function(t,e,i,n,o){for(var a=s.create({label:"Newtons Cradle"}),l=0;lu.bounds.max.x||p.bounds.max.yu.bounds.max.y)){var g=n._getRegion(t,p);if(!p.region||g.id!==p.region.id||s){f.broadphaseTests+=1,p.region&&!s||(p.region=g);var v=n._regionUnion(g,p.region);for(o=v.startCol;o<=v.endCol;o++)for(a=v.startRow;a<=v.endRow;a++){h=c[l=n._getBucketId(o,a)];var m=o>=g.startCol&&o<=g.endCol&&a>=g.startRow&&a<=g.endRow,y=o>=p.region.startCol&&o<=p.region.endCol&&a>=p.region.startRow&&a<=p.region.endRow;!m&&y&&y&&h&&n._bucketRemoveBody(t,h,p),(p.region===g||m&&!y||s)&&(h||(h=n._createBucket(c,l)),n._bucketAddBody(t,h,p))}p.region=g,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),s=Math.max(t.endCol,e.endCol),r=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,s,r,o)},n._getRegion=function(t,e){var i=e.bounds,s=Math.floor(i.min.x/t.bucketWidth),r=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(s,r,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[s]];return n}},function(t,e,i){var n={};t.exports=n;var s=i(492),r=i(37);n._pairMaxIdleLife=1e3,n.create=function(t){return r.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,r,o,a,h=t.list,l=t.table,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;an._pairMaxIdleLife&&l.push(o);for(o=0;of.friction*f.frictionStatic*k*i&&(I=R,F=o.clamp(f.friction*L*i,-I,I));var B=r.cross(S,m),N=r.cross(_,m),Y=T/(g.inverseMass+v.inverseMass+g.inverseInertia*B*B+v.inverseInertia*N*N);if(D*=Y,F*=Y,P<0&&P*P>n._restingThresh*i)b.normalImpulse=0;else{var X=b.normalImpulse;b.normalImpulse=Math.min(b.normalImpulse+D,0),D=b.normalImpulse-X}if(O*O>n._restingThreshTangent*i)b.tangentImpulse=0;else{var z=b.tangentImpulse;b.tangentImpulse=o.clamp(b.tangentImpulse+F,-I,I),F=b.tangentImpulse-z}s.x=m.x*D+y.x*F,s.y=m.y*D+y.y*F,g.isStatic||g.isSleeping||(g.positionPrev.x+=s.x*g.inverseMass,g.positionPrev.y+=s.y*g.inverseMass,g.anglePrev+=r.cross(S,s)*g.inverseInertia),v.isStatic||v.isSleeping||(v.positionPrev.x-=s.x*v.inverseMass,v.positionPrev.y-=s.y*v.inverseMass,v.anglePrev-=r.cross(_,s)*v.inverseInertia)}}}}},function(t,e,i){var n={};t.exports=n;var s=i(1271),r=i(452),o=i(1368),a=i(1367),h=i(1424),l=i(1366),u=i(233),c=i(213),d=i(234),f=i(37),p=i(62);n.create=function(t,e){e=f.isElement(t)?e:t,t=f.isElement(t)?t:null,e=e||{},(t||e.render)&&f.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:l}},n=f.extend(i,e);if(t||n.render){var r={element:t,controller:Render};n.render=f.extend(r,n.render)}return n.render&&n.render.controller&&(n.render=n.render.controller.create(n.render)),n.render&&(n.render.engine=n),n.world=e.world||s.create(n.world),n.pairs=a.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n.metrics=h.create(n.metrics),n},n.update=function(t,e,i){e=e||1e3/60,i=i||1;var s,l=t.world,f=t.timing,p=t.broadphase,g=[];f.timestamp+=e*f.timeScale;var v={timestamp:f.timestamp};u.trigger(t,"beforeUpdate",v);var m=c.allBodies(l),y=c.allConstraints(l);for(h.reset(t.metrics),t.enableSleeping&&r.update(m,f.timeScale),n._bodiesApplyGravity(m,l.gravity),n._bodiesUpdate(m,e,f.timeScale,i,l.bounds),d.preSolveAll(m),s=0;s0&&u.trigger(t,"collisionStart",{pairs:T.collisionStart}),o.preSolvePosition(T.list),s=0;s0&&u.trigger(t,"collisionActive",{pairs:T.collisionActive}),T.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:T.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(m),u.trigger(t,"afterUpdate",v),t},n.merge=function(t,e){if(f.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=c.allBodies(t.world),s=0;s0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_START,e,i,n)}),p.on(e,"collisionActive",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_ACTIVE,e,i,n)}),p.on(e,"collisionEnd",function(e){var i,n,s=e.pairs;s.length>0&&(i=s[0].bodyA,n=s[0].bodyB),t.emit(u.COLLISION_END,e,i,n)})},setBounds:function(t,e,i,n,s,r,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===s&&(s=128),void 0===r&&(r=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(r,"left",t-s,e-s,s,n+2*s),this.updateWall(o,"right",t+i,e-s,s,n+2*s),this.updateWall(a,"top",t,e-s,i,s),this.updateWall(h,"bottom",t,e+n,i,s),this},updateWall:function(t,e,i,n,s,r){var o=this.walls[e];t?(o&&v.remove(this.localWorld,o),i+=s/2,n+=r/2,this.walls[e]=this.create(i,n,s,r,{isStatic:!0,friction:0,frictionStatic:0})):(o&&v.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,s,r){var o=n.rectangle(t,e,i,s,r);return v.add(this.localWorld,o),o},add:function(t){return v.add(this.localWorld,t),this},remove:function(t,e){var i=t.body?t.body:t;return a.remove(this.localWorld,i,e),this},removeConstraint:function(t,e){return a.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i1?1:0;r1?1:0;s0?e-o:e+o<0?e+o:0}return n(e,-r,r)}},function(t,e){t.exports=function(t,e){if(t.standing=!1,e.collision.y&&(t.bounciness>0&&Math.abs(t.vel.y)>t.minBounceVelocity?t.vel.y*=-t.bounciness:(t.vel.y>0&&(t.standing=!0),t.vel.y=0)),e.collision.x&&(t.bounciness>0&&Math.abs(t.vel.x)>t.minBounceVelocity?t.vel.x*=-t.bounciness:t.vel.x=0),e.collision.slope){var i=e.collision.slope;if(t.bounciness>0){var n=t.vel.x*i.nx+t.vel.y*i.ny;t.vel.x=(t.vel.x-i.nx*n*2)*t.bounciness,t.vel.y=(t.vel.y-i.ny*n*2)*t.bounciness}else{var s=i.x*i.x+i.y*i.y,r=(t.vel.x*i.x+t.vel.y*i.y)/s;t.vel.x=i.x*r,t.vel.y=i.y*r;var o=Math.atan2(i.x,i.y);o>t.slopeStanding.min&&oi.last.x&&e.last.xi.last.y&&e.last.y0))r=t.collisionMap.trace(e.pos.x,e.pos.y,0,-(e.pos.y+e.size.y-i.pos.y),e.size.x,e.size.y),e.pos.y=r.pos.y,e.bounciness>0&&e.vel.y>e.minBounceVelocity?e.vel.y*=-e.bounciness:(e.standing=!0,e.vel.y=0);else{var l=(e.vel.y-i.vel.y)/2;e.vel.y=-l,i.vel.y=l,s=i.vel.x*t.delta,r=t.collisionMap.trace(e.pos.x,e.pos.y,s,-o/2,e.size.x,e.size.y),e.pos.y=r.pos.y;var u=t.collisionMap.trace(i.pos.x,i.pos.y,0,o/2,i.size.x,i.size.y);i.pos.y=u.pos.y}}},function(t,e,i){t.exports={Factory:i(1359),Image:i(1363),Matter:i(1269),MatterPhysics:i(1426),PolyDecomp:i(1360),Sprite:i(1364),TileBody:i(1266),PhysicsEditorParser:i(1362),World:i(1370)}},function(t,e,i){var n=i(491),s=i(2),r=i(3);t.exports=function(t,e,i){void 0===i&&(i={});var o=e.x,a=e.y;if(e.body={temp:!0,position:{x:o,y:a}},[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity].forEach(function(t){for(var i in t)(n=t[i]).get&&"function"==typeof n.get||n.set&&"function"==typeof n.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var n}),e.world=t,e._tempVec2=new r(o,a),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,!0);else{var h=s(i,"shape",null);h||(h="rectangle"),e.setBody(h,i)}return e}},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e){var i={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i1?1:0;n1;if(!d||t!=d.x||e!=d.y){d&&n?(f=d.x,p=d.y):(f=0,p=0);var s={x:f+t,y:p+e};!n&&d||(d=s),g.push(s),m=f+t,y=p+e}},T=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":m=t.x,y=t.y;break;case"H":m=t.x;break;case"V":y=t.y}x(m,y,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i0)for(var a=s+1;ae.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.y - \ No newline at end of file + diff --git a/example/render/pixel/google/logo1.png b/example/render/pixel/google/logo1.png old mode 100644 new mode 100755 diff --git a/example/render/pixel/google/logo2.png b/example/render/pixel/google/logo2.png old mode 100644 new mode 100755 diff --git a/example/render/pixel/image/glaxy.jpg b/example/render/pixel/image/glaxy.jpg old mode 100644 new mode 100755 diff --git a/example/render/pixel/image/logo1.png b/example/render/pixel/image/logo1.png old mode 100644 new mode 100755 diff --git a/example/render/pixel/image/logo2.png b/example/render/pixel/image/logo2.png old mode 100644 new mode 100755 diff --git a/example/render/pixel/image/logo3.png b/example/render/pixel/image/logo3.png old mode 100644 new mode 100755 diff --git a/example/render/pixel/js/PxLoader.js b/example/render/pixel/js/PxLoader.js old mode 100644 new mode 100755 diff --git a/example/render/pixel/js/PxLoaderImage.js b/example/render/pixel/js/PxLoaderImage.js old mode 100644 new mode 100755 diff --git a/example/render/pixel/js/PxLoaderSound.js b/example/render/pixel/js/PxLoaderSound.js old mode 100644 new mode 100755 diff --git a/example/render/pixel/pixelrender.html b/example/render/pixel/pixelrender.html old mode 100644 new mode 100755 diff --git a/example/render/pixel/thousand.html b/example/render/pixel/thousand.html old mode 100644 new mode 100755 diff --git a/example/render/pixi/image/bunny.png b/example/render/pixi/image/bunny.png old mode 100644 new mode 100755 diff --git a/example/render/pixi/image/eggHead.png b/example/render/pixi/image/eggHead.png old mode 100644 new mode 100755 diff --git a/example/render/pixi/image/flowerTop.png b/example/render/pixi/image/flowerTop.png old mode 100644 new mode 100755 diff --git a/example/render/pixi/image/helmlok.png b/example/render/pixi/image/helmlok.png old mode 100644 new mode 100755 diff --git a/example/render/pixi/pixi-mulirender.html b/example/render/pixi/pixi-mulirender.html old mode 100644 new mode 100755 index 02597a3..8dc08ef --- a/example/render/pixi/pixi-mulirender.html +++ b/example/render/pixi/pixi-mulirender.html @@ -44,7 +44,6 @@ Add Behaviours: Gravity + Alpha
- @@ -269,4 +268,4 @@ - \ No newline at end of file + diff --git a/example/render/pixi/pixirender.html b/example/render/pixi/pixirender.html old mode 100644 new mode 100755 index 0422fbc..cb007bb --- a/example/render/pixi/pixirender.html +++ b/example/render/pixi/pixirender.html @@ -1,126 +1,140 @@ - + - - + proton.js-render-custom-pixi.js - - + + - - - -
+ -
- + +
- + - - - \ No newline at end of file + + diff --git a/example/render/webgl/webglrender.html b/example/render/webgl/webglrender.html old mode 100644 new mode 100755 diff --git a/example/sparks/bigfire/bigfire.html b/example/sparks/bigfire/bigfire.html old mode 100644 new mode 100755 diff --git a/example/sparks/bigfire/image/fire.png b/example/sparks/bigfire/image/fire.png old mode 100644 new mode 100755 diff --git a/example/sparks/bomb/bomb.html b/example/sparks/bomb/bomb.html old mode 100644 new mode 100755 diff --git a/example/sparks/drugs/drugs.html b/example/sparks/drugs/drugs.html old mode 100644 new mode 100755 diff --git a/example/sparks/eightDiagrams/eightDiagrams.html b/example/sparks/eightDiagrams/eightDiagrams.html old mode 100644 new mode 100755 diff --git a/example/sparks/firework/bg.jpg b/example/sparks/firework/bg.jpg old mode 100644 new mode 100755 diff --git a/example/sparks/firework/fireworks.html b/example/sparks/firework/fireworks.html old mode 100644 new mode 100755 diff --git a/example/sparks/sun/fireball.html b/example/sparks/sun/fireball.html old mode 100644 new mode 100755 diff --git a/example/sparks/sun/sun.html b/example/sparks/sun/sun.html old mode 100644 new mode 100755 diff --git a/example/zone/circlezone/circlezone.html b/example/zone/circlezone/circlezone.html old mode 100644 new mode 100755 diff --git a/example/zone/circlezone/image/n.png b/example/zone/circlezone/image/n.png old mode 100644 new mode 100755 diff --git a/example/zone/circlezone/image/o.png b/example/zone/circlezone/image/o.png old mode 100644 new mode 100755 diff --git a/example/zone/circlezone/image/p.png b/example/zone/circlezone/image/p.png old mode 100644 new mode 100755 diff --git a/example/zone/circlezone/image/r.png b/example/zone/circlezone/image/r.png old mode 100644 new mode 100755 diff --git a/example/zone/circlezone/image/t.png b/example/zone/circlezone/image/t.png old mode 100644 new mode 100755 diff --git a/example/zone/imagezone/image/logo.png b/example/zone/imagezone/image/logo.png old mode 100644 new mode 100755 diff --git a/example/zone/imagezone/imagezone.html b/example/zone/imagezone/imagezone.html old mode 100644 new mode 100755 diff --git a/example/zone/linezone/bound.html b/example/zone/linezone/bound.html old mode 100644 new mode 100755 diff --git a/example/zone/pointzone/js/color.min.js b/example/zone/pointzone/js/color.min.js old mode 100644 new mode 100755 diff --git a/example/zone/pointzone/pointzone.html b/example/zone/pointzone/pointzone.html old mode 100644 new mode 100755 diff --git a/package.json b/package.json old mode 100644 new mode 100755 index d155775..aa3e2a7 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "proton-engine", - "version": "3.3.0", - "description": "Proton is an easily customizable html5 particle engine including six different types of renderers.", + "version": "4.0.0", + "description": "Proton is a simple and powerful javascript particle animation engine.", "main": "./build/proton.min.js", "scripts": { "start": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c -w -m inline\" \"serve --listen 3001\"", @@ -14,7 +14,7 @@ "url": "git+https://github.com/a-jie/Proton.git" }, "authors": [ - "a-jie " + "anonymous namespace " ], "license": "MIT", "bugs": { diff --git a/rollup.config.js b/rollup.config.js old mode 100644 new mode 100755 diff --git a/script/makeexamplepage.js b/script/makeexamplepage.js old mode 100644 new mode 100755 diff --git a/src/behaviour/Alpha.js b/src/behaviour/Alpha.js old mode 100644 new mode 100755 index 1be2a70..4c1b5db --- a/src/behaviour/Alpha.js +++ b/src/behaviour/Alpha.js @@ -1,82 +1,84 @@ -import Util from '../utils/Util'; -import Behaviour from './Behaviour'; +import Util from "../utils/Util"; +import Span from "../math/Span"; +import Behaviour from "./Behaviour"; export default class Alpha extends Behaviour { + /** + * @memberof! Proton# + * @augments Proton.Behaviour + * @constructor + * @alias Proton.Alpha + * + * @todo add description for 'a' and 'b' + * + * @param {Number} a + * @param {String} b + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=ease.easeLinear] this behaviour's easing + * + * @property {String} name The Behaviour name + */ + constructor(a, b, life, easing) { + super(life, easing); - /** - * @memberof! Proton# - * @augments Proton.Behaviour - * @constructor - * @alias Proton.Alpha - * - * @todo add description for 'a' and 'b' - * - * @param {Number} a - * @param {String} b - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=ease.easeLinear] this behaviour's easing - * - * @property {String} name The Behaviour name - */ - constructor(a, b, life, easing) { - super(life, easing); + this.reset(a, b); + this.name = "Alpha"; + } - this.reset(a, b); - this.name = 'Alpha'; - } + /** + * Reset this behaviour's parameters + * + * @method reset + * @memberof Proton#Proton.Alpha + * @instance + * + * @todo add description for 'a' and 'b' + * + * @param {Number} a + * @param {String} b + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=ease.easeLinear] this behaviour's easing + */ + reset(a, b, life, easing) { + this.same = b === null || b === undefined ? true : false; + this.a = Span.setSpanValue(Util.initValue(a, 1)); + this.b = Span.setSpanValue(b); - /** - * Reset this behaviour's parameters - * - * @method reset - * @memberof Proton#Proton.Alpha - * @instance - * - * @todo add description for 'a' and 'b' - * - * @param {Number} a - * @param {String} b - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=ease.easeLinear] this behaviour's easing - */ - reset(a, b, life, easing) { - this.same = b === null || b === undefined ? true : false; - this.a = Util.setSpanValue(Util.initValue(a, 1)); - this.b = Util.setSpanValue(b); + life && super.reset(life, easing); + } - life && super.reset(life, easing); - } + /** + * Sets the new alpha value of the particle + * + * @method initialize + * @memberof Proton#Proton.Alpha + * @instance + * + * @param {Proton.Particle} particle A single Proton generated particle + */ + initialize(particle) { + particle.data.alphaA = this.a.getValue(); - /** - * Sets the new alpha value of the particle - * - * @method initialize - * @memberof Proton#Proton.Alpha - * @instance - * - * @param {Proton.Particle} particle A single Proton generated particle - */ - initialize(particle) { - particle.transform.alphaA = this.a.getValue(); + if (this.same) particle.data.alphaB = particle.data.alphaA; + else particle.data.alphaB = this.b.getValue(); + } - if (this.same) - particle.transform.alphaB = particle.transform.alphaA; - else - particle.transform.alphaB = this.b.getValue(); - } - - /** - * @method applyBehaviour - * @memberof Proton#Proton.Alpha - * @instance - * - * @param {Proton.Particle} particle - * @param {Number} time the integrate time 1/ms - * @param {Int} index the particle index - */ - applyBehaviour(particle, time, index) { - this.calculate(particle, time, index); - particle.alpha = particle.transform.alphaB + (particle.transform.alphaA - particle.transform.alphaB) * this.energy; - if (particle.alpha < 0.001) particle.alpha = 0; - } + /** + * @method applyBehaviour + * @memberof Proton#Proton.Alpha + * @instance + * + * @param {Proton.Particle} particle + * @param {Number} time the integrate time 1/ms + * @param {Int} index the particle index + */ + applyBehaviour(particle, time, index) { + this.calculate(particle, time, index); + + particle.alpha = + particle.data.alphaB + + (particle.data.alphaA - particle.data.alphaB) * this.energy; + + if (particle.alpha < 0.001) particle.alpha = 0; + } } diff --git a/src/behaviour/Attraction.js b/src/behaviour/Attraction.js old mode 100644 new mode 100755 diff --git a/src/behaviour/Behaviour.js b/src/behaviour/Behaviour.js old mode 100644 new mode 100755 index fca4cca..214bf52 --- a/src/behaviour/Behaviour.js +++ b/src/behaviour/Behaviour.js @@ -129,4 +129,4 @@ export default class Behaviour { this.parents.length = 0; } -} \ No newline at end of file +} diff --git a/src/behaviour/Collision.js b/src/behaviour/Collision.js old mode 100644 new mode 100755 diff --git a/src/behaviour/Color.js b/src/behaviour/Color.js old mode 100644 new mode 100755 index 9c25a87..b814a74 --- a/src/behaviour/Color.js +++ b/src/behaviour/Color.js @@ -1,93 +1,94 @@ -import ColorUtil from '../utils/ColorUtil'; -import ArraySpan from '../math/ArraySpan'; -import Behaviour from './Behaviour'; +import ColorUtil from "../utils/ColorUtil"; +import ArraySpan from "../math/ArraySpan"; +import Behaviour from "./Behaviour"; export default class Color extends Behaviour { + /** + * @memberof! Proton# + * @augments Proton.Behaviour + * @constructor + * @alias Proton.Color + * + * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black + * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=easeLinear] this behaviour's easing + * + * @property {String} name The Behaviour name + */ + constructor(a, b, life, easing) { + super(life, easing); - /** - * @memberof! Proton# - * @augments Proton.Behaviour - * @constructor - * @alias Proton.Color - * - * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black - * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=easeLinear] this behaviour's easing - * - * @property {String} name The Behaviour name - */ - constructor(a, b, life, easing) { - super(life, easing); + this.reset(a, b); + this.name = "Color"; + } - this.reset(a, b); - this.name = 'Color'; - } - - /** - * Reset this behaviour's parameters - * - * @method reset - * @memberof Proton#Proton.Color - * @instance - * - * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black - * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=easeLinear] this behaviour's easing - */ - reset(a, b, life, easing) { - this.a = ArraySpan.createArraySpan(a); - this.b = ArraySpan.createArraySpan(b); - - life && super.reset(life, easing); - } + /** + * Reset this behaviour's parameters + * + * @method reset + * @memberof Proton#Proton.Color + * @instance + * + * @param {Proton.ArraySpan | String} a the string should be a hex e.g. #000000 for black + * @param {Proton.ArraySpan | String} b the string should be a hex e.g. #000000 for black + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=easeLinear] this behaviour's easing + */ + reset(a, b, life, easing) { + this.a = ArraySpan.createArraySpan(a); + this.b = ArraySpan.createArraySpan(b); + life && super.reset(life, easing); + } - /** - * Initialize the behaviour's parameters for all particles - * - * @method initialize - * @memberof Proton#Proton.Color - * @instance - * - * @param {Proton.Particle} particle - */ - initialize(particle) { - particle.color = this.a.getValue(); - particle.transform.colorA = ColorUtil.hexToRGB(particle.color); + /** + * Initialize the behaviour's parameters for all particles + * + * @method initialize + * @memberof Proton#Proton.Color + * @instance + * + * @param {Proton.Particle} particle + */ + initialize(particle) { + particle.color = this.a.getValue(); + particle.data.colorA = ColorUtil.hexToRgb(particle.color); - if (this.b) - particle.transform.colorB = ColorUtil.hexToRGB(this.b.getValue()); - }; + if (this.b) particle.data.colorB = ColorUtil.hexToRgb(this.b.getValue()); + } - /** - * Apply this behaviour for all particles every time - * - * @method applyBehaviour - * @memberof Proton#Proton.Color - * @instance - * - * @param {Proton.Particle} particle - * @param {Number} the integrate time 1/ms - * @param {Int} the particle index - */ - applyBehaviour(particle, time, index) { - if (this.b) { - this.calculate(particle, time, index); + /** + * Apply this behaviour for all particles every time + * + * @method applyBehaviour + * @memberof Proton#Proton.Color + * @instance + * + * @param {Proton.Particle} particle + * @param {Number} the integrate time 1/ms + * @param {Int} the particle index + */ + applyBehaviour(particle, time, index) { + if (this.b) { + this.calculate(particle, time, index); - particle.transform.rgb.r = particle.transform.colorB.r + (particle.transform.colorA.r - particle.transform.colorB.r) * this.energy; - particle.transform.rgb.g = particle.transform.colorB.g + (particle.transform.colorA.g - particle.transform.colorB.g) * this.energy; - particle.transform.rgb.b = particle.transform.colorB.b + (particle.transform.colorA.b - particle.transform.colorB.b) * this.energy; + particle.rgb.r = + particle.data.colorB.r + + (particle.data.colorA.r - particle.data.colorB.r) * this.energy; + particle.rgb.g = + particle.data.colorB.g + + (particle.data.colorA.g - particle.data.colorB.g) * this.energy; + particle.rgb.b = + particle.data.colorB.b + + (particle.data.colorA.b - particle.data.colorB.b) * this.energy; - particle.transform.rgb.r = Math.floor(particle.transform.rgb.r); - particle.transform.rgb.g = Math.floor(particle.transform.rgb.g); - particle.transform.rgb.b = Math.floor(particle.transform.rgb.b); - - } else { - particle.transform.rgb.r = particle.transform.colorA.r; - particle.transform.rgb.g = particle.transform.colorA.g; - particle.transform.rgb.b = particle.transform.colorA.b; - } - }; - -} \ No newline at end of file + particle.rgb.r = Math.floor(particle.rgb.r); + particle.rgb.g = Math.floor(particle.rgb.g); + particle.rgb.b = Math.floor(particle.rgb.b); + } else { + particle.rgb.r = particle.data.colorA.r; + particle.rgb.g = particle.data.colorA.g; + particle.rgb.b = particle.data.colorA.b; + } + } +} diff --git a/src/behaviour/CrossZone.js b/src/behaviour/CrossZone.js old mode 100644 new mode 100755 diff --git a/src/behaviour/Force.js b/src/behaviour/Force.js old mode 100644 new mode 100755 diff --git a/src/behaviour/Gravity.js b/src/behaviour/Gravity.js old mode 100644 new mode 100755 diff --git a/src/behaviour/GravityWell.js b/src/behaviour/GravityWell.js old mode 100644 new mode 100755 diff --git a/src/behaviour/RandomDrift.js b/src/behaviour/RandomDrift.js old mode 100644 new mode 100755 index 2f9bbd4..1ee7028 --- a/src/behaviour/RandomDrift.js +++ b/src/behaviour/RandomDrift.js @@ -1,71 +1,78 @@ -import Vector2D from '../math/Vector2D'; -import MathUtils from '../math/MathUtils'; -import Behaviour from './Behaviour'; +import Vector2D from "../math/Vector2D"; +import MathUtil from "../math/MathUtil"; +import Behaviour from "./Behaviour"; export default class RandomDrift extends Behaviour { + /** + * @memberof! Proton# + * @augments Behaviour + * @constructor + * @alias RandomDrift + * + * @param {Number} driftX X value of the new Vector2D + * @param {Number} driftY Y value of the new Vector2D + * @param {Number} delay How much delay the drift should have + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=easeLinear] this behaviour's easing + * + * @property {Number} time The time of the drift + * @property {String} name The Behaviour name + */ + constructor(driftX, driftY, delay, life, easing) { + super(life, easing); - /** - * @memberof! Proton# - * @augments Behaviour - * @constructor - * @alias RandomDrift - * - * @param {Number} driftX X value of the new Vector2D - * @param {Number} driftY Y value of the new Vector2D - * @param {Number} delay How much delay the drift should have - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=easeLinear] this behaviour's easing - * - * @property {Number} time The time of the drift - * @property {String} name The Behaviour name - */ - constructor(driftX, driftY, delay, life, easing) { - super(life, easing); + this.reset(driftX, driftY, delay); + this.time = 0; + this.name = "RandomDrift"; + } - this.reset(driftX, driftY, delay); - this.time = 0; - this.name = 'RandomDrift'; - } + /** + * Reset this behaviour's parameters + * + * @method reset + * @memberof Proton#RandomDrift + * @instance + * + * @param {Number} driftX X value of the new Vector2D + * @param {Number} driftY Y value of the new Vector2D + * @param {Number} delay How much delay the drift should have + * @param {Number} [life=Infinity] this behaviour's life + * @param {String} [easing=easeLinear] this behaviour's easing + */ + reset(driftX, driftY, delay, life, easing) { + this.panFoce = new Vector2D(driftX, driftY); + this.panFoce = this.normalizeForce(this.panFoce); + this.delay = delay; - /** - * Reset this behaviour's parameters - * - * @method reset - * @memberof Proton#RandomDrift - * @instance - * - * @param {Number} driftX X value of the new Vector2D - * @param {Number} driftY Y value of the new Vector2D - * @param {Number} delay How much delay the drift should have - * @param {Number} [life=Infinity] this behaviour's life - * @param {String} [easing=easeLinear] this behaviour's easing - */ - reset(driftX, driftY, delay, life, easing) { - this.panFoce = new Vector2D(driftX, driftY); - this.panFoce = this.normalizeForce(this.panFoce); - this.delay = delay; + life && super.reset(life, easing); + } - life && super.reset(life, easing); - } + initialize(particle) { + particle.data.time = 0; + } - /** - * Apply this behaviour for all particles every time - * - * @method applyBehaviour - * @memberof Proton#RandomDrift - * @instance - * - * @param {Particle} particle - * @param {Number} time the integrate time 1/ms - * @param {Int} index the particle index - */ - applyBehaviour(particle, time, index) { - this.calculate(particle, time, index); - this.time += time; + /** + * Apply this behaviour for all particles every time + * + * @method applyBehaviour + * @memberof Proton#RandomDrift + * @instance + * + * @param {Particle} particle + * @param {Number} time the integrate time 1/ms + * @param {Int} index the particle index + */ + applyBehaviour(particle, time, index) { + this.calculate(particle, time, index); + particle.data.time += time; - if (this.time >= this.delay) { - particle.a.addXY(MathUtils.randomAToB(-this.panFoce.x, this.panFoce.x), MathUtils.randomAToB(-this.panFoce.y, this.panFoce.y)); - this.time = 0; - }; - } + if (particle.data.time >= this.delay) { + particle.a.addXY( + MathUtil.randomAToB(-this.panFoce.x, this.panFoce.x), + MathUtil.randomAToB(-this.panFoce.y, this.panFoce.y) + ); + + particle.data.time = 0; + } + } } diff --git a/src/behaviour/Repulsion.js b/src/behaviour/Repulsion.js old mode 100644 new mode 100755 diff --git a/src/behaviour/Rotate.js b/src/behaviour/Rotate.js old mode 100644 new mode 100755 index 185e422..9185a00 --- a/src/behaviour/Rotate.js +++ b/src/behaviour/Rotate.js @@ -1,3 +1,4 @@ +import Span from "../math/Span"; import Util from '../utils/Util'; import Behaviour from './Behaviour'; @@ -44,8 +45,8 @@ export default class Rotate extends Behaviour { reset(a, b, style, life, easing) { this.same = b === null || b === undefined ? true : false; - this.a = Util.setSpanValue(Util.initValue(a, 'Velocity')); - this.b = Util.setSpanValue(Util.initValue(b, 0)); + this.a = Span.setSpanValue(Util.initValue(a, 'Velocity')); + this.b = Span.setSpanValue(Util.initValue(b, 0)); this.style = Util.initValue(style, 'to'); life && super.reset(life, easing); @@ -62,9 +63,9 @@ export default class Rotate extends Behaviour { */ initialize(particle) { particle.rotation = this.a.getValue(); - particle.transform.rotationA = this.a.getValue(); + particle.data.rotationA = this.a.getValue(); - if (!this.same) particle.transform.rotationB = this.b.getValue(); + if (!this.same) particle.data.rotationB = this.b.getValue(); }; /** @@ -83,9 +84,9 @@ export default class Rotate extends Behaviour { if (!this.same) { if (this.style === 'to' || this.style === 'TO' || this.style === '_') { - particle.rotation += particle.transform.rotationB + (particle.transform.rotationA - particle.transform.rotationB) * this.energy + particle.rotation += particle.data.rotationB + (particle.data.rotationA - particle.data.rotationB) * this.energy } else { - particle.rotation += particle.transform.rotationB; + particle.rotation += particle.data.rotationB; } } else if (this.a.a === 'V' || this.a.a === 'Velocity' || this.a.a === 'v') { // beta... diff --git a/src/behaviour/Scale.js b/src/behaviour/Scale.js old mode 100644 new mode 100755 index fd92561..7555391 --- a/src/behaviour/Scale.js +++ b/src/behaviour/Scale.js @@ -1,3 +1,4 @@ +import Span from "../math/Span"; import Util from '../utils/Util'; import Behaviour from './Behaviour'; @@ -39,8 +40,8 @@ export default class Scale extends Behaviour { */ reset(a, b, life, easing) { this.same = b === null || b === undefined ? true : false; - this.a = Util.setSpanValue(Util.initValue(a, 1)); - this.b = Util.setSpanValue(b); + this.a = Span.setSpanValue(Util.initValue(a, 1)); + this.b = Span.setSpanValue(b); life && super.reset(life, easing); } @@ -55,9 +56,9 @@ export default class Scale extends Behaviour { * @param {Proton.Particle} particle */ initialize(particle) { - particle.transform.scaleA = this.a.getValue(); - particle.transform.oldRadius = particle.radius; - particle.transform.scaleB = this.same ? particle.transform.scaleA : this.b.getValue(); + particle.data.scaleA = this.a.getValue(); + particle.data.oldRadius = particle.radius; + particle.data.scaleB = this.same ? particle.data.scaleA : this.b.getValue(); }; /** @@ -73,9 +74,9 @@ export default class Scale extends Behaviour { */ applyBehaviour(particle, time, index) { this.calculate(particle, time, index); - particle.scale = particle.transform.scaleB + (particle.transform.scaleA - particle.transform.scaleB) * this.energy; + particle.scale = particle.data.scaleB + (particle.data.scaleA - particle.data.scaleB) * this.energy; if (particle.scale < 0.0001) particle.scale = 0; - particle.radius = particle.transform.oldRadius * particle.scale; + particle.radius = particle.data.oldRadius * particle.scale; } } \ No newline at end of file diff --git a/src/core/Particle.js b/src/core/Particle.js old mode 100644 new mode 100755 index 7569222..cded462 --- a/src/core/Particle.js +++ b/src/core/Particle.js @@ -1,156 +1,141 @@ -import Util from '../utils/Util'; -import ease from '../math/ease'; -import Vector2D from '../math/Vector2D'; -import MathUtils from '../math/MathUtils'; +import Rgb from "../utils/Rgb"; +import Puid from "../utils/Puid"; +import Util from "../utils/Util"; +import ease from "../math/ease"; +import Vector2D from "../math/Vector2D"; +import MathUtil from "../math/MathUtil"; export default class Particle { - - static ID = 0; - + /** + * the Particle class + * + * @class Proton.Particle + * @constructor + * @param {Object} pObj the parameters object; + * for example {life:3,dead:false} + */ + constructor(conf) { /** - * the Particle class - * - * @class Proton.Particle - * @constructor - * @param {Object} pObj the parameters object; - * for example {life:3,dead:false} + * The particle's id; + * @property id + * @type {string} */ - constructor(pOBJ) { - /** - * The particle's id; - * @property id - * @type {string} - */ - this.id = `particle_${Particle.ID++}`; - this.reset('init'); - - pOBJ && Util.setPrototypeByObject(this, pOBJ); - } - - getDirection() { - return Math.atan2(this.v.x, -this.v.y) * MathUtils.N180_PI; - } - - reset(init) { - this.life = Infinity; - this.age = 0; - - // Energy loss - this.energy = 1; - this.dead = false; - this.sleep = false; - this.body = null; - this.sprite = null; - this.parent = null; - - this.mass = 1; - this.radius = 10; - this.alpha = 1; - this.scale = 1; - this.rotation = 0; - this.color = null; - - this.easing = ease.easeLinear; - - if (init === 'init') { - this.transform = {}; - this.p = new Vector2D(); - this.v = new Vector2D(); - this.a = new Vector2D(); - - this.old = { - p: new Vector2D(), - v: new Vector2D(), - a: new Vector2D() - }; - - this.behaviours = []; - } else { - Util.destroyObject(this.transform, 'rgb'); - - this.p.set(0, 0); - this.v.set(0, 0); - this.a.set(0, 0); - - this.old.p.set(0, 0); - this.old.v.set(0, 0); - this.old.a.set(0, 0); - - this.removeAllBehaviours(); - } - - if (!this.transform.rgb) { - this.transform.rgb = { r: 255, g: 255, b: 255 }; - } else { - this.transform.rgb.r = 255; - this.transform.rgb.g = 255; - this.transform.rgb.b = 255; - } - - return this; - } - - update(time, index) { - if (!this.sleep) { - this.age += time; - this.applyBehaviours(time, index); - } - - if (this.age < this.life) { - const scale = this.easing(this.age / this.life); - this.energy = Math.max(1 - scale, 0); - } else { - this.destroy(); - } + this.name = "Particle"; + this.id = Puid.id(this.name); + this.old = {}; + this.data = {}; + this.behaviours = []; + + this.p = new Vector2D(); + this.v = new Vector2D(); + this.a = new Vector2D(); + this.old.p = new Vector2D(); + this.old.v = new Vector2D(); + this.old.a = new Vector2D(); + + this.rgb = new Rgb(); + this.reset(); + conf && Util.setProp(this, conf); + } + + getDirection() { + return Math.atan2(this.v.x, -this.v.y) * MathUtil.N180_PI; + } + + reset() { + this.life = Infinity; + this.age = 0; + + this.dead = false; + this.sleep = false; + this.body = null; + this.sprite = null; + this.parent = null; + + this.energy = 1; // Energy Loss + this.mass = 1; + this.radius = 10; + this.alpha = 1; + this.scale = 1; + this.rotation = 0; + this.color = null; + + this.p.set(0, 0); + this.v.set(0, 0); + this.a.set(0, 0); + this.old.p.set(0, 0); + this.old.v.set(0, 0); + this.old.a.set(0, 0); + this.easing = ease.easeLinear; + + this.rgb.reset(); + Util.emptyObject(this.data); + this.removeAllBehaviours(); + + return this; + } + + update(time, index) { + if (!this.sleep) { + this.age += time; + this.applyBehaviours(time, index); } - applyBehaviours(time, index) { - const length = this.behaviours.length; - let i; - - for (i = 0; i < length; i++) { - this.behaviours[i] && this.behaviours[i].applyBehaviour(this, time, index) - } + if (this.age < this.life) { + const scale = this.easing(this.age / this.life); + this.energy = Math.max(1 - scale, 0); + } else { + this.destroy(); } + } - addBehaviour(behaviour) { - this.behaviours.push(behaviour); + applyBehaviours(time, index) { + const length = this.behaviours.length; + let i; - if (behaviour.hasOwnProperty('parents')) behaviour.parents.push(this); - behaviour.initialize(this); + for (i = 0; i < length; i++) { + this.behaviours[i] && + this.behaviours[i].applyBehaviour(this, time, index); } + } - addBehaviours(behaviours) { - const length = behaviours.length; - let i; + addBehaviour(behaviour) { + this.behaviours.push(behaviour); - for (i = 0; i < length; i++) { - this.addBehaviour(behaviours[i]); - } - } + if (behaviour.hasOwnProperty("parents")) behaviour.parents.push(this); + behaviour.initialize(this); + } - removeBehaviour(behaviour) { - const index = this.behaviours.indexOf(behaviour); + addBehaviours(behaviours) { + const length = behaviours.length; + let i; - if (index > -1) { - const behaviour = this.behaviours.splice(index, 1); - behaviour.parents = null; - } + for (i = 0; i < length; i++) { + this.addBehaviour(behaviours[i]); } + } - removeAllBehaviours() { - Util.destroyArray(this.behaviours); - } + removeBehaviour(behaviour) { + const index = this.behaviours.indexOf(behaviour); - /** - * Destory this particle - * @method destroy - */ - destroy() { - this.removeAllBehaviours(); - this.energy = 0; - this.dead = true; - this.parent = null; + if (index > -1) { + const behaviour = this.behaviours.splice(index, 1); + behaviour.parents = null; } - -} \ No newline at end of file + } + + removeAllBehaviours() { + Util.emptyArray(this.behaviours); + } + + /** + * Destory this particle + * @method destroy + */ + destroy() { + this.removeAllBehaviours(); + this.energy = 0; + this.dead = true; + this.parent = null; + } +} diff --git a/src/core/Pool.js b/src/core/Pool.js old mode 100644 new mode 100755 index bfe98fb..bf53328 --- a/src/core/Pool.js +++ b/src/core/Pool.js @@ -1,141 +1,143 @@ /** - * get -> PUID :: uid-> Body - * -> cache[abc]. -> cache[abc] .pop() - * -> create [new Body| clone] - * -> return p1: { __pid: abc } + * Pool is the cache pool of the proton engine, it is very important. * - * expire -> cache[abc]= [p0, p1]; + * get(target, params, uid) + * Class + * uid = Puid.getId -> Puid save target cache + * target.__puid = uid + * + * body + * uid = Puid.getId -> Puid save target cache + * + * + * expire(target) + * cache[target.__puid] push target * */ -import Util from '../utils/Util'; -import PUID from '../utils/PUID'; +import Util from "../utils/Util"; +import Puid from "../utils/Puid"; export default class Pool { + /** + * @memberof! Proton# + * @constructor + * @alias Proton.Pool + * + * @todo add description + * @todo add description of properties + * + * @property {Number} total + * @property {Object} cache + */ + constructor(num) { + this.total = 0; + this.cache = {}; + } - /** - * @memberof! Proton# - * @constructor - * @alias Proton.Pool - * - * @todo add description - * @todo add description of properties - * - * @property {Number} total - * @property {Object} cache - */ - constructor(num) { - this.total = 0; - this.cache = {}; - } + /** + * @todo add description + * + * @method get + * @memberof Proton#Proton.Pool + * + * @param {Object|Function} target + * @param {Object} [params] just add if `target` is a function + * + * @return {Object} + */ + get(target, params, uid) { + let p; + uid = uid || target.__puid || Puid.getId(target); - /** - * @todo add description - * - * @method get - * @memberof Proton#Proton.Pool - * - * @param {Object|Function} target - * @param {Object} [params] just add if `target` is a function - * - * @return {Object} - */ - get(target, params, uid) { - let p; - uid = uid || target.__puid || PUID.getID(target); - - if (this.cache[uid] && this.cache[uid].length > 0) - p = this.cache[uid].pop(); - else - p = this.createOrClone(target, params); - - p.__puid = target.__puid || uid; - return p; + if (this.cache[uid] && this.cache[uid].length > 0) { + p = this.cache[uid].pop(); + } else { + p = this.createOrClone(target, params); } - /** - * @todo add description - * - * @method set - * @memberof Proton#Proton.Pool - * - * @param {Object} target - * - * @return {Object} - */ - expire(target) { - return this.getCache(target.__puid).push(target); - } + p.__puid = target.__puid || uid; + return p; + } - /** - * Creates a new class instance - * - * @todo add more documentation - * - * @method create - * @memberof Proton#Proton.Pool - * - * @param {Object|Function} target any Object or Function - * @param {Object} [params] just add if `target` is a function - * - * @return {Object} - */ - createOrClone(target, params) { - this.total++; + /** + * @todo add description + * + * @method set + * @memberof Proton#Proton.Pool + * + * @param {Object} target + * + * @return {Object} + */ + expire(target) { + return this.getCache(target.__puid).push(target); + } - if (this.create) { - return this.create(target, params); - } else if (typeof target === 'function') { - return Util.classApply(target, params); - } else { - return target.clone(); - } - } - - /** - * @todo add description - what is in the cache? - * - * @method getCount - * @memberof Proton#Proton.Pool - * - * @return {Number} - */ - getCount() { - let count = 0; - - for (let id in this.cache) - count += this.cache[id].length; + /** + * Creates a new class instance + * + * @todo add more documentation + * + * @method create + * @memberof Proton#Proton.Pool + * + * @param {Object|Function} target any Object or Function + * @param {Object} [params] just add if `target` is a function + * + * @return {Object} + */ + createOrClone(target, params) { + this.total++; - return count++; + if (this.create) { + return this.create(target, params); + } else if (typeof target === "function") { + return Util.classApply(target, params); + } else { + return target.clone(); } + } - /** - * Destroyes all items from Pool.cache - * - * @method destroy - * @memberof Proton#Proton.Pool - */ - destroy() { - for (let id in this.cache) { - this.cache[id].length = 0; - delete this.cache[id]; - } - } - - /** - * Returns Pool.cache - * - * @method getCache - * @memberof Proton#Proton.Pool - * @private - * - * @param {Number} uid the unique id - * - * @return {Object} - */ - getCache(uid) { - uid = uid || 'default'; + /** + * @todo add description - what is in the cache? + * + * @method getCount + * @memberof Proton#Proton.Pool + * + * @return {Number} + */ + getCount() { + let count = 0; + for (let id in this.cache) count += this.cache[id].length; + return count++; + } - if (!this.cache[uid]) this.cache[uid] = []; - return this.cache[uid]; + /** + * Destroyes all items from Pool.cache + * + * @method destroy + * @memberof Proton#Proton.Pool + */ + destroy() { + for (let id in this.cache) { + this.cache[id].length = 0; + delete this.cache[id]; } -} \ No newline at end of file + } + + /** + * Returns Pool.cache + * + * @method getCache + * @memberof Proton#Proton.Pool + * @private + * + * @param {Number} uid the unique id + * + * @return {Object} + */ + getCache(uid = "default") { + if (!this.cache[uid]) this.cache[uid] = []; + return this.cache[uid]; + } +} diff --git a/src/core/Proton.js b/src/core/Proton.js old mode 100644 new mode 100755 index 53f932b..1db5de9 --- a/src/core/Proton.js +++ b/src/core/Proton.js @@ -1,207 +1,216 @@ -import Pool from './Pool'; -import Util from '../utils/Util'; -import Stats from '../debug/Stats'; -import EventDispatcher from '../events/EventDispatcher'; -import Integration from '../math/Integration'; +import Pool from "./Pool"; +import Util from "../utils/Util"; +import Stats from "../debug/Stats"; +import EventDispatcher from "../events/EventDispatcher"; +import Integration from "../math/Integration"; export default class Proton { - - static USE_CLOCK = false; - - // 1:100 - static MEASURE = 100; - static EULER = 'euler'; - static RK2 = 'runge-kutta2'; - - static PARTICLE_CREATED = 'PARTICLE_CREATED'; - static PARTICLE_UPDATE = 'PARTICLE_UPDATE'; - static PARTICLE_SLEEP = 'PARTICLE_SLEEP'; - static PARTICLE_DEAD = 'PARTICLE_DEAD'; - static PROTON_UPDATE = 'PROTON_UPDATE'; - static PROTON_UPDATE_AFTER = 'PROTON_UPDATE_AFTER'; - static EMITTER_ADDED = 'EMITTER_ADDED'; - static EMITTER_REMOVED = 'EMITTER_REMOVED'; - - static amendChangeTabsBug = true; - - /** - * The constructor to add emitters - * - * @constructor Proton - * - * @todo proParticleCount is not in use - * @todo add more documentation of the single properties and parameters - * - * @param {Number} [proParticleCount] not in use? - * @param {Number} [integrationType=Proton.EULER] - * - * @property {String} [integrationType=Proton.EULER] - * @property {Array} emitters All added emitter - * @property {Array} renderers All added renderer - * @property {Number} time The active time - * @property {Number} oldtime The old time - */ - constructor(integrationType) { - - this.emitters = []; - this.renderers = []; - - this.time = 0; - this.oldTime = 0; - this.elapsed = 0; - - this.stats = new Stats(this); - this.pool = new Pool(80); - - this.integrationType = Util.initValue(integrationType, Proton.EULER); - this.integrator = new Integration(this.integrationType); - } - - /** - * add a type of Renderer - * - * @method addRenderer - * @memberof Proton - * @instance - * - * @param {Renderer} render - */ - addRenderer(render) { - render.init(this); - this.renderers.push(render); - } - - /** - * @name add a type of Renderer - * - * @method addRenderer - * @param {Renderer} render - */ - removeRenderer(render) { - const index = this.renderers.indexOf(render); - this.renderers.splice(index, 1); - render.remove(this); - } - - /** - * add the Emitter - * - * @method addEmitter - * @memberof Proton - * @instance - * - * @param {Emitter} emitter - */ - addEmitter(emitter) { - this.emitters.push(emitter); - emitter.parent = this; - - this.dispatchEvent(Proton.EMITTER_ADDED, emitter); - } - - /** - * Removes an Emitter - * - * @method removeEmitter - * @memberof Proton - * @instance - * - * @param {Proton.Emitter} emitter - */ - removeEmitter(emitter) { - const index = this.emitters.indexOf(emitter); - this.emitters.splice(index, 1); - emitter.parent = null; - - this.dispatchEvent(Proton.EMITTER_REMOVED, emitter); - } - - /** - * Updates all added emitters - * - * @method update - * @memberof Proton - * @instance - */ - update() { - this.dispatchEvent(Proton.PROTON_UPDATE); - - if (Proton.USE_CLOCK) { - if (!this.oldTime) this.oldTime = (new Date()).getTime(); - - let time = new Date().getTime(); - this.elapsed = (time - this.oldTime) / 1000; - Proton.amendChangeTabsBug && this.amendChangeTabsBug(); - - this.oldTime = time; - } else { - this.elapsed = 0.0167; - } - - // emitter update - if (this.elapsed > 0) this.emittersUpdate(this.elapsed); - - this.dispatchEvent(Proton.PROTON_UPDATE_AFTER); - } - - emittersUpdate(elapsed) { - let i = this.emitters.length; - while (i--) this.emitters[i].update(elapsed); + static USE_CLOCK = false; + + // 1:100 + static MEASURE = 100; + static EULER = "euler"; + static RK2 = "runge-kutta2"; + + static PARTICLE_CREATED = "PARTICLE_CREATED"; + static PARTICLE_UPDATE = "PARTICLE_UPDATE"; + static PARTICLE_SLEEP = "PARTICLE_SLEEP"; + static PARTICLE_DEAD = "PARTICLE_DEAD"; + static PROTON_UPDATE = "PROTON_UPDATE"; + static PROTON_UPDATE_AFTER = "PROTON_UPDATE_AFTER"; + static EMITTER_ADDED = "EMITTER_ADDED"; + static EMITTER_REMOVED = "EMITTER_REMOVED"; + + static amendChangeTabsBug = true; + + /** + * The constructor to add emitters + * + * @constructor Proton + * + * @todo proParticleCount is not in use + * @todo add more documentation of the single properties and parameters + * + * @param {Number} [proParticleCount] not in use? + * @param {Number} [integrationType=Proton.EULER] + * + * @property {String} [integrationType=Proton.EULER] + * @property {Array} emitters All added emitter + * @property {Array} renderers All added renderer + * @property {Number} time The active time + * @property {Number} oldtime The old time + */ + constructor(integrationType) { + this.emitters = []; + this.renderers = []; + + this.time = 0; + this.oldTime = 0; + this.elapsed = 0; + + this.stats = new Stats(this); + this.pool = new Pool(80); + + this.integrationType = Util.initValue(integrationType, Proton.EULER); + this.integrator = new Integration(this.integrationType); + } + + /** + * add a type of Renderer + * + * @method addRenderer + * @memberof Proton + * @instance + * + * @param {Renderer} render + */ + addRenderer(render) { + render.init(this); + this.renderers.push(render); + } + + /** + * @name add a type of Renderer + * + * @method addRenderer + * @param {Renderer} render + */ + removeRenderer(render) { + const index = this.renderers.indexOf(render); + this.renderers.splice(index, 1); + render.remove(this); + } + + /** + * add the Emitter + * + * @method addEmitter + * @memberof Proton + * @instance + * + * @param {Emitter} emitter + */ + addEmitter(emitter) { + this.emitters.push(emitter); + emitter.parent = this; + + this.dispatchEvent(Proton.EMITTER_ADDED, emitter); + } + + /** + * Removes an Emitter + * + * @method removeEmitter + * @memberof Proton + * @instance + * + * @param {Proton.Emitter} emitter + */ + removeEmitter(emitter) { + const index = this.emitters.indexOf(emitter); + this.emitters.splice(index, 1); + emitter.parent = null; + + this.dispatchEvent(Proton.EMITTER_REMOVED, emitter); + } + + /** + * Updates all added emitters + * + * @method update + * @memberof Proton + * @instance + */ + update() { + this.dispatchEvent(Proton.PROTON_UPDATE); + + if (Proton.USE_CLOCK) { + if (!this.oldTime) this.oldTime = new Date().getTime(); + + let time = new Date().getTime(); + this.elapsed = (time - this.oldTime) / 1000; + Proton.amendChangeTabsBug && this.amendChangeTabsBug(); + + this.oldTime = time; + } else { + this.elapsed = 0.0167; } - /** - * @todo add description - * - * @method amendChangeTabsBug - * @memberof Proton - * @instance - */ - amendChangeTabsBug() { - if (this.elapsed > 0.5) { - this.oldTime = (new Date()).getTime(); - this.elapsed = 0; - } + // emitter update + if (this.elapsed > 0) this.emittersUpdate(this.elapsed); + + this.dispatchEvent(Proton.PROTON_UPDATE_AFTER); + } + + emittersUpdate(elapsed) { + let i = this.emitters.length; + while (i--) this.emitters[i].update(elapsed); + } + + /** + * @todo add description + * + * @method amendChangeTabsBug + * @memberof Proton + * @instance + */ + amendChangeTabsBug() { + if (this.elapsed > 0.5) { + this.oldTime = new Date().getTime(); + this.elapsed = 0; } - - /** - * Counts all particles from all emitters - * - * @method getCount - * @memberof Proton - * @instance - */ - getCount() { - let total = 0; - let i = this.emitters.length; - - while (i--) total += this.emitters[i].particles.length; - return total; - } - - getAllParticles() { - let particles = []; - let i = this.emitters.length; - - while (i--) particles = particles.concat(this.emitters[i].particles); - return particles; - } - - /** - * Destroys everything related to this Proton instance. This includes all emitters, and all properties - * - * @method destroy - * @memberof Proton - * @instance - */ - destroy() { - Util.destroy(this.renderers, this.getAllParticles()); - Util.destroy(this.emitters); - - this.time = 0; - this.oldTime = 0; - - this.pool.destroy(); + } + + /** + * Counts all particles from all emitters + * + * @method getCount + * @memberof Proton + * @instance + */ + getCount() { + let total = 0; + let i = this.emitters.length; + + while (i--) total += this.emitters[i].particles.length; + return total; + } + + getAllParticles() { + let particles = []; + let i = this.emitters.length; + + while (i--) particles = particles.concat(this.emitters[i].particles); + return particles; + } + + destroyAllEmitters() { + Util.destroyAll(this.emitters); + } + + /** + * Destroys everything related to this Proton instance. This includes all emitters, and all properties + * + * @method destroy + * @memberof Proton + * @instance + */ + destroy(remove = false) { + const destroyOther = () => { + this.time = 0; + this.oldTime = 0; + this.pool.destroy(); + + Util.destroyAll(this.emitters); + Util.destroyAll(this.renderers, this.getAllParticles()); + }; + + if (remove) { + setTimeout(destroyOther, 200); + } else { + destroyOther(); } + } } -EventDispatcher.bind(Proton); \ No newline at end of file +EventDispatcher.bind(Proton); diff --git a/src/debug/Debug.js b/src/debug/Debug.js old mode 100644 new mode 100755 index f0ab375..a724a7a --- a/src/debug/Debug.js +++ b/src/debug/Debug.js @@ -1,68 +1,68 @@ -import ColorUtil from '../utils/ColorUtil'; -import CircleZone from '../zone/CircleZone'; -import PointZone from '../zone/PointZone'; -import LineZone from '../zone/LineZone'; -import RectZone from '../zone/RectZone'; +import ColorUtil from "../utils/ColorUtil"; +import CircleZone from "../zone/CircleZone"; +import PointZone from "../zone/PointZone"; +import LineZone from "../zone/LineZone"; +import RectZone from "../zone/RectZone"; +import MathUtil from "../math/MathUtil"; export default { - addEventListener(proton, fun) { - proton.addEventListener('PROTON_UPDATE_AFTER', () => fun()); - }, + addEventListener(proton, func) { + proton.addEventListener("PROTON_UPDATE_AFTER", () => func()); + }, - getStyle(color) { - const rgb = ColorUtil.hexToRGB(color || '#ff0000'); - return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`; - }, + getStyle(color = "#ff0000") { + const rgb = ColorUtil.hexToRgb(color); + return `rgba(${rgb.r}, ${rgb.g}, ${rgb.b}, 0.5)`; + }, - drawZone(proton, canvas, zone, clear) { - const context = canvas.getContext('2d'); - const style = this.getStyle(); + drawZone(proton, canvas, zone, clear) { + const context = canvas.getContext("2d"); + const style = this.getStyle(); - this.addEventListener(proton, () => { - if (clear) - context.clearRect(0, 0, canvas.width, canvas.height); + this.addEventListener(proton, () => { + if (clear) context.clearRect(0, 0, canvas.width, canvas.height); - if (zone instanceof PointZone) { - context.beginPath(); - context.fillStyle = style; - context.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true); - context.fill(); - context.closePath(); - } else if (zone instanceof LineZone) { - context.beginPath(); - context.strokeStyle = style; - context.moveTo(zone.x1, zone.y1); - context.lineTo(zone.x2, zone.y2); - context.stroke(); - context.closePath(); - } else if (zone instanceof RectZone) { - context.beginPath(); - context.strokeStyle = style; - context.drawRect(zone.x, zone.y, zone.width, zone.height); - context.stroke(); - context.closePath(); - } else if (zone instanceof CircleZone) { - context.beginPath(); - context.strokeStyle = style; - context.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true); - context.stroke(); - context.closePath(); - } - }); - }, + if (zone instanceof PointZone) { + context.beginPath(); + context.fillStyle = style; + context.arc(zone.x, zone.y, 10, 0, Math.PI * 2, true); + context.fill(); + context.closePath(); + } else if (zone instanceof LineZone) { + context.beginPath(); + context.strokeStyle = style; + context.moveTo(zone.x1, zone.y1); + context.lineTo(zone.x2, zone.y2); + context.stroke(); + context.closePath(); + } else if (zone instanceof RectZone) { + context.beginPath(); + context.strokeStyle = style; + context.drawRect(zone.x, zone.y, zone.width, zone.height); + context.stroke(); + context.closePath(); + } else if (zone instanceof CircleZone) { + context.beginPath(); + context.strokeStyle = style; + context.arc(zone.x, zone.y, zone.radius, 0, Math.PI * 2, true); + context.stroke(); + context.closePath(); + } + }); + }, - drawEmitter(proton, canvas, emitter, clear) { - const context = canvas.getContext('2d'); - const style = this.getStyle(); + drawEmitter(proton, canvas, emitter, clear) { + const context = canvas.getContext("2d"); + const style = this.getStyle(); - this.addEventListener(proton, () => { - if (clear) context.clearRect(0, 0, canvas.width, canvas.height); + this.addEventListener(proton, () => { + if (clear) context.clearRect(0, 0, canvas.width, canvas.height); - context.beginPath(); - context.fillStyle = style; - context.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true); - context.fill(); - context.closePath(); - }); - } -} \ No newline at end of file + context.beginPath(); + context.fillStyle = style; + context.arc(emitter.p.x, emitter.p.y, 10, 0, Math.PI * 2, true); + context.fill(); + context.closePath(); + }); + } +}; diff --git a/src/debug/Stats.js b/src/debug/Stats.js old mode 100644 new mode 100755 index 356c5a2..72951ff --- a/src/debug/Stats.js +++ b/src/debug/Stats.js @@ -1,116 +1,128 @@ export default class Stats { - - constructor(proton) { - this.proton = proton; - this.container = null; - this.type = 1; - - this.emitterIndex = 0; - this.rendererIndex = 0; - } - - update(style, body) { - this.add(style, body); - - const emitter = this.getEmitter(); - const renderer = this.getRenderer(); - let str = ''; - - switch (this.type) { - case 2: - str += 'emitter:' + this.proton.emitters.length + '
'; - if (emitter) str += 'em speed:' + emitter.emitSpeed + '
'; - if (emitter) str += 'pos:' + this.getEmitterPos(emitter); - break; - - case 3: - if (emitter) str += 'initializes:' + emitter.initializes.length + '
'; - if (emitter) str += '' + this.concatArr(emitter.initializes) + '
'; - if (emitter) str += 'behaviours:' + emitter.behaviours.length + '
'; - if (emitter) str += '' + this.concatArr(emitter.behaviours) + '
'; - break; - - case 4: - if (renderer) str += renderer.name + '
'; - if (renderer) str += 'body:' + this.getCreatedNumber(renderer) + '
'; - break; - - default: - str += 'particles:' + this.proton.getCount() + '
'; - str += 'pool:' + this.proton.pool.getCount() + '
'; - str += 'total:' + this.proton.pool.total; - } - - this.container.innerHTML = str; + constructor(proton) { + this.proton = proton; + this.container = null; + this.type = 1; + + this.emitterIndex = 0; + this.rendererIndex = 0; + } + + update(style, body) { + this.add(style, body); + + const emitter = this.getEmitter(); + const renderer = this.getRenderer(); + let str = ""; + + switch (this.type) { + case 2: + str += "emitter:" + this.proton.emitters.length + "
"; + if (emitter) str += "em speed:" + emitter.emitSpeed + "
"; + if (emitter) str += "pos:" + this.getEmitterPos(emitter); + break; + + case 3: + if (emitter) + str += "initializes:" + emitter.initializes.length + "
"; + if (emitter) + str += + '' + + this.concatArr(emitter.initializes) + + "
"; + if (emitter) str += "behaviours:" + emitter.behaviours.length + "
"; + if (emitter) + str += + '' + + this.concatArr(emitter.behaviours) + + "
"; + break; + + case 4: + if (renderer) str += renderer.name + "
"; + if (renderer) str += "body:" + this.getCreatedNumber(renderer) + "
"; + break; + + default: + str += "particles:" + this.proton.getCount() + "
"; + str += "pool:" + this.proton.pool.getCount() + "
"; + str += "total:" + this.proton.pool.total; } - add(style, body) { - if (!this.container) { - this.type = 1; - - this.container = document.createElement('div'); - this.container.style.cssText = [ - 'position:absolute;bottom:0px;left:0;cursor:pointer;', - 'opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;', - 'width:120px;height:50px;background-color:#002;color:#0ff;' - ].join(''); - - this.container.addEventListener('click', e => { - this.type++; - if (this.type > 4) this.type = 1; - }, false); - - let bg, color; - switch (style) { - case 2: - bg = '#201'; - color = '#f08'; - break; - - case 3: - bg = '#020'; - color = '#0f0'; - break; - - default: - bg = '#002'; - color = '#0ff'; - } - - this.container.style['background-color'] = bg; - this.container.style['color'] = color; - } - - if (!this.container.parentNode) { - body = body || this.body || document.body; - body.appendChild(this.container); - } + this.container.innerHTML = str; + } + + add(style, body) { + if (!this.container) { + this.type = 1; + + this.container = document.createElement("div"); + this.container.style.cssText = [ + "position:absolute;bottom:0px;left:0;cursor:pointer;", + "opacity:0.9;z-index:10000;padding:10px;font-size:12px;font-family:Helvetica,Arial,sans-serif;", + "width:120px;height:50px;background-color:#002;color:#0ff;" + ].join(""); + + this.container.addEventListener( + "click", + e => { + this.type++; + if (this.type > 4) this.type = 1; + }, + false + ); + + let bg, color; + switch (style) { + case 2: + bg = "#201"; + color = "#f08"; + break; + + case 3: + bg = "#020"; + color = "#0f0"; + break; + + default: + bg = "#002"; + color = "#0ff"; + } + + this.container.style["background-color"] = bg; + this.container.style["color"] = color; } - getEmitter() { - return this.proton.emitters[this.emitterIndex]; + if (!this.container.parentNode) { + body = body || this.body || document.body; + body.appendChild(this.container); } + } - getRenderer() { - return this.proton.renderers[this.rendererIndex]; - } + getEmitter() { + return this.proton.emitters[this.emitterIndex]; + } - concatArr(arr) { - let result = ''; - if (!arr || !arr.length) return result; + getRenderer() { + return this.proton.renderers[this.rendererIndex]; + } - for (let i = 0; i < arr.length; i++) { - result += (arr[i].name || '').substr(0, 1) + '.'; - } + concatArr(arr) { + let result = ""; + if (!arr || !arr.length) return result; - return result; + for (let i = 0; i < arr.length; i++) { + result += (arr[i].name || "").substr(0, 1) + "."; } - getCreatedNumber(renderer) { - return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0; - } + return result; + } - getEmitterPos(e) { - return Math.round(e.p.x) + ',' + Math.round(e.p.y); - } -} \ No newline at end of file + getCreatedNumber(renderer) { + return renderer.pool.total || (renderer.cpool && renderer.cpool.total) || 0; + } + + getEmitterPos(e) { + return Math.round(e.p.x) + "," + Math.round(e.p.y); + } +} diff --git a/src/emitter/BehaviourEmitter.js b/src/emitter/BehaviourEmitter.js old mode 100644 new mode 100755 index 20aa438..b49545e --- a/src/emitter/BehaviourEmitter.js +++ b/src/emitter/BehaviourEmitter.js @@ -1,57 +1,56 @@ -import Emitter from './Emitter'; +import Emitter from "./Emitter"; export default class BehaviourEmitter extends Emitter { - - /** - * The BehaviourEmitter class inherits from Proton.Emitter - * - * use the BehaviourEmitter you can add behaviours to self; - * @class Proton.BehaviourEmitter - * @constructor - * @param {Object} pObj the parameters object; - */ - constructor(pObj) { - super(pObj); - - this.selfBehaviours = []; - }; - - /** - * add the Behaviour to emitter; - * - * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3); - * @method addSelfBehaviour - * @param {Proton.Behaviour} behaviour like this new Proton.Color('random') - */ - addSelfBehaviour(...rest) { - const length = rest.length; - let i; - - for (i = 0; i < length; i++) { - this.selfBehaviours.push(rest[i]); - } - }; - - /** - * remove the Behaviour for self - * @method removeSelfBehaviour - * @param {Proton.Behaviour} behaviour a behaviour - */ - removeSelfBehaviour(behaviour) { - const index = this.selfBehaviours.indexOf(behaviour); - if (index > -1) this.selfBehaviours.splice(index, 1); - }; - - update(time) { - super.update(time); - - if (!this.sleep) { - const length = this.selfBehaviours.length; - let i; - - for (i = 0; i < length; i++) { - this.selfBehaviours[i].applyBehaviour(this, time, i); - } - } - } -} \ No newline at end of file + /** + * The BehaviourEmitter class inherits from Proton.Emitter + * + * use the BehaviourEmitter you can add behaviours to self; + * @class Proton.BehaviourEmitter + * @constructor + * @param {Object} conf the parameters object; + */ + constructor(conf) { + super(conf); + + this.selfBehaviours = []; + } + + /** + * add the Behaviour to emitter; + * + * you can use Behaviours array:emitter.addSelfBehaviour(Behaviour1,Behaviour2,Behaviour3); + * @method addSelfBehaviour + * @param {Proton.Behaviour} behaviour like this new Proton.Color('random') + */ + addSelfBehaviour(...rest) { + let i, + length = rest.length; + + for (i = 0; i < length; i++) { + this.selfBehaviours.push(rest[i]); + } + } + + /** + * remove the Behaviour for self + * @method removeSelfBehaviour + * @param {Proton.Behaviour} behaviour a behaviour + */ + removeSelfBehaviour(behaviour) { + const index = this.selfBehaviours.indexOf(behaviour); + if (index > -1) this.selfBehaviours.splice(index, 1); + } + + update(time) { + super.update(time); + + if (!this.sleep) { + const length = this.selfBehaviours.length; + let i; + + for (i = 0; i < length; i++) { + this.selfBehaviours[i].applyBehaviour(this, time, i); + } + } + } +} diff --git a/src/emitter/Emitter.js b/src/emitter/Emitter.js old mode 100644 new mode 100755 index 57eafad..280bab9 --- a/src/emitter/Emitter.js +++ b/src/emitter/Emitter.js @@ -1,325 +1,314 @@ -import Util from '../utils/Util'; -import Particle from '../core/Particle'; -import EventDispatcher from '../events/EventDispatcher'; +import Util from "../utils/Util"; +import Puid from "../utils/Puid"; +import Particle from "../core/Particle"; +import EventDispatcher from "../events/EventDispatcher"; -import Rate from '../initialize/Rate'; -import InitializeUtil from '../initialize/InitializeUtil'; +import Rate from "../initialize/Rate"; +import InitializeUtil from "../initialize/InitializeUtil"; export default class Emitter extends Particle { - - static ID = 0; - - /** - * You can use this emit particles. - * - * It will dispatch follow events: - * PARTICLE_CREATED - * PARTICLE_UPDATA - * PARTICLE_DEAD - * - * @class Emitter - * @constructor - * @param {Object} pObj the parameters object; - * for example {damping:0.01,bindEmitter:false} - */ - constructor(pObj) { - super(pObj); - - this.initializes = []; - this.particles = []; - this.behaviours = []; - - this.emitSpeed = 0; - this.emitTime = 0; - this.totalTime = -1; - - /** - * The friction coefficient for all particle emit by This; - * @property damping - * @type {Number} - * @default 0.006 - */ - this.damping = .006; - - /** - * If bindEmitter the particles can bind this emitter's property; - * @property bindEmitter - * @type {Boolean} - * @default true - */ - this.bindEmitter = true; - - /** - * The number of particles per second emit (a [particle]/b [s]); - * @property rate - * @type {Rate} - * @default Rate(1, .1) - */ - this.rate = new Rate(1, .1); - - this.id = `emitter_${Emitter.ID++}`; - this.name = 'Emitter'; - } - - /** - * start emit particle - * @method emit - * @param {Number} emitTime begin emit time; - * @param {String} life the life of this emitter - */ - emit(totalTime, life) { - this.stoped = false; - this.emitTime = 0; - this.totalTime = Util.initValue(totalTime, Infinity); - - if (life === true || life === 'life' || life === 'destroy') { - this.life = totalTime === 'once' ? 1 : this.totalTime; - } else if (!isNaN(life)) { - this.life = life; - } - - this.rate.init(); - } - - /** - * stop emiting - * @method stop - */ - stop() { - this.totalTime = -1; - this.emitTime = 0; - this.stoped = true; - } - - preEmit(time) { - let oldStoped = this.stoped; - let oldEmitTime = this.emitTime; - let oldTotalTime = this.totalTime; - - this.stoped = false; - this.emitTime = 0; - this.totalTime = time; - this.rate.init(); - - const step = 0.0167; - while (time > step) { - time -= step; - this.update(step); - } - - this.stoped = oldStoped; - this.emitTime = oldEmitTime + Math.max(time, 0); - this.totalTime = oldTotalTime; - } - - /** - * remove current all particles - * @method removeAllParticles - */ - removeAllParticles() { - let i = this.particles.length; - while (i--) this.particles[i].dead = true; - } - - /** - * add initialize to this emitter - * @method addSelfInitialize - */ - addSelfInitialize(pObj) { - if (pObj['init']) { - pObj.init(this); - } else { - this.initAll(); - } - } - - /** - * add the Initialize to particles; - * - * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3); - * @method addInitialize - * @param {Initialize} initialize like this new Radius(1, 12) - */ - addInitialize(...rest) { - let i = rest.length; - while (i--) - this.initializes.push(rest[i]); - } - - /** - * remove the Initialize - * @method removeInitialize - * @param {Initialize} initialize a initialize - */ - removeInitialize(initializer) { - const index = this.initializes.indexOf(initializer); - if (index > -1) this.initializes.splice(index, 1); - } - - /** - * remove all Initializes - * @method removeInitializers - */ - removeAllInitializers() { - Util.destroyArray(this.initializes); - } - - /** - * add the Behaviour to particles; - * - * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3); - * @method addBehaviour - * @param {Behaviour} behaviour like this new Color('random') - */ - addBehaviour(...rest) { - let i = arguments.length; - while (i--) { - let behaviour = rest[i]; - this.behaviours.push(behaviour); - if (behaviour.parents) behaviour.parents.push(this); - } - } - - /** - * remove the Behaviour - * @method removeBehaviour - * @param {Behaviour} behaviour a behaviour - */ - removeBehaviour(behaviour) { - let index = this.behaviours.indexOf(behaviour); - this.behaviours.splice(index, 1); - - if (behaviour.parents) { - index = behaviour.parents.indexOf(behaviour); - behaviour.parents.splice(index, 1); - } - - return index; - } - - /** - * remove all behaviours - * @method removeAllBehaviours - */ - removeAllBehaviours() { - Util.destroyArray(this.behaviours); - } - - // emitter update - update(time) { - this.age += time; - if (this.age >= this.life || this.dead) this.destroy(); - - this.emitting(time); - this.integrate(time); - } - - integrate(time) { - if (!this.parent) return; - - const damping = 1 - this.damping; - this.parent.integrator.calculate(this, time, damping); - - const length = this.particles.length; - let i, particle; - - for (i = length - 1; i >= 0; i--) { - particle = this.particles[i]; - - // particle update - particle.update(time, i); - this.parent.integrator.calculate(particle, time, damping); - this.dispatch('PARTICLE_UPDATE', particle); - - // check dead - if (particle.dead) { - this.dispatch('PARTICLE_DEAD', particle); - - this.parent.pool.expire(particle); - this.particles.splice(i, 1); - } - } - } - - dispatch(event, target) { - this.parent && this.parent.dispatchEvent(event, target); - this.bindEvent && this.dispatchEvent(event, target); - } - - emitting(time) { - if (this.totalTime === 'once') { - let i; - const length = this.rate.getValue(99999); - - if (length > 0) this.emitSpeed = length; - for (i = 0; i < length; i++) this.createParticle(); - this.totalTime = 'none'; - } - - else { - this.emitTime += time; - - if (this.emitTime < this.totalTime) { - const length = this.rate.getValue(time) - let i; - - if (length > 0) this.emitSpeed = length; - for (i = 0; i < length; i++) this.createParticle(); - } - } - } - - /** - * create single particle; - * - * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun}) - * @method removeAllParticles - */ - createParticle(initialize, behaviour) { - const particle = this.parent.pool.get(Particle); - this.setupParticle(particle, initialize, behaviour); - this.dispatch('PARTICLE_CREATED', particle); - - return particle; - } - - setupParticle(particle, initialize, behaviour) { - let initializes = this.initializes; - let behaviours = this.behaviours; - - if (initialize) { - initializes = Util.isArray(initialize) ? initialize : [initialize]; - } - - if (behaviour) { - behaviours = Util.isArray(behaviour) ? behaviour : [behaviour]; - } - - particle.reset(); - InitializeUtil.initialize(this, particle, initializes); - particle.addBehaviours(behaviours); - particle.parent = this; - - this.particles.push(particle); - } - - remove() { - this.stop(); - Util.destroy(this.particles); - } - - /** - * Destory this Emitter - * @method destroy - */ - destroy(slow) { - this.dead = true; - this.remove(); - this.removeAllInitializers(); - this.removeAllBehaviours(); - this.parent && this.parent.removeEmitter(this); - } - + /** + * You can use this emit particles. + * + * It will dispatch follow events: + * PARTICLE_CREATED + * PARTICLE_UPDATA + * PARTICLE_DEAD + * + * @class Emitter + * @constructor + * @param {Object} conf the parameters object; + * for example {damping:0.01,bindEmitter:false} + */ + constructor(conf = {}) { + super(conf); + + this.particles = []; + this.behaviours = []; + this.initializes = []; + + this.emitTime = 0; + this.emitSpeed = 0; + this.totalTime = -1; + + /** + * The friction coefficient for all particle emit by This; + * @property damping + * @type {Number} + * @default 0.006 + */ + this.damping = 0.006; + + /** + * If bindEmitter the particles can bind this emitter's property; + * @property bindEmitter + * @type {Boolean} + * @default true + */ + this.bindEmitter = true; + + /** + * The number of particles per second emit (a [particle]/b [s]); + * @property rate + * @type {Rate} + * @default Rate(1, .1) + */ + this.rate = new Rate(1, 0.1); + + this.name = "Emitter"; + this.id = Puid.id(this.name); + } + + /** + * start emit particle + * @method emit + * @param {Number} emitTime begin emit time; + * @param {String} life the life of this emitter + */ + emit(totalTime, life) { + this.stoped = false; + this.emitTime = 0; + this.totalTime = Util.initValue(totalTime, Infinity); + + if (life === true || life === "life" || life === "destroy") { + this.life = totalTime === "once" ? 1 : this.totalTime; + } else if (!isNaN(life)) { + this.life = life; + } + + this.rate.init(); + } + + /** + * stop emiting + * @method stop + */ + stop() { + this.totalTime = -1; + this.emitTime = 0; + this.stoped = true; + } + + preEmit(time) { + let oldStoped = this.stoped; + let oldEmitTime = this.emitTime; + let oldTotalTime = this.totalTime; + + this.stoped = false; + this.emitTime = 0; + this.totalTime = time; + this.rate.init(); + + const step = 0.0167; + while (time > step) { + time -= step; + this.update(step); + } + + this.stoped = oldStoped; + this.emitTime = oldEmitTime + Math.max(time, 0); + this.totalTime = oldTotalTime; + } + + /** + * remove current all particles + * @method removeAllParticles + */ + removeAllParticles() { + let i = this.particles.length; + while (i--) this.particles[i].dead = true; + } + + /** + * add initialize to this emitter + * @method addSelfInitialize + */ + addSelfInitialize(initialize) { + if (initialize["init"]) { + initialize.init(this); + } else { + this.initAll(); + } + } + + /** + * add the Initialize to particles; + * + * you can use initializes array:for example emitter.addInitialize(initialize1,initialize2,initialize3); + * @method addInitialize + * @param {Initialize} initialize like this new Radius(1, 12) + */ + addInitialize(...rest) { + let i = rest.length; + while (i--) this.initializes.push(rest[i]); + } + + /** + * remove the Initialize + * @method removeInitialize + * @param {Initialize} initialize a initialize + */ + removeInitialize(initializer) { + const index = this.initializes.indexOf(initializer); + if (index > -1) this.initializes.splice(index, 1); + } + + /** + * remove all Initializes + * @method removeInitializers + */ + removeAllInitializers() { + Util.emptyArray(this.initializes); + } + + /** + * add the Behaviour to particles; + * + * you can use Behaviours array:emitter.addBehaviour(Behaviour1,Behaviour2,Behaviour3); + * @method addBehaviour + * @param {Behaviour} behaviour like this new Color('random') + */ + addBehaviour(...rest) { + let i = arguments.length; + while (i--) { + let behaviour = rest[i]; + this.behaviours.push(behaviour); + if (behaviour.parents) behaviour.parents.push(this); + } + } + + /** + * remove the Behaviour + * @method removeBehaviour + * @param {Behaviour} behaviour a behaviour + */ + removeBehaviour(behaviour) { + let index = this.behaviours.indexOf(behaviour); + this.behaviours.splice(index, 1); + + if (behaviour.parents) { + index = behaviour.parents.indexOf(behaviour); + behaviour.parents.splice(index, 1); + } + + return index; + } + + /** + * remove all behaviours + * @method removeAllBehaviours + */ + removeAllBehaviours() { + Util.emptyArray(this.behaviours); + } + + // emitter update + update(time) { + this.age += time; + if (this.age >= this.life || this.dead) this.destroy(); + + this.emitting(time); + this.integrate(time); + } + + integrate(time) { + if (!this.parent) return; + + const damping = 1 - this.damping; + this.parent.integrator.calculate(this, time, damping); + + const length = this.particles.length; + let i, particle; + + for (i = length - 1; i >= 0; i--) { + particle = this.particles[i]; + + // particle update + particle.update(time, i); + this.parent.integrator.calculate(particle, time, damping); + this.dispatch("PARTICLE_UPDATE", particle); + + // check dead + if (particle.dead) { + this.dispatch("PARTICLE_DEAD", particle); + + this.parent.pool.expire(particle); + this.particles.splice(i, 1); + } + } + } + + dispatch(event, target) { + this.parent && this.parent.dispatchEvent(event, target); + this.bindEvent && this.dispatchEvent(event, target); + } + + emitting(time) { + if (this.totalTime === "once") { + let i; + const length = this.rate.getValue(99999); + + if (length > 0) this.emitSpeed = length; + for (i = 0; i < length; i++) this.createParticle(); + this.totalTime = "none"; + } else { + this.emitTime += time; + + if (this.emitTime < this.totalTime) { + const length = this.rate.getValue(time); + let i; + + if (length > 0) this.emitSpeed = length; + for (i = 0; i < length; i++) this.createParticle(); + } + } + } + + /** + * create single particle; + * + * can use emit({x:10},new Gravity(10),{'particleUpdate',fun}) or emit([{x:10},new Initialize],new Gravity(10),{'particleUpdate',fun}) + * @method removeAllParticles + */ + createParticle(initialize, behaviour) { + const particle = this.parent.pool.get(Particle); + this.setupParticle(particle, initialize, behaviour); + this.dispatch("PARTICLE_CREATED", particle); + + return particle; + } + + setupParticle(particle, initialize, behaviour) { + let initializes = this.initializes; + let behaviours = this.behaviours; + + if (initialize) initializes = Util.toArray(initialize); + if (behaviour) behaviours = Util.toArray(behaviour); + + particle.reset(); + InitializeUtil.initialize(this, particle, initializes); + particle.addBehaviours(behaviours); + particle.parent = this; + + this.particles.push(particle); + } + + remove() { + this.stop(); + Util.destroyAll(this.particles); + } + + /** + * Destory this Emitter + * @method destroy + */ + destroy() { + this.dead = true; + this.remove(); + this.removeAllInitializers(); + this.removeAllBehaviours(); + this.parent && this.parent.removeEmitter(this); + } } -EventDispatcher.bind(Emitter); \ No newline at end of file +EventDispatcher.bind(Emitter); diff --git a/src/emitter/FollowEmitter.js b/src/emitter/FollowEmitter.js old mode 100644 new mode 100755 index 254307c..3af5a4c --- a/src/emitter/FollowEmitter.js +++ b/src/emitter/FollowEmitter.js @@ -1,73 +1,79 @@ -import Util from '../utils/Util'; -import Emitter from './Emitter'; +import Util from "../utils/Util"; +import Emitter from "./Emitter"; export default class FollowEmitter extends Emitter { + /** + * The FollowEmitter class inherits from Proton.Emitter + * + * use the FollowEmitter will emit particle when mousemoving + * + * @class Proton.FollowEmitter + * @constructor + * @param {Element} mouseTarget mouseevent's target; + * @param {Number} ease the easing of following speed; + * @default 0.7 + * @param {Object} conf the parameters object; + */ + constructor(mouseTarget, ease, conf) { + super(conf); - /** - * The FollowEmitter class inherits from Proton.Emitter - * - * use the FollowEmitter will emit particle when mousemoving - * - * @class Proton.FollowEmitter - * @constructor - * @param {Element} mouseTarget mouseevent's target; - * @param {Number} ease the easing of following speed; - * @default 0.7 - * @param {Object} pObj the parameters object; - */ - constructor(mouseTarget, ease, pObj) { - super(pObj); + this.mouseTarget = Util.initValue(mouseTarget, window); + this.ease = Util.initValue(ease, 0.7); - this.mouseTarget = Util.initValue(mouseTarget, window); - this.ease = Util.initValue(ease, 0.7); + this._allowEmitting = false; + this.initEventHandler(); + } - this._allowEmitting = false; - this.initEventHandler(); - }; + initEventHandler() { + this.mousemoveHandler = e => this.mousemove.call(this, e); + this.mousedownHandler = e => this.mousedown.call(this, e); + this.mouseupHandler = e => this.mouseup.call(this, e); - initEventHandler() { - this.mousemoveHandler = e => this.mousemove.call(this, e); - this.mousedownHandler = e => this.mousedown.call(this, e); - this.mouseupHandler = e => this.mouseup.call(this, e); + this.mouseTarget.addEventListener( + "mousemove", + this.mousemoveHandler, + false + ); + } - this.mouseTarget.addEventListener('mousemove', this.mousemoveHandler, false); - } + /** + * start emit particle + * @method emit + */ + emit() { + this._allowEmitting = true; + } - /** - * start emit particle - * @method emit - */ - emit() { - this._allowEmitting = true; - } + /** + * stop emiting + * @method stop + */ + stop() { + this._allowEmitting = false; + } - /** - * stop emiting - * @method stop - */ - stop() { - this._allowEmitting = false; - } + mousemove(e) { + if (e.layerX || e.layerX === 0) { + this.p.x += (e.layerX - this.p.x) * this.ease; + this.p.y += (e.layerY - this.p.y) * this.ease; + } else if (e.offsetX || e.offsetX === 0) { + this.p.x += (e.offsetX - this.p.x) * this.ease; + this.p.y += (e.offsetY - this.p.y) * this.ease; + } - mousemove(e) { - if (e.layerX || e.layerX === 0) { - this.p.x += (e.layerX - this.p.x) * this.ease; - this.p.y += (e.layerY - this.p.y) * this.ease; - } else if (e.offsetX || e.offsetX === 0) { - this.p.x += (e.offsetX - this.p.x) * this.ease; - this.p.y += (e.offsetY - this.p.y) * this.ease; - } - - if (this._allowEmitting) super.emit('once'); - }; - - /** - * Destory this Emitter - * @method destroy - */ - destroy() { - super.destroy(); - this.mouseTarget.removeEventListener('mousemove', this.mousemoveHandler, false); - } + if (this._allowEmitting) super.emit("once"); + } + /** + * Destory this Emitter + * @method destroy + */ + destroy() { + super.destroy(); + this.mouseTarget.removeEventListener( + "mousemove", + this.mousemoveHandler, + false + ); + } } diff --git a/src/events/EventDispatcher.js b/src/events/EventDispatcher.js old mode 100644 new mode 100755 index 5c37699..ac04f23 --- a/src/events/EventDispatcher.js +++ b/src/events/EventDispatcher.js @@ -5,88 +5,91 @@ **/ export default class EventDispatcher { + constructor() { + this._listeners = null; + } - constructor() { - this._listeners = null; - } - - static bind(TargetClass) { - TargetClass.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent; - TargetClass.prototype.hasEventListener = EventDispatcher.prototype.hasEventListener; - TargetClass.prototype.addEventListener = EventDispatcher.prototype.addEventListener; - TargetClass.prototype.removeEventListener = EventDispatcher.prototype.removeEventListener; - TargetClass.prototype.removeAllEventListeners = EventDispatcher.prototype.removeAllEventListeners; - } + static bind(target) { + target.prototype.dispatchEvent = EventDispatcher.prototype.dispatchEvent; - addEventListener(type, listener) { - if (!this._listeners) { - this._listeners = {}; - } else { - this.removeEventListener(type, listener); - } - - if (!this._listeners[type]) this._listeners[type] = []; - this._listeners[type].push(listener); - - return listener; - } + target.prototype.hasEventListener = + EventDispatcher.prototype.hasEventListener; - removeEventListener(type, listener) { - if (!this._listeners) return; - if (!this._listeners[type]) return; + target.prototype.addEventListener = + EventDispatcher.prototype.addEventListener; - const arr = this._listeners[type]; - const length = arr.length; + target.prototype.removeEventListener = + EventDispatcher.prototype.removeEventListener; - for (let i = 0; i < length; i++) { - if (arr[i] === listener) { - if (length === 1) { - delete (this._listeners[type]); - } + target.prototype.removeAllEventListeners = + EventDispatcher.prototype.removeAllEventListeners; + } - // allows for faster checks. - else { - arr.splice(i, 1); - } - - break; - } - } + addEventListener(type, listener) { + if (!this._listeners) { + this._listeners = {}; + } else { + this.removeEventListener(type, listener); } - removeAllEventListeners(type) { - if (!type) - this._listeners = null; - else if (this._listeners) - delete (this._listeners[type]); - } + if (!this._listeners[type]) this._listeners[type] = []; + this._listeners[type].push(listener); - dispatchEvent(type, args) { - let result = false; - const listeners = this._listeners; + return listener; + } - if (type && listeners) { - let arr = listeners[type]; - if (!arr) return result; + removeEventListener(type, listener) { + if (!this._listeners) return; + if (!this._listeners[type]) return; - // arr = arr.slice(); - // to avoid issues with items being removed or added during the dispatch + const arr = this._listeners[type]; + const length = arr.length; - let handler; - let i = arr.length; - while (i--) { - handler = arr[i]; - result = result || handler(args); - } + for (let i = 0; i < length; i++) { + if (arr[i] === listener) { + if (length === 1) { + delete this._listeners[type]; + } + // allows for faster checks. + else { + arr.splice(i, 1); } - return !!result; + break; + } } - - hasEventListener(type) { - const listeners = this._listeners; - return !!(listeners && listeners[type]); + } + + removeAllEventListeners(type) { + if (!type) this._listeners = null; + else if (this._listeners) delete this._listeners[type]; + } + + dispatchEvent(type, args) { + let result = false; + const listeners = this._listeners; + + if (type && listeners) { + let arr = listeners[type]; + if (!arr) return result; + + // arr = arr.slice(); + // to avoid issues with items being removed or added during the dispatch + + let handler; + let i = arr.length; + while (i--) { + handler = arr[i]; + result = result || handler(args); + } } -} \ No newline at end of file + return !!result; + } + + hasEventListener(type) { + const listeners = this._listeners; + return !!(listeners && listeners[type]); + } +} diff --git a/src/index.js b/src/index.js old mode 100644 new mode 100755 index 777faf4..6a31fc4 --- a/src/index.js +++ b/src/index.js @@ -1,61 +1,61 @@ -import Proton from './core/Proton'; -import Particle from './core/Particle'; -import Pool from './core/Pool'; - -import Util from './utils/Util'; -import ColorUtil from './utils/ColorUtil'; -import MathUtils from './math/MathUtils'; -import Vector2D from './math/Vector2D'; -import Polar2D from './math/Polar2D'; -import Mat3 from './math/Mat3'; -import Span from './math/Span'; -import ArraySpan from './math/ArraySpan'; -import Rectangle from './math/Rectangle'; -import ease from './math/ease'; - -import Rate from './initialize/Rate'; -import Initialize from './initialize/Initialize'; -import Life from './initialize/Life'; -import Position from './initialize/Position'; -import Velocity from './initialize/Velocity'; -import Mass from './initialize/Mass'; -import Radius from './initialize/Radius'; -import Body from './initialize/Body'; - -import Behaviour from './behaviour/Behaviour'; -import Force from './behaviour/Force'; -import Attraction from './behaviour/Attraction'; -import RandomDrift from './behaviour/RandomDrift'; -import Gravity from './behaviour/Gravity'; -import Collision from './behaviour/Collision'; -import CrossZone from './behaviour/CrossZone'; -import Alpha from './behaviour/Alpha'; -import Scale from './behaviour/Scale'; -import Rotate from './behaviour/Rotate'; -import Color from './behaviour/Color'; -import Repulsion from './behaviour/Repulsion'; -import GravityWell from './behaviour/GravityWell'; - -import Emitter from './emitter/Emitter'; -import BehaviourEmitter from './emitter/BehaviourEmitter'; -import FollowEmitter from './emitter/FollowEmitter'; - -import CanvasRenderer from './render/CanvasRenderer'; -import DomRenderer from './render/DomRenderer'; -import EaselRenderer from './render/EaselRenderer'; -import PixelRenderer from './render/PixelRenderer'; -import PixiRenderer from './render/PixiRenderer'; -import WebGLRenderer from './render/WebGLRenderer'; -import CustomRenderer from './render/CustomRenderer'; - -import Zone from './zone/Zone'; -import LineZone from './zone/LineZone'; -import CircleZone from './zone/CircleZone'; -import PointZone from './zone/PointZone'; -import RectZone from './zone/RectZone'; -import ImageZone from './zone/ImageZone'; - -import Debug from './debug/Debug'; +import Proton from "./core/Proton"; +import Particle from "./core/Particle"; +import Pool from "./core/Pool"; + +import Util from "./utils/Util"; +import ColorUtil from "./utils/ColorUtil"; +import MathUtil from "./math/MathUtil"; +import Vector2D from "./math/Vector2D"; +import Polar2D from "./math/Polar2D"; +import Mat3 from "./math/Mat3"; +import Span from "./math/Span"; +import ArraySpan from "./math/ArraySpan"; +import Rectangle from "./math/Rectangle"; +import ease from "./math/ease"; + +import Rate from "./initialize/Rate"; +import Initialize from "./initialize/Initialize"; +import Life from "./initialize/Life"; +import Position from "./initialize/Position"; +import Velocity from "./initialize/Velocity"; +import Mass from "./initialize/Mass"; +import Radius from "./initialize/Radius"; +import Body from "./initialize/Body"; + +import Behaviour from "./behaviour/Behaviour"; +import Force from "./behaviour/Force"; +import Attraction from "./behaviour/Attraction"; +import RandomDrift from "./behaviour/RandomDrift"; +import Gravity from "./behaviour/Gravity"; +import Collision from "./behaviour/Collision"; +import CrossZone from "./behaviour/CrossZone"; +import Alpha from "./behaviour/Alpha"; +import Scale from "./behaviour/Scale"; +import Rotate from "./behaviour/Rotate"; +import Color from "./behaviour/Color"; +import Repulsion from "./behaviour/Repulsion"; +import GravityWell from "./behaviour/GravityWell"; + +import Emitter from "./emitter/Emitter"; +import BehaviourEmitter from "./emitter/BehaviourEmitter"; +import FollowEmitter from "./emitter/FollowEmitter"; + +import CanvasRenderer from "./render/CanvasRenderer"; +import DomRenderer from "./render/DomRenderer"; +import EaselRenderer from "./render/EaselRenderer"; +import PixelRenderer from "./render/PixelRenderer"; +import PixiRenderer from "./render/PixiRenderer"; +import WebGLRenderer from "./render/WebGLRenderer"; +import CustomRenderer from "./render/CustomRenderer"; + +import Zone from "./zone/Zone"; +import LineZone from "./zone/LineZone"; +import CircleZone from "./zone/CircleZone"; +import PointZone from "./zone/PointZone"; +import RectZone from "./zone/RectZone"; +import ImageZone from "./zone/ImageZone"; + +import Debug from "./debug/Debug"; // namespace Proton.Particle = Proton.P = Particle; @@ -63,7 +63,7 @@ Proton.Pool = Pool; Proton.Util = Util; Proton.ColorUtil = ColorUtil; -Proton.MathUtils = MathUtils; +Proton.MathUtil = MathUtil; Proton.Vector2D = Proton.Vector = Vector2D; Proton.Polar2D = Proton.Polar = Polar2D; Proton.ArraySpan = ArraySpan; @@ -121,4 +121,4 @@ Proton.Debug = Debug; Object.assign(Proton, ease); // export -export default Proton; \ No newline at end of file +export default Proton; diff --git a/src/initialize/Body.js b/src/initialize/Body.js old mode 100644 new mode 100755 index b9e06b4..53b0f2b --- a/src/initialize/Body.js +++ b/src/initialize/Body.js @@ -1,29 +1,34 @@ -import Util from '../utils/Util'; -import ArraySpan from '../math/ArraySpan'; -import Initialize from './Initialize'; +import Util from "../utils/Util"; +import ArraySpan from "../math/ArraySpan"; +import Initialize from "./Initialize"; export default class Body extends Initialize { + constructor(image, w, h) { + super(); - constructor(image, w, h) { - super(); + this.image = this.setSpanValue(image); + this.w = Util.initValue(w, 20); + this.h = Util.initValue(h, this.w); + this.name = "Body"; + } - this.image = this.setSpanValue(image); - this.w = Util.initValue(w, 20); - this.h = Util.initValue(h, this.w); - this.name = 'Body'; - } - - initialize(particle) { - const imagetarget = this.image.getValue(); + initialize(particle) { + const imageTarget = this.image.getValue(); - if (typeof (imagetarget) === 'string') { - particle.body = { width: this.w, height: this.h, src: imagetarget, isInner: true, inner: true }; - } else { - particle.body = imagetarget; - } - }; - - setSpanValue(color) { - return color instanceof ArraySpan ? color : new ArraySpan(color); + if (typeof imageTarget === "string") { + particle.body = { + width: this.w, + height: this.h, + src: imageTarget, + isInner: true, + inner: true + }; + } else { + particle.body = imageTarget; } -} \ No newline at end of file + } + + setSpanValue(image) { + return image instanceof ArraySpan ? image : new ArraySpan(image); + } +} diff --git a/src/initialize/Initialize.js b/src/initialize/Initialize.js old mode 100644 new mode 100755 index 42db392..7e81ae1 --- a/src/initialize/Initialize.js +++ b/src/initialize/Initialize.js @@ -1,17 +1,14 @@ export default class Initialize { + reset() {} - reset() { - } + init(emitter, particle) { + if (particle) { + this.initialize(particle); + } else { + this.initialize(emitter); + } + } - init(emitter, particle) { - if (particle) { - this.initialize(particle); - } else { - this.initialize(emitter); - } - }; - - // sub class init - initialize(target) { - }; -} \ No newline at end of file + // sub class init + initialize(target) {} +} diff --git a/src/initialize/InitializeUtil.js b/src/initialize/InitializeUtil.js old mode 100644 new mode 100755 index 82336cb..085dfa5 --- a/src/initialize/InitializeUtil.js +++ b/src/initialize/InitializeUtil.js @@ -1,36 +1,36 @@ -import Util from '../utils/Util'; -import Initialize from './Initialize'; -import MathUtils from '../math/MathUtils'; +import Util from "../utils/Util"; +import Initialize from "./Initialize"; +import MathUtil from "../math/MathUtil"; export default { + initialize(emitter, particle, initializes) { + const length = initializes.length; + let i; - initialize(emitter, particle, initializes) { - const length = initializes.length; - let i; + for (i = 0; i < length; i++) { + if (initializes[i] instanceof Initialize) { + initializes[i].init(emitter, particle); + } else { + this.init(emitter, particle, initializes[i]); + } + } - for (i = 0; i < length; i++) { - if (initializes[i] instanceof Initialize) - initializes[i].init(emitter, particle); - else - this.init(emitter, particle, initializes[i]); - } + this.bindEmitter(emitter, particle); + }, - this.bindEmitter(emitter, particle); - }, + // init + init(emitter, particle, initialize) { + Util.setProp(particle, initialize); + Util.setVectorVal(particle, initialize); + }, - // init - init(emitter, particle, initialize) { - Util.setPrototypeByObject(particle, initialize); - Util.setVector2DByObject(particle, initialize); - }, + bindEmitter(emitter, particle) { + if (emitter.bindEmitter) { + particle.p.add(emitter.p); + particle.v.add(emitter.v); + particle.a.add(emitter.a); - bindEmitter(emitter, particle) { - if (emitter.bindEmitter) { - particle.p.add(emitter.p); - particle.v.add(emitter.v); - particle.a.add(emitter.a); - - particle.v.rotate(MathUtils.degreeTransform(emitter.rotation)); - } - } -} + particle.v.rotate(MathUtil.degreeTransform(emitter.rotation)); + } + } +}; diff --git a/src/initialize/Life.js b/src/initialize/Life.js old mode 100644 new mode 100755 index dbb0c80..66f5ef4 --- a/src/initialize/Life.js +++ b/src/initialize/Life.js @@ -1,19 +1,16 @@ -import Util from '../utils/Util'; -import Initialize from './Initialize'; +import Span from "../math/Span"; +import Initialize from "./Initialize"; export default class Life extends Initialize { + constructor(a, b, c) { + super(); - constructor(a, b, c) { - super(); + this.lifePan = Span.setSpanValue(a, b, c); + this.name = "Life"; + } - this.lifePan = Util.setSpanValue(a, b, c); - this.name = 'Life'; - } - - initialize(target) { - if (this.lifePan.a === Infinity) - target.life = Infinity; - else - target.life = this.lifePan.getValue(); - } + initialize(target) { + if (this.lifePan.a === Infinity) target.life = Infinity; + else target.life = this.lifePan.getValue(); + } } diff --git a/src/initialize/Mass.js b/src/initialize/Mass.js old mode 100644 new mode 100755 index 540fc7d..4e6b910 --- a/src/initialize/Mass.js +++ b/src/initialize/Mass.js @@ -1,15 +1,14 @@ -import Util from '../utils/Util'; -import Initialize from './Initialize'; +import Span from "../math/Span"; +import Initialize from "./Initialize"; export default class Mass extends Initialize { + constructor(a, b, c) { + super(); + this.massPan = Span.setSpanValue(a, b, c); + this.name = "Mass"; + } - constructor(a, b, c) { - super(); - this.massPan = Util.setSpanValue(a, b, c); - this.name = 'Mass'; - } - - initialize(target) { - target.mass = this.massPan.getValue(); - } -} \ No newline at end of file + initialize(target) { + target.mass = this.massPan.getValue(); + } +} diff --git a/src/initialize/Position.js b/src/initialize/Position.js old mode 100644 new mode 100755 index b106e21..c3637f5 --- a/src/initialize/Position.js +++ b/src/initialize/Position.js @@ -1,25 +1,22 @@ -import Util from '../utils/Util'; -import PointZone from '../zone/PointZone'; -import Initialize from './Initialize'; +import Util from "../utils/Util"; +import PointZone from "../zone/PointZone"; +import Initialize from "./Initialize"; export default class Position extends Initialize { + constructor(zone) { + super(); + this.zone = Util.initValue(zone, new PointZone()); + this.name = "Position"; + } - constructor(zone) { - super(); - this.zone = Util.initValue(zone, new PointZone()); - - this.name = 'Position'; - } - - reset(zone) { - this.zone = Util.initValue(zone, new PointZone()); - } - - initialize(target) { - this.zone.getPosition(); - - target.p.x = this.zone.vector.x; - target.p.y = this.zone.vector.y; - }; + reset(zone) { + this.zone = Util.initValue(zone, new PointZone()); + } + initialize(target) { + this.zone.getPosition(); + + target.p.x = this.zone.vector.x; + target.p.y = this.zone.vector.y; + } } diff --git a/src/initialize/Radius.js b/src/initialize/Radius.js old mode 100644 new mode 100755 index dd5e210..95fc3d1 --- a/src/initialize/Radius.js +++ b/src/initialize/Radius.js @@ -1,21 +1,20 @@ -import Util from '../utils/Util'; -import Initialize from './Initialize'; +import Span from "../math/Span"; +import Initialize from "./Initialize"; export default class Radius extends Initialize { + constructor(a, b, c) { + super(); + this.radius = Span.setSpanValue(a, b, c); - constructor(a, b, c) { - super(); - this.radius = Util.setSpanValue(a, b, c); + this.name = "Radius"; + } - this.name = 'Radius'; - } + reset(a, b, c) { + this.radius = Span.setSpanValue(a, b, c); + } - reset(a, b, c) { - this.radius = Util.setSpanValue(a, b, c); - }; - - initialize(particle) { - particle.radius = this.radius.getValue(); - particle.transform.oldRadius = particle.radius; - }; -} \ No newline at end of file + initialize(particle) { + particle.radius = this.radius.getValue(); + particle.data.oldRadius = particle.radius; + } +} diff --git a/src/initialize/Rate.js b/src/initialize/Rate.js old mode 100644 new mode 100755 index 542c9f4..c13472b --- a/src/initialize/Rate.js +++ b/src/initialize/Rate.js @@ -1,49 +1,47 @@ -import Util from '../utils/Util'; +import Span from "../math/Span"; +import Util from "../utils/Util"; export default class Rate { - - /** - * The number of particles per second emission (a [particle]/b [s]); - * @namespace - * @memberof! Proton# - * @constructor - * @alias Rate - * - * @param {Array | Number | Span} numpan the number of each emission; - * @param {Array | Number | Span} timepan the time of each emission; - * for example: new Rate(new Span(10, 20), new Span(.1, .25)); - */ - constructor(numpan, timepan) { - this.numPan = Util.setSpanValue(Util.initValue(numpan, 1)); - this.timePan = Util.setSpanValue(Util.initValue(timepan, 1)); - - this.startTime = 0; - this.nextTime = 0; - this.init(); - } - - init() { - this.startTime = 0; - this.nextTime = this.timePan.getValue(); - } - - getValue(time) { - this.startTime += time; - - if (this.startTime >= this.nextTime) { - this.startTime = 0; - this.nextTime = this.timePan.getValue(); - - if (this.numPan.b === 1) { - if (this.numPan.getValue(false) > 0.5) - return 1; - else - return 0; - } else { - return this.numPan.getValue(true); - } - } - - return 0; - } -} \ No newline at end of file + /** + * The number of particles per second emission (a [particle]/b [s]); + * @namespace + * @memberof! Proton# + * @constructor + * @alias Rate + * + * @param {Array | Number | Span} numpan the number of each emission; + * @param {Array | Number | Span} timepan the time of each emission; + * for example: new Rate(new Span(10, 20), new Span(.1, .25)); + */ + constructor(numpan, timepan) { + this.numPan = Span.setSpanValue(Util.initValue(numpan, 1)); + this.timePan = Span.setSpanValue(Util.initValue(timepan, 1)); + + this.startTime = 0; + this.nextTime = 0; + this.init(); + } + + init() { + this.startTime = 0; + this.nextTime = this.timePan.getValue(); + } + + getValue(time) { + this.startTime += time; + + if (this.startTime >= this.nextTime) { + this.startTime = 0; + this.nextTime = this.timePan.getValue(); + + if (this.numPan.b === 1) { + if (this.numPan.getValue(false) > 0.5) return 1; + else return 0; + } else { + return this.numPan.getValue(true); + } + } + + return 0; + } +} diff --git a/src/initialize/Velocity.js b/src/initialize/Velocity.js old mode 100644 new mode 100755 index 4aaee74..1720fee --- a/src/initialize/Velocity.js +++ b/src/initialize/Velocity.js @@ -1,40 +1,43 @@ -import Proton from '../core/Proton'; -import Util from '../utils/Util'; -import Polar2D from '../math/Polar2D'; -import MathUtils from '../math/MathUtils'; -import Initialize from './Initialize'; +import Proton from "../core/Proton"; +import Span from "../math/Span"; +import Util from "../utils/Util"; +import Initialize from "./Initialize"; +import Polar2D from "../math/Polar2D"; +import MathUtil from "../math/MathUtil"; export default class Velocity extends Initialize { - - constructor(rpan, thapan, type) { - super(); - - this.rPan = Util.setSpanValue(rpan); - this.thaPan = Util.setSpanValue(thapan); - this.type = Util.initValue(type, 'vector'); - - this.name = 'Velocity'; - } - - reset(rpan, thapan, type) { - this.rPan = Util.setSpanValue(rpan); - this.thaPan = Util.setSpanValue(thapan); - this.type = Util.initValue(type, 'vector'); - }; - - normalizeVelocity(vr) { - return vr * Proton.MEASURE; + constructor(rpan, thapan, type) { + super(); + + this.rPan = Span.setSpanValue(rpan); + this.thaPan = Span.setSpanValue(thapan); + this.type = Util.initValue(type, "vector"); + + this.name = "Velocity"; + } + + reset(rpan, thapan, type) { + this.rPan = Span.setSpanValue(rpan); + this.thaPan = Span.setSpanValue(thapan); + this.type = Util.initValue(type, "vector"); + } + + normalizeVelocity(vr) { + return vr * Proton.MEASURE; + } + + initialize(target) { + if (this.type === "p" || this.type === "P" || this.type === "polar") { + const polar2d = new Polar2D( + this.normalizeVelocity(this.rPan.getValue()), + this.thaPan.getValue() * MathUtil.PI_180 + ); + + target.v.x = polar2d.getX(); + target.v.y = polar2d.getY(); + } else { + target.v.x = this.normalizeVelocity(this.rPan.getValue()); + target.v.y = this.normalizeVelocity(this.thaPan.getValue()); } - - initialize(target) { - if (this.type === 'p' || this.type === 'P' || this.type === 'polar') { - const polar2d = new Polar2D(this.normalizeVelocity(this.rPan.getValue()), this.thaPan.getValue() * MathUtils.PI_180); - - target.v.x = polar2d.getX(); - target.v.y = polar2d.getY(); - } else { - target.v.x = this.normalizeVelocity(this.rPan.getValue()); - target.v.y = this.normalizeVelocity(this.thaPan.getValue()); - } - }; -} \ No newline at end of file + } +} diff --git a/src/math/ArraySpan.js b/src/math/ArraySpan.js old mode 100644 new mode 100755 index 169fe17..fcb28f1 --- a/src/math/ArraySpan.js +++ b/src/math/ArraySpan.js @@ -1,37 +1,33 @@ -import Span from './Span'; -import Util from '../utils/Util'; -import MathUtils from './MathUtils'; +import Span from "./Span"; +import Util from "../utils/Util"; +import MathUtil from "./MathUtil"; export default class ArraySpan extends Span { + constructor(color) { + super(); + this._arr = Util.toArray(color); + } - constructor(color) { - super(); - this._arr = Util.isArray(color) ? color : [color]; - } + getValue() { + const val = Util.getRandFromArray(this._arr); + return val === "random" || val === "Random" ? MathUtil.randomColor() : val; + } - getValue() { - const color = this._arr[Math.floor(this._arr.length * Math.random())]; - return color === 'random' || color === 'Random' ? MathUtils.randomColor() : color; - } + /** + * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance + * + * @method setSpanValue + * @memberof Proton#Proton.Color + * @instance + * + * @param {Proton.Particle} particle + * @param {Number} the integrate time 1/ms + * @param {Int} the particle index + */ + static createArraySpan(arr) { + if (!arr) return null; - /** - * Make sure that the color is an instance of Proton.ArraySpan, if not it makes a new instance - * - * @method setSpanValue - * @memberof Proton#Proton.Color - * @instance - * - * @param {Proton.Particle} particle - * @param {Number} the integrate time 1/ms - * @param {Int} the particle index - */ - static createArraySpan(arr) { - if (!arr) return null; - - if (arr instanceof ArraySpan) - return arr; - else - return new ArraySpan(arr); - } - -} \ No newline at end of file + if (arr instanceof ArraySpan) return arr; + else return new ArraySpan(arr); + } +} diff --git a/src/math/Integration.js b/src/math/Integration.js old mode 100644 new mode 100755 index 03db6db..63635ce --- a/src/math/Integration.js +++ b/src/math/Integration.js @@ -1,26 +1,26 @@ export default class Integration { + constructor(type) { + this.type = type; + } - constructor(type) { - this.type = type; - } + calculate(particles, time, damping) { + this.eulerIntegrate(particles, time, damping); + } - calculate(particles, time, damping) { - this.eulerIntegrate(particles, time, damping); - } + // Euler Integrate + // https://rosettacode.org/wiki/Euler_method + eulerIntegrate(particle, time, damping) { + if (!particle.sleep) { + particle.old.p.copy(particle.p); + particle.old.v.copy(particle.v); - // Euler Integrate - eulerIntegrate(particle, time, damping) { - if (!particle.sleep) { - particle.old.p.copy(particle.p); - particle.old.v.copy(particle.v); + particle.a.multiplyScalar(1 / particle.mass); + particle.v.add(particle.a.multiplyScalar(time)); + particle.p.add(particle.old.v.multiplyScalar(time)); - particle.a.multiplyScalar(1 / particle.mass); - particle.v.add(particle.a.multiplyScalar(time)); - particle.p.add(particle.old.v.multiplyScalar(time)); + if (damping) particle.v.multiplyScalar(damping); - if (damping) particle.v.multiplyScalar(damping); - - particle.a.clear(); - } - } -} \ No newline at end of file + particle.a.clear(); + } + } +} diff --git a/src/math/Mat3.js b/src/math/Mat3.js old mode 100644 new mode 100755 index 1b85ad1..5aaf968 --- a/src/math/Mat3.js +++ b/src/math/Mat3.js @@ -1,52 +1,77 @@ -export default { - create(mat3) { - const mat = new Float32Array(9); - if (mat3) this.set(mat3, mat); - - return mat; - }, - - set(mat1, mat2) { - for (let i = 0; i < 9; i++) - mat2[i] = mat1[i]; - - return mat2; - }, - - multiply(mat, mat2, mat3) { - let a00 = mat[0], a01 = mat[1], a02 = mat[2], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b00 = mat2[0], b01 = mat2[1], b02 = mat2[2], b10 = mat2[3], b11 = mat2[4], b20 = mat2[6], b21 = mat2[7]; - - mat3[0] = b00 * a00 + b01 * a10; - mat3[1] = b00 * a01 + b01 * a11; - mat3[2] = a02 * b02; - mat3[3] = b10 * a00 + b11 * a10; - mat3[4] = b10 * a01 + b11 * a11; - mat3[6] = b20 * a00 + b21 * a10 + a20; - mat3[7] = b20 * a01 + b21 * a11 + a21; - - return mat3; - }, - - inverse(mat, mat3) { - let a00 = mat[0], a01 = mat[1], a10 = mat[3], a11 = mat[4], a20 = mat[6], a21 = mat[7], b01 = a11, b11 = -a10, b21 = a21 * a10 - a11 * a20, d = a00 * b01 + a01 * b11, id; - - id = 1 / d; - mat3[0] = b01 * id; - mat3[1] = (-a01) * id; - mat3[3] = b11 * id; - mat3[4] = a00 * id; - mat3[6] = b21 * id; - mat3[7] = (-a21 * a00 + a01 * a20) * id; - - return mat3; - }, - - multiplyVec2(m, vec, mat3) { - let x = vec[0], y = vec[1]; - - mat3[0] = x * m[0] + y * m[3] + m[6]; - mat3[1] = x * m[1] + y * m[4] + m[7]; - - return mat3; - } -} \ No newline at end of file +const Mat3 = { + create(mat3) { + const mat = new Float32Array(9); + if (mat3) this.set(mat3, mat); + + return mat; + }, + + set(mat1, mat2) { + for (let i = 0; i < 9; i++) mat2[i] = mat1[i]; + + return mat2; + }, + + multiply(mat, mat2, mat3) { + let a00 = mat[0], + a01 = mat[1], + a02 = mat[2], + a10 = mat[3], + a11 = mat[4], + a20 = mat[6], + a21 = mat[7], + b00 = mat2[0], + b01 = mat2[1], + b02 = mat2[2], + b10 = mat2[3], + b11 = mat2[4], + b20 = mat2[6], + b21 = mat2[7]; + + mat3[0] = b00 * a00 + b01 * a10; + mat3[1] = b00 * a01 + b01 * a11; + mat3[2] = a02 * b02; + mat3[3] = b10 * a00 + b11 * a10; + mat3[4] = b10 * a01 + b11 * a11; + mat3[6] = b20 * a00 + b21 * a10 + a20; + mat3[7] = b20 * a01 + b21 * a11 + a21; + + return mat3; + }, + + inverse(mat, mat3) { + let a00 = mat[0], + a01 = mat[1], + a10 = mat[3], + a11 = mat[4], + a20 = mat[6], + a21 = mat[7], + b01 = a11, + b11 = -a10, + b21 = a21 * a10 - a11 * a20, + d = a00 * b01 + a01 * b11, + id; + + id = 1 / d; + mat3[0] = b01 * id; + mat3[1] = -a01 * id; + mat3[3] = b11 * id; + mat3[4] = a00 * id; + mat3[6] = b21 * id; + mat3[7] = (-a21 * a00 + a01 * a20) * id; + + return mat3; + }, + + multiplyVec2(m, vec, mat3) { + let x = vec[0], + y = vec[1]; + + mat3[0] = x * m[0] + y * m[3] + m[6]; + mat3[1] = x * m[1] + y * m[4] + m[7]; + + return mat3; + } +}; + +export default Mat3; diff --git a/src/math/MathUtil.js b/src/math/MathUtil.js new file mode 100755 index 0000000..62d2d92 --- /dev/null +++ b/src/math/MathUtil.js @@ -0,0 +1,45 @@ +const PI = 3.1415926; +const INFINITY = Infinity; + +const MathUtil = { + PI: PI, + PIx2: PI * 2, + PI_2: PI / 2, + PI_180: PI / 180, + N180_PI: 180 / PI, + Infinity: -999, + + isInfinity(num) { + return num === this.Infinity || num === INFINITY; + }, + + randomAToB(a, b, isInt = false) { + if (!isInt) return a + Math.random() * (b - a); + else return Math.floor(Math.random() * (b - a)) + a; + }, + + randomFloating(center, f, isInt) { + return this.randomAToB(center - f, center + f, isInt); + }, + + randomZone(display) {}, + + degreeTransform(a) { + return (a * PI) / 180; + }, + + toColor16(num) { + return `#${num.toString(16)}`; + }, + + randomColor() { + return ( + "#" + + ("00000" + ((Math.random() * 0x1000000) << 0).toString(16)).slice( + -6 + ) + ); + } +}; + +export default MathUtil; diff --git a/src/math/MathUtils.js b/src/math/MathUtils.js deleted file mode 100644 index df4b0e1..0000000 --- a/src/math/MathUtils.js +++ /dev/null @@ -1,37 +0,0 @@ -const PI = 3.1415926; - -const MathUtils = { - - PI: PI, - PIx2: PI * 2, - PI_2: PI / 2, - PI_180: PI / 180, - N180_PI: 180 / PI, - - randomAToB(a, b, INT) { - if (!INT) - return a + Math.random() * (b - a); - else - return Math.floor(Math.random() * (b - a)) + a; - }, - - randomFloating(center, f, INT) { - return this.randomAToB(center - f, center + f, INT); - }, - - randomZone(display) {}, - - degreeTransform(a) { - return a * PI / 180; - }, - - toColor16(num) { - return '#' + num.toString(16); - }, - - randomColor() { - return '#' + ('00000' + (Math.random() * 0x1000000 << 0).toString(16)).slice(-6); - } -} - -export default MathUtils; \ No newline at end of file diff --git a/src/math/Polar2D.js b/src/math/Polar2D.js old mode 100644 new mode 100755 index fbff21e..1edb794 --- a/src/math/Polar2D.js +++ b/src/math/Polar2D.js @@ -1,62 +1,61 @@ -import Vector2D from './Vector2D'; +import Vector2D from "./Vector2D"; export default class Polar2D { - - constructor(r, tha) { - this.r = Math.abs(r) || 0; - this.tha = tha || 0; - } - - set(r, tha) { - this.r = r; - this.tha = tha; - return this; - } - - setR(r) { - this.r = r; - return this; - } - - setTha(tha) { - this.tha = tha; - return this; - } - - copy(p) { - this.r = p.r; - this.tha = p.tha; - return this; - } - - toVector() { - return new Vector2D(this.getX(), this.getY()); - } - - getX() { - return this.r * Math.sin(this.tha); - } - - getY() { - return -this.r * Math.cos(this.tha); - } - - normalize() { - this.r = 1; - return this; - } - - equals(v) { - return ((v.r === this.r) && (v.tha === this.tha)); - } - - clear() { - this.r = 0.0; - this.tha = 0.0; - return this; - } - - clone() { - return new Polar2D(this.r, this.tha); - } -} \ No newline at end of file + constructor(r, tha) { + this.r = Math.abs(r) || 0; + this.tha = tha || 0; + } + + set(r, tha) { + this.r = r; + this.tha = tha; + return this; + } + + setR(r) { + this.r = r; + return this; + } + + setTha(tha) { + this.tha = tha; + return this; + } + + copy(p) { + this.r = p.r; + this.tha = p.tha; + return this; + } + + toVector() { + return new Vector2D(this.getX(), this.getY()); + } + + getX() { + return this.r * Math.sin(this.tha); + } + + getY() { + return -this.r * Math.cos(this.tha); + } + + normalize() { + this.r = 1; + return this; + } + + equals(v) { + return v.r === this.r && v.tha === this.tha; + } + + clear() { + this.r = 0.0; + this.tha = 0.0; + return this; + } + + clone() { + return new Polar2D(this.r, this.tha); + } +} diff --git a/src/math/Rectangle.js b/src/math/Rectangle.js old mode 100644 new mode 100755 index d54f25b..672ae56 --- a/src/math/Rectangle.js +++ b/src/math/Rectangle.js @@ -1,20 +1,18 @@ export default class Rectangle { + constructor(x, y, w, h) { + this.x = x; + this.y = y; - constructor(x, y, w, h) { - this.x = x; - this.y = y; + this.width = w; + this.height = h; - this.width = w; - this.height = h; + this.bottom = this.y + this.height; + this.right = this.x + this.width; + } - this.bottom = this.y + this.height; - this.right = this.x + this.width; - } - - contains(x, y) { - if (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y) - return true; - else - return false; - } + contains(x, y) { + if (x <= this.right && x >= this.x && y <= this.bottom && y >= this.y) + return true; + else return false; + } } diff --git a/src/math/Span.js b/src/math/Span.js old mode 100644 new mode 100755 index 566639a..f37176a --- a/src/math/Span.js +++ b/src/math/Span.js @@ -1,30 +1,69 @@ -import Util from '../utils/Util'; -import MathUtils from '../math/MathUtils'; +import Util from "../utils/Util"; +import MathUtil from "../math/MathUtil"; export default class Span { + constructor(a, b, center) { + if (Util.isArray(a)) { + this.isArray = true; + this.a = a; + } else { + this.isArray = false; + this.a = Util.initValue(a, 1); + this.b = Util.initValue(b, this.a); + this.center = Util.initValue(center, false); + } + } - constructor(a, b, center) { - this.isArray = false; + getValue(isInt = false) { + if (this.isArray) { + return Util.getRandFromArray(this.a); + } else { + if (!this.center) { + return MathUtil.randomAToB(this.a, this.b, isInt); + } else { + return MathUtil.randomFloating(this.a, this.b, isInt); + } + } + } - if (Util.isArray(a)) { - this.isArray = true; - this.a = a; - } else { - this.a = Util.initValue(a, 1); - this.b = Util.initValue(b, this.a); - this.center = Util.initValue(center, false); - } + /** + * Returns a new Span object + * + * @memberof Proton#Proton.Util + * @method setSpanValue + * + * @todo a, b and c should be 'Mixed' or 'Number'? + * + * @param {Mixed | Span} a + * @param {Mixed} b + * @param {Mixed} c + * + * @return {Span} + */ + static setSpanValue(a, b, c) { + if (a instanceof Span) { + return a; + } else { + if (b === undefined) { + return new Span(a); + } else { + if (c === undefined) return new Span(a, b); + else return new Span(a, b, c); + } + } + } - } - - getValue(INT) { - if (this.isArray) { - return this.a[Math.floor(this.a.length * Math.random())]; - } else { - if (!this.center) - return MathUtils.randomAToB(this.a, this.b, INT); - else - return MathUtils.randomFloating(this.a, this.b, INT); - } - } -} \ No newline at end of file + /** + * Returns the value from a Span, if the param is not a Span it will return the given parameter + * + * @memberof Proton#Proton.Util + * @method getValue + * + * @param {Mixed | Span} pan + * + * @return {Mixed} the value of Span OR the parameter if it is not a Span + */ + static getSpanValue(pan) { + return pan instanceof Span ? pan.getValue() : pan; + } +} diff --git a/src/math/Vector2D.js b/src/math/Vector2D.js old mode 100644 new mode 100755 index 32d1b9c..85f818f --- a/src/math/Vector2D.js +++ b/src/math/Vector2D.js @@ -1,164 +1,160 @@ -import MathUtils from '../math/MathUtils'; +import MathUtil from "../math/MathUtil"; export default class Vector2D { + constructor(x, y) { + this.x = x || 0; + this.y = y || 0; + } - constructor(x, y) { - this.x = x || 0; - this.y = y || 0; - } + set(x, y) { + this.x = x; + this.y = y; + return this; + } - set(x, y) { - this.x = x; - this.y = y; - return this; - } + setX(x) { + this.x = x; + return this; + } - setX(x) { - this.x = x; - return this; - } + setY(y) { + this.y = y; + return this; + } - setY(y) { - this.y = y; - return this; - } + getGradient() { + if (this.x !== 0) return Math.atan2(this.y, this.x); + else if (this.y > 0) return MathUtil.PI_2; + else if (this.y < 0) return -MathUtil.PI_2; + } - getGradient() { - if (this.x !== 0) - return Math.atan2(this.y, this.x); - else if (this.y > 0) - return MathUtils.PI_2; - else if (this.y < 0) - return -MathUtils.PI_2; - } + copy(v) { + this.x = v.x; + this.y = v.y; - copy(v) { - this.x = v.x; - this.y = v.y; + return this; + } - return this; + add(v, w) { + if (w !== undefined) { + return this.addVectors(v, w); } - add(v, w) { - if (w !== undefined) { - return this.addVectors(v, w); - } + this.x += v.x; + this.y += v.y; - this.x += v.x; - this.y += v.y; + return this; + } - return this; - } + addXY(a, b) { + this.x += a; + this.y += b; - addXY(a, b) { - this.x += a; - this.y += b; + return this; + } - return this; - } + addVectors(a, b) { + this.x = a.x + b.x; + this.y = a.y + b.y; - addVectors(a, b) { - this.x = a.x + b.x; - this.y = a.y + b.y; + return this; + } - return this; + sub(v, w) { + if (w !== undefined) { + return this.subVectors(v, w); } - sub(v, w) { - if (w !== undefined) { - return this.subVectors(v, w); - } + this.x -= v.x; + this.y -= v.y; - this.x -= v.x; - this.y -= v.y; + return this; + } - return this; - } + subVectors(a, b) { + this.x = a.x - b.x; + this.y = a.y - b.y; - subVectors(a, b) { - this.x = a.x - b.x; - this.y = a.y - b.y; + return this; + } - return this; + divideScalar(s) { + if (s !== 0) { + this.x /= s; + this.y /= s; + } else { + this.set(0, 0); } - divideScalar(s) { - if (s !== 0) { - this.x /= s; - this.y /= s; - } else { - this.set(0, 0); - } + return this; + } - return this; - } + multiplyScalar(s) { + this.x *= s; + this.y *= s; - multiplyScalar(s) { - this.x *= s; - this.y *= s; + return this; + } - return this; - } + negate() { + return this.multiplyScalar(-1); + } - negate() { - return this.multiplyScalar(-1); - } + dot(v) { + return this.x * v.x + this.y * v.y; + } - dot(v) { - return this.x * v.x + this.y * v.y; - } + lengthSq() { + return this.x * this.x + this.y * this.y; + } - lengthSq() { - return this.x * this.x + this.y * this.y; - } + length() { + return Math.sqrt(this.x * this.x + this.y * this.y); + } - length() { - return Math.sqrt(this.x * this.x + this.y * this.y); - } + normalize() { + return this.divideScalar(this.length()); + } - normalize() { - return this.divideScalar(this.length()); - } + distanceTo(v) { + return Math.sqrt(this.distanceToSquared(v)); + } - distanceTo(v) { - return Math.sqrt(this.distanceToSquared(v)); - } + rotate(tha) { + const x = this.x; + const y = this.y; - rotate(tha) { - const x = this.x; - const y = this.y; + this.x = x * Math.cos(tha) + y * Math.sin(tha); + this.y = -x * Math.sin(tha) + y * Math.cos(tha); - this.x = x * Math.cos(tha) + y * Math.sin(tha); - this.y = -x * Math.sin(tha) + y * Math.cos(tha); + return this; + } - return this; - } + distanceToSquared(v) { + const dx = this.x - v.x; + const dy = this.y - v.y; - distanceToSquared(v) { - const dx = this.x - v.x; - const dy = this.y - v.y; + return dx * dx + dy * dy; + } - return dx * dx + dy * dy; - } + lerp(v, alpha) { + this.x += (v.x - this.x) * alpha; + this.y += (v.y - this.y) * alpha; - lerp(v, alpha) { - this.x += (v.x - this.x) * alpha; - this.y += (v.y - this.y) * alpha; + return this; + } - return this; - } + equals(v) { + return v.x === this.x && v.y === this.y; + } - equals(v) { - return ((v.x === this.x) && (v.y === this.y)); - } + clear() { + this.x = 0.0; + this.y = 0.0; + return this; + } - clear() { - this.x = 0.0; - this.y = 0.0; - return this; - } - - clone() { - return new Vector2D(this.x, this.y); - } -} \ No newline at end of file + clone() { + return new Vector2D(this.x, this.y); + } +} diff --git a/src/math/ease.js b/src/math/ease.js old mode 100644 new mode 100755 index be6b306..086ffcd --- a/src/math/ease.js +++ b/src/math/ease.js @@ -1,124 +1,114 @@ -import MathUtils from './MathUtils'; +import MathUtil from "./MathUtil"; export default { + easeLinear(value) { + return value; + }, - easeLinear(value) { - return value; - }, + easeInQuad(value) { + return Math.pow(value, 2); + }, - easeInQuad(value) { - return Math.pow(value, 2); - }, + easeOutQuad(value) { + return -(Math.pow(value - 1, 2) - 1); + }, - easeOutQuad(value) { - return -(Math.pow((value - 1), 2) - 1); - }, + easeInOutQuad(value) { + if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 2); - easeInOutQuad(value) { - if ((value /= 0.5) < 1) - return 0.5 * Math.pow(value, 2); + return -0.5 * ((value -= 2) * value - 2); + }, - return -0.5 * ((value -= 2) * value - 2); - }, - - easeInCubic(value) { - return Math.pow(value, 3); - }, - - easeOutCubic(value) { - return (Math.pow((value - 1), 3) + 1); - }, - - easeInOutCubic(value) { - if ((value /= 0.5) < 1) - return 0.5 * Math.pow(value, 3); - - return 0.5 * (Math.pow((value - 2), 3) + 2); - }, - - easeInQuart(value) { - return Math.pow(value, 4); - }, - - easeOutQuart(value) { - return -(Math.pow((value - 1), 4) - 1); - }, - - easeInOutQuart(value) { - if ((value /= 0.5) < 1) - return 0.5 * Math.pow(value, 4); - - return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2); - }, - - easeInSine(value) { - return -Math.cos(value * (MathUtils.PI_2)) + 1; - }, - - easeOutSine(value) { - return Math.sin(value * (MathUtils.PI_2)); - }, - - easeInOutSine(value) { - return (-0.5 * (Math.cos(MathUtils.PI * value) - 1)); - }, - - easeInExpo(value) { - return (value === 0) ? 0 : Math.pow(2, 10 * (value - 1)); - }, - - easeOutExpo(value) { - return (value === 1) ? 1 : -Math.pow(2, -10 * value) + 1; - }, - - easeInOutExpo(value) { - if (value === 0) - return 0; - - if (value === 1) - return 1; - - if ((value /= 0.5) < 1) - return 0.5 * Math.pow(2, 10 * (value - 1)); - - return 0.5 * (-Math.pow(2, -10 * --value) + 2); - }, - - easeInCirc(value) { - return -(Math.sqrt(1 - (value * value)) - 1); - }, - - easeOutCirc(value) { - return Math.sqrt(1 - Math.pow((value - 1), 2)); - }, - - easeInOutCirc(value) { - if ((value /= 0.5) < 1) - return -0.5 * (Math.sqrt(1 - value * value) - 1); - return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1); - }, - - easeInBack(value) { - let s = 1.70158; - return (value) * value * ((s + 1) * value - s); - }, - - easeOutBack(value) { - let s = 1.70158; - return (value = value - 1) * value * ((s + 1) * value + s) + 1; - }, - - easeInOutBack(value) { - let s = 1.70158; - if ((value /= 0.5) < 1) - return 0.5 * (value * value * (((s *= (1.525)) + 1) * value - s)); - return 0.5 * ((value -= 2) * value * (((s *= (1.525)) + 1) * value + s) + 2); - }, - - getEasing(ease) { - if (typeof ease === 'function') - return ease; - else - return this[ease] || this.easeLinear; - } -}; \ No newline at end of file + easeInCubic(value) { + return Math.pow(value, 3); + }, + + easeOutCubic(value) { + return Math.pow(value - 1, 3) + 1; + }, + + easeInOutCubic(value) { + if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 3); + + return 0.5 * (Math.pow(value - 2, 3) + 2); + }, + + easeInQuart(value) { + return Math.pow(value, 4); + }, + + easeOutQuart(value) { + return -(Math.pow(value - 1, 4) - 1); + }, + + easeInOutQuart(value) { + if ((value /= 0.5) < 1) return 0.5 * Math.pow(value, 4); + + return -0.5 * ((value -= 2) * Math.pow(value, 3) - 2); + }, + + easeInSine(value) { + return -Math.cos(value * MathUtil.PI_2) + 1; + }, + + easeOutSine(value) { + return Math.sin(value * MathUtil.PI_2); + }, + + easeInOutSine(value) { + return -0.5 * (Math.cos(Math.PI * value) - 1); + }, + + easeInExpo(value) { + return value === 0 ? 0 : Math.pow(2, 10 * (value - 1)); + }, + + easeOutExpo(value) { + return value === 1 ? 1 : -Math.pow(2, -10 * value) + 1; + }, + + easeInOutExpo(value) { + if (value === 0) return 0; + + if (value === 1) return 1; + + if ((value /= 0.5) < 1) return 0.5 * Math.pow(2, 10 * (value - 1)); + + return 0.5 * (-Math.pow(2, -10 * --value) + 2); + }, + + easeInCirc(value) { + return -(Math.sqrt(1 - value * value) - 1); + }, + + easeOutCirc(value) { + return Math.sqrt(1 - Math.pow(value - 1, 2)); + }, + + easeInOutCirc(value) { + if ((value /= 0.5) < 1) return -0.5 * (Math.sqrt(1 - value * value) - 1); + return 0.5 * (Math.sqrt(1 - (value -= 2) * value) + 1); + }, + + easeInBack(value) { + let s = 1.70158; + return value * value * ((s + 1) * value - s); + }, + + easeOutBack(value) { + let s = 1.70158; + return (value = value - 1) * value * ((s + 1) * value + s) + 1; + }, + + easeInOutBack(value) { + let s = 1.70158; + if ((value /= 0.5) < 1) + return 0.5 * (value * value * (((s *= 1.525) + 1) * value - s)); + return 0.5 * ((value -= 2) * value * (((s *= 1.525) + 1) * value + s) + 2); + }, + + getEasing(ease) { + if (typeof ease === "function") return ease; + else return this[ease] || this.easeLinear; + } +}; diff --git a/src/render/BaseRenderer.js b/src/render/BaseRenderer.js old mode 100644 new mode 100755 index cfc525b..1d808c4 --- a/src/render/BaseRenderer.js +++ b/src/render/BaseRenderer.js @@ -1,77 +1,119 @@ -import Pool from '../core/Pool'; -import Util from '../utils/Util'; +import Pool from "../core/Pool"; +import Util from "../utils/Util"; export default class BaseRenderer { - constructor(element, stroke) { + this.pool = new Pool(); this.element = element; this.stroke = stroke; + this.circleConf = { isCircle: true }; this.initHandler(); - - this.circleConf = { isCircle: true }; - this.pool = new Pool(); - this.name = 'BaseRenderer'; + this.name = "BaseRenderer"; } - setStroke(color, thinkness) { - color = Util.initValue(color, '#000000'); - thinkness = Util.initValue(thinkness, 1); - + setStroke(color = "#000000", thinkness = 1) { this.stroke = { color, thinkness }; } initHandler() { - this._protonUpdateHandler = () => { this.onProtonUpdate.call(this) }; - this._protonUpdateAfterHandler = () => { this.onProtonUpdateAfter.call(this) }; - this._emitterAddedHandler = (emitter) => { this.onEmitterAdded.call(this, emitter) }; - this._emitterRemovedHandler = (emitter) => { this.onEmitterRemoved.call(this, emitter) }; - this._particleCreatedHandler = (particle) => { this.onParticleCreated.call(this, particle) }; - this._particleUpdateHandler = (particle) => { this.onParticleUpdate.call(this, particle) }; - this._particleDeadHandler = (particle) => { this.onParticleDead.call(this, particle) }; + this._protonUpdateHandler = () => { + this.onProtonUpdate.call(this); + }; + + this._protonUpdateAfterHandler = () => { + this.onProtonUpdateAfter.call(this); + }; + + this._emitterAddedHandler = emitter => { + this.onEmitterAdded.call(this, emitter); + }; + + this._emitterRemovedHandler = emitter => { + this.onEmitterRemoved.call(this, emitter); + }; + + this._particleCreatedHandler = particle => { + this.onParticleCreated.call(this, particle); + }; + + this._particleUpdateHandler = particle => { + this.onParticleUpdate.call(this, particle); + }; + + this._particleDeadHandler = particle => { + this.onParticleDead.call(this, particle); + }; } init(proton) { this.parent = proton; - proton.addEventListener('PROTON_UPDATE', this._protonUpdateHandler); - proton.addEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler); - - proton.addEventListener('EMITTER_ADDED', this._emitterAddedHandler); - proton.addEventListener('EMITTER_REMOVED', this._emitterRemovedHandler); - - proton.addEventListener('PARTICLE_CREATED', this._particleCreatedHandler); - proton.addEventListener('PARTICLE_UPDATE', this._particleUpdateHandler); - proton.addEventListener('PARTICLE_DEAD', this._particleDeadHandler); + proton.addEventListener("PROTON_UPDATE", this._protonUpdateHandler); + proton.addEventListener( + "PROTON_UPDATE_AFTER", + this._protonUpdateAfterHandler + ); + + proton.addEventListener("EMITTER_ADDED", this._emitterAddedHandler); + proton.addEventListener("EMITTER_REMOVED", this._emitterRemovedHandler); + + proton.addEventListener( + "PARTICLE_CREATED", + this._particleCreatedHandler + ); + proton.addEventListener("PARTICLE_UPDATE", this._particleUpdateHandler); + proton.addEventListener("PARTICLE_DEAD", this._particleDeadHandler); } - resize(width, height) { } + resize(width, height) {} destroy() { this.remove(); } remove(proton) { - this.parent.removeEventListener('PROTON_UPDATE', this._protonUpdateHandler); - this.parent.removeEventListener('PROTON_UPDATE_AFTER', this._protonUpdateAfterHandler); - - this.parent.removeEventListener('EMITTER_ADDED', this._emitterAddedHandler); - this.parent.removeEventListener('EMITTER_REMOVED', this._emitterRemovedHandler); - - this.parent.removeEventListener('PARTICLE_CREATED', this._particleCreatedHandler); - this.parent.removeEventListener('PARTICLE_UPDATE', this._particleUpdateHandler); - this.parent.removeEventListener('PARTICLE_DEAD', this._particleDeadHandler); + this.parent.removeEventListener( + "PROTON_UPDATE", + this._protonUpdateHandler + ); + this.parent.removeEventListener( + "PROTON_UPDATE_AFTER", + this._protonUpdateAfterHandler + ); + + this.parent.removeEventListener( + "EMITTER_ADDED", + this._emitterAddedHandler + ); + this.parent.removeEventListener( + "EMITTER_REMOVED", + this._emitterRemovedHandler + ); + + this.parent.removeEventListener( + "PARTICLE_CREATED", + this._particleCreatedHandler + ); + this.parent.removeEventListener( + "PARTICLE_UPDATE", + this._particleUpdateHandler + ); + this.parent.removeEventListener( + "PARTICLE_DEAD", + this._particleDeadHandler + ); this.parent = null; } - onProtonUpdate() { } - onProtonUpdateAfter() { } + onProtonUpdate() {} + onProtonUpdateAfter() {} - onEmitterAdded(emitter) { } - onEmitterRemoved(emitter) { } + onEmitterAdded(emitter) {} + onEmitterRemoved(emitter) {} - onParticleCreated(particle) { } - onParticleUpdate(particle) { } - onParticleDead(particle) { } -} \ No newline at end of file + onParticleCreated(particle) {} + onParticleUpdate(particle) {} + onParticleDead(particle) {} +} diff --git a/src/render/CanvasRenderer.js b/src/render/CanvasRenderer.js old mode 100644 new mode 100755 index b398831..e5cb8d5 --- a/src/render/CanvasRenderer.js +++ b/src/render/CanvasRenderer.js @@ -1,18 +1,16 @@ -import ImgUtil from '../utils/ImgUtil'; -import ColorUtil from '../utils/ColorUtil'; -import MathUtils from '../math/MathUtils'; -import BaseRenderer from './BaseRenderer'; +import ImgUtil from "../utils/ImgUtil"; +import ColorUtil from "../utils/ColorUtil"; +import MathUtil from "../math/MathUtil"; +import BaseRenderer from "./BaseRenderer"; export default class CanvasRenderer extends BaseRenderer { - constructor(element) { super(element); this.stroke = null; - this.context = this.element.getContext('2d'); + this.context = this.element.getContext("2d"); this.bufferCache = {}; - - this.name = 'CanvasRenderer'; + this.name = "CanvasRenderer"; } resize(width, height) { @@ -25,10 +23,11 @@ export default class CanvasRenderer extends BaseRenderer { } onParticleCreated(particle) { - if (particle.body) + if (particle.body) { ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle); - else - particle.color = particle.color || '#ff0000'; + } else { + particle.color = particle.color || "#ff0000"; + } } onParticleUpdate(particle) { @@ -50,34 +49,65 @@ export default class CanvasRenderer extends BaseRenderer { // private drawCircle drawImage(particle) { - const w = particle.body.width * particle.scale | 0; - const h = particle.body.height * particle.scale | 0; + const w = (particle.body.width * particle.scale) | 0; + const h = (particle.body.height * particle.scale) | 0; const x = particle.p.x - w / 2; const y = particle.p.y - h / 2; if (!!particle.color) { - if (!particle.transform['buffer']) particle.transform.buffer = this.createBuffer(particle.body); - - const bufferContext = particle.transform.buffer.getContext('2d'); - bufferContext.clearRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height); - bufferContext.globalAlpha = particle.alpha; - bufferContext.drawImage(particle.body, 0, 0); - - bufferContext.globalCompositeOperation = 'source-atop'; - bufferContext.fillStyle = ColorUtil.rgbToHex(particle.transform.rgb); - bufferContext.fillRect(0, 0, particle.transform.buffer.width, particle.transform.buffer.height); - bufferContext.globalCompositeOperation = 'source-over'; - bufferContext.globalAlpha = 1; - - this.context.drawImage(particle.transform.buffer, 0, 0, particle.transform.buffer.width, particle.transform.buffer.height, x, y, w, h); + if (!particle.data["buffer"]) + particle.data.buffer = this.createBuffer(particle.body); + + const bufContext = particle.data.buffer.getContext("2d"); + bufContext.clearRect( + 0, + 0, + particle.data.buffer.width, + particle.data.buffer.height + ); + bufContext.globalAlpha = particle.alpha; + bufContext.drawImage(particle.body, 0, 0); + + bufContext.globalCompositeOperation = "source-atop"; + bufContext.fillStyle = ColorUtil.rgbToHex(particle.rgb); + bufContext.fillRect( + 0, + 0, + particle.data.buffer.width, + particle.data.buffer.height + ); + bufContext.globalCompositeOperation = "source-over"; + bufContext.globalAlpha = 1; + + this.context.drawImage( + particle.data.buffer, + 0, + 0, + particle.data.buffer.width, + particle.data.buffer.height, + x, + y, + w, + h + ); } else { this.context.save(); this.context.globalAlpha = particle.alpha; this.context.translate(particle.p.x, particle.p.y); - this.context.rotate(MathUtils.degreeTransform(particle.rotation)); + this.context.rotate(MathUtil.degreeTransform(particle.rotation)); this.context.translate(-particle.p.x, -particle.p.y); - this.context.drawImage(particle.body, 0, 0, particle.body.width, particle.body.height, x, y, w, h); + this.context.drawImage( + particle.body, + 0, + 0, + particle.body.width, + particle.body.height, + x, + y, + w, + h + ); this.context.globalAlpha = 1; this.context.restore(); @@ -86,14 +116,22 @@ export default class CanvasRenderer extends BaseRenderer { // private drawCircle -- drawCircle(particle) { - if (particle.transform['rgb']) - this.context.fillStyle = 'rgba(' + particle.transform.rgb.r + ',' + particle.transform.rgb.g + ',' + particle.transform.rgb.b + ',' + particle.alpha + ')'; - else + if (particle.rgb) { + this.context.fillStyle = `rgba(${particle.rgb.r},${particle.rgb.g},${particle.rgb.b},${particle.alpha})`; + } else { this.context.fillStyle = particle.color; + } // draw circle this.context.beginPath(); - this.context.arc(particle.p.x, particle.p.y, particle.radius, 0, Math.PI * 2, true); + this.context.arc( + particle.p.x, + particle.p.y, + particle.radius, + 0, + Math.PI * 2, + true + ); if (this.stroke) { this.context.strokeStyle = this.stroke.color; @@ -105,14 +143,14 @@ export default class CanvasRenderer extends BaseRenderer { this.context.fill(); } - // private createBuffer -- + // private createBuffer createBuffer(image) { if (image instanceof Image) { - const size = image.width + '_' + image.height; + const size = image.width + "_" + image.height; let canvas = this.bufferCache[size]; if (!canvas) { - canvas = document.createElement('canvas'); + canvas = document.createElement("canvas"); canvas.width = image.width; canvas.height = image.height; this.bufferCache[size] = canvas; @@ -121,4 +159,4 @@ export default class CanvasRenderer extends BaseRenderer { return canvas; } } -} \ No newline at end of file +} diff --git a/src/render/CustomRenderer.js b/src/render/CustomRenderer.js old mode 100644 new mode 100755 index 0ff24e0..d02ff2d --- a/src/render/CustomRenderer.js +++ b/src/render/CustomRenderer.js @@ -1,11 +1,9 @@ -import BaseRenderer from './BaseRenderer'; +import BaseRenderer from "./BaseRenderer"; export default class CustomRenderer extends BaseRenderer { + constructor(element) { + super(element); - constructor(element) { - super(element); - - this.name = 'CustomRenderer'; - } - -} \ No newline at end of file + this.name = "CustomRenderer"; + } +} diff --git a/src/render/DomRenderer.js b/src/render/DomRenderer.js old mode 100644 new mode 100755 index 437ee27..10d713f --- a/src/render/DomRenderer.js +++ b/src/render/DomRenderer.js @@ -1,92 +1,111 @@ -import DomUtil from '../utils/DomUtil'; -import ImgUtil from '../utils/ImgUtil'; -import BaseRenderer from './BaseRenderer'; +import DomUtil from "../utils/DomUtil"; +import ImgUtil from "../utils/ImgUtil"; +import BaseRenderer from "./BaseRenderer"; export default class DomRenderer extends BaseRenderer { - - constructor(element) { - super(element); - - this.stroke = null; - this.pool.create = (body, particle) => this.createBody(body, particle); - this.addImg2Body = this.addImg2Body.bind(this); - - this.transform3d = false; - - this.name = 'DomRenderer'; + constructor(element) { + super(element); + + this.stroke = null; + this.pool.create = (body, particle) => this.createBody(body, particle); + this.addImg2Body = this.addImg2Body.bind(this); + + this.transform3d = false; + this.name = "DomRenderer"; + } + + onParticleCreated(particle) { + if (particle.body) { + ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle); + } else { + particle.body = this.pool.get(this.circleConf, particle); + this.element.appendChild(particle.body); } - - onParticleCreated(particle) { - if (particle.body) { - ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle); - } else { - particle.body = this.pool.get(this.circleConf, particle); - this.element.appendChild(particle.body); - } + } + + onParticleUpdate(particle) { + if (this.bodyReady(particle)) { + if (this.transform3d) + DomUtil.transform3d( + particle.body, + particle.p.x, + particle.p.y, + particle.scale, + particle.rotation + ); + else + DomUtil.transform( + particle.body, + particle.p.x, + particle.p.y, + particle.scale, + particle.rotation + ); + + particle.body.style.opacity = particle.alpha; + if (particle.body.isCircle) { + particle.body.style.backgroundColor = particle.color || "#ff0000"; + } } + } - onParticleUpdate(particle) { - if (this.bodyReady(particle)) { - if (this.transform3d) - DomUtil.transform3d(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation); - else - DomUtil.transform(particle.body, particle.p.x, particle.p.y, particle.scale, particle.rotation); - - particle.body.style.opacity = particle.alpha; - if (particle.body.isCircle) { - particle.body.style.backgroundColor = particle.color || '#ff0000'; - } - } + onParticleDead(particle) { + if (this.bodyReady(particle)) { + this.element.removeChild(particle.body); + this.pool.expire(particle.body); + particle.body = null; } - - onParticleDead(particle) { - if (this.bodyReady(particle)) { - this.element.removeChild(particle.body); - this.pool.expire(particle.body); - particle.body = null; - } - } - - bodyReady(particle) { - return typeof particle.body === 'object' && particle.body && !particle.body.isInner; - } - - // private - addImg2Body(img, particle) { - if (particle.dead) return; - particle.body = this.pool.get(img, particle); - DomUtil.resize(particle.body, img.width, img.height); - - this.element.appendChild(particle.body); + } + + bodyReady(particle) { + return ( + typeof particle.body === "object" && + particle.body && + !particle.body.isInner + ); + } + + // private + addImg2Body(img, particle) { + if (particle.dead) return; + particle.body = this.pool.get(img, particle); + DomUtil.resize(particle.body, img.width, img.height); + + this.element.appendChild(particle.body); + } + + createBody(body, particle) { + if (body.isCircle) return this.createCircle(particle); + else return this.createSprite(body, particle); + } + + // private -- + createCircle(particle) { + const dom = DomUtil.createDiv( + `${particle.id}_dom`, + 2 * particle.radius, + 2 * particle.radius + ); + dom.style.borderRadius = `${particle.radius}px`; + + if (this.stroke) { + dom.style.borderColor = this.stroke.color; + dom.style.borderWidth = `${this.stroke.thinkness}px`; } - - createBody(body, particle) { - if (body.isCircle) - return this.createCircle(particle); - else - return this.createSprite(body, particle); - } - - // private -- - createCircle(particle) { - const dom = DomUtil.createDiv(`${particle.id}_dom`, 2 * particle.radius, 2 * particle.radius); - dom.style.borderRadius = `${particle.radius}px`; - - if (this.stroke) { - dom.style.borderColor = this.stroke.color; - dom.style.borderWidth = `${this.stroke.thinkness}px`; - } - dom.isCircle = true; - - return dom; - } - - createSprite(body, particle) { - const url = typeof body === 'string' ? body : body.src; - const dom = DomUtil.createDiv(`${particle.id}_dom`, body.width, body.height); - dom.style.backgroundImage = `url(${url})`; - - return dom; - } - -} \ No newline at end of file + dom.isCircle = true; + + return dom; + } + + createSprite(body, particle) { + const url = typeof body === "string" ? body : body.src; + const dom = DomUtil.createDiv( + `${particle.id}_dom`, + body.width, + body.height + ); + dom.style.backgroundImage = `url(${url})`; + + return dom; + } +} diff --git a/src/render/EaselRenderer.js b/src/render/EaselRenderer.js old mode 100644 new mode 100755 index d07704e..ee304cf --- a/src/render/EaselRenderer.js +++ b/src/render/EaselRenderer.js @@ -1,71 +1,69 @@ -import BaseRenderer from './BaseRenderer'; +import BaseRenderer from "./BaseRenderer"; export default class EaselRenderer extends BaseRenderer { - - constructor(element, stroke) { - super(element); - - this.stroke = stroke; - this.name = 'EaselRenderer'; + constructor(element, stroke) { + super(element); + + this.stroke = stroke; + this.name = "EaselRenderer"; + } + + onParticleCreated(particle) { + if (particle.body) { + this.createSprite(particle); + } else { + this.createCircle(particle); } - onParticleCreated(particle) { - if (particle.body) { - this.createSprite(particle); - } else { - this.createCircle(particle); - } + this.element.addChild(particle.body); + } - this.element.addChild(particle.body); - } + onParticleUpdate(particle) { + if (particle.body) { + particle.body.x = particle.p.x; + particle.body.y = particle.p.y; - onParticleUpdate(particle) { - if (particle.body) { - particle.body.x = particle.p.x; - particle.body.y = particle.p.y; - - particle.body.alpha = particle.alpha; - particle.body.scaleX = particle.body.scaleY = particle.scale; - particle.body.rotation = particle.rotation; - } + particle.body.alpha = particle.alpha; + particle.body.scaleX = particle.body.scaleY = particle.scale; + particle.body.rotation = particle.rotation; } + } - onParticleDead(particle) { - if (particle.body) { - particle.body.parent && particle.body.parent.removeChild(particle.body); - this.pool.expire(particle.body); - particle.body = null; - } - - if (particle.graphics) this.pool.expire(particle.graphics); + onParticleDead(particle) { + if (particle.body) { + particle.body.parent && particle.body.parent.removeChild(particle.body); + this.pool.expire(particle.body); + particle.body = null; } - // private - createSprite(particle) { - particle.body = this.pool.get(particle.body); + if (particle.graphics) this.pool.expire(particle.graphics); + } - if (particle.body.parent) return; - if (particle.body['image']) { - particle.body.regX = particle.body.image.width / 2; - particle.body.regY = particle.body.image.height / 2; - } - } - - createCircle(particle) { - const graphics = this.pool.get(createjs.Graphics); + // private + createSprite(particle) { + particle.body = this.pool.get(particle.body); - if (this.stroke) { - if (this.stroke instanceof String) - graphics.beginStroke(this.stroke); - else - graphics.beginStroke('#000000'); - } - graphics.beginFill(particle.color || '#ff0000').drawCircle(0, 0, particle.radius); + if (particle.body.parent) return; + if (particle.body["image"]) { + particle.body.regX = particle.body.image.width / 2; + particle.body.regY = particle.body.image.height / 2; + } + } - const shape = this.pool.get(createjs.Shape, [graphics]); + createCircle(particle) { + const graphics = this.pool.get(createjs.Graphics); - particle.body = shape; - particle.graphics = graphics; + if (this.stroke) { + if (this.stroke instanceof String) graphics.beginStroke(this.stroke); + else graphics.beginStroke("#000000"); } + graphics + .beginFill(particle.color || "#ff0000") + .drawCircle(0, 0, particle.radius); + + const shape = this.pool.get(createjs.Shape, [graphics]); -} \ No newline at end of file + particle.body = shape; + particle.graphics = graphics; + } +} diff --git a/src/render/PixelRenderer.js b/src/render/PixelRenderer.js old mode 100644 new mode 100755 index 9192f91..c00c9e3 --- a/src/render/PixelRenderer.js +++ b/src/render/PixelRenderer.js @@ -1,64 +1,87 @@ -import Rectangle from '../math/Rectangle'; -import BaseRenderer from './BaseRenderer'; +import Rectangle from "../math/Rectangle"; +import BaseRenderer from "./BaseRenderer"; export default class PixelRenderer extends BaseRenderer { - - constructor(element, rectangle) { - super(element); - - this.context = this.element.getContext('2d'); - this.imageData = null; - this.rectangle = null; - this.rectangle = rectangle; - this.createImageData(rectangle); - - this.name = 'PixelRenderer'; - } - - resize(width, height) { - this.element.width = width; - this.element.height = height; + constructor(element, rectangle) { + super(element); + + this.context = this.element.getContext("2d"); + this.imageData = null; + this.rectangle = null; + this.rectangle = rectangle; + this.createImageData(rectangle); + + this.name = "PixelRenderer"; + } + + resize(width, height) { + this.element.width = width; + this.element.height = height; + } + + createImageData(rectangle) { + this.rectangle = rectangle + ? rectangle + : new Rectangle(0, 0, this.element.width, this.element.height); + this.imageData = this.context.createImageData( + this.rectangle.width, + this.rectangle.height + ); + this.context.putImageData( + this.imageData, + this.rectangle.x, + this.rectangle.y + ); + } + + onProtonUpdate() { + this.context.clearRect( + this.rectangle.x, + this.rectangle.y, + this.rectangle.width, + this.rectangle.height + ); + this.imageData = this.context.getImageData( + this.rectangle.x, + this.rectangle.y, + this.rectangle.width, + this.rectangle.height + ); + } + + onProtonUpdateAfter() { + this.context.putImageData( + this.imageData, + this.rectangle.x, + this.rectangle.y + ); + } + + onParticleCreated(particle) {} + + onParticleUpdate(particle) { + if (this.imageData) { + this.setPixel( + this.imageData, + Math.floor(particle.p.x - this.rectangle.x), + Math.floor(particle.p.y - this.rectangle.y), + particle + ); } + } - createImageData(rectangle) { - this.rectangle = rectangle ? rectangle : new Rectangle(0, 0, this.element.width, this.element.height); - this.imageData = this.context.createImageData(this.rectangle.width, this.rectangle.height); - this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y); - } - - onProtonUpdate() { - this.context.clearRect(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height); - this.imageData = this.context.getImageData(this.rectangle.x, this.rectangle.y, this.rectangle.width, this.rectangle.height); - } - - onProtonUpdateAfter() { - this.context.putImageData(this.imageData, this.rectangle.x, this.rectangle.y); - } + setPixel(imagedata, x, y, particle) { + const rgb = particle.rgb; + if (x < 0 || x > this.element.width || y < 0 || y > this.elementwidth) + return; - onParticleCreated(particle) {} + const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4; - onParticleUpdate(particle) { - if (this.imageData) { - this.setPixel(this.imageData, Math.floor(particle.p.x - this.rectangle.x), Math.floor(particle.p.y - this.rectangle.y), particle); - } - } - - setPixel(imagedata, x, y, particle) { - const rgb = particle.transform.rgb; - - if ((x < 0) || (x > this.element.width) || (y < 0) || (y > this.elementwidth)) - return; - - const i = ((y >> 0) * imagedata.width + (x >> 0)) * 4; - - imagedata.data[i] = rgb.r; - imagedata.data[i + 1] = rgb.g; - imagedata.data[i + 2] = rgb.b; - imagedata.data[i + 3] = particle.alpha * 255; - } - - onParticleDead(particle) { - - } + imagedata.data[i] = rgb.r; + imagedata.data[i + 1] = rgb.g; + imagedata.data[i + 2] = rgb.b; + imagedata.data[i + 3] = particle.alpha * 255; + } -} \ No newline at end of file + onParticleDead(particle) {} +} diff --git a/src/render/PixiRenderer.js b/src/render/PixiRenderer.js old mode 100644 new mode 100755 index 1bb214a..f41b368 --- a/src/render/PixiRenderer.js +++ b/src/render/PixiRenderer.js @@ -1,103 +1,106 @@ -import ColorUtil from '../utils/ColorUtil'; -import MathUtils from '../math/MathUtils'; -import BaseRenderer from './BaseRenderer'; +import ColorUtil from "../utils/ColorUtil"; +import MathUtil from "../math/MathUtil"; +import BaseRenderer from "./BaseRenderer"; export default class PixiRenderer extends BaseRenderer { - - constructor(element, stroke) { - super(element); - - this.stroke = stroke; - this.setColor = false; - this.pool.create = (body, particle) => this.createBody(body, particle); - this.name = 'PixiRenderer'; - } - - onProtonUpdate() { } - - /** - * @param particle - */ - onParticleCreated(particle) { - if (particle.body) { - particle.body = this.pool.get(particle.body, particle); - } else { - particle.body = this.pool.get(this.circleConf, particle); - } - - this.element.addChild(particle.body); - } - - /** - * @param particle - */ - onParticleUpdate(particle) { - this.transform(particle, particle.body); - if (this.setColor) particle.body.tint = ColorUtil.getHex16FromParticle(particle); + constructor(element, stroke) { + super(element); + + this.stroke = stroke; + this.setColor = false; + this.pool.create = (body, particle) => this.createBody(body, particle); + this.createFromImage = PIXI.Sprite.from || PIXI.Sprite.fromImage; + + this.name = "PixiRenderer"; + } + + onProtonUpdate() {} + + /** + * @param particle + */ + onParticleCreated(particle) { + if (particle.body) { + particle.body = this.pool.get(particle.body, particle); + } else { + particle.body = this.pool.get(this.circleConf, particle); } - /** - * @param particle - */ - onParticleDead(particle) { + this.element.addChild(particle.body); + } + + /** + * @param particle + */ + onParticleUpdate(particle) { + this.transform(particle, particle.body); + if (this.setColor) + particle.body.tint = ColorUtil.getHex16FromParticle(particle); + } + + /** + * @param particle + */ + onParticleDead(particle) { + this.element.removeChild(particle.body); + this.pool.expire(particle.body); + particle.body = null; + } + + destroy(particles) { + super.destroy(); + this.pool.destroy(); + + let i = particles.length; + while (i--) { + let particle = particles[i]; + if (particle.body) { this.element.removeChild(particle.body); - this.pool.expire(particle.body); - particle.body = null; + } } + } - destroy(particles) { - super.destroy(); - this.pool.destroy(); - - let i = particles.length; - while (i--) { - let particle = particles[i]; - if (particle.body) { - this.element.removeChild(particle.body); - } - } - } + transform(particle, target) { + target.x = particle.p.x; + target.y = particle.p.y; - transform(particle, target) { - target.x = particle.p.x; - target.y = particle.p.y; + target.alpha = particle.alpha; - target.alpha = particle.alpha; + target.scale.x = particle.scale; + target.scale.y = particle.scale; - target.scale.x = particle.scale; - target.scale.y = particle.scale; + // using cached version of MathUtil.PI_180 for slight performance increase. + target.rotation = particle.rotation * MathUtil.PI_180; // MathUtil.PI_180; + } - // using cached version of MathUtils.PI_180 for slight performance increase. - target.rotation = particle.rotation * MathUtils.PI_180; // MathUtils.PI_180; - } + createBody(body, particle) { + if (body.isCircle) return this.createCircle(particle); + else return this.createSprite(body); + } - createBody(body, particle) { - if (body.isCircle) - return this.createCircle(particle); - else - return this.createSprite(body); - } + createSprite(body) { + const sprite = body.isInner + ? this.createFromImage(body.src) + : new PIXI.Sprite(body); - createSprite(body) { - const sprite = body.isInner ? PIXI.Sprite.fromImage(body.src) : new PIXI.Sprite(body); - sprite.anchor.x = 0.5; - sprite.anchor.y = 0.5; + sprite.anchor.x = 0.5; + sprite.anchor.y = 0.5; - return sprite; - } + return sprite; + } - createCircle(particle) { - const graphics = new PIXI.Graphics(); + createCircle(particle) { + const graphics = new PIXI.Graphics(); - if (this.stroke) { - const stroke = this.stroke instanceof String ? this.stroke : 0x000000; - graphics.beginStroke(stroke); - } + if (this.stroke) { + const stroke = this.stroke instanceof String ? this.stroke : 0x000000; + graphics.beginStroke(stroke); + } - graphics.beginFill(particle.color || 0x008ced); - graphics.drawCircle(0, 0, particle.radius); - graphics.endFill(); + graphics.beginFill(particle.color || 0x008ced); + graphics.drawCircle(0, 0, particle.radius); + graphics.endFill(); - return graphics; - } -} \ No newline at end of file + return graphics; + } +} diff --git a/src/render/WebGLRenderer.js b/src/render/WebGLRenderer.js old mode 100644 new mode 100755 index f818266..e5eea64 --- a/src/render/WebGLRenderer.js +++ b/src/render/WebGLRenderer.js @@ -6,7 +6,7 @@ import ImgUtil from '../utils/ImgUtil'; import MStack from '../utils/MStack'; import DomUtil from '../utils/DomUtil'; import WebGLUtil from '../utils/WebGLUtil'; -import MathUtils from '../math/MathUtils'; +import MathUtil from '../math/MathUtil'; export default class WebGLRenderer extends BaseRenderer { @@ -168,30 +168,30 @@ export default class WebGLRenderer extends BaseRenderer { const _scaleX = particle.body.width / _width; const _scaleY = particle.body.height / _height; - if (!this.texturebuffers[particle.transform.src]) - this.texturebuffers[particle.transform.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()]; + if (!this.texturebuffers[particle.data.src]) + this.texturebuffers[particle.data.src] = [this.gl.createTexture(), this.gl.createBuffer(), this.gl.createBuffer()]; - particle.transform.texture = this.texturebuffers[particle.transform.src][0]; - particle.transform.vcBuffer = this.texturebuffers[particle.transform.src][1]; - particle.transform.tcBuffer = this.texturebuffers[particle.transform.src][2]; + particle.data.texture = this.texturebuffers[particle.data.src][0]; + particle.data.vcBuffer = this.texturebuffers[particle.data.src][1]; + particle.data.tcBuffer = this.texturebuffers[particle.data.src][2]; - this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer); + this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer); this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _scaleX, 0.0, 0.0, _scaleY, _scaleY, _scaleY]), this.gl.STATIC_DRAW); - this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer); + this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer); this.gl.bufferData(this.gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, _w, 0.0, 0.0, _h, _w, _h]), this.gl.STATIC_DRAW); - const context = particle.transform.canvas.getContext('2d'); + const context = particle.data.canvas.getContext('2d'); const data = context.getImageData(0, 0, _width, _height); - this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture); + this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture); this.gl.texImage2D(this.gl.TEXTURE_2D, 0, this.gl.RGBA, this.gl.RGBA, this.gl.UNSIGNED_BYTE, data); this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MAG_FILTER, this.gl.LINEAR); this.gl.texParameteri(this.gl.TEXTURE_2D, this.gl.TEXTURE_MIN_FILTER, this.gl.LINEAR_MIPMAP_NEAREST); this.gl.generateMipmap(this.gl.TEXTURE_2D); - particle.transform.textureLoaded = true; - particle.transform.textureWidth = _w; - particle.transform.textureHeight = _h; + particle.data.textureLoaded = true; + particle.data.textureWidth = _w; + particle.data.textureHeight = _h; } onProtonUpdate() { @@ -200,17 +200,17 @@ export default class WebGLRenderer extends BaseRenderer { } onParticleCreated(particle) { - particle.transform.textureLoaded = false; - particle.transform.tmat = Mat3.create(); - particle.transform.tmat[8] = 1; - particle.transform.imat = Mat3.create(); - particle.transform.imat[8] = 1; + particle.data.textureLoaded = false; + particle.data.tmat = Mat3.create(); + particle.data.tmat[8] = 1; + particle.data.imat = Mat3.create(); + particle.data.imat[8] = 1; if (particle.body) { ImgUtil.getImgFromCache(particle.body, this.addImg2Body, particle); } else { ImgUtil.getImgFromCache(this.circleCanvasURL, this.addImg2Body, particle); - particle.transform.oldScale = particle.radius / this.circleCanvasRadius; + particle.data.oldScale = particle.radius / this.circleCanvasRadius; } } @@ -218,25 +218,25 @@ export default class WebGLRenderer extends BaseRenderer { addImg2Body(img, particle) { if (particle.dead) return; particle.body = img; - particle.transform.src = img.src; - particle.transform.canvas = ImgUtil.getCanvasFromCache(img); - particle.transform.oldScale = 1; + particle.data.src = img.src; + particle.data.canvas = ImgUtil.getCanvasFromCache(img); + particle.data.oldScale = 1; this.drawImg2Canvas(particle); } onParticleUpdate(particle) { - if (particle.transform.textureLoaded) { + if (particle.data.textureLoaded) { this.updateMatrix(particle); - this.gl.uniform3f(this.sprogram.color, particle.transform.rgb.r / 255, particle.transform.rgb.g / 255, particle.transform.rgb.b / 255); + this.gl.uniform3f(this.sprogram.color, particle.rgb.r / 255, particle.rgb.g / 255, particle.rgb.b / 255); this.gl.uniformMatrix3fv(this.sprogram.tMatUniform, false, this.mstack.top()); - this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.vcBuffer); + this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.vcBuffer); this.gl.vertexAttribPointer(this.sprogram.vpa, 2, this.gl.FLOAT, false, 0, 0); - this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.transform.tcBuffer); + this.gl.bindBuffer(this.gl.ARRAY_BUFFER, particle.data.tcBuffer); this.gl.vertexAttribPointer(this.sprogram.tca, 2, this.gl.FLOAT, false, 0, 0); - this.gl.bindTexture(this.gl.TEXTURE_2D, particle.transform.texture); + this.gl.bindTexture(this.gl.TEXTURE_2D, particle.data.texture); this.gl.uniform1i(this.sprogram.samplerUniform, 0); this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.unitIBuffer); @@ -249,20 +249,20 @@ export default class WebGLRenderer extends BaseRenderer { onParticleDead(particle) { } updateMatrix(particle) { - const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.transform.textureWidth / 2, -particle.transform.textureHeight / 2); + const moveOriginMatrix = WebGLUtil.makeTranslation(-particle.data.textureWidth / 2, -particle.data.textureHeight / 2); const translationMatrix = WebGLUtil.makeTranslation(particle.p.x, particle.p.y); - const angel = particle.rotation * (MathUtils.PI_180); + const angel = particle.rotation * (MathUtil.PI_180); const rotationMatrix = WebGLUtil.makeRotation(angel); - const scale = particle.scale * particle.transform.oldScale; + const scale = particle.scale * particle.data.oldScale; const scaleMatrix = WebGLUtil.makeScale(scale, scale); let matrix = WebGLUtil.matrixMultiply(moveOriginMatrix, scaleMatrix); matrix = WebGLUtil.matrixMultiply(matrix, rotationMatrix); matrix = WebGLUtil.matrixMultiply(matrix, translationMatrix); - Mat3.inverse(matrix, particle.transform.imat); + Mat3.inverse(matrix, particle.data.imat); matrix[2] = particle.alpha; this.mstack.push(matrix); diff --git a/src/utils/ColorUtil.js b/src/utils/ColorUtil.js old mode 100644 new mode 100755 index b5334b6..0330a92 --- a/src/utils/ColorUtil.js +++ b/src/utils/ColorUtil.js @@ -1,45 +1,44 @@ export default { + /** + * @typedef {Object} rgbObject + * @property {Number} r red value + * @property {Number} g green value + * @property {Number} b blue value + */ + /** + * converts a hex value to a rgb object + * + * @memberof Proton#Proton.Util + * @method hexToRgb + * + * @param {String} h any hex value, e.g. #000000 or 000000 for black + * + * @return {rgbObject} + */ + hexToRgb(h) { + const hex16 = h.charAt(0) === "#" ? h.substring(1, 7) : h; + const r = parseInt(hex16.substring(0, 2), 16); + const g = parseInt(hex16.substring(2, 4), 16); + const b = parseInt(hex16.substring(4, 6), 16); - /** - * @typedef {Object} rgbObject - * @property {Number} r red value - * @property {Number} g green value - * @property {Number} b blue value - */ - /** - * converts a hex value to a rgb object - * - * @memberof Proton#Proton.Util - * @method hexToRGB - * - * @param {String} h any hex value, e.g. #000000 or 000000 for black - * - * @return {rgbObject} - */ - hexToRGB(h) { - const hex16 = (h.charAt(0) === '#') ? h.substring(1, 7) : h; - const r = parseInt(hex16.substring(0, 2), 16); - const g = parseInt(hex16.substring(2, 4), 16); - const b = parseInt(hex16.substring(4, 6), 16); + return { r, g, b }; + }, - return { r, g, b }; - }, + /** + * converts a rgb value to a rgb string + * + * @memberof Proton#Proton.Util + * @method rgbToHex + * + * @param {Object | Proton.hexToRgb} rgb a rgb object like in {@link Proton#Proton.} + * + * @return {String} rgb() + */ + rgbToHex(rbg) { + return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`; + }, - /** - * converts a rgb value to a rgb string - * - * @memberof Proton#Proton.Util - * @method rgbToHex - * - * @param {Object | Proton.hexToRGB} rgb a rgb object like in {@link Proton#Proton.} - * - * @return {String} rgb() - */ - rgbToHex(rbg) { - return `rgb(${rbg.r}, ${rbg.g}, ${rbg.b})`; - }, - - getHex16FromParticle(p) { - return Number(p.transform.rgb.r) * 65536 + Number(p.transform.rgb.g) * 256 + Number(p.transform.rgb.b); - } -} \ No newline at end of file + getHex16FromParticle(p) { + return Number(p.rgb.r) * 65536 + Number(p.rgb.g) * 256 + Number(p.rgb.b); + } +}; diff --git a/src/utils/DomUtil.js b/src/utils/DomUtil.js old mode 100644 new mode 100755 index dcbea97..b241fb4 --- a/src/utils/DomUtil.js +++ b/src/utils/DomUtil.js @@ -1,84 +1,79 @@ export default { + /** + * Creates and returns a new canvas. The opacity is by default set to 0 + * + * @memberof Proton#Proton.DomUtil + * @method createCanvas + * + * @param {String} $id the canvas' id + * @param {Number} $width the canvas' width + * @param {Number} $height the canvas' height + * @param {String} [$position=absolute] the canvas' position, default is 'absolute' + * + * @return {Object} + */ + createCanvas(id, width, height, position = "absolute") { + const dom = document.createElement("canvas"); - /** - * Creates and returns a new canvas. The opacity is by default set to 0 - * - * @memberof Proton#Proton.DomUtil - * @method createCanvas - * - * @param {String} $id the canvas' id - * @param {Number} $width the canvas' width - * @param {Number} $height the canvas' height - * @param {String} [$position=absolute] the canvas' position, default is 'absolute' - * - * @return {Object} - */ - createCanvas(id, width, height, position) { - const dom = document.createElement('canvas'); - position = position || 'absolute'; + dom.id = id; + dom.width = width; + dom.height = height; + dom.style.opacity = 0; + dom.style.position = position; + this.transform(dom, -500, -500, 0, 0); - dom.id = id; - dom.width = width; - dom.height = height; - dom.style.opacity = 0; - dom.style.position = position; + return dom; + }, - this.transform(dom, -500, -500, 0, 0); + createDiv(id, width, height) { + const dom = document.createElement("div"); - return dom; - }, + dom.id = id; + dom.style.position = "absolute"; + this.resize(dom, width, height); - createDiv(id, width, height) { - const dom = document.createElement('div'); + return dom; + }, - dom.id = id; - dom.style.position = 'absolute'; - this.resize(dom, width, height); + resize(dom, width, height) { + dom.style.width = width + "px"; + dom.style.height = height + "px"; + dom.style.marginLeft = -width / 2 + "px"; + dom.style.marginTop = -height / 2 + "px"; + }, - return dom; - }, + /** + * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers + * + * @memberof Proton#Proton.DomUtil + * @method transform + * + * @param {HTMLDivElement} div + * @param {Number} $x + * @param {Number} $y + * @param {Number} $scale + * @param {Number} $rotate + */ + transform(div, x, y, scale, rotate) { + div.style.willChange = "transform"; + const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`; + this.css3(div, "transform", transform); + }, - resize(dom, width, height) { - dom.style.width = width + 'px'; - dom.style.height = height + 'px'; - dom.style.marginLeft = -width / 2 + 'px'; - dom.style.marginTop = -height / 2 + 'px'; - }, + transform3d(div, x, y, scale, rotate) { + div.style.willChange = "transform"; + const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`; + this.css3(div, "backfaceVisibility", "hidden"); + this.css3(div, "transform", transform); + }, - /** - * Adds a transform: translate(), scale(), rotate() to a given div dom for all browsers - * - * @memberof Proton#Proton.DomUtil - * @method transform - * - * @param {HTMLDivElement} div - * @param {Number} $x - * @param {Number} $y - * @param {Number} $scale - * @param {Number} $rotate - */ - transform(div, x, y, scale, rotate) { - const transform = `translate(${x}px, ${y}px) scale(${scale}) rotate(${rotate}deg)`; + css3(div, key, val) { + const bkey = key.charAt(0).toUpperCase() + key.substr(1); - div.style.willChange = 'transform'; - this.css3(div, 'transform', transform); - }, - - transform3d(div, x, y, scale, rotate) { - const transform = `translate3d(${x}px, ${y}px, 0) scale(${scale}) rotate(${rotate}deg)`; - - div.style.willChange = 'transform'; - this.css3(div, 'backfaceVisibility', 'hidden'); - this.css3(div, 'transform', transform); - }, - - css3(div, key, val) { - const bkey = key.charAt(0).toUpperCase() + key.substr(1); - - div.style[`Webkit${bkey}`] = val; - div.style[`Moz${bkey}`] = val; - div.style[`O${bkey}`] = val; - div.style[`ms${bkey}`] = val; - div.style[`${key}`] = val; - } -} \ No newline at end of file + div.style[`Webkit${bkey}`] = val; + div.style[`Moz${bkey}`] = val; + div.style[`O${bkey}`] = val; + div.style[`ms${bkey}`] = val; + div.style[`${key}`] = val; + } +}; diff --git a/src/utils/ImgUtil.js b/src/utils/ImgUtil.js old mode 100644 new mode 100755 index 1cc7c52..05d8922 --- a/src/utils/ImgUtil.js +++ b/src/utils/ImgUtil.js @@ -1,74 +1,82 @@ -import WebGLUtil from './WebGLUtil'; -import DomUtil from './DomUtil'; +import WebGLUtil from "./WebGLUtil"; +import DomUtil from "./DomUtil"; -const IMG_CACHE = {}; -const CANVAS_CACHE = {}; -let canvasID = 0; +const imgsCache = {}; +const canvasCache = {}; +let canvasId = 0; export default { + /** + * This will get the image data. It could be necessary to create a Proton.Zone. + * + * @memberof Proton#Proton.Util + * @method getImageData + * + * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')' + * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag'); + * @param {Proton.Rectangle} rect + */ + getImageData(context, image, rect) { + context.drawImage(image, rect.x, rect.y); + const imagedata = context.getImageData( + rect.x, + rect.y, + rect.width, + rect.height + ); + context.clearRect(rect.x, rect.y, rect.width, rect.height); - /** - * This will get the image data. It could be necessary to create a Proton.Zone. - * - * @memberof Proton#Proton.Util - * @method getImageData - * - * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')' - * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag'); - * @param {Proton.Rectangle} rect - */ - getImageData(context, image, rect) { - context.drawImage(image, rect.x, rect.y); - const imagedata = context.getImageData(rect.x, rect.y, rect.width, rect.height); - context.clearRect(rect.x, rect.y, rect.width, rect.height); + return imagedata; + }, - return imagedata; - }, + /** + * @memberof Proton#Proton.Util + * @method getImgFromCache + * + * @todo add description + * @todo describe func + * + * @param {Mixed} img + * @param {Proton.Particle} particle + * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.data.canvas + * @param {Boolean} func + */ + getImgFromCache(img, callback, param) { + const src = typeof img === "string" ? img : img.src; - /** - * @memberof Proton#Proton.Util - * @method getImgFromCache - * - * @todo add description - * @todo describe func - * - * @param {Mixed} img - * @param {Proton.Particle} particle - * @param {Boolean} drawCanvas set to true if a canvas should be saved into particle.transform.canvas - * @param {Boolean} func - */ - getImgFromCache(img, callback, param) { - const src = typeof (img) === 'string' ? img : img.src; + if (imgsCache[src]) { + callback(imgsCache[src], param); + } else { + const image = new Image(); + image.onload = e => { + imgsCache[src] = e.target; + callback(imgsCache[src], param); + }; - if (IMG_CACHE[src]) { - callback(IMG_CACHE[src], param); - } else { - const image = new Image(); - image.onload = e => { - IMG_CACHE[src] = e.target; - callback(IMG_CACHE[src], param); - } - - image.src = src; - } - }, + image.src = src; + } + }, - getCanvasFromCache(img, callback, param) { - const src = img.src; + getCanvasFromCache(img, callback, param) { + const src = img.src; - if (!CANVAS_CACHE[src]) { - const width = WebGLUtil.nhpot(img.width); - const height = WebGLUtil.nhpot(img.height); + if (!canvasCache[src]) { + const width = WebGLUtil.nhpot(img.width); + const height = WebGLUtil.nhpot(img.height); - const canvas = DomUtil.createCanvas(`canvas_cache_${canvasID}`, width, height); - const context = canvas.getContext('2d'); - context.drawImage(img, 0, 0, img.width, img.height); + const canvas = DomUtil.createCanvas( + `proton_canvas_cache_${++canvasId}`, + width, + height + ); + const context = canvas.getContext("2d"); + context.drawImage(img, 0, 0, img.width, img.height); - CANVAS_CACHE[src] = canvas; - } + canvasCache[src] = canvas; + } - callback && callback(CANVAS_CACHE[src], param); + callback && callback(canvasCache[src], param); - return CANVAS_CACHE[src]; - } -} \ No newline at end of file + return canvasCache[src]; + } +}; diff --git a/src/utils/MStack.js b/src/utils/MStack.js old mode 100644 new mode 100755 index d91c884..446310c --- a/src/utils/MStack.js +++ b/src/utils/MStack.js @@ -1,38 +1,33 @@ -import Mat3 from '../math/Mat3'; +import Mat3 from "../math/Mat3"; export default class MStack { + constructor() { + this.mats = []; + this.size = 0; - constructor() { - this.mats = []; - this.size = 0; + for (let i = 0; i < 20; i++) + this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0])); + } - for (let i = 0; i < 20; i++) this.mats.push(Mat3.create([0, 0, 0, 0, 0, 0, 0, 0, 0])); - } + set(m, i) { + if (i === 0) Mat3.set(m, this.mats[0]); + else Mat3.multiply(this.mats[i - 1], m, this.mats[i]); - set(m, i) { - if (i === 0) - Mat3.set(m, this.mats[0]); - else - Mat3.multiply(this.mats[i - 1], m, this.mats[i]); + this.size = Math.max(this.size, i + 1); + } - this.size = Math.max(this.size, i + 1); - } + push(m) { + if (this.size === 0) Mat3.set(m, this.mats[0]); + else Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]); - push(m) { - if (this.size === 0) - Mat3.set(m, this.mats[0]); - else - Mat3.multiply(this.mats[this.size - 1], m, this.mats[this.size]); + this.size++; + } - this.size++; - } + pop() { + if (this.size > 0) this.size--; + } - pop() { - if (this.size > 0) - this.size--; - } - - top() { - return (this.mats[this.size - 1]); - } -} \ No newline at end of file + top() { + return this.mats[this.size - 1]; + } +} diff --git a/src/utils/PUID.js b/src/utils/PUID.js old mode 100644 new mode 100755 index 5d2fb02..889f195 --- a/src/utils/PUID.js +++ b/src/utils/PUID.js @@ -1,33 +1,49 @@ -export default { - id: 0, - cache: {}, +const IdsMap = {}; - getID(target) { - let uid = this.getCacheID(target); - if (uid) return uid; +const Puid = { + _index: 0, + _cache: {}, - uid = `PUID_${this.id++}`; - this.cache[uid] = target; + id(type) { + if (IdsMap[type] === undefined || IdsMap[type] === null) IdsMap[type] = 0; + return `${type}_${IdsMap[type]++}`; + }, - return uid; - }, + getId(target) { + let uid = this.getIdFromCache(target); + if (uid) return uid; - getCacheID(target) { - let obj; - for (let id in this.cache) { - obj = this.cache[id]; + uid = `PUID_${this._index++}`; + this._cache[uid] = target; - if (obj === target) return id; - if (typeof obj === 'object' && typeof target === 'object' && obj.isInner && target.isInner) { - if (obj.src === target.src) - return id; - } - } + return uid; + }, - return null; - }, + getIdFromCache(target) { + let obj, id; - getTarget(uid) { - return this.cache[uid]; + for (id in this._cache) { + obj = this._cache[id]; + + if (obj === target) return id; + if (this.isBody(obj, target) && obj.src === target.src) return id; } -} \ No newline at end of file + + return null; + }, + + isBody(obj, target) { + return ( + typeof obj === "object" && + typeof target === "object" && + obj.isInner && + target.isInner + ); + }, + + getTarget(uid) { + return this._cache[uid]; + } +}; + +export default Puid; diff --git a/src/utils/Rgb.js b/src/utils/Rgb.js new file mode 100755 index 0000000..9d1d24f --- /dev/null +++ b/src/utils/Rgb.js @@ -0,0 +1,13 @@ +export default class Rgb { + constructor(r = 255, g = 255, b = 255) { + this.r = r; + this.g = g; + this.b = b; + } + + reset() { + this.r = 255; + this.g = 255; + this.b = 255; + } +} diff --git a/src/utils/Util.js b/src/utils/Util.js old mode 100644 new mode 100755 index efe0dd0..7046ee3 --- a/src/utils/Util.js +++ b/src/utils/Util.js @@ -1,215 +1,181 @@ -import Span from '../math/Span'; -import ImgUtil from './ImgUtil'; +import Span from "../math/Span"; +import ImgUtil from "./ImgUtil"; export default { + /** + * Returns the default if the value is null or undefined + * + * @memberof Proton#Proton.Util + * @method initValue + * + * @param {Mixed} value a specific value, could be everything but null or undefined + * @param {Mixed} defaults the default if the value is null or undefined + */ + initValue(value, defaults) { + value = value !== null && value !== undefined ? value : defaults; + return value; + }, + + /** + * Checks if the value is a valid array + * + * @memberof Proton#Proton.Util + * @method isArray + * + * @param {Array} value Any array + * + * @returns {Boolean} + */ + isArray(value) { + return Object.prototype.toString.call(value) === "[object Array]"; + }, + + /** + * Destroyes the given array + * + * @memberof Proton#Proton.Util + * @method emptyArray + * + * @param {Array} array Any array + */ + emptyArray(arr) { + if (arr) arr.length = 0; + }, + + toArray(arr) { + return this.isArray(arr) ? arr : [arr]; + }, + + getRandFromArray(arr) { + if (!arr) return null; + return arr[Math.floor(arr.length * Math.random())]; + }, + + /** + * Destroyes the given object + * + * @memberof Proton#Proton.Util + * @method emptyObject + * + * @param {Object} obj Any object + */ + emptyObject(obj, ignore = null) { + for (let key in obj) { + if (ignore && ignore.indexOf(key) > -1) continue; + delete obj[key]; + } + }, + + /** + * Makes an instance of a class and binds the given array + * + * @memberof Proton#Proton.Util + * @method classApply + * + * @param {Function} constructor A class to make an instance from + * @param {Array} [args] Any array to bind it to the constructor + * + * @return {Object} The instance of constructor, optionally bind with args + */ + classApply(constructor, args = null) { + if (!args) { + return new constructor(); + } else { + const FactoryFunc = constructor.bind.apply( + constructor, + [null].concat(args) + ); + return new FactoryFunc(); + } + }, + + /** + * @memberof Proton#Proton.Util + * @method setVectorVal + * + * @todo add description for param `target` + * @todo add description for param `conf` + * @todo add description for function + * + * @param {Object} target + * @param {Object} conf + */ + setVectorVal(particle, conf = null) { + if (!conf) return; + + if (this.hasProp(conf, "x")) particle.p.x = conf["x"]; + if (this.hasProp(conf, "y")) particle.p.y = conf["y"]; + + if (this.hasProp(conf, "vx")) particle.v.x = conf["vx"]; + if (this.hasProp(conf, "vy")) particle.v.y = conf["vy"]; + + if (this.hasProp(conf, "ax")) particle.a.x = conf["ax"]; + if (this.hasProp(conf, "ay")) particle.a.y = conf["ay"]; + + if (this.hasProp(conf, "p")) particle.p.copy(conf["p"]); + if (this.hasProp(conf, "v")) particle.v.copy(conf["v"]); + if (this.hasProp(conf, "a")) particle.a.copy(conf["a"]); + + if (this.hasProp(conf, "position")) particle.p.copy(conf["position"]); + if (this.hasProp(conf, "velocity")) particle.v.copy(conf["velocity"]); + if (this.hasProp(conf, "accelerate")) particle.a.copy(conf["accelerate"]); + }, + + hasProp(target, key) { + if (!target) return false; + return target[key] !== undefined; + // return obj.hasOwnProperty(key); + }, + + /** + * set the prototype in a given prototypeObject + * + * @memberof Proton#Proton.Util + * @method setProp + * + * @todo add description for param `target` + * @todo translate desription from chinese to english + * + * @param {Object} target + * @param {Object} prototypeObject An object of single prototypes + * + * @return {Object} target + */ + setProp(target, props) { + for (let prop in props) { + if (target.hasOwnProperty(prop)) { + target[prop] = Span.getSpanValue(props[prop]); + } + } - /** - * Returns the default if the value is null or undefined - * - * @memberof Proton#Proton.Util - * @method initValue - * - * @param {Mixed} value a specific value, could be everything but null or undefined - * @param {Mixed} defaults the default if the value is null or undefined - */ - initValue(value, defaults) { - value = (value !== null && value !== undefined) ? value : defaults; - return value; - }, - - /** - * Checks if the value is a valid array - * - * @memberof Proton#Proton.Util - * @method isArray - * - * @param {Array} value Any array - * - * @returns {Boolean} - */ - isArray(value) { - return Object.prototype.toString.call(value) === '[object Array]'; - }, - - /** - * Destroyes the given array - * - * @memberof Proton#Proton.Util - * @method destroyArray - * - * @param {Array} array Any array - */ - destroyArray(array) { - if (array) array.length = 0; - }, - - /** - * Destroyes the given object - * - * @memberof Proton#Proton.Util - * @method destroyObject - * - * @param {Object} obj Any object - */ - destroyObject(obj, ignore) { - for (let o in obj) { - if (ignore && ignore.indexOf(o) > -1) continue; - delete obj[o]; - } - }, - - /** - * Makes an instance of a class and binds the given array - * - * @memberof Proton#Proton.Util - * @method classApply - * - * @param {Function} constructor A class to make an instance from - * @param {Array} [args] Any array to bind it to the constructor - * - * @return {Object} The instance of constructor, optionally bind with args - */ - classApply(constructor, args) { - if (!args) return new constructor; - - args = [null].concat(args); - const FactoryFunc = constructor.bind.apply(constructor, args); - return new FactoryFunc(); - }, - - /** - * @memberof Proton#Proton.Util - * @method setVector2DByObject - * - * @todo add description for param `target` - * @todo add description for param `pOBJ` - * @todo add description for function - * - * @param {Object} target - * @param {Object} pOBJ - */ - setVector2DByObject(target, pOBJ) { - if (this.hasProp(pOBJ, 'x')) target.p.x = pOBJ['x']; - if (this.hasProp(pOBJ, 'y')) target.p.y = pOBJ['y']; - - if (this.hasProp(pOBJ, 'vx')) target.v.x = pOBJ['vx']; - if (this.hasProp(pOBJ, 'vy')) target.v.y = pOBJ['vy']; - - if (this.hasProp(pOBJ, 'ax')) target.a.x = pOBJ['ax']; - if (this.hasProp(pOBJ, 'ay')) target.a.y = pOBJ['ay']; - - if (this.hasProp(pOBJ, 'p')) target.p.copy(pOBJ['p']); - if (this.hasProp(pOBJ, 'v')) target.v.copy(pOBJ['v']); - if (this.hasProp(pOBJ, 'a')) target.a.copy(pOBJ['a']); - - if (this.hasProp(pOBJ, 'position')) target.p.copy(pOBJ['position']); - if (this.hasProp(pOBJ, 'velocity')) target.v.copy(pOBJ['velocity']); - if (this.hasProp(pOBJ, 'accelerate')) target.a.copy(pOBJ['accelerate']); - }, - - hasProp(obj, key) { - if (!obj) return false; - return obj[key] !== undefined; - // return obj.hasOwnProperty(key); - }, - - /** - * set the prototype in a given prototypeObject - * - * @memberof Proton#Proton.Util - * @method setPrototypeByObject - * - * @todo add description for param `target` - * @todo add description for param `filters` - * @todo translate desription from chinese to english - * - * @param {Object} target - * @param {Object} prototypeObject An object of single prototypes - * @param {Object} filters - * - * @return {Object} target - */ - setPrototypeByObject(target, prototypeObject, filters) { - for (let singleProp in prototypeObject) { - if (target.hasOwnProperty(singleProp)) { - if (filters) { - if (filters.indexOf(singleProp) < 0) - target[singleProp] = this.getSpanValue(prototypeObject[singleProp]); - } else { - target[singleProp] = this.getSpanValue(prototypeObject[singleProp]); - } - } - } - - return target; - }, - - /** - * Returns a new Span object - * - * @memberof Proton#Proton.Util - * @method setSpanValue - * - * @todo a, b and c should be 'Mixed' or 'Number'? - * - * @param {Mixed | Span} a - * @param {Mixed} b - * @param {Mixed} c - * - * @return {Span} - */ - setSpanValue(a, b, c) { - if (a instanceof Span) { - return a; - } else { - if (!b) { - return new Span(a); - } else { - if (!c) - return new Span(a, b); - else - return new Span(a, b, c); - } - } - }, - - /** - * Returns the value from a Span, if the param is not a Span it will return the given parameter - * - * @memberof Proton#Proton.Util - * @method getSpanValue - * - * @param {Mixed | Span} pan - * - * @return {Mixed} the value of Span OR the parameter if it is not a Span - */ - getSpanValue(pan) { - return pan instanceof Span ? pan.getValue() : pan; - }, - - /** - * This will get the image data. It could be necessary to create a Proton.Zone. - * - * @memberof Proton#Proton.Util - * @method getImageData - * - * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')' - * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag'); - * @param {Proton.Rectangle} rect - */ - getImageData(context, image, rect) { - return ImgUtil.getImageData(context, image, rect); - }, - - destroy(arr, param) { - let i = arr.length; - - while (i--) { - try { arr[i].destroy(param); } catch (e) { } - delete arr[i]; - } - - arr.length = 0; + return target; + }, + + /** + * This will get the image data. It could be necessary to create a Proton.Zone. + * + * @memberof Proton#Proton.Util + * @method getImageData + * + * @param {HTMLCanvasElement} context any canvas, must be a 2dContext 'canvas.getContext('2d')' + * @param {Object} image could be any dom image, e.g. document.getElementById('thisIsAnImgTag'); + * @param {Proton.Rectangle} rect + */ + getImageData(context, image, rect) { + return ImgUtil.getImageData(context, image, rect); + }, + + destroyAll(arr, param = null) { + let i = arr.length; + + while (i--) { + try { + arr[i].destroy(param); + } catch (e) {} + + delete arr[i]; } -} \ No newline at end of file + arr.length = 0; + } +}; diff --git a/src/utils/WebGLUtil.js b/src/utils/WebGLUtil.js old mode 100644 new mode 100755 index cd89ad6..ddfd5ea --- a/src/utils/WebGLUtil.js +++ b/src/utils/WebGLUtil.js @@ -1,135 +1,134 @@ export default { + /** + * @memberof Proton#Proton.WebGLUtil + * @method ipot + * + * @todo add description + * @todo add length description + * + * @param {Number} length + * + * @return {Boolean} + */ + ipot(length) { + return (length & (length - 1)) === 0; + }, - /** - * @memberof Proton#Proton.WebGLUtil - * @method ipot - * - * @todo add description - * @todo add length description - * - * @param {Number} length - * - * @return {Boolean} - */ - ipot(length) { - return (length & (length - 1)) === 0; - }, - - /** - * @memberof Proton#Proton.WebGLUtil - * @method nhpot - * - * @todo add description - * @todo add length description - * - * @param {Number} length - * - * @return {Number} - */ - nhpot(length) { - --length; - for (let i = 1; i < 32; i <<= 1) { - length = length | length >> i; - } + /** + * @memberof Proton#Proton.WebGLUtil + * @method nhpot + * + * @todo add description + * @todo add length description + * + * @param {Number} length + * + * @return {Number} + */ + nhpot(length) { + --length; + for (let i = 1; i < 32; i <<= 1) { + length = length | (length >> i); + } - return length + 1; - }, + return length + 1; + }, - /** - * @memberof Proton#Proton.WebGLUtil - * @method makeTranslation - * - * @todo add description - * @todo add tx, ty description - * @todo add return description - * - * @param {Number} tx either 0 or 1 - * @param {Number} ty either 0 or 1 - * - * @return {Object} - */ - makeTranslation(tx, ty) { - return [1, 0, 0, 0, 1, 0, tx, ty, 1]; - }, + /** + * @memberof Proton#Proton.WebGLUtil + * @method makeTranslation + * + * @todo add description + * @todo add tx, ty description + * @todo add return description + * + * @param {Number} tx either 0 or 1 + * @param {Number} ty either 0 or 1 + * + * @return {Object} + */ + makeTranslation(tx, ty) { + return [1, 0, 0, 0, 1, 0, tx, ty, 1]; + }, - /** - * @memberof Proton#Proton.WebGLUtil - * @method makeRotation - * - * @todo add description - * @todo add return description - * - * @param {Number} angleInRadians - * - * @return {Object} - */ - makeRotation(angleInRadians) { - let c = Math.cos(angleInRadians); - let s = Math.sin(angleInRadians); + /** + * @memberof Proton#Proton.WebGLUtil + * @method makeRotation + * + * @todo add description + * @todo add return description + * + * @param {Number} angleInRadians + * + * @return {Object} + */ + makeRotation(angleInRadians) { + let c = Math.cos(angleInRadians); + let s = Math.sin(angleInRadians); - return [c, -s, 0, s, c, 0, 0, 0, 1]; - }, + return [c, -s, 0, s, c, 0, 0, 0, 1]; + }, - /** - * @memberof Proton#Proton.WebGLUtil - * @method makeScale - * - * @todo add description - * @todo add tx, ty description - * @todo add return description - * - * @param {Number} sx either 0 or 1 - * @param {Number} sy either 0 or 1 - * - * @return {Object} - */ - makeScale(sx, sy) { - return [sx, 0, 0, 0, sy, 0, 0, 0, 1]; - }, + /** + * @memberof Proton#Proton.WebGLUtil + * @method makeScale + * + * @todo add description + * @todo add tx, ty description + * @todo add return description + * + * @param {Number} sx either 0 or 1 + * @param {Number} sy either 0 or 1 + * + * @return {Object} + */ + makeScale(sx, sy) { + return [sx, 0, 0, 0, sy, 0, 0, 0, 1]; + }, - /** - * @memberof Proton#Proton.WebGLUtil - * @method matrixMultiply - * - * @todo add description - * @todo add a, b description - * @todo add return description - * - * @param {Object} a - * @param {Object} b - * - * @return {Object} - */ - matrixMultiply(a, b) { - let a00 = a[0 * 3 + 0]; - let a01 = a[0 * 3 + 1]; - let a02 = a[0 * 3 + 2]; - let a10 = a[1 * 3 + 0]; - let a11 = a[1 * 3 + 1]; - let a12 = a[1 * 3 + 2]; - let a20 = a[2 * 3 + 0]; - let a21 = a[2 * 3 + 1]; - let a22 = a[2 * 3 + 2]; - let b00 = b[0 * 3 + 0]; - let b01 = b[0 * 3 + 1]; - let b02 = b[0 * 3 + 2]; - let b10 = b[1 * 3 + 0]; - let b11 = b[1 * 3 + 1]; - let b12 = b[1 * 3 + 2]; - let b20 = b[2 * 3 + 0]; - let b21 = b[2 * 3 + 1]; - let b22 = b[2 * 3 + 2]; + /** + * @memberof Proton#Proton.WebGLUtil + * @method matrixMultiply + * + * @todo add description + * @todo add a, b description + * @todo add return description + * + * @param {Object} a + * @param {Object} b + * + * @return {Object} + */ + matrixMultiply(a, b) { + let a00 = a[0 * 3 + 0]; + let a01 = a[0 * 3 + 1]; + let a02 = a[0 * 3 + 2]; + let a10 = a[1 * 3 + 0]; + let a11 = a[1 * 3 + 1]; + let a12 = a[1 * 3 + 2]; + let a20 = a[2 * 3 + 0]; + let a21 = a[2 * 3 + 1]; + let a22 = a[2 * 3 + 2]; + let b00 = b[0 * 3 + 0]; + let b01 = b[0 * 3 + 1]; + let b02 = b[0 * 3 + 2]; + let b10 = b[1 * 3 + 0]; + let b11 = b[1 * 3 + 1]; + let b12 = b[1 * 3 + 2]; + let b20 = b[2 * 3 + 0]; + let b21 = b[2 * 3 + 1]; + let b22 = b[2 * 3 + 2]; - return [ - a00 * b00 + a01 * b10 + a02 * b20, - a00 * b01 + a01 * b11 + a02 * b21, - a00 * b02 + a01 * b12 + a02 * b22, - a10 * b00 + a11 * b10 + a12 * b20, - a10 * b01 + a11 * b11 + a12 * b21, - a10 * b02 + a11 * b12 + a12 * b22, - a20 * b00 + a21 * b10 + a22 * b20, - a20 * b01 + a21 * b11 + a22 * b21, - a20 * b02 + a21 * b12 + a22 * b22 - ]; - } -} \ No newline at end of file + return [ + a00 * b00 + a01 * b10 + a02 * b20, + a00 * b01 + a01 * b11 + a02 * b21, + a00 * b02 + a01 * b12 + a02 * b22, + a10 * b00 + a11 * b10 + a12 * b20, + a10 * b01 + a11 * b11 + a12 * b21, + a10 * b02 + a11 * b12 + a12 * b22, + a20 * b00 + a21 * b10 + a22 * b20, + a20 * b01 + a21 * b11 + a22 * b21, + a20 * b02 + a21 * b12 + a22 * b22 + ]; + } +}; diff --git a/src/zone/CircleZone.js b/src/zone/CircleZone.js old mode 100644 new mode 100755 index 12670ec..34efc07 --- a/src/zone/CircleZone.js +++ b/src/zone/CircleZone.js @@ -1,64 +1,64 @@ -import Zone from './Zone'; -import MathUtils from '../math/MathUtils'; +import Zone from "./Zone"; +import MathUtil from "../math/MathUtil"; export default class CircleZone extends Zone { + constructor(x, y, radius) { + super(); - constructor(x, y, radius) { - super(); + this.x = x; + this.y = y; + this.radius = radius; - this.x = x; - this.y = y; - this.radius = radius; + this.angle = 0; + this.center = { x, y }; + } - this.angle = 0; - this.center = { x, y }; - } - - getPosition() { - this.random = Math.random(); - this.angle = MathUtils.PIx2 * Math.random(); + getPosition() { + this.angle = MathUtil.PIx2 * Math.random(); + this.randomRadius = Math.random() * this.radius; - this.vector.x = this.x + this.random * this.radius * Math.cos(this.angle); - this.vector.y = this.y + this.random * this.radius * Math.sin(this.angle); + this.vector.x = this.x + this.randomRadius * Math.cos(this.angle); + this.vector.y = this.y + this.randomRadius * Math.sin(this.angle); - return this.vector; - } + return this.vector; + } - setCenter(x, y) { - this.center.x = x; - this.center.y = y; - } + setCenter(x, y) { + this.center.x = x; + this.center.y = y; + } - crossing(particle) { - const d = particle.p.distanceTo(this.center); + crossing(particle) { + const d = particle.p.distanceTo(this.center); - if (this.crossType === 'dead') { - if (d - particle.radius > this.radius) - particle.dead = true; - } else if (this.crossType === 'bound') { - if (d + particle.radius >= this.radius) - this.getSymmetric(particle); - } else if (this.crossType === 'cross') { - if (this.alert) { - alert('Sorry CircleZone does not support cross method'); - this.alert = false; - } - } + if (this.crossType === "dead") { + if (d - particle.radius > this.radius) particle.dead = true; + } else if (this.crossType === "bound") { + if (d + particle.radius >= this.radius) this.getSymmetric(particle); + } else if (this.crossType === "cross") { + if (this.alert) { + console.error("Sorry, CircleZone does not support cross method!"); + this.alert = false; + } } + } - getSymmetric(particle) { - let tha2 = particle.v.getGradient(); - let tha1 = this.getGradient(particle); + getSymmetric(particle) { + let tha2 = particle.v.getGradient(); + let tha1 = this.getGradient(particle); - let tha = 2 * (tha1 - tha2); - let oldx = particle.v.x; - let oldy = particle.v.y; + let tha = 2 * (tha1 - tha2); + let oldx = particle.v.x; + let oldy = particle.v.y; - particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha); - particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha); - } + particle.v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha); + particle.v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha); + } - getGradient(particle) { - return -MathUtils.PI_2 + Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x); - } -} \ No newline at end of file + getGradient(particle) { + return ( + -MathUtil.PI_2 + + Math.atan2(particle.p.y - this.center.y, particle.p.x - this.center.x) + ); + } +} diff --git a/src/zone/ImageZone.js b/src/zone/ImageZone.js old mode 100644 new mode 100755 index 9f261ef..235c3ee --- a/src/zone/ImageZone.js +++ b/src/zone/ImageZone.js @@ -1,77 +1,73 @@ -import Zone from './Zone'; -import Util from '../utils/Util'; +import Zone from "./Zone"; +import Util from "../utils/Util"; export default class ImageZone extends Zone { + constructor(imageData, x, y, d) { + super(); - constructor(imageData, x, y, d) { - super(); + this.reset(imageData, x, y, d); + } - this.reset(imageData, x, y, d); - } + reset(imageData, x, y, d) { + this.imageData = imageData; + this.x = Util.initValue(x, 0); + this.y = Util.initValue(y, 0); + this.d = Util.initValue(d, 2); - reset(imageData, x, y, d) { - this.imageData = imageData; - this.x = Util.initValue(x, 0); - this.y = Util.initValue(y, 0); - this.d = Util.initValue(d, 2); + this.vectors = []; + this.setVectors(); + } - this.vectors = []; - this.setVectors(); - } + setVectors() { + let i, j; + const length1 = this.imageData.width; + const length2 = this.imageData.height; - setVectors() { - let i, j; - const length1 = this.imageData.width; - const length2 = this.imageData.height; + for (i = 0; i < length1; i += this.d) { + for (j = 0; j < length2; j += this.d) { + let index = ((j >> 0) * length1 + (i >> 0)) * 4; - for (i = 0; i < length1; i += this.d) { - for (j = 0; j < length2; j += this.d) { - let index = ((j >> 0) * length1 + (i >> 0)) * 4; + if (this.imageData.data[index + 3] > 0) { + this.vectors.push({ x: i + this.x, y: j + this.y }); + } + } + } - if (this.imageData.data[index + 3] > 0) { - this.vectors.push({ x: i + this.x, y: j + this.y }); - } - } - } + return this.vector; + } - return this.vector; - } + getBound(x, y) { + var index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4; + if (this.imageData.data[index + 3] > 0) return true; + else return false; + } - getBound(x, y) { - var index = ((y >> 0) * this.imageData.width + (x >> 0)) * 4; - if (this.imageData.data[index + 3] > 0) - return true; - else - return false; - } + getPosition() { + const vector = Util.getRandFromArray(this.vectors); + return this.vector.copy(vector); + } - getPosition() { - return this.vector.copy(this.vectors[Math.floor(Math.random() * this.vectors.length)]); - } + getColor(x, y) { + x -= this.x; + y -= this.y; + var i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4; - getColor(x, y) { - x -= this.x; - y -= this.y; - var i = ((y >> 0) * this.imageData.width + (x >> 0)) * 4; + return { + r: this.imageData.data[i], + g: this.imageData.data[i + 1], + b: this.imageData.data[i + 2], + a: this.imageData.data[i + 3] + }; + } - return { - r: this.imageData.data[i], - g: this.imageData.data[i + 1], - b: this.imageData.data[i + 2], - a: this.imageData.data[i + 3] - }; - } - - crossing(particle) { - if (this.crossType === 'dead') { - if (this.getBound(particle.p.x - this.x, particle.p.y - this.y)) - particle.dead = true; - else - particle.dead = false; - } - else if (this.crossType === 'bound') { - if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y)) - particle.v.negate(); - } - } -} \ No newline at end of file + crossing(particle) { + if (this.crossType === "dead") { + if (this.getBound(particle.p.x - this.x, particle.p.y - this.y)) + particle.dead = true; + else particle.dead = false; + } else if (this.crossType === "bound") { + if (!this.getBound(particle.p.x - this.x, particle.p.y - this.y)) + particle.v.negate(); + } + } +} diff --git a/src/zone/LineZone.js b/src/zone/LineZone.js old mode 100644 new mode 100755 index ee19ac5..c5750ff --- a/src/zone/LineZone.js +++ b/src/zone/LineZone.js @@ -1,133 +1,135 @@ -import Zone from './Zone'; -import Util from '../utils/Util'; -import MathUtils from '../math/MathUtils'; +import Zone from "./Zone"; +import Util from "../utils/Util"; +import MathUtil from "../math/MathUtil"; export default class LineZone extends Zone { - - constructor(x1, y1, x2, y2, direction) { - super(); - - if (x2 - x1 >= 0) { - this.x1 = x1; - this.y1 = y1; - this.x2 = x2; - this.y2 = y2; - } else { - this.x1 = x2; - this.y1 = y2; - this.x2 = x1; - this.y2 = y1; - } - - this.dx = this.x2 - this.x1; - this.dy = this.y2 - this.y1; - - this.minx = Math.min(this.x1, this.x2); - this.miny = Math.min(this.y1, this.y2); - this.maxx = Math.max(this.x1, this.x2); - this.maxy = Math.max(this.y1, this.y2); - - this.dot = this.x2 * this.y1 - this.x1 * this.y2; - this.xxyy = this.dx * this.dx + this.dy * this.dy; - - this.gradient = this.getGradient(); - this.length = this.getLength(); - this.direction = Util.initValue(direction, '>'); - } - - getPosition() { - this.random = Math.random(); - this.vector.x = this.x1 + this.random * this.length * Math.cos(this.gradient); - this.vector.y = this.y1 + this.random * this.length * Math.sin(this.gradient); - - return this.vector; - } - - getDirection(x, y) { - const A = this.dy; - const B = -this.dx; - const C = this.dot; - const D = B === 0 ? 1 : B; - - if ((A * x + B * y + C) * D > 0) - return true; - else - return false; - } - - getDistance(x, y) { - const A = this.dy; - const B = -this.dx; - const C = this.dot; - const D = (A * x + B * y + C); - - return D / Math.sqrt(this.xxyy); - } - - getSymmetric(v) { - const tha2 = v.getGradient(); - const tha1 = this.getGradient(); - const tha = 2 * (tha1 - tha2); - - const oldx = v.x; - const oldy = v.y; - - v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha); - v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha); - - return v; - } - - getGradient() { - return Math.atan2(this.dy, this.dx); - } - - rangeOut(particle) { - const angle = Math.abs(this.getGradient()); - - if (angle <= MathUtils.PI / 4) { - if (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true; - } else { - if (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true; - } - - return false; - } - - getLength() { - return Math.sqrt(this.dx * this.dx + this.dy * this.dy) - } - - crossing(particle) { - if (this.crossType === 'dead') { - if (this.direction === '>' || this.direction === 'R' || this.direction === 'right' || this.direction === 'down') { - if (!this.rangeOut(particle)) return; - if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true; - } else { - if (!this.rangeOut(particle)) return; - if (!this.getDirection(particle.p.x, particle.p.y)) particle.dead = true; - } - } - - else if (this.crossType === 'bound') { - if (!this.rangeOut(particle)) return; - - if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) { - if (this.dx === 0) { - particle.v.x *= -1; - } else if (this.dy === 0) { - particle.v.y *= -1; - } else { - this.getSymmetric(particle.v); - } - } - } - - else if (this.crossType === 'cross') { - if (this.alert) { - console.error('Sorry lineZone does not support cross method'); - this.alert = false; - } - } - } -} \ No newline at end of file + constructor(x1, y1, x2, y2, direction) { + super(); + + if (x2 - x1 >= 0) { + this.x1 = x1; + this.y1 = y1; + this.x2 = x2; + this.y2 = y2; + } else { + this.x1 = x2; + this.y1 = y2; + this.x2 = x1; + this.y2 = y1; + } + + this.dx = this.x2 - this.x1; + this.dy = this.y2 - this.y1; + + this.minx = Math.min(this.x1, this.x2); + this.miny = Math.min(this.y1, this.y2); + this.maxx = Math.max(this.x1, this.x2); + this.maxy = Math.max(this.y1, this.y2); + + this.dot = this.x2 * this.y1 - this.x1 * this.y2; + this.xxyy = this.dx * this.dx + this.dy * this.dy; + + this.gradient = this.getGradient(); + this.length = this.getLength(); + this.direction = Util.initValue(direction, ">"); + } + + getPosition() { + this.random = Math.random(); + + this.vector.x = + this.x1 + this.random * this.length * Math.cos(this.gradient); + this.vector.y = + this.y1 + this.random * this.length * Math.sin(this.gradient); + + return this.vector; + } + + getDirection(x, y) { + const A = this.dy; + const B = -this.dx; + const C = this.dot; + const D = B === 0 ? 1 : B; + + if ((A * x + B * y + C) * D > 0) return true; + else return false; + } + + getDistance(x, y) { + const A = this.dy; + const B = -this.dx; + const C = this.dot; + const D = A * x + B * y + C; + + return D / Math.sqrt(this.xxyy); + } + + getSymmetric(v) { + const tha2 = v.getGradient(); + const tha1 = this.getGradient(); + const tha = 2 * (tha1 - tha2); + + const oldx = v.x; + const oldy = v.y; + + v.x = oldx * Math.cos(tha) - oldy * Math.sin(tha); + v.y = oldx * Math.sin(tha) + oldy * Math.cos(tha); + + return v; + } + + getGradient() { + return Math.atan2(this.dy, this.dx); + } + + rangeOut(particle) { + const angle = Math.abs(this.getGradient()); + + if (angle <= MathUtil.PI / 4) { + if (particle.p.x <= this.maxx && particle.p.x >= this.minx) return true; + } else { + if (particle.p.y <= this.maxy && particle.p.y >= this.miny) return true; + } + + return false; + } + + getLength() { + return Math.sqrt(this.dx * this.dx + this.dy * this.dy); + } + + crossing(particle) { + if (this.crossType === "dead") { + if ( + this.direction === ">" || + this.direction === "R" || + this.direction === "right" || + this.direction === "down" + ) { + if (!this.rangeOut(particle)) return; + if (this.getDirection(particle.p.x, particle.p.y)) particle.dead = true; + } else { + if (!this.rangeOut(particle)) return; + if (!this.getDirection(particle.p.x, particle.p.y)) + particle.dead = true; + } + } else if (this.crossType === "bound") { + if (!this.rangeOut(particle)) return; + + if (this.getDistance(particle.p.x, particle.p.y) <= particle.radius) { + if (this.dx === 0) { + particle.v.x *= -1; + } else if (this.dy === 0) { + particle.v.y *= -1; + } else { + this.getSymmetric(particle.v); + } + } + } else if (this.crossType === "cross") { + if (this.alert) { + console.error("Sorry, LineZone does not support cross method!"); + this.alert = false; + } + } + } +} diff --git a/src/zone/PointZone.js b/src/zone/PointZone.js old mode 100644 new mode 100755 index 896c0c6..56651aa --- a/src/zone/PointZone.js +++ b/src/zone/PointZone.js @@ -1,24 +1,24 @@ -import Zone from './Zone'; +import Zone from "./Zone"; export default class PointZone extends Zone { + constructor(x, y) { + super(); - constructor(x, y) { - super(); + this.x = x; + this.y = y; + } - this.x = x; - this.y = y; - } + getPosition() { + this.vector.x = this.x; + this.vector.y = this.y; - getPosition() { - this.vector.x = this.x; - this.vector.y = this.y; - return this.vector; - } + return this.vector; + } - crossing(particle) { - if (this.alert) { - alert('Sorry PointZone does not support crossing method'); - this.alert = false; - } - } -} \ No newline at end of file + crossing(particle) { + if (this.alert) { + console.error("Sorry, PointZone does not support crossing method!"); + this.alert = false; + } + } +} diff --git a/src/zone/RectZone.js b/src/zone/RectZone.js old mode 100644 new mode 100755 index e91d0d7..cfc5117 --- a/src/zone/RectZone.js +++ b/src/zone/RectZone.js @@ -1,64 +1,70 @@ -import Zone from './Zone'; +import Zone from "./Zone"; export default class RectZone extends Zone { + constructor(x, y, width, height) { + super(); - constructor(x, y, width, height) { - super(); + this.x = x; + this.y = y; + this.width = width; + this.height = height; + } - this.x = x; - this.y = y; - this.width = width; - this.height = height; - } + getPosition() { + this.vector.x = this.x + Math.random() * this.width; + this.vector.y = this.y + Math.random() * this.height; - getPosition() { - this.vector.x = this.x + Math.random() * this.width; - this.vector.y = this.y + Math.random() * this.height; + return this.vector; + } - return this.vector; - } + crossing(particle) { + // particle dead zone + if (this.crossType === "dead") { + if (particle.p.x + particle.radius < this.x) particle.dead = true; + else if (particle.p.x - particle.radius > this.x + this.width) + particle.dead = true; - crossing(particle) { - if (this.crossType === 'dead') { - if (particle.p.x + particle.radius < this.x) - particle.dead = true; - else if (particle.p.x - particle.radius > this.x + this.width) - particle.dead = true; + if (particle.p.y + particle.radius < this.y) particle.dead = true; + else if (particle.p.y - particle.radius > this.y + this.height) + particle.dead = true; + } - if (particle.p.y + particle.radius < this.y) - particle.dead = true; - else if (particle.p.y - particle.radius > this.y + this.height) - particle.dead = true; - } + // particle bound zone + else if (this.crossType === "bound") { + if (particle.p.x - particle.radius < this.x) { + particle.p.x = this.x + particle.radius; + particle.v.x *= -1; + } else if (particle.p.x + particle.radius > this.x + this.width) { + particle.p.x = this.x + this.width - particle.radius; + particle.v.x *= -1; + } - else if (this.crossType === 'bound') { - if (particle.p.x - particle.radius < this.x) { - particle.p.x = this.x + particle.radius; - particle.v.x *= -1; - } else if (particle.p.x + particle.radius > this.x + this.width) { - particle.p.x = this.x + this.width - particle.radius; - particle.v.x *= -1; - } + if (particle.p.y - particle.radius < this.y) { + particle.p.y = this.y + particle.radius; + particle.v.y *= -1; + } else if (particle.p.y + particle.radius > this.y + this.height) { + particle.p.y = this.y + this.height - particle.radius; + particle.v.y *= -1; + } + } - if (particle.p.y - particle.radius < this.y) { - particle.p.y = this.y + particle.radius; - particle.v.y *= -1; - } else if (particle.p.y + particle.radius > this.y + this.height) { - particle.p.y = this.y + this.height - particle.radius; - particle.v.y *= -1; - } - } + // particle cross zone + else if (this.crossType === "cross") { + if (particle.p.x + particle.radius < this.x && particle.v.x <= 0) + particle.p.x = this.x + this.width + particle.radius; + else if ( + particle.p.x - particle.radius > this.x + this.width && + particle.v.x >= 0 + ) + particle.p.x = this.x - particle.radius; - else if (this.crossType === 'cross') { - if (particle.p.x + particle.radius < this.x && particle.v.x <= 0) - particle.p.x = this.x + this.width + particle.radius; - else if (particle.p.x - particle.radius > this.x + this.width && particle.v.x >= 0) - particle.p.x = this.x - particle.radius; - - if (particle.p.y + particle.radius < this.y && particle.v.y <= 0) - particle.p.y = this.y + this.height + particle.radius; - else if (particle.p.y - particle.radius > this.y + this.height && particle.v.y >= 0) - particle.p.y = this.y - particle.radius; - } - } -} \ No newline at end of file + if (particle.p.y + particle.radius < this.y && particle.v.y <= 0) + particle.p.y = this.y + this.height + particle.radius; + else if ( + particle.p.y - particle.radius > this.y + this.height && + particle.v.y >= 0 + ) + particle.p.y = this.y - particle.radius; + } + } +} diff --git a/src/zone/Zone.js b/src/zone/Zone.js old mode 100644 new mode 100755 index 00ca86c..7ad0b24 --- a/src/zone/Zone.js +++ b/src/zone/Zone.js @@ -1,17 +1,14 @@ -import Vector2D from '../math/Vector2D'; +import Vector2D from "../math/Vector2D"; export default class Zone { + constructor() { + this.vector = new Vector2D(0, 0); + this.random = 0; + this.crossType = "dead"; + this.alert = true; + } - constructor() { - this.vector = new Vector2D(0, 0); - this.random = 0; - this.crossType = 'dead'; - this.alert = true; - } + getPosition() {} - getPosition() { - } - - crossing(particle) { - } + crossing(particle) {} }