From d07912d61085f74ac48a419507ca73f39a3f8d21 Mon Sep 17 00:00:00 2001 From: yhh <359807859@qq.com> Date: Thu, 27 Aug 2020 18:48:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=99=9A=E6=8B=9F=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E7=B1=BB=20VirtualInput?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/libs/framework/framework.d.ts | 399 ++++-- demo/libs/framework/framework.js | 1187 ++++++++++------- demo/libs/framework/framework.min.js | 2 +- demo/manifest.json | 4 +- demo/resource/default.res.json | 27 +- demo/resource/preload/caveman/caveman.png | Bin 0 -> 11371 bytes demo/resource/preload/caveman/tiledMap.json | 193 +++ demo/resource/preload/caveman/tileset.png | Bin 0 -> 1055 bytes demo/resource/preload/ninja/tilemap.json | 370 +++++ demo/resource/preload/ninja/tileset.png | Bin 0 -> 88026 bytes .../preload/{ => orthogonal}/buch-outdoor.png | Bin .../{ => orthogonal}/orthogonal-outside.json | 0 demo/resource/preload/plume.png | Bin 0 -> 1138 bytes demo/src/Scenes/LineCasting/LineCaster.ts | 16 - .../Scenes/Ninja Adventure/CameraBounds.ts | 37 + .../FireballProjectileController.ts | 28 + demo/src/Scenes/Ninja Adventure/Ninja.ts | 157 ++- .../Ninja Adventure/NinjaAdventureScene.ts | 68 +- source/bin/framework.d.ts | 399 ++++-- source/bin/framework.js | 1187 ++++++++++------- source/bin/framework.min.js | 2 +- source/src/ECS/Component.ts | 10 - .../Physics/Colliders/BoxCollider.ts | 44 +- .../Physics/Colliders/CircleCollider.ts | 11 +- .../Components/Physics/Colliders/Collider.ts | 21 +- source/src/ECS/Components/Physics/Mover.ts | 2 +- .../ECS/Components/Physics/ProjectileMover.ts | 9 +- source/src/ECS/Components/SpriteAnimation.ts | 2 +- source/src/ECS/Components/TiledMapRenderer.ts | 6 +- source/src/ECS/Core.ts | 1 + source/src/ECS/Entity.ts | 40 - source/src/Math/Flags.ts | 16 +- source/src/Physics/Collision.ts | 45 +- source/src/Physics/Shapes/Box.ts | 2 +- source/src/Physics/Shapes/Circle.ts | 8 +- source/src/Physics/Shapes/Polygon.ts | 8 +- source/src/Physics/Shapes/Shape.ts | 4 - source/src/Physics/Verlet/SpatialHash.ts | 4 +- source/src/Tiled/Layer.ts | 10 +- source/src/Utils/{ => Input}/Input.ts | 36 + source/src/Utils/Input/KeyboardUtils.ts | 47 + source/src/Utils/Input/Keys.ts | 116 ++ source/src/Utils/Input/Virtual/VirtualAxis.ts | 79 ++ .../src/Utils/Input/Virtual/VirtualButton.ts | 134 ++ .../src/Utils/Input/Virtual/VirtualInput.ts | 43 + .../Utils/Input/Virtual/VirtualIntegerAxis.ts | 44 + source/src/Utils/KeyboardUtils.ts | 225 ---- 47 files changed, 3428 insertions(+), 1615 deletions(-) create mode 100644 demo/resource/preload/caveman/caveman.png create mode 100644 demo/resource/preload/caveman/tiledMap.json create mode 100644 demo/resource/preload/caveman/tileset.png create mode 100644 demo/resource/preload/ninja/tilemap.json create mode 100644 demo/resource/preload/ninja/tileset.png rename demo/resource/preload/{ => orthogonal}/buch-outdoor.png (100%) rename demo/resource/preload/{ => orthogonal}/orthogonal-outside.json (100%) create mode 100644 demo/resource/preload/plume.png create mode 100644 demo/src/Scenes/Ninja Adventure/CameraBounds.ts create mode 100644 demo/src/Scenes/Ninja Adventure/FireballProjectileController.ts rename source/src/Utils/{ => Input}/Input.ts (82%) create mode 100644 source/src/Utils/Input/KeyboardUtils.ts create mode 100644 source/src/Utils/Input/Keys.ts create mode 100644 source/src/Utils/Input/Virtual/VirtualAxis.ts create mode 100644 source/src/Utils/Input/Virtual/VirtualButton.ts create mode 100644 source/src/Utils/Input/Virtual/VirtualInput.ts create mode 100644 source/src/Utils/Input/Virtual/VirtualIntegerAxis.ts delete mode 100644 source/src/Utils/KeyboardUtils.ts diff --git a/demo/libs/framework/framework.d.ts b/demo/libs/framework/framework.d.ts index cfdf66e7..3e948d6b 100644 --- a/demo/libs/framework/framework.d.ts +++ b/demo/libs/framework/framework.d.ts @@ -285,7 +285,6 @@ declare module es { update(): void; setEnabled(isEnabled: boolean): this; setUpdateOrder(updateOrder: number): this; - clone(): Component; } } declare module es { @@ -334,7 +333,6 @@ declare module es { destroy(): void; detachFromScene(): void; attachToScene(newScene: Scene): void; - clone(position?: Vector2): Entity; onAddedToScene(): void; onRemovedFromScene(): void; update(): void; @@ -349,7 +347,6 @@ declare module es { removeAllComponents(): void; compareTo(other: Entity): number; toString(): string; - protected copyFrom(entity: Entity): void; } } declare module es { @@ -691,7 +688,7 @@ declare module es { class SpriteAnimation { readonly sprites: Sprite[]; readonly frameRate: number; - constructor(sprites: Sprite[], frameRate: number); + constructor(sprites: Sprite[], frameRate?: number); } } declare module es { @@ -759,7 +756,7 @@ declare module es { declare module es { class TiledMapRenderer extends RenderableComponent { tiledMap: TmxMap; - physicsLayer: number; + physicsLayer: Ref; layerIndicesToRender: number[]; private toContainer; readonly width: number; @@ -808,11 +805,10 @@ declare module es { } declare module es { abstract class Collider extends Component { - debug: any; shape: Shape; isTrigger: boolean; - physicsLayer: number; - collidesWithLayers: number; + physicsLayer: Ref; + collidesWithLayers: Ref; shouldColliderScaleAndRotateWithTransform: boolean; registeredPhysicsBounds: Rectangle; _localOffsetLength: number; @@ -837,7 +833,6 @@ declare module es { unregisterColliderWithPhysicsSystem(): void; overlaps(other: Collider): boolean; collidesWith(collider: Collider, motion: Vector2, result: CollisionResult): boolean; - clone(): Component; } } declare module es { @@ -846,10 +841,9 @@ declare module es { polygonShape: egret.Shape; pixelShape1: egret.Shape; pixelShape2: egret.Shape; - constructor(); + constructor(x?: number, y?: number, width?: number, height?: number); width: number; height: number; - createBoxRect(x: number, y: number, width: number, height: number): BoxCollider; setSize(width: number, height: number): this; setWidth(width: number): BoxCollider; setHeight(height: number): void; @@ -1303,10 +1297,10 @@ declare module es { class Flags { static isFlagSet(self: number, flag: number): boolean; static isUnshiftedFlagSet(self: number, flag: number): boolean; - static setFlagExclusive(self: number, flag: number): number; - static setFlag(self: number, flag: number): number; - static unsetFlag(self: number, flag: number): number; - static invertFlags(self: number): number; + static setFlagExclusive(self: Ref, flag: number): void; + static setFlag(self: Ref, flag: number): void; + static unsetFlag(self: Ref, flag: number): void; + static invertFlags(self: Ref): void; } } declare module es { @@ -1422,12 +1416,12 @@ declare module es { static isLineToLine(a1: Vector2, a2: Vector2, b1: Vector2, b2: Vector2): boolean; static lineToLineIntersection(a1: Vector2, a2: Vector2, b1: Vector2, b2: Vector2): Vector2; static closestPointOnLine(lineA: Vector2, lineB: Vector2, closestTo: Vector2): Vector2; - static isCircleToCircle(circleCenter1: Vector2, circleRadius1: number, circleCenter2: Vector2, circleRadius2: number): boolean; - static isCircleToLine(circleCenter: Vector2, radius: number, lineFrom: Vector2, lineTo: Vector2): boolean; - static isCircleToPoint(circleCenter: Vector2, radius: number, point: Vector2): boolean; - static isRectToCircle(rect: egret.Rectangle, cPosition: Vector2, cRadius: number): boolean; - static isRectToLine(rect: Rectangle, lineFrom: Vector2, lineTo: Vector2): boolean; - static isRectToPoint(rX: number, rY: number, rW: number, rH: number, point: Vector2): boolean; + static circleToCircle(circleCenter1: Vector2, circleRadius1: number, circleCenter2: Vector2, circleRadius2: number): boolean; + static circleToLine(circleCenter: Vector2, radius: number, lineFrom: Vector2, lineTo: Vector2): boolean; + static circleToPoint(circleCenter: Vector2, radius: number, point: Vector2): boolean; + static rectToCircle(rect: egret.Rectangle, cPosition: Vector2, cRadius: number): boolean; + static rectToLine(rect: Rectangle, lineFrom: Vector2, lineTo: Vector2): boolean; + static rectToPoint(rX: number, rY: number, rW: number, rH: number, point: Vector2): boolean; static getSector(rX: number, rY: number, rW: number, rH: number, point: Vector2): PointSectors; } } @@ -1486,7 +1480,6 @@ declare module es { abstract collidesWithLine(start: Vector2, end: Vector2, hit: RaycastHit): boolean; abstract containsPoint(point: Vector2): any; abstract pointCollidesWithShape(point: Vector2, result: CollisionResult): boolean; - clone(): Shape; } } declare module es { @@ -1508,7 +1501,7 @@ declare module es { static findPolygonCenter(points: Vector2[]): Vector2; static getFarthestPointInDirection(points: Vector2[], direction: Vector2): Vector2; static getClosestPointOnPolygonToPoint(points: Vector2[], point: Vector2, distanceSquared: Ref, edgeNormal: Vector2): Vector2; - static rotatePolygonVerts(radians: number, originalPoints: Vector2[], rotatedPoints: any): void; + static rotatePolygonVerts(radians: number, originalPoints: Vector2[], rotatedPoints: Vector2[]): void; recalculateBounds(collider: Collider): void; overlaps(other: Shape): any; collidesWithShape(other: Shape, result: CollisionResult): boolean; @@ -2051,122 +2044,6 @@ declare module es { update(): void; } } -declare module es { - class TouchState { - x: number; - y: number; - touchPoint: number; - touchDown: boolean; - readonly position: Vector2; - reset(): void; - } - class Input { - private static _init; - private static _previousTouchState; - private static _resolutionOffset; - private static _touchIndex; - private static _gameTouchs; - static readonly gameTouchs: TouchState[]; - private static _resolutionScale; - static readonly resolutionScale: Vector2; - private static _totalTouchCount; - static readonly totalTouchCount: number; - static readonly touchPosition: Vector2; - static maxSupportedTouch: number; - static readonly touchPositionDelta: Vector2; - static initialize(): void; - static scaledPosition(position: Vector2): Vector2; - private static initTouchCache; - private static touchBegin; - private static touchMove; - private static touchEnd; - private static setpreviousTouchState; - } -} -declare class KeyboardUtils { - static TYPE_KEY_DOWN: number; - static TYPE_KEY_UP: number; - static A: string; - static B: string; - static C: string; - static D: string; - static E: string; - static F: string; - static G: string; - static H: string; - static I: string; - static J: string; - static K: string; - static L: string; - static M: string; - static N: string; - static O: string; - static P: string; - static Q: string; - static R: string; - static S: string; - static T: string; - static U: string; - static V: string; - static W: string; - static X: string; - static Y: string; - static Z: string; - static ESC: string; - static F1: string; - static F2: string; - static F3: string; - static F4: string; - static F5: string; - static F6: string; - static F7: string; - static F8: string; - static F9: string; - static F10: string; - static F11: string; - static F12: string; - static NUM_1: string; - static NUM_2: string; - static NUM_3: string; - static NUM_4: string; - static NUM_5: string; - static NUM_6: string; - static NUM_7: string; - static NUM_8: string; - static NUM_9: string; - static NUM_0: string; - static TAB: string; - static CTRL: string; - static ALT: string; - static SHIFT: string; - static CAPS_LOCK: string; - static ENTER: string; - static SPACE: string; - static BACK_SPACE: string; - static INSERT: string; - static DELETE: string; - static HOME: string; - static END: string; - static PAGE_UP: string; - static PAGE_DOWN: string; - static LEFT: string; - static RIGHT: string; - static UP: string; - static DOWN: string; - static PAUSE_BREAK: string; - static NUM_LOCK: string; - static SCROLL_LOCK: string; - static WINDOWS: string; - private static keyDownDict; - private static keyUpDict; - static init(): void; - static registerKey(key: string, fun: Function, thisObj: any, type?: number, ...args: any[]): void; - static unregisterKey(key: string, type?: number): void; - static destroy(): void; - private static onKeyDonwHander; - private static onKeyUpHander; - private static keyCodeToString; -} declare module es { class ListPool { private static readonly _objectQueue; @@ -2386,6 +2263,250 @@ declare module es { initialized: boolean; } } +declare module es { + class TouchState { + x: number; + y: number; + touchPoint: number; + touchDown: boolean; + readonly position: Vector2; + reset(): void; + } + class Input { + private static _init; + private static _previousTouchState; + private static _resolutionOffset; + private static _touchIndex; + private static _gameTouchs; + static readonly gameTouchs: TouchState[]; + private static _resolutionScale; + static readonly resolutionScale: Vector2; + private static _totalTouchCount; + static readonly totalTouchCount: number; + static readonly touchPosition: Vector2; + static _virtualInputs: VirtualInput[]; + static maxSupportedTouch: number; + static readonly touchPositionDelta: Vector2; + static initialize(): void; + static update(): void; + static scaledPosition(position: Vector2): Vector2; + static isKeyPressed(key: Keys): boolean; + static isKeyPressedBoth(keyA: Keys, keyB: Keys): boolean; + static isKeyDown(key: Keys): boolean; + static isKeyDownBoth(keyA: Keys, keyB: Keys): boolean; + static isKeyReleased(key: Keys): boolean; + static isKeyReleasedBoth(keyA: Keys, keyB: Keys): boolean; + private static initTouchCache; + private static touchBegin; + private static touchMove; + private static touchEnd; + private static setpreviousTouchState; + } +} +import Keys = es.Keys; +declare class KeyboardUtils { + static currentKeys: Keys[]; + static previousKeys: Keys[]; + private static keyStatusKeys; + static init(): void; + static update(): void; + static destroy(): void; + private static onKeyDownHandler; + private static onKeyUpHandler; +} +declare module es { + enum Keys { + none = 0, + back = 8, + tab = 9, + enter = 13, + capsLock = 20, + escape = 27, + space = 32, + pageUp = 33, + pageDown = 34, + end = 35, + home = 36, + left = 37, + up = 38, + right = 39, + down = 40, + select = 41, + print = 42, + execute = 43, + printScreen = 44, + insert = 45, + delete = 46, + help = 47, + d0 = 48, + d1 = 49, + d2 = 50, + d3 = 51, + d4 = 52, + d5 = 53, + d6 = 54, + d7 = 55, + d8 = 56, + d9 = 57, + 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, + leftWindows = 91, + rightWindows = 92, + apps = 93, + sleep = 95, + numPad0 = 96, + numPad1 = 97, + numPad2 = 98, + numPad3 = 99, + numPad4 = 100, + numPad5 = 101, + numPad6 = 102, + numPad7 = 103, + numPad8 = 104, + numPad9 = 105, + multiply = 106, + add = 107, + seperator = 108, + subtract = 109, + decimal = 110, + divide = 111, + f1 = 112, + f2 = 113, + f3 = 114, + f4 = 115, + f5 = 116, + f6 = 117, + f7 = 118, + f8 = 119, + f9 = 120, + f10 = 121, + f11 = 122, + f12 = 123, + f13 = 124, + f14 = 125, + f15 = 126, + f16 = 127, + f17 = 128, + f18 = 129, + f19 = 130, + f20 = 131, + f21 = 132, + f22 = 133, + f23 = 134, + f24 = 135, + numLock = 144, + scroll = 145, + leftShift = 160, + rightShift = 161, + leftControl = 162, + rightControl = 163, + leftAlt = 164, + rightAlt = 165, + browserBack = 166, + browserForward = 167 + } +} +declare module es { + enum OverlapBehavior { + cancelOut = 0, + takeOlder = 1, + takeNewer = 2 + } + abstract class VirtualInput { + protected constructor(); + deregister(): void; + abstract update(): any; + } + abstract class VirtualInputNode { + update(): void; + } +} +declare module es { + class VirtualIntegerAxis extends VirtualInput { + nodes: VirtualAxisNode[]; + readonly value: number; + constructor(...nodes: VirtualAxisNode[]); + update(): void; + addKeyboardKeys(overlapBehavior: OverlapBehavior, negative: Keys, positive: Keys): this; + } + abstract class VirtualAxisNode extends VirtualInputNode { + abstract value: number; + } +} +declare module es { + class VirtualAxis extends VirtualInput { + nodes: VirtualAxisNode[]; + readonly value: number; + constructor(...nodes: VirtualAxisNode[]); + update(): void; + } + class KeyboardKeys extends VirtualAxisNode { + overlapBehavior: OverlapBehavior; + positive: Keys; + negative: Keys; + _value: number; + _turned: boolean; + constructor(overlapBehavior: OverlapBehavior, negative: Keys, positive: Keys); + update(): void; + readonly value: number; + } +} +declare module es { + class VirtualButton extends VirtualInput { + nodes: Node[]; + bufferTime: number; + firstRepeatTime: number; + mutiRepeatTime: number; + isRepeating: boolean; + _bufferCounter: number; + _repeatCounter: number; + _willRepeat: boolean; + constructor(bufferTime?: number, ...nodes: Node[]); + setRepeat(firstRepeatTime: number, mutiRepeatTime?: number): void; + update(): void; + readonly isDown: boolean; + readonly isPressed: boolean; + readonly isReleased: boolean; + consumeBuffer(): void; + addKeyboardKey(key: Keys): VirtualButton; + } + abstract class Node extends VirtualInputNode { + abstract isDown: boolean; + abstract isPressed: boolean; + abstract isReleased: boolean; + } + class KeyboardKey extends Node { + key: Keys; + constructor(key: Keys); + readonly isDown: boolean; + readonly isPressed: boolean; + readonly isReleased: boolean; + } +} declare module es { class AssetPacker { protected itemsToRaster: TextureToPack[]; diff --git a/demo/libs/framework/framework.js b/demo/libs/framework/framework.js index 1261c84d..d5a7d6fe 100644 --- a/demo/libs/framework/framework.js +++ b/demo/libs/framework/framework.js @@ -1096,6 +1096,7 @@ var es; case 0: this.startDebugUpdate(); es.Time.update(egret.getTimer()); + es.Input.update(); if (!this._scene) return [3, 2]; for (i = this._globalManagers.length - 1; i >= 0; i--) { if (this._globalManagers[i].enabled) @@ -1311,11 +1312,6 @@ var es; } return this; }; - Component.prototype.clone = function () { - var component = ObjectUtils.clone(this); - component.entity = null; - return component; - }; return Component; }(egret.HashObject)); es.Component = Component; @@ -1554,13 +1550,6 @@ var es; this.transform.getChild(i).entity.attachToScene(newScene); } }; - Entity.prototype.clone = function (position) { - if (position === void 0) { position = new es.Vector2(); } - var entity = new Entity(this.name + "(clone)"); - entity.copyFrom(this); - entity.transform.position = position; - return entity; - }; Entity.prototype.onAddedToScene = function () { }; Entity.prototype.onRemovedFromScene = function () { @@ -1620,24 +1609,6 @@ var es; Entity.prototype.toString = function () { return "[Entity: name: " + this.name + ", tag: " + this.tag + ", enabled: " + this.enabled + ", depth: " + this.updateOrder + "]"; }; - Entity.prototype.copyFrom = function (entity) { - this.tag = entity.tag; - this.updateInterval = entity.updateInterval; - this.updateOrder = entity.updateOrder; - this.enabled = entity.enabled; - this.transform.scale = entity.transform.scale; - this.transform.rotation = entity.transform.rotation; - for (var i = 0; i < entity.components.count; i++) - this.addComponent(entity.components.buffer[i].clone()); - for (var i = 0; i < entity.components._componentsToAdd.length; i++) - this.addComponent(entity.components._componentsToAdd[i].clone()); - for (var i = 0; i < entity.transform.childCount; i++) { - var child = entity.transform.getChild(i).entity; - var childClone = child.clone(); - childClone.transform.copyFrom(child.transform); - childClone.transform.parent = this.transform; - } - }; Entity._idGenerator = 0; return Entity; }()); @@ -3264,6 +3235,7 @@ var es; (function (es) { var SpriteAnimation = (function () { function SpriteAnimation(sprites, frameRate) { + if (frameRate === void 0) { frameRate = 10; } this.sprites = sprites; this.frameRate = frameRate; } @@ -3461,13 +3433,13 @@ var es; if (collisionLayerName === void 0) { collisionLayerName = null; } if (shouldCreateColliders === void 0) { shouldCreateColliders = true; } var _this = _super.call(this) || this; - _this.physicsLayer = 1 << 0; + _this.physicsLayer = new es.Ref(1 << 0); _this.toContainer = false; _this.tiledMap = tiledMap; _this._shouldCreateColliders = shouldCreateColliders; _this.displayObject = new egret.DisplayObjectContainer(); if (collisionLayerName) { - _this.collisionLayer = tiledMap.tileLayers[collisionLayerName]; + _this.collisionLayer = tiledMap.tileLayers.find(function (layer) { return layer.name == collisionLayerName; }); } return _this; } @@ -3554,7 +3526,7 @@ var es; var collisionRects = this.collisionLayer.getCollisionRectangles(); this._colliders = []; for (var i = 0; i < collisionRects.length; i++) { - var collider = new es.BoxCollider().createBoxRect(collisionRects[i].x + this._localOffset.x, collisionRects[i].y + this._localOffset.y, collisionRects[i].width, collisionRects[i].height); + var collider = new es.BoxCollider(collisionRects[i].x + this._localOffset.x, collisionRects[i].y + this._localOffset.y, collisionRects[i].width, collisionRects[i].height); collider.physicsLayer = this.physicsLayer; collider.entity = this.entity; this._colliders[i] = collider; @@ -3596,7 +3568,7 @@ var es; var bounds = collider.bounds; bounds.x += motion.x; bounds.y += motion.y; - var neighbors = es.Physics.boxcastBroadphaseExcludingSelf(collider, bounds, collider.collidesWithLayers); + var neighbors = es.Physics.boxcastBroadphaseExcludingSelf(collider, bounds, collider.collidesWithLayers.value); for (var j = 0; j < neighbors.length; j++) { var neighbor = neighbors[j]; if (neighbor.isTrigger) @@ -3645,10 +3617,10 @@ var es; if (!this._collider) return false; var didCollide = false; - this.entity.position = es.Vector2.add(this.entity.position, motion); - var neighbors = es.Physics.boxcastBroadphase(this._collider.bounds, this._collider.collidesWithLayers); - for (var i = 0; i < neighbors.length; i++) { - var neighbor = neighbors[i]; + this.entity.position.add(motion); + var neighbors = es.Physics.boxcastBroadphase(this._collider.bounds, this._collider.collidesWithLayers.value); + for (var _i = 0, neighbors_1 = neighbors; _i < neighbors_1.length; _i++) { + var neighbor = neighbors_1[_i]; if (this._collider.overlaps(neighbor) && neighbor.enabled) { didCollide = true; this.notifyTriggerListeners(this._collider, neighbor); @@ -3678,8 +3650,8 @@ var es; __extends(Collider, _super); function Collider() { var _this = _super !== null && _super.apply(this, arguments) || this; - _this.physicsLayer = 1 << 0; - _this.collidesWithLayers = es.Physics.allLayers; + _this.physicsLayer = new es.Ref(1 << 0); + _this.collidesWithLayers = new es.Ref(es.Physics.allLayers); _this.shouldColliderScaleAndRotateWithTransform = true; _this.registeredPhysicsBounds = new es.Rectangle(); _this._isPositionDirty = true; @@ -3748,8 +3720,8 @@ var es; var renderable = this.entity.getComponent(es.RenderableComponent); if (renderable) { var renderableBounds = renderable.bounds; - var width = renderableBounds.width / this.entity.scale.x; - var height = renderableBounds.height / this.entity.scale.y; + var width = renderableBounds.width / this.entity.transform.scale.x; + var height = renderableBounds.height / this.entity.transform.scale.y; if (this instanceof es.CircleCollider) { this.radius = Math.max(width, height) * 0.5; } @@ -3809,20 +3781,13 @@ var es; }; Collider.prototype.collidesWith = function (collider, motion, result) { var oldPosition = this.entity.position; - this.entity.position = this.entity.position.add(motion); + this.entity.position.add(motion); var didCollide = this.shape.collidesWithShape(collider.shape, result); if (didCollide) result.collider = collider; this.entity.position = oldPosition; return didCollide; }; - Collider.prototype.clone = function () { - var collider = ObjectUtils.clone(this); - collider.entity = null; - if (this.shape) - collider.shape = this.shape.clone(); - return collider; - }; return Collider; }(es.Component)); es.Collider = Collider; @@ -3831,14 +3796,28 @@ var es; (function (es) { var BoxCollider = (function (_super) { __extends(BoxCollider, _super); - function BoxCollider() { + function BoxCollider(x, y, width, height) { var _this = _super.call(this) || this; _this.hollowShape = new egret.Shape(); _this.polygonShape = new egret.Shape(); _this.pixelShape1 = new egret.Shape(); _this.pixelShape2 = new egret.Shape(); - _this.shape = new es.Box(1, 1); - _this._colliderRequiresAutoSizing = true; + if (x == undefined && y == undefined) { + if (width == undefined && height == undefined) { + _this.shape = new es.Box(1, 1); + _this._colliderRequiresAutoSizing = true; + } + else if (width != undefined && height != undefined) { + x = -width / 2; + y = -height / 2; + _this._localOffset = new es.Vector2(x + width / 2, y + height / 2); + _this.shape = new es.Box(width, height); + } + } + else if (x != undefined && y != undefined && width != undefined && height != undefined) { + _this._localOffset = new es.Vector2(x + width / 2, y + height / 2); + _this.shape = new es.Box(width, height); + } return _this; } Object.defineProperty(BoxCollider.prototype, "width", { @@ -3861,12 +3840,6 @@ var es; enumerable: true, configurable: true }); - BoxCollider.prototype.createBoxRect = function (x, y, width, height) { - this._localOffset = new es.Vector2(x + width / 2, y + width / 2); - this.shape = new es.Box(width, height); - this._colliderRequiresAutoSizing = false; - return this; - }; BoxCollider.prototype.setSize = function (width, height) { this._colliderRequiresAutoSizing = false; var box = this.shape; @@ -3906,6 +3879,11 @@ var es; this.debugDisplayObject.addChild(this.pixelShape1); if (!this.pixelShape2.parent) this.debugDisplayObject.addChild(this.pixelShape2); + this.hollowShape.graphics.clear(); + this.hollowShape.graphics.beginFill(es.Colors.colliderBounds, 0); + this.hollowShape.graphics.lineStyle(es.Size.lineSizeMultiplier, es.Colors.colliderBounds); + this.hollowShape.graphics.drawRect(this.bounds.x, this.bounds.y, this.bounds.width, this.bounds.height); + this.hollowShape.graphics.endFill(); this.polygonShape.graphics.clear(); if (poly.points.length >= 2) { this.polygonShape.graphics.beginFill(es.Colors.colliderEdge, 0); @@ -3951,9 +3929,13 @@ var es; _this.circleShape = new egret.Shape(); _this.pixelShape1 = new egret.Shape(); _this.pixelShape2 = new egret.Shape(); - if (radius) + if (radius == undefined) { + _this.shape = new es.Circle(1); _this._colliderRequiresAutoSizing = true; - _this.shape = new es.Circle(radius ? radius : 1); + } + else { + _this.shape = new es.Circle(radius); + } return _this; } Object.defineProperty(CircleCollider.prototype, "radius", { @@ -6155,17 +6137,17 @@ var es; return (self & flag) != 0; }; Flags.setFlagExclusive = function (self, flag) { - return 1 << flag; + self.value = 1 << flag; }; Flags.setFlag = function (self, flag) { - return (self | 1 << flag); + self.value = (self.value | 1 << flag); }; Flags.unsetFlag = function (self, flag) { flag = 1 << flag; - return (self & (~flag)); + self.value = (self.value & (~flag)); }; Flags.invertFlags = function (self) { - return ~self; + self.value = ~self.value; }; return Flags; }()); @@ -6828,23 +6810,42 @@ var es; t = es.MathHelper.clamp(t, 0, 1); return es.Vector2.add(lineA, new es.Vector2(v.x * t, v.y * t)); }; - Collisions.isCircleToCircle = function (circleCenter1, circleRadius1, circleCenter2, circleRadius2) { + Collisions.circleToCircle = function (circleCenter1, circleRadius1, circleCenter2, circleRadius2) { return es.Vector2.distanceSquared(circleCenter1, circleCenter2) < (circleRadius1 + circleRadius2) * (circleRadius1 + circleRadius2); }; - Collisions.isCircleToLine = function (circleCenter, radius, lineFrom, lineTo) { + Collisions.circleToLine = function (circleCenter, radius, lineFrom, lineTo) { return es.Vector2.distanceSquared(circleCenter, this.closestPointOnLine(lineFrom, lineTo, circleCenter)) < radius * radius; }; - Collisions.isCircleToPoint = function (circleCenter, radius, point) { + Collisions.circleToPoint = function (circleCenter, radius, point) { return es.Vector2.distanceSquared(circleCenter, point) < radius * radius; }; - Collisions.isRectToCircle = function (rect, cPosition, cRadius) { - var ew = rect.width * 0.5; - var eh = rect.height * 0.5; - var vx = Math.max(0, Math.max(cPosition.x - rect.x) - ew); - var vy = Math.max(0, Math.max(cPosition.y - rect.y) - eh); - return vx * vx + vy * vy < cRadius * cRadius; + Collisions.rectToCircle = function (rect, cPosition, cRadius) { + if (this.rectToPoint(rect.x, rect.y, rect.width, rect.height, cPosition)) + return true; + var edgeFrom = es.Vector2.zero; + var edgeTo = es.Vector2.zero; + var sector = this.getSector(rect.x, rect.y, rect.width, rect.height, cPosition); + if ((sector & PointSectors.top) != 0) { + edgeFrom = new es.Vector2(rect.x, rect.y); + edgeTo = new es.Vector2(rect.x + rect.width, rect.y); + if (this.circleToLine(cPosition, cRadius, edgeFrom, edgeTo)) + return true; + } + if ((sector & PointSectors.bottom) != 0) { + edgeFrom = new es.Vector2(rect.x, rect.y + rect.width); + edgeTo = new es.Vector2(rect.x + rect.width, rect.y + rect.height); + if (this.circleToLine(cPosition, cRadius, edgeFrom, edgeTo)) + return true; + } + if ((sector & PointSectors.left) != 0) { + edgeFrom = new es.Vector2(rect.x + rect.width, rect.y); + edgeTo = new es.Vector2(rect.x + rect.width, rect.y + rect.height); + if (this.circleToLine(cPosition, cRadius, edgeFrom, edgeTo)) + return true; + } + return false; }; - Collisions.isRectToLine = function (rect, lineFrom, lineTo) { + Collisions.rectToLine = function (rect, lineFrom, lineTo) { var fromSector = this.getSector(rect.x, rect.y, rect.width, rect.height, lineFrom); var toSector = this.getSector(rect.x, rect.y, rect.width, rect.height, lineTo); if (fromSector == PointSectors.center || toSector == PointSectors.center) { @@ -6884,7 +6885,7 @@ var es; } return false; }; - Collisions.isRectToPoint = function (rX, rY, rW, rH, point) { + Collisions.rectToPoint = function (rX, rY, rW, rH, point) { return point.x >= rX && point.y >= rY && point.x < rX + rW && point.y < rY + rH; }; Collisions.getSector = function (rX, rY, rW, rH, point) { @@ -7022,9 +7023,6 @@ var es; var Shape = (function () { function Shape() { } - Shape.prototype.clone = function () { - return ObjectUtils.clone(this); - }; return Shape; }()); es.Shape = Shape; @@ -7064,7 +7062,7 @@ var es; }; Polygon.prototype.buildEdgeNormals = function () { var totalEdges = this.isBox ? 2 : this.points.length; - if (this._edgeNormals == null || this._edgeNormals.length != totalEdges) + if (this._edgeNormals == undefined || this._edgeNormals.length != totalEdges) this._edgeNormals = new Array(totalEdges); var p2; for (var i = 0; i < totalEdges; i++) { @@ -7116,7 +7114,7 @@ var es; edgeNormal.x = 0; edgeNormal.y = 0; var closestPoint = new es.Vector2(0, 0); - var tempDistanceSquared; + var tempDistanceSquared = 0; for (var i = 0; i < points.length; i++) { var j = i + 1; if (j == points.length) @@ -7136,7 +7134,7 @@ var es; }; Polygon.rotatePolygonVerts = function (radians, originalPoints, rotatedPoints) { var cos = Math.cos(radians); - var sin = Math.sign(radians); + var sin = Math.sin(radians); for (var i = 0; i < originalPoints.length; i++) { var position = originalPoints[i]; rotatedPoints[i] = new es.Vector2(position.x * cos + position.y * -sin, position.x * sin + position.y * cos); @@ -7258,7 +7256,7 @@ var es; if (other instanceof Box && other.isUnrotated) return this.bounds.intersects(other.bounds); if (other instanceof es.Circle) - return es.Collisions.isRectToCircle(this.bounds, other.position, other.radius); + return es.Collisions.rectToCircle(this.bounds, other.position, other.radius); } return _super.prototype.overlaps.call(this, other); }; @@ -7302,18 +7300,18 @@ var es; if (collider.entity.transform.rotation != 0) { var offsetAngle = Math.atan2(collider.localOffset.y, collider.localOffset.x) * es.MathHelper.Rad2Deg; var offsetLength = hasUnitScale ? collider._localOffsetLength : es.Vector2.multiply(collider.localOffset, collider.entity.transform.scale).length(); - this.center = es.MathHelper.pointOnCirlce(es.Vector2.zero, offsetLength, collider.entity.transform.rotation + offsetAngle); + this.center = es.MathHelper.pointOnCirlce(es.Vector2.zero, offsetLength, collider.entity.transform.rotationDegrees + offsetAngle); } } - this.position = es.Vector2.add(collider.transform.position, this.center); + this.position = es.Vector2.add(collider.entity.transform.position, this.center); this.bounds = new es.Rectangle(this.position.x - this.radius, this.position.y - this.radius, this.radius * 2, this.radius * 2); }; Circle.prototype.overlaps = function (other) { var result = new es.CollisionResult(); if (other instanceof es.Box && other.isUnrotated) - return es.Collisions.isRectToCircle(other.bounds, this.position, this.radius); + return es.Collisions.rectToCircle(other.bounds, this.position, this.radius); if (other instanceof Circle) - return es.Collisions.isCircleToCircle(this.position, this.radius, other.position, other.radius); + return es.Collisions.circleToCircle(this.position, this.radius, other.position, other.radius); if (other instanceof es.Polygon) return es.ShapeCollisions.circleToPolygon(this, other, result); throw new Error("overlaps of circle to " + other + " are not supported"); @@ -7760,7 +7758,7 @@ var es; continue; var _loop_8 = function (i) { var collider = cell[i]; - if (collider == excludeCollider || !es.Flags.isFlagSet(layerMask, collider.physicsLayer)) + if (collider == excludeCollider || !es.Flags.isFlagSet(layerMask, collider.physicsLayer.value)) return "continue"; if (bounds.intersects(collider.bounds)) { if (!this_4._tempHashSet.firstOrDefault(function (c) { return c.hashCode == collider.hashCode; })) @@ -7916,7 +7914,7 @@ var es; this._checkedColliders.push(potential); if (potential.isTrigger && !es.Physics.raycastsHitTriggers) continue; - if (!es.Flags.isFlagSet(this._layerMask, potential.physicsLayer)) + if (!es.Flags.isFlagSet(this._layerMask, potential.physicsLayer.value)) continue; var colliderBounds = potential.bounds; if (colliderBounds.rayIntersects(this._ray, fraction) && fraction.value <= 1) { @@ -7992,7 +7990,7 @@ var es; return this.tiles[x + y * this.width]; }; TmxLayer.prototype.getCollisionRectangles = function () { - var checkedIndexes = []; + var checkedIndexes = new Array(this.tiles.length); var rectangles = []; var startCol = -1; var index = -1; @@ -8005,7 +8003,7 @@ var es; startCol = x; checkedIndexes[index] = true; } - else if (tile || checkedIndexes[index]) { + else if (!tile || checkedIndexes[index] == true) { if (startCol >= 0) { rectangles.push(this.findBoundsRect(startCol, x, y, checkedIndexes)); startCol = -1; @@ -8025,7 +8023,7 @@ var es; for (var x = startX; x < endX; x++) { index = y * this.map.width + x; var tile = this.getTile(x, y); - if (tile || checkedIndexes[index]) { + if (!tile || checkedIndexes[index]) { for (var _x = startX; _x < x; _x++) { index = y * this.map.width + _x; checkedIndexes[index] = false; @@ -8063,7 +8061,7 @@ var es; }); Object.defineProperty(TmxLayerTile.prototype, "tilesetTile", { get: function () { - if (this._tilesetTileIndex == undefined) { + if (!this._tilesetTileIndex) { this._tilesetTileIndex = -1; if (this.tileset.firstGid <= this.gid) { var tilesetTile = this.tileset.tiles.get(this.gid - this.tileset.firstGid); @@ -9892,364 +9890,6 @@ var es; es.GlobalManager = GlobalManager; })(es || (es = {})); var es; -(function (es) { - var TouchState = (function () { - function TouchState() { - this.x = 0; - this.y = 0; - this.touchPoint = -1; - this.touchDown = false; - } - Object.defineProperty(TouchState.prototype, "position", { - get: function () { - return new es.Vector2(this.x, this.y); - }, - enumerable: true, - configurable: true - }); - TouchState.prototype.reset = function () { - this.x = 0; - this.y = 0; - this.touchDown = false; - this.touchPoint = -1; - }; - return TouchState; - }()); - es.TouchState = TouchState; - var Input = (function () { - function Input() { - } - Object.defineProperty(Input, "gameTouchs", { - get: function () { - return this._gameTouchs; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Input, "resolutionScale", { - get: function () { - return this._resolutionScale; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Input, "totalTouchCount", { - get: function () { - return this._totalTouchCount; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Input, "touchPosition", { - get: function () { - if (!this._gameTouchs[0]) - return es.Vector2.zero; - return this._gameTouchs[0].position; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Input, "maxSupportedTouch", { - get: function () { - return es.Core._instance.stage.maxTouches; - }, - set: function (value) { - es.Core._instance.stage.maxTouches = value; - this.initTouchCache(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Input, "touchPositionDelta", { - get: function () { - var delta = es.Vector2.subtract(this.touchPosition, this._previousTouchState.position); - if (delta.length() > 0) { - this.setpreviousTouchState(this._gameTouchs[0]); - } - return delta; - }, - enumerable: true, - configurable: true - }); - Input.initialize = function () { - if (this._init) - return; - this._init = true; - es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.touchBegin, this); - es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.touchMove, this); - es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.touchEnd, this); - es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL, this.touchEnd, this); - es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.touchEnd, this); - this.initTouchCache(); - }; - Input.scaledPosition = function (position) { - var scaledPos = new es.Vector2(position.x - this._resolutionOffset.x, position.y - this._resolutionOffset.y); - return es.Vector2.multiply(scaledPos, this.resolutionScale); - }; - Input.initTouchCache = function () { - this._totalTouchCount = 0; - this._touchIndex = 0; - this._gameTouchs.length = 0; - for (var i = 0; i < this.maxSupportedTouch; i++) { - this._gameTouchs.push(new TouchState()); - } - }; - Input.touchBegin = function (evt) { - if (this._touchIndex < this.maxSupportedTouch) { - this._gameTouchs[this._touchIndex].touchPoint = evt.touchPointID; - this._gameTouchs[this._touchIndex].touchDown = evt.touchDown; - this._gameTouchs[this._touchIndex].x = evt.stageX; - this._gameTouchs[this._touchIndex].y = evt.stageY; - if (this._touchIndex == 0) { - this.setpreviousTouchState(this._gameTouchs[0]); - } - this._touchIndex++; - this._totalTouchCount++; - } - }; - Input.touchMove = function (evt) { - if (evt.touchPointID == this._gameTouchs[0].touchPoint) { - this.setpreviousTouchState(this._gameTouchs[0]); - } - var touchIndex = this._gameTouchs.findIndex(function (touch) { return touch.touchPoint == evt.touchPointID; }); - if (touchIndex != -1) { - var touchData = this._gameTouchs[touchIndex]; - touchData.x = evt.stageX; - touchData.y = evt.stageY; - } - }; - Input.touchEnd = function (evt) { - var touchIndex = this._gameTouchs.findIndex(function (touch) { return touch.touchPoint == evt.touchPointID; }); - if (touchIndex != -1) { - var touchData = this._gameTouchs[touchIndex]; - touchData.reset(); - if (touchIndex == 0) - this._previousTouchState.reset(); - this._totalTouchCount--; - if (this.totalTouchCount == 0) { - this._touchIndex = 0; - } - } - }; - Input.setpreviousTouchState = function (touchState) { - this._previousTouchState = new TouchState(); - this._previousTouchState.x = touchState.position.x; - this._previousTouchState.y = touchState.position.y; - this._previousTouchState.touchPoint = touchState.touchPoint; - this._previousTouchState.touchDown = touchState.touchDown; - }; - Input._init = false; - Input._previousTouchState = new TouchState(); - Input._resolutionOffset = new es.Vector2(); - Input._touchIndex = 0; - Input._gameTouchs = []; - Input._resolutionScale = es.Vector2.one; - Input._totalTouchCount = 0; - return Input; - }()); - es.Input = Input; -})(es || (es = {})); -var KeyboardUtils = (function () { - function KeyboardUtils() { - } - KeyboardUtils.init = function () { - KeyboardUtils.keyDownDict = {}; - KeyboardUtils.keyUpDict = {}; - document.addEventListener("keydown", KeyboardUtils.onKeyDonwHander); - document.addEventListener("keyup", KeyboardUtils.onKeyUpHander); - }; - KeyboardUtils.registerKey = function (key, fun, thisObj, type) { - if (type === void 0) { type = 0; } - var args = []; - for (var _i = 4; _i < arguments.length; _i++) { - args[_i - 4] = arguments[_i]; - } - var keyDict = type ? this.keyUpDict : this.keyDownDict; - keyDict[key] = { "fun": fun, args: args, "thisObj": thisObj }; - }; - KeyboardUtils.unregisterKey = function (key, type) { - if (type === void 0) { type = 0; } - var keyDict = type ? this.keyUpDict : this.keyDownDict; - delete keyDict[key]; - }; - KeyboardUtils.destroy = function () { - KeyboardUtils.keyDownDict = null; - KeyboardUtils.keyUpDict = null; - document.removeEventListener("keydown", this.onKeyDonwHander); - document.removeEventListener("keyup", this.onKeyUpHander); - }; - KeyboardUtils.onKeyDonwHander = function (event) { - if (!KeyboardUtils.keyDownDict) - return; - var key = KeyboardUtils.keyCodeToString(event.keyCode); - var o = KeyboardUtils.keyDownDict[key]; - if (o) { - var fun = o["fun"]; - var thisObj = o["thisObj"]; - var args = o["args"]; - fun.apply(thisObj, args); - } - }; - KeyboardUtils.onKeyUpHander = function (event) { - if (!KeyboardUtils.keyUpDict) - return; - var key = KeyboardUtils.keyCodeToString(event.keyCode); - var o = KeyboardUtils.keyUpDict[key]; - if (o) { - var fun = o["fun"]; - var thisObj = o["thisObj"]; - var args = o["args"]; - fun.apply(thisObj, args); - } - }; - KeyboardUtils.keyCodeToString = function (keyCode) { - switch (keyCode) { - case 8: - return this.BACK_SPACE; - case 9: - return this.TAB; - case 13: - return this.ENTER; - case 16: - return this.SHIFT; - case 17: - return this.CTRL; - case 19: - return this.PAUSE_BREAK; - case 20: - return this.CAPS_LOCK; - case 27: - return this.ESC; - case 32: - return this.SPACE; - case 33: - return this.PAGE_UP; - case 34: - return this.PAGE_DOWN; - case 35: - return this.END; - case 36: - return this.HOME; - case 37: - return this.LEFT; - case 38: - return this.UP; - case 39: - return this.RIGHT; - case 40: - return this.DOWN; - case 45: - return this.INSERT; - case 46: - return this.DELETE; - case 91: - return this.WINDOWS; - case 112: - return this.F1; - case 113: - return this.F2; - case 114: - return this.F3; - case 115: - return this.F4; - case 116: - return this.F5; - case 117: - return this.F6; - case 118: - return this.F7; - case 119: - return this.F8; - case 120: - return this.F9; - case 122: - return this.F11; - case 123: - return this.F12; - case 144: - return this.NUM_LOCK; - case 145: - return this.SCROLL_LOCK; - default: - return String.fromCharCode(keyCode); - } - }; - KeyboardUtils.TYPE_KEY_DOWN = 0; - KeyboardUtils.TYPE_KEY_UP = 1; - KeyboardUtils.A = "A"; - KeyboardUtils.B = "B"; - KeyboardUtils.C = "C"; - KeyboardUtils.D = "D"; - KeyboardUtils.E = "E"; - KeyboardUtils.F = "F"; - KeyboardUtils.G = "G"; - KeyboardUtils.H = "H"; - KeyboardUtils.I = "I"; - KeyboardUtils.J = "J"; - KeyboardUtils.K = "K"; - KeyboardUtils.L = "L"; - KeyboardUtils.M = "M"; - KeyboardUtils.N = "N"; - KeyboardUtils.O = "O"; - KeyboardUtils.P = "P"; - KeyboardUtils.Q = "Q"; - KeyboardUtils.R = "R"; - KeyboardUtils.S = "S"; - KeyboardUtils.T = "T"; - KeyboardUtils.U = "U"; - KeyboardUtils.V = "V"; - KeyboardUtils.W = "W"; - KeyboardUtils.X = "X"; - KeyboardUtils.Y = "Y"; - KeyboardUtils.Z = "Z"; - KeyboardUtils.ESC = "Esc"; - KeyboardUtils.F1 = "F1"; - KeyboardUtils.F2 = "F2"; - KeyboardUtils.F3 = "F3"; - KeyboardUtils.F4 = "F4"; - KeyboardUtils.F5 = "F5"; - KeyboardUtils.F6 = "F6"; - KeyboardUtils.F7 = "F7"; - KeyboardUtils.F8 = "F8"; - KeyboardUtils.F9 = "F9"; - KeyboardUtils.F10 = "F10"; - KeyboardUtils.F11 = "F11"; - KeyboardUtils.F12 = "F12"; - KeyboardUtils.NUM_1 = "1"; - KeyboardUtils.NUM_2 = "2"; - KeyboardUtils.NUM_3 = "3"; - KeyboardUtils.NUM_4 = "4"; - KeyboardUtils.NUM_5 = "5"; - KeyboardUtils.NUM_6 = "6"; - KeyboardUtils.NUM_7 = "7"; - KeyboardUtils.NUM_8 = "8"; - KeyboardUtils.NUM_9 = "9"; - KeyboardUtils.NUM_0 = "0"; - KeyboardUtils.TAB = "Tab"; - KeyboardUtils.CTRL = "Ctrl"; - KeyboardUtils.ALT = "Alt"; - KeyboardUtils.SHIFT = "Shift"; - KeyboardUtils.CAPS_LOCK = "Caps Lock"; - KeyboardUtils.ENTER = "Enter"; - KeyboardUtils.SPACE = "Space"; - KeyboardUtils.BACK_SPACE = "Back Space"; - KeyboardUtils.INSERT = "Insert"; - KeyboardUtils.DELETE = "Page Down"; - KeyboardUtils.HOME = "Home"; - KeyboardUtils.END = "Page Down"; - KeyboardUtils.PAGE_UP = "Page Up"; - KeyboardUtils.PAGE_DOWN = "Page Down"; - KeyboardUtils.LEFT = "Left"; - KeyboardUtils.RIGHT = "Right"; - KeyboardUtils.UP = "Up"; - KeyboardUtils.DOWN = "Down"; - KeyboardUtils.PAUSE_BREAK = "Pause Break"; - KeyboardUtils.NUM_LOCK = "Num Lock"; - KeyboardUtils.SCROLL_LOCK = "Scroll Lock"; - KeyboardUtils.WINDOWS = "Windows"; - return KeyboardUtils; -}()); -var es; (function (es) { var ListPool = (function () { function ListPool() { @@ -11097,6 +10737,651 @@ var es; es.MarkerLog = MarkerLog; })(es || (es = {})); var es; +(function (es) { + var TouchState = (function () { + function TouchState() { + this.x = 0; + this.y = 0; + this.touchPoint = -1; + this.touchDown = false; + } + Object.defineProperty(TouchState.prototype, "position", { + get: function () { + return new es.Vector2(this.x, this.y); + }, + enumerable: true, + configurable: true + }); + TouchState.prototype.reset = function () { + this.x = 0; + this.y = 0; + this.touchDown = false; + this.touchPoint = -1; + }; + return TouchState; + }()); + es.TouchState = TouchState; + var Input = (function () { + function Input() { + } + Object.defineProperty(Input, "gameTouchs", { + get: function () { + return this._gameTouchs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Input, "resolutionScale", { + get: function () { + return this._resolutionScale; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Input, "totalTouchCount", { + get: function () { + return this._totalTouchCount; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Input, "touchPosition", { + get: function () { + if (!this._gameTouchs[0]) + return es.Vector2.zero; + return this._gameTouchs[0].position; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Input, "maxSupportedTouch", { + get: function () { + return es.Core._instance.stage.maxTouches; + }, + set: function (value) { + es.Core._instance.stage.maxTouches = value; + this.initTouchCache(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Input, "touchPositionDelta", { + get: function () { + var delta = es.Vector2.subtract(this.touchPosition, this._previousTouchState.position); + if (delta.length() > 0) { + this.setpreviousTouchState(this._gameTouchs[0]); + } + return delta; + }, + enumerable: true, + configurable: true + }); + Input.initialize = function () { + if (this._init) + return; + this._init = true; + es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.touchBegin, this); + es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.touchMove, this); + es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.touchEnd, this); + es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL, this.touchEnd, this); + es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.touchEnd, this); + this.initTouchCache(); + }; + Input.update = function () { + KeyboardUtils.update(); + for (var i = 0; i < this._virtualInputs.length; i++) + this._virtualInputs[i].update(); + }; + Input.scaledPosition = function (position) { + var scaledPos = new es.Vector2(position.x - this._resolutionOffset.x, position.y - this._resolutionOffset.y); + return es.Vector2.multiply(scaledPos, this.resolutionScale); + }; + Input.isKeyPressed = function (key) { + return KeyboardUtils.currentKeys.contains(key) && !KeyboardUtils.previousKeys.contains(key); + }; + Input.isKeyPressedBoth = function (keyA, keyB) { + return this.isKeyPressed(keyA) || this.isKeyPressed(keyB); + }; + Input.isKeyDown = function (key) { + return KeyboardUtils.currentKeys.contains(key); + }; + Input.isKeyDownBoth = function (keyA, keyB) { + return this.isKeyDown(keyA) || this.isKeyDown(keyB); + }; + Input.isKeyReleased = function (key) { + return !KeyboardUtils.currentKeys.contains(key) && KeyboardUtils.previousKeys.contains(key); + }; + Input.isKeyReleasedBoth = function (keyA, keyB) { + return this.isKeyReleased(keyA) || this.isKeyReleased(keyB); + }; + Input.initTouchCache = function () { + this._totalTouchCount = 0; + this._touchIndex = 0; + this._gameTouchs.length = 0; + for (var i = 0; i < this.maxSupportedTouch; i++) { + this._gameTouchs.push(new TouchState()); + } + }; + Input.touchBegin = function (evt) { + if (this._touchIndex < this.maxSupportedTouch) { + this._gameTouchs[this._touchIndex].touchPoint = evt.touchPointID; + this._gameTouchs[this._touchIndex].touchDown = evt.touchDown; + this._gameTouchs[this._touchIndex].x = evt.stageX; + this._gameTouchs[this._touchIndex].y = evt.stageY; + if (this._touchIndex == 0) { + this.setpreviousTouchState(this._gameTouchs[0]); + } + this._touchIndex++; + this._totalTouchCount++; + } + }; + Input.touchMove = function (evt) { + if (evt.touchPointID == this._gameTouchs[0].touchPoint) { + this.setpreviousTouchState(this._gameTouchs[0]); + } + var touchIndex = this._gameTouchs.findIndex(function (touch) { return touch.touchPoint == evt.touchPointID; }); + if (touchIndex != -1) { + var touchData = this._gameTouchs[touchIndex]; + touchData.x = evt.stageX; + touchData.y = evt.stageY; + } + }; + Input.touchEnd = function (evt) { + var touchIndex = this._gameTouchs.findIndex(function (touch) { return touch.touchPoint == evt.touchPointID; }); + if (touchIndex != -1) { + var touchData = this._gameTouchs[touchIndex]; + touchData.reset(); + if (touchIndex == 0) + this._previousTouchState.reset(); + this._totalTouchCount--; + if (this.totalTouchCount == 0) { + this._touchIndex = 0; + } + } + }; + Input.setpreviousTouchState = function (touchState) { + this._previousTouchState = new TouchState(); + this._previousTouchState.x = touchState.position.x; + this._previousTouchState.y = touchState.position.y; + this._previousTouchState.touchPoint = touchState.touchPoint; + this._previousTouchState.touchDown = touchState.touchDown; + }; + Input._init = false; + Input._previousTouchState = new TouchState(); + Input._resolutionOffset = new es.Vector2(); + Input._touchIndex = 0; + Input._gameTouchs = []; + Input._resolutionScale = es.Vector2.one; + Input._totalTouchCount = 0; + Input._virtualInputs = []; + return Input; + }()); + es.Input = Input; +})(es || (es = {})); +var Keys = es.Keys; +var KeyboardUtils = (function () { + function KeyboardUtils() { + } + KeyboardUtils.init = function () { + document.addEventListener("keydown", KeyboardUtils.onKeyDownHandler); + document.addEventListener("keyup", KeyboardUtils.onKeyUpHandler); + }; + KeyboardUtils.update = function () { + KeyboardUtils.previousKeys.length = 0; + for (var _i = 0, _a = KeyboardUtils.currentKeys; _i < _a.length; _i++) { + var key = _a[_i]; + KeyboardUtils.previousKeys.push(key); + KeyboardUtils.currentKeys.remove(key); + } + KeyboardUtils.currentKeys.length = 0; + for (var _b = 0, _c = KeyboardUtils.keyStatusKeys; _b < _c.length; _b++) { + var key = _c[_b]; + KeyboardUtils.currentKeys.push(key); + } + }; + KeyboardUtils.destroy = function () { + KeyboardUtils.currentKeys.length = 0; + document.removeEventListener("keyup", KeyboardUtils.onKeyUpHandler); + document.removeEventListener("keypress", KeyboardUtils.onKeyDownHandler); + }; + KeyboardUtils.onKeyDownHandler = function (event) { + if (!KeyboardUtils.keyStatusKeys.contains(event.keyCode)) + KeyboardUtils.keyStatusKeys.push(event.keyCode); + }; + KeyboardUtils.onKeyUpHandler = function (event) { + if (KeyboardUtils.keyStatusKeys.contains(event.keyCode)) + KeyboardUtils.keyStatusKeys.remove(event.keyCode); + }; + KeyboardUtils.currentKeys = []; + KeyboardUtils.previousKeys = []; + KeyboardUtils.keyStatusKeys = []; + return KeyboardUtils; +}()); +var es; +(function (es) { + var Keys; + (function (Keys) { + Keys[Keys["none"] = 0] = "none"; + Keys[Keys["back"] = 8] = "back"; + Keys[Keys["tab"] = 9] = "tab"; + Keys[Keys["enter"] = 13] = "enter"; + Keys[Keys["capsLock"] = 20] = "capsLock"; + Keys[Keys["escape"] = 27] = "escape"; + Keys[Keys["space"] = 32] = "space"; + Keys[Keys["pageUp"] = 33] = "pageUp"; + Keys[Keys["pageDown"] = 34] = "pageDown"; + Keys[Keys["end"] = 35] = "end"; + Keys[Keys["home"] = 36] = "home"; + Keys[Keys["left"] = 37] = "left"; + Keys[Keys["up"] = 38] = "up"; + Keys[Keys["right"] = 39] = "right"; + Keys[Keys["down"] = 40] = "down"; + Keys[Keys["select"] = 41] = "select"; + Keys[Keys["print"] = 42] = "print"; + Keys[Keys["execute"] = 43] = "execute"; + Keys[Keys["printScreen"] = 44] = "printScreen"; + Keys[Keys["insert"] = 45] = "insert"; + Keys[Keys["delete"] = 46] = "delete"; + Keys[Keys["help"] = 47] = "help"; + Keys[Keys["d0"] = 48] = "d0"; + Keys[Keys["d1"] = 49] = "d1"; + Keys[Keys["d2"] = 50] = "d2"; + Keys[Keys["d3"] = 51] = "d3"; + Keys[Keys["d4"] = 52] = "d4"; + Keys[Keys["d5"] = 53] = "d5"; + Keys[Keys["d6"] = 54] = "d6"; + Keys[Keys["d7"] = 55] = "d7"; + Keys[Keys["d8"] = 56] = "d8"; + Keys[Keys["d9"] = 57] = "d9"; + Keys[Keys["a"] = 65] = "a"; + Keys[Keys["b"] = 66] = "b"; + Keys[Keys["c"] = 67] = "c"; + Keys[Keys["d"] = 68] = "d"; + Keys[Keys["e"] = 69] = "e"; + Keys[Keys["f"] = 70] = "f"; + Keys[Keys["g"] = 71] = "g"; + Keys[Keys["h"] = 72] = "h"; + Keys[Keys["i"] = 73] = "i"; + Keys[Keys["j"] = 74] = "j"; + Keys[Keys["k"] = 75] = "k"; + Keys[Keys["l"] = 76] = "l"; + Keys[Keys["m"] = 77] = "m"; + Keys[Keys["n"] = 78] = "n"; + Keys[Keys["o"] = 79] = "o"; + Keys[Keys["p"] = 80] = "p"; + Keys[Keys["q"] = 81] = "q"; + Keys[Keys["r"] = 82] = "r"; + Keys[Keys["s"] = 83] = "s"; + Keys[Keys["t"] = 84] = "t"; + Keys[Keys["u"] = 85] = "u"; + Keys[Keys["v"] = 86] = "v"; + Keys[Keys["w"] = 87] = "w"; + Keys[Keys["x"] = 88] = "x"; + Keys[Keys["y"] = 89] = "y"; + Keys[Keys["z"] = 90] = "z"; + Keys[Keys["leftWindows"] = 91] = "leftWindows"; + Keys[Keys["rightWindows"] = 92] = "rightWindows"; + Keys[Keys["apps"] = 93] = "apps"; + Keys[Keys["sleep"] = 95] = "sleep"; + Keys[Keys["numPad0"] = 96] = "numPad0"; + Keys[Keys["numPad1"] = 97] = "numPad1"; + Keys[Keys["numPad2"] = 98] = "numPad2"; + Keys[Keys["numPad3"] = 99] = "numPad3"; + Keys[Keys["numPad4"] = 100] = "numPad4"; + Keys[Keys["numPad5"] = 101] = "numPad5"; + Keys[Keys["numPad6"] = 102] = "numPad6"; + Keys[Keys["numPad7"] = 103] = "numPad7"; + Keys[Keys["numPad8"] = 104] = "numPad8"; + Keys[Keys["numPad9"] = 105] = "numPad9"; + Keys[Keys["multiply"] = 106] = "multiply"; + Keys[Keys["add"] = 107] = "add"; + Keys[Keys["seperator"] = 108] = "seperator"; + Keys[Keys["subtract"] = 109] = "subtract"; + Keys[Keys["decimal"] = 110] = "decimal"; + Keys[Keys["divide"] = 111] = "divide"; + Keys[Keys["f1"] = 112] = "f1"; + Keys[Keys["f2"] = 113] = "f2"; + Keys[Keys["f3"] = 114] = "f3"; + Keys[Keys["f4"] = 115] = "f4"; + Keys[Keys["f5"] = 116] = "f5"; + Keys[Keys["f6"] = 117] = "f6"; + Keys[Keys["f7"] = 118] = "f7"; + Keys[Keys["f8"] = 119] = "f8"; + Keys[Keys["f9"] = 120] = "f9"; + Keys[Keys["f10"] = 121] = "f10"; + Keys[Keys["f11"] = 122] = "f11"; + Keys[Keys["f12"] = 123] = "f12"; + Keys[Keys["f13"] = 124] = "f13"; + Keys[Keys["f14"] = 125] = "f14"; + Keys[Keys["f15"] = 126] = "f15"; + Keys[Keys["f16"] = 127] = "f16"; + Keys[Keys["f17"] = 128] = "f17"; + Keys[Keys["f18"] = 129] = "f18"; + Keys[Keys["f19"] = 130] = "f19"; + Keys[Keys["f20"] = 131] = "f20"; + Keys[Keys["f21"] = 132] = "f21"; + Keys[Keys["f22"] = 133] = "f22"; + Keys[Keys["f23"] = 134] = "f23"; + Keys[Keys["f24"] = 135] = "f24"; + Keys[Keys["numLock"] = 144] = "numLock"; + Keys[Keys["scroll"] = 145] = "scroll"; + Keys[Keys["leftShift"] = 160] = "leftShift"; + Keys[Keys["rightShift"] = 161] = "rightShift"; + Keys[Keys["leftControl"] = 162] = "leftControl"; + Keys[Keys["rightControl"] = 163] = "rightControl"; + Keys[Keys["leftAlt"] = 164] = "leftAlt"; + Keys[Keys["rightAlt"] = 165] = "rightAlt"; + Keys[Keys["browserBack"] = 166] = "browserBack"; + Keys[Keys["browserForward"] = 167] = "browserForward"; + })(Keys = es.Keys || (es.Keys = {})); +})(es || (es = {})); +var es; +(function (es) { + var OverlapBehavior; + (function (OverlapBehavior) { + OverlapBehavior[OverlapBehavior["cancelOut"] = 0] = "cancelOut"; + OverlapBehavior[OverlapBehavior["takeOlder"] = 1] = "takeOlder"; + OverlapBehavior[OverlapBehavior["takeNewer"] = 2] = "takeNewer"; + })(OverlapBehavior = es.OverlapBehavior || (es.OverlapBehavior = {})); + var VirtualInput = (function () { + function VirtualInput() { + es.Input._virtualInputs.push(this); + } + VirtualInput.prototype.deregister = function () { + es.Input._virtualInputs.remove(this); + }; + return VirtualInput; + }()); + es.VirtualInput = VirtualInput; + var VirtualInputNode = (function () { + function VirtualInputNode() { + } + VirtualInputNode.prototype.update = function () { }; + return VirtualInputNode; + }()); + es.VirtualInputNode = VirtualInputNode; +})(es || (es = {})); +var es; +(function (es) { + var VirtualIntegerAxis = (function (_super) { + __extends(VirtualIntegerAxis, _super); + function VirtualIntegerAxis() { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + var _this = _super.call(this) || this; + _this.nodes = []; + _this.nodes.concat(nodes); + return _this; + } + Object.defineProperty(VirtualIntegerAxis.prototype, "value", { + get: function () { + for (var i = 0; i < this.nodes.length; i++) { + var val = this.nodes[i].value; + if (val != 0) + return Math.sign(val); + } + return 0; + }, + enumerable: true, + configurable: true + }); + VirtualIntegerAxis.prototype.update = function () { + for (var i = 0; i < this.nodes.length; i++) + this.nodes[i].update(); + }; + VirtualIntegerAxis.prototype.addKeyboardKeys = function (overlapBehavior, negative, positive) { + this.nodes.push(new es.KeyboardKeys(overlapBehavior, negative, positive)); + return this; + }; + return VirtualIntegerAxis; + }(es.VirtualInput)); + es.VirtualIntegerAxis = VirtualIntegerAxis; + var VirtualAxisNode = (function (_super) { + __extends(VirtualAxisNode, _super); + function VirtualAxisNode() { + return _super !== null && _super.apply(this, arguments) || this; + } + return VirtualAxisNode; + }(es.VirtualInputNode)); + es.VirtualAxisNode = VirtualAxisNode; +})(es || (es = {})); +var es; +(function (es) { + var VirtualAxis = (function (_super) { + __extends(VirtualAxis, _super); + function VirtualAxis() { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + var _this = _super.call(this) || this; + _this.nodes = []; + _this.nodes.concat(nodes); + return _this; + } + Object.defineProperty(VirtualAxis.prototype, "value", { + get: function () { + for (var i = 0; i < this.nodes.length; i++) { + var val = this.nodes[i].value; + if (val != 0) + return val; + } + return 0; + }, + enumerable: true, + configurable: true + }); + VirtualAxis.prototype.update = function () { + for (var i = 0; i < this.nodes.length; i++) + this.nodes[i].update(); + }; + return VirtualAxis; + }(es.VirtualInput)); + es.VirtualAxis = VirtualAxis; + var KeyboardKeys = (function (_super) { + __extends(KeyboardKeys, _super); + function KeyboardKeys(overlapBehavior, negative, positive) { + var _this = _super.call(this) || this; + _this._value = 0; + _this.overlapBehavior = overlapBehavior; + _this.negative = negative; + _this.positive = positive; + return _this; + } + KeyboardKeys.prototype.update = function () { + if (es.Input.isKeyDown(this.positive)) { + if (es.Input.isKeyDown(this.negative)) { + switch (this.overlapBehavior) { + default: + case es.OverlapBehavior.cancelOut: + this._value = 0; + break; + case es.OverlapBehavior.takeNewer: + if (!this._turned) { + this._value *= -1; + this._turned = true; + } + break; + case es.OverlapBehavior.takeOlder: + break; + } + } + else { + this._turned = false; + this._value = 1; + } + } + else if (es.Input.isKeyDown(this.negative)) { + this._turned = false; + this._value = -1; + } + else { + this._turned = false; + this._value = 0; + } + }; + Object.defineProperty(KeyboardKeys.prototype, "value", { + get: function () { + return this._value; + }, + enumerable: true, + configurable: true + }); + return KeyboardKeys; + }(es.VirtualAxisNode)); + es.KeyboardKeys = KeyboardKeys; +})(es || (es = {})); +var es; +(function (es) { + var VirtualButton = (function (_super) { + __extends(VirtualButton, _super); + function VirtualButton(bufferTime) { + if (bufferTime === void 0) { bufferTime = 0; } + var nodes = []; + for (var _i = 1; _i < arguments.length; _i++) { + nodes[_i - 1] = arguments[_i]; + } + var _this = _super.call(this) || this; + _this.nodes = []; + _this.bufferTime = 0; + _this.firstRepeatTime = 0; + _this.mutiRepeatTime = 0; + _this._bufferCounter = 0; + _this._repeatCounter = 0; + _this.nodes = nodes; + _this.bufferTime = bufferTime; + return _this; + } + VirtualButton.prototype.setRepeat = function (firstRepeatTime, mutiRepeatTime) { + if (mutiRepeatTime === void 0) { mutiRepeatTime = firstRepeatTime; } + this.firstRepeatTime = firstRepeatTime; + this.mutiRepeatTime = mutiRepeatTime; + this._willRepeat = this.firstRepeatTime > 0; + if (!this._willRepeat) + this.isRepeating = false; + }; + VirtualButton.prototype.update = function () { + this._bufferCounter -= es.Time.unscaledDeltaTime; + this.isRepeating = false; + var check = false; + for (var i = 0; i < this.nodes.length; i++) { + this.nodes[i].update(); + if (this.nodes[i].isPressed) { + this._bufferCounter = this.bufferTime; + check = true; + } + else if (this.nodes[i].isDown) { + check = true; + } + } + if (!check) { + this._repeatCounter = 0; + this._bufferCounter = 0; + } + else if (this._willRepeat) { + if (this._repeatCounter == 0) { + this._repeatCounter = this.firstRepeatTime; + } + else { + this._repeatCounter -= es.Time.unscaledDeltaTime; + if (this._repeatCounter <= 0) { + this.isRepeating = true; + this._repeatCounter = this.mutiRepeatTime; + } + } + } + }; + Object.defineProperty(VirtualButton.prototype, "isDown", { + get: function () { + for (var _i = 0, _a = this.nodes; _i < _a.length; _i++) { + var node = _a[_i]; + if (node.isDown) + return true; + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VirtualButton.prototype, "isPressed", { + get: function () { + if (this._bufferCounter > 0 || this.isRepeating) + return true; + for (var _i = 0, _a = this.nodes; _i < _a.length; _i++) { + var node = _a[_i]; + if (node.isPressed) + return true; + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VirtualButton.prototype, "isReleased", { + get: function () { + for (var _i = 0, _a = this.nodes; _i < _a.length; _i++) { + var node = _a[_i]; + if (node.isReleased) + return true; + } + return false; + }, + enumerable: true, + configurable: true + }); + VirtualButton.prototype.consumeBuffer = function () { + this._bufferCounter = 0; + }; + VirtualButton.prototype.addKeyboardKey = function (key) { + this.nodes.push(new KeyboardKey(key)); + return this; + }; + return VirtualButton; + }(es.VirtualInput)); + es.VirtualButton = VirtualButton; + var Node = (function (_super) { + __extends(Node, _super); + function Node() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Node; + }(es.VirtualInputNode)); + es.Node = Node; + var KeyboardKey = (function (_super) { + __extends(KeyboardKey, _super); + function KeyboardKey(key) { + var _this = _super.call(this) || this; + _this.key = key; + return _this; + } + Object.defineProperty(KeyboardKey.prototype, "isDown", { + get: function () { + return es.Input.isKeyDown(this.key); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(KeyboardKey.prototype, "isPressed", { + get: function () { + return es.Input.isKeyPressed(this.key); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(KeyboardKey.prototype, "isReleased", { + get: function () { + return es.Input.isKeyReleased(this.key); + }, + enumerable: true, + configurable: true + }); + return KeyboardKey; + }(Node)); + es.KeyboardKey = KeyboardKey; +})(es || (es = {})); +var es; (function (es) { var Bitmap = egret.Bitmap; var AssetPacker = (function () { diff --git a/demo/libs/framework/framework.min.js b/demo/libs/framework/framework.min.js index 4c0da89f..5b173882 100644 --- a/demo/libs/framework/framework.min.js +++ b/demo/libs/framework/framework.min.js @@ -1 +1 @@ -window.es={},window.__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var transform,__awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(s,a)}h((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]-1}(this,t)},Array.prototype.firstOrDefault=function(t){return function(t,e){var i=t.findIndex(e);return-1==i?null:t[i]}(this,t)},Array.prototype.find=function(t){return function(t,e){return t.firstOrDefault(e)}(this,t)},Array.prototype.where=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return e.call(arguments[2],n,r,t)&&i.push(n),i},[]);for(var i=[],n=0,r=t.length;n=0&&t.splice(i,1)}while(i>=0)}(this,t)},Array.prototype.remove=function(t){return function(t,e){var i=t.findIndex(function(t){return t===e});return i>=0&&(t.splice(i,1),!0)}(this,t)},Array.prototype.removeAt=function(t){return function(t,e){t.splice(e,1)}(this,t)},Array.prototype.removeRange=function(t,e){return function(t,e,i){t.splice(e,i)}(this,t,e)},Array.prototype.select=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return i.push(e.call(arguments[2],n,r,t)),i},[]);for(var i=[],n=0,r=t.length;no?1:-1}),t}(this,t,e)},Array.prototype.orderByDescending=function(t,e){return function(t,e,i){return t.sort(function(t,n){var r=e(t),o=e(n);return i?-i(r,o):r0;){if("break"===l())break}return s?this.recontructPath(a,n,r):null},e.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},e}();t.AStarPathfinder=e;var i=function(t){function e(e){var i=t.call(this)||this;return i.data=e,i}return __extends(e,t),e}(t.PriorityQueueNode);t.AStarNode=i}(es||(es={})),function(t){var e=function(){function e(e,i){this.dirs=[new t.Vector2(1,0),new t.Vector2(0,-1),new t.Vector2(-1,0),new t.Vector2(0,1)],this.walls=[],this.weightedNodes=[],this.defaultWeight=1,this.weightedNodeWeight=5,this._neighbors=new Array(4),this._width=e,this._height=i}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x=this._nodes.length?(console.error("node.QueueIndex has been corrupted. Did you change it manually? Or add this node to another queue?"),!1):this._nodes[t.queueIndex]==t:(console.error("node cannot be null"),!1)},t.prototype.enqueue=function(t,e){t.priority=e,this._numNodes++,this._nodes[this._numNodes]=t,t.queueIndex=this._numNodes,t.insertionIndex=this._numNodesEverEnqueued++,this.cascadeUp(this._nodes[this._numNodes])},t.prototype.dequeue=function(){var t=this._nodes[1];return this.remove(t),t},t.prototype.remove=function(t){if(t.queueIndex==this._numNodes)return this._nodes[this._numNodes]=null,void this._numNodes--;var e=this._nodes[this._numNodes];this.swap(t,e),delete this._nodes[this._numNodes],this._numNodes--,this.onNodeUpdated(e)},t.prototype.isValidQueue=function(){for(var t=1;t0&&this.hasHigherPriority(t,i)?this.cascadeUp(t):this.cascadeDown(t)},t.prototype.cascadeDown=function(t){for(var e,i=t.queueIndex;;){e=t;var n=2*i;if(n>this._numNodes){t.queueIndex=i,this._nodes[i]=t;break}var r=this._nodes[n];this.hasHigherPriority(r,e)&&(e=r);var o=n+1;if(o<=this._numNodes){var s=this._nodes[o];this.hasHigherPriority(s,e)&&(e=s)}if(e==t){t.queueIndex=i,this._nodes[i]=t;break}this._nodes[i]=e;var a=e.queueIndex;e.queueIndex=i,i=a}},t.prototype.cascadeUp=function(t){for(var e=Math.floor(t.queueIndex/2);e>=1;){var i=this._nodes[e];if(this.hasHigherPriority(i,t))break;this.swap(t,i),e=Math.floor(t.queueIndex/2)}},t.prototype.swap=function(t,e){this._nodes[t.queueIndex]=e,this._nodes[e.queueIndex]=t;var i=t.queueIndex;t.queueIndex=e.queueIndex,e.queueIndex=i},t.prototype.hasHigherPriority=function(t,e){return t.priority0;){if("break"===h())break}return o?t.AStarPathfinder.recontructPath(a,i,n):null},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e}();t.BreadthFirstPathfinder=e}(es||(es={})),function(t){var e=function(){function t(){this.edges=new Map}return t.prototype.addEdgesForNode=function(t,e){return this.edges.set(t,e),this},t.prototype.getNeighbors=function(t){return this.edges.get(t)},t}();t.UnweightedGraph=e}(es||(es={})),function(t){var e=function(){function e(t,e){this.x=0,this.y=0,this.x=t||0,this.y=null!=e?e:this.x}return Object.defineProperty(e,"zero",{get:function(){return new e(0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return new e(1,1)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitX",{get:function(){return new e(1,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitY",{get:function(){return new e(0,1)},enumerable:!0,configurable:!0}),e.add=function(t,i){var n=new e(0,0);return n.x=t.x+i.x,n.y=t.y+i.y,n},e.divide=function(t,i){var n=new e(0,0);return n.x=t.x/i.x,n.y=t.y/i.y,n},e.multiply=function(t,i){var n=new e(0,0);return n.x=t.x*i.x,n.y=t.y*i.y,n},e.subtract=function(t,i){var n=new e(0,0);return n.x=t.x-i.x,n.y=t.y-i.y,n},e.normalize=function(t){var i=new e(t.x,t.y),n=1/Math.sqrt(i.x*i.x+i.y*i.y);return i.x*=n,i.y*=n,i},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.distanceSquared=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},e.clamp=function(i,n,r){return new e(t.MathHelper.clamp(i.x,n.x,r.x),t.MathHelper.clamp(i.y,n.y,r.y))},e.lerp=function(i,n,r){return new e(t.MathHelper.lerp(i.x,n.x,r),t.MathHelper.lerp(i.y,n.y,r))},e.transform=function(t,i){return new e(t.x*i.m11+t.y*i.m21+i.m31,t.x*i.m12+t.y*i.m22+i.m32)},e.distance=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},e.angle=function(i,n){return i=e.normalize(i),n=e.normalize(n),Math.acos(t.MathHelper.clamp(e.dot(i,n),-1,1))*t.MathHelper.Rad2Deg},e.negate=function(t){var i=new e;return i.x=-t.x,i.y=-t.y,i},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.normalize=function(){var t=1/Math.sqrt(this.x*this.x+this.y*this.y);this.x*=t,this.y*=t},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.round=function(){return new e(Math.round(this.x),Math.round(this.y))},e.prototype.equals=function(t){return t.x==this.x&&t.y==this.y},e}();t.Vector2=e}(es||(es={})),function(t){var e=function(){function e(t,i,n){void 0===n&&(n=!1),this.walls=[],this._neighbors=new Array(4),this._width=t,this._hegiht=i,this._dirs=n?e.COMPASS_DIRS:e.CARDINAL_DIRS}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x0;){if("break"===l())break}return s?this.recontructPath(a,n,r):null},i.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},i.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},i.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},i}();t.WeightedPathfinder=i}(es||(es={})),function(t){var e=function(e){function i(){var n=e.call(this)||this;return n._globalManagers=[],n._timerManager=new t.TimerManager,i._instance=n,i.emitter=new t.Emitter,i.content=new t.ContentManager,n.addEventListener(egret.Event.ADDED_TO_STAGE,n.onAddToStage,n),i.registerGlobalManager(n._timerManager),n}return __extends(i,e),Object.defineProperty(i,"Instance",{get:function(){return this._instance},enumerable:!0,configurable:!0}),Object.defineProperty(i,"scene",{get:function(){return this._instance?this._instance._scene:null},set:function(t){t?null==this._instance._scene?(this._instance.addChild(t),this._instance._scene=t,this._instance._scene.begin(),i.Instance.onSceneChanged()):this._instance._nextScene=t:console.error("场景不能为空")},enumerable:!0,configurable:!0}),i.startSceneTransition=function(t){if(!this._instance._sceneTransition)return this._instance._sceneTransition=t,t;console.warn("在前一个场景完成之前,不能开始一个新的场景转换。")},i.registerGlobalManager=function(t){this._instance._globalManagers.push(t),t.enabled=!0},i.unregisterGlobalManager=function(t){this._instance._globalManagers.remove(t),t.enabled=!1},i.getGlobalManager=function(t){for(var e=0;e=0;e--)this._globalManagers[e].enabled&&this._globalManagers[e].update();return this._sceneTransition&&(!this._sceneTransition||this._sceneTransition.loadsNewScene&&!this._sceneTransition.isNewSceneLoaded)||this._scene.update(),this._nextScene?(this._scene.parent&&this._scene.parent.removeChild(this._scene),this._scene.end(),this._scene=this._nextScene,this._nextScene=null,this.onSceneChanged(),[4,this._scene.begin()]):[3,2];case 1:i.sent(),this.addChild(this._scene),i.label=2;case 2:return this.endDebugUpdate(),[4,this.draw()];case 3:return i.sent(),[2]}})})},i.prototype.onAddToStage=function(){i.graphicsDevice=new t.GraphicsDevice,this.addEventListener(egret.Event.RESIZE,this.onGraphicsDeviceReset,this),this.addEventListener(egret.StageOrientationEvent.ORIENTATION_CHANGE,this.onOrientationChanged,this),this.addEventListener(egret.Event.ENTER_FRAME,this.update,this),t.Input.initialize(),KeyboardUtils.init(),this.initialize()},i.debugRenderEndabled=!1,i}(egret.DisplayObjectContainer);t.Core=e}(es||(es={})),function(t){var e=function(){function t(){}return t.renderableBounds=16776960,t.renderableCenter=10040012,t.colliderBounds=5592405,t.colliderEdge=9109504,t.colliderPosition=16776960,t.colliderCenter=16711680,t}();t.Colors=e;var i=function(){function e(){}return Object.defineProperty(e,"lineSizeMultiplier",{get:function(){return Math.max(Math.ceil(t.Core.scene.x/t.Core.scene.width),1)},enumerable:!0,configurable:!0}),e}();t.Size=i;var n=function(){function e(){}return e.drawHollowRect=function(e,i,n){void 0===n&&(n=0),this._debugDrawItems.push(new t.DebugDrawItem(e,i,n))},e.render=function(){if(this._debugDrawItems.length>0){var e=new egret.Shape;t.Core.scene&&t.Core.scene.addChild(e);for(var i=this._debugDrawItems.length-1;i>=0;i--){this._debugDrawItems[i].draw(e)&&this._debugDrawItems.removeAt(i)}}},e._debugDrawItems=[],e}();t.Debug=n}(es||(es={})),function(t){var e=function(){function t(){}return t.verletParticle=14431326,t.verletConstraintEdge=4406838,t}();t.DebugDefaults=e}(es||(es={})),function(t){var e;!function(t){t[t.line=0]="line",t[t.hollowRectangle=1]="hollowRectangle",t[t.pixel=2]="pixel",t[t.text=3]="text"}(e=t.DebugDrawType||(t.DebugDrawType={}));var i=function(){function i(t,i,n){this.rectangle=t,this.color=i,this.duration=n,this.drawType=e.hollowRectangle}return i.prototype.draw=function(i){switch(this.drawType){case e.line:case e.hollowRectangle:case e.pixel:case e.text:}return this.duration-=t.Time.deltaTime,this.duration<0},i}();t.DebugDrawItem=i}(es||(es={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.updateInterval=1,e.debugDisplayObject=new egret.DisplayObjectContainer,e._enabled=!0,e._updateOrder=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"transform",{get:function(){return this.entity.transform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this.entity?this.entity.enabled&&this._enabled:this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){},e.prototype.onAddedToEntity=function(){},e.prototype.onRemovedFromEntity=function(){},e.prototype.onEntityTransformChanged=function(t){},e.prototype.debugRender=function(){},e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled()),this},e.prototype.setUpdateOrder=function(t){return this._updateOrder!=t&&(this._updateOrder=t),this},e.prototype.clone=function(){var t=ObjectUtils.clone(this);return t.entity=null,t},e}(egret.HashObject);t.Component=e}(es||(es={})),function(t){!function(t){t[t.GraphicsDeviceReset=0]="GraphicsDeviceReset",t[t.SceneChanged=1]="SceneChanged",t[t.OrientationChanged=2]="OrientationChanged"}(t.CoreEvents||(t.CoreEvents={}))}(es||(es={})),function(t){var e=function(){function e(i){this.updateInterval=1,this._tag=0,this._enabled=!0,this._updateOrder=0,this.components=new t.ComponentList(this),this.transform=new t.Transform(this),this.name=i,this.id=e._idGenerator++,this.componentBits=new t.BitSet}return Object.defineProperty(e.prototype,"isDestroyed",{get:function(){return this._isDestroyed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tag",{get:function(){return this._tag},set:function(t){this.setTag(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.transform.parent},set:function(t){this.transform.setParent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childCount",{get:function(){return this.transform.childCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.setPosition(t.x,t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localPosition",{get:function(){return this.transform.localPosition},set:function(t){this.transform.setLocalPosition(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.setRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationDegrees",{get:function(){return this.transform.rotationDegrees},set:function(t){this.transform.setRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotation",{get:function(){return this.transform.localRotation},set:function(t){this.transform.setLocalRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotationDegrees",{get:function(){return this.transform.localRotationDegrees},set:function(t){this.transform.setLocalRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.setScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localScale",{get:function(){return this.transform.localScale},set:function(t){this.transform.setLocalScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldInverseTransform",{get:function(){return this.transform.worldInverseTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localToWorldTransform",{get:function(){return this.transform.localToWorldTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldToLocalTransform",{get:function(){return this.transform.worldToLocalTransform},enumerable:!0,configurable:!0}),e.prototype.onTransformChanged=function(t){this.components.onEntityTransformChanged(t)},e.prototype.setTag=function(t){return this._tag!=t&&(this.scene&&this.scene.entities.removeFromTagList(this),this._tag=t,this.scene&&this.scene.entities.addToTagList(this)),this},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.components.onEntityEnabled():this.components.onEntityDisabled()),this},e.prototype.setUpdateOrder=function(t){if(this._updateOrder!=t)return this._updateOrder=t,this.scene&&(this.scene.entities.markEntityListUnsorted(),this.scene.entities.markTagUnsorted(this.tag)),this},e.prototype.destroy=function(){this._isDestroyed=!0,this.scene.entities.remove(this),this.transform.parent=null;for(var t=this.transform.childCount-1;t>=0;t--){this.transform.getChild(t).entity.destroy()}},e.prototype.detachFromScene=function(){this.scene.entities.remove(this),this.components.deregisterAllComponents();for(var t=0;t=0;t--)this._sceneComponents[t].enabled&&this._sceneComponents[t].update();this.entityProcessors&&this.entityProcessors.update(),this.entities.update(),this.entityProcessors&&this.entityProcessors.lateUpdate(),this.renderableComponents.updateList()},i.prototype.render=function(){if(0!=this._renderers.length)for(var t=0;te.x?-1:1,n=t.Vector2.normalize(t.Vector2.subtract(this.position,e));this.rotation=i*Math.acos(t.Vector2.dot(n,t.Vector2.unitY))},n.prototype.setLocalRotation=function(t){return this._localRotation=t,this._localDirty=this._positionDirty=this._localPositionDirty=this._localRotationDirty=this._localScaleDirty=!0,this.setDirty(e.rotationDirty),this},n.prototype.setLocalRotationDegrees=function(e){return this.setLocalRotation(t.MathHelper.toRadians(e))},n.prototype.setScale=function(e){return this._scale=e,this.parent?this.localScale=t.Vector2.divide(e,this.parent._scale):this.localScale=e,this},n.prototype.setLocalScale=function(t){return this._localScale=t,this._localDirty=this._positionDirty=this._localScaleDirty=!0,this.setDirty(e.scaleDirty),this},n.prototype.roundPosition=function(){this.position=this._position.round()},n.prototype.updateTransform=function(){this.hierarchyDirty!=e.clean&&(this.parent&&this.parent.updateTransform(),this._localDirty&&(this._localPositionDirty&&(this._translationMatrix=t.Matrix2D.create().translate(this._localPosition.x,this._localPosition.y),this._localPositionDirty=!1),this._localRotationDirty&&(this._rotationMatrix=t.Matrix2D.create().rotate(this._localRotation),this._localRotationDirty=!1),this._localScaleDirty&&(this._scaleMatrix=t.Matrix2D.create().scale(this._localScale.x,this._localScale.y),this._localScaleDirty=!1),this._localTransform=this._scaleMatrix.multiply(this._rotationMatrix),this._localTransform=this._localTransform.multiply(this._translationMatrix),this.parent||(this._worldTransform=this._localTransform,this._rotation=this._localRotation,this._scale=this._localScale,this._worldInverseDirty=!0),this._localDirty=!1),this.parent&&(this._worldTransform=this._localTransform.multiply(this.parent._worldTransform),this._rotation=this._localRotation+this.parent._rotation,this._scale=t.Vector2.multiply(this.parent._scale,this._localScale),this._worldInverseDirty=!0),this._worldToLocalDirty=!0,this._positionDirty=!0,this.hierarchyDirty=e.clean)},n.prototype.setDirty=function(e){if(0==(this.hierarchyDirty&e)){switch(this.hierarchyDirty|=e,e){case t.DirtyType.positionDirty:this.entity.onTransformChanged(transform.Component.position);break;case t.DirtyType.rotationDirty:this.entity.onTransformChanged(transform.Component.rotation);break;case t.DirtyType.scaleDirty:this.entity.onTransformChanged(transform.Component.scale)}this._children||(this._children=[]);for(var i=0;it&&(this._zoom=t),this._maximumZoom=t,this;console.error("maximumZoom must be greater than zero")},n.prototype.forceMatrixUpdate=function(){this._areMatrixedDirty=!0},n.prototype.onEntityTransformChanged=function(t){this._areMatrixedDirty=!0},n.prototype.zoomIn=function(t){this.zoom+=t},n.prototype.zoomOut=function(t){this.zoom-=t},n.prototype.worldToScreenPoint=function(e){return this.updateMatrixes(),e=t.Vector2Ext.transformR(e,this._transformMatrix)},n.prototype.screenToWorldPoint=function(e){return this.updateMatrixes(),e=t.Vector2Ext.transformR(e,this._inverseTransformMatrix)},n.prototype.onSceneRenderTargetSizeChanged=function(e,i){this._isProjectionMatrixDirty=!0;var n=this._origin;this.origin=new t.Vector2(e/2,i/2),this.entity.transform.position.add(t.Vector2.subtract(this._origin,n))},n.prototype.mouseToWorldPoint=function(){return this.screenToWorldPoint(t.Input.touchPosition)},n.prototype.updateMatrixes=function(){var e;this._areMatrixedDirty&&(this._transformMatrix=t.Matrix2D.create().translate(-this.entity.transform.position.x,-this.entity.transform.position.y),1!=this._zoom&&(e=t.Matrix2D.create().scale(this._zoom,this._zoom),this._transformMatrix=this._transformMatrix.multiply(e)),0!=this.entity.transform.rotation&&(e=t.Matrix2D.create().rotate(this.entity.transform.rotation),this._transformMatrix=this._transformMatrix.multiply(e)),e=t.Matrix2D.create().translate(this._origin.x,this._origin.y),this._transformMatrix=this._transformMatrix.multiply(e),this._inverseTransformMatrix=this._transformMatrix.invert(),this._areBoundsDirty=!0,this._areMatrixedDirty=!1)},n}(t.Component);t.Camera=i}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i._shakeDirection=t.Vector2.zero,i._shakeOffset=t.Vector2.zero,i._shakeIntensity=0,i._shakeDegredation=.95,i}return __extends(i,e),i.prototype.shake=function(e,i,n){void 0===e&&(e=15),void 0===i&&(i=.9),void 0===n&&(n=t.Vector2.zero),this.enabled=!0,this._shakeIntensity=1)&&(i=.95),this._shakeDegredation=i)},i.prototype.update=function(){Math.abs(this._shakeIntensity)>0&&(this._shakeOffset=this._shakeDirection,0!=this._shakeOffset.x||0!=this._shakeOffset.y?this._shakeOffset.normalize():(this._shakeOffset.x=this._shakeOffset.x+Math.random()-.5,this._shakeOffset.y=this._shakeOffset.y+Math.random()-.5),this._shakeOffset.multiply(new t.Vector2(this._shakeIntensity)),this._shakeIntensity*=-this._shakeDegredation,Math.abs(this._shakeIntensity)<=.01&&(this._shakeIntensity=0,this.enabled=!1)),this.entity.scene.camera.position.add(this._shakeOffset)},i}(t.Component);t.CameraShake=e}(es||(es={})),function(t){var e=function(){function t(t){this._type=t,this._cache=[]}return t.prototype.obtain=function(){try{return this._cache.length>0?this._cache.shift():new this._type}catch(t){throw new Error(this._type+t)}},t.prototype.free=function(t){t.reset(),this._cache.push(t)},t}();t.ComponentPool=e}(es||(es={})),function(t){var e;!function(t){t[t.lockOn=0]="lockOn",t[t.cameraWindow=1]="cameraWindow"}(e=t.CameraStyle||(t.CameraStyle={}));var i=function(i){function n(n,r,o){void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=e.lockOn);var s=i.call(this)||this;return s.followLerp=.1,s.deadzone=new t.Rectangle,s.focusOffset=t.Vector2.zero,s.mapLockEnabled=!1,s.mapSize=new t.Rectangle,s._desiredPositionDelta=new t.Vector2,s._worldSpaceDeadZone=new t.Rectangle,s.rectShape=new egret.Shape,s._targetEntity=n,s._cameraStyle=o,s.camera=r,s}return __extends(n,i),n.prototype.onAddedToEntity=function(){this.camera||(this.camera=this.entity.scene.camera),this.follow(this._targetEntity,this._cameraStyle),t.Core.emitter.addObserver(t.CoreEvents.GraphicsDeviceReset,this.onGraphicsDeviceReset,this)},n.prototype.onGraphicsDeviceReset=function(){t.Core.schedule(0,!1,this,function(t){var e=t.context;e.follow(e._targetEntity,e._cameraStyle)})},n.prototype.update=function(){var e=t.Vector2.multiply(this.camera.bounds.size,new t.Vector2(.5));this._worldSpaceDeadZone.x=this.camera.position.x-e.x*t.Core.scene.scaleX+this.deadzone.x+this.focusOffset.x,this._worldSpaceDeadZone.y=this.camera.position.y-e.y*t.Core.scene.scaleY+this.deadzone.y+this.focusOffset.y,this._worldSpaceDeadZone.width=this.deadzone.width,this._worldSpaceDeadZone.height=this.deadzone.height,this._targetEntity&&this.updateFollow(),this.camera.position=t.Vector2.lerp(this.camera.position,t.Vector2.add(this.camera.position,this._desiredPositionDelta),this.followLerp),this.entity.transform.roundPosition(),this.mapLockEnabled&&(this.camera.position=this.clampToMapSize(this.camera.position),this.entity.transform.roundPosition())},n.prototype.debugRender=function(){this.rectShape||this.debugDisplayObject.addChild(this.rectShape),this.rectShape.graphics.clear(),this._cameraStyle==e.lockOn?(this.rectShape.graphics.beginFill(9109504,0),this.rectShape.graphics.lineStyle(1,9109504),this.rectShape.graphics.drawRect(this._worldSpaceDeadZone.x-5,this._worldSpaceDeadZone.y-5,this._worldSpaceDeadZone.width,this._worldSpaceDeadZone.height),this.rectShape.graphics.endFill()):(this.rectShape.graphics.beginFill(9109504,0),this.rectShape.graphics.lineStyle(1,9109504),this.rectShape.graphics.drawRect(this._worldSpaceDeadZone.x,this._worldSpaceDeadZone.y,this._worldSpaceDeadZone.width,this._worldSpaceDeadZone.height),this.rectShape.graphics.endFill())},n.prototype.clampToMapSize=function(e){var i=t.Vector2.multiply(this.camera.bounds.size,new t.Vector2(.5)).add(new t.Vector2(this.mapSize.x,this.mapSize.y)),n=new t.Vector2(this.mapSize.width-i.x,this.mapSize.height-i.y);return t.Vector2.clamp(e,i,n)},n.prototype.follow=function(i,n){void 0===n&&(n=e.cameraWindow),this._targetEntity=i,this._cameraStyle=n;var r=this.camera.bounds;switch(this._cameraStyle){case e.cameraWindow:var o=r.width/6,s=r.height/3;this.deadzone=new t.Rectangle((r.width-o)/2,(r.height-s)/2,o,s);break;case e.lockOn:this.deadzone=new t.Rectangle(r.width/2,r.height/2,10,10)}},n.prototype.updateFollow=function(){if(this._desiredPositionDelta.x=this._desiredPositionDelta.y=0,this._cameraStyle==e.lockOn){var i=this._targetEntity.transform.position.x,n=this._targetEntity.transform.position.y;this._worldSpaceDeadZone.x>i?this._desiredPositionDelta.x=i-this._worldSpaceDeadZone.x:this._worldSpaceDeadZone.xn&&(this._desiredPositionDelta.y=n-this._worldSpaceDeadZone.y)}else{if(!this._targetCollider&&(this._targetCollider=this._targetEntity.getComponent(t.Collider),!this._targetCollider))return;var r=this._targetEntity.getComponent(t.Collider).bounds;this._worldSpaceDeadZone.containsRect(r)||(this._worldSpaceDeadZone.left>r.left?this._desiredPositionDelta.x=r.left-this._worldSpaceDeadZone.left:this._worldSpaceDeadZone.rightr.top&&(this._desiredPositionDelta.y=r.top-this._worldSpaceDeadZone.top))}},n.prototype.setCenteredDeadzone=function(e,i){if(this.camera){var n=this.camera.bounds;this.deadzone=new t.Rectangle((n.width-e)/2,(n.height-i)/2,e,i)}else console.error("相机是null。我们不能得到它的边界。请等到该组件添加到实体之后")},n}(t.Component);t.FollowCamera=i}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.compare=function(t,e){return t.updateOrder-e.updateOrder},t}();t.IUpdatableComparer=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Component);t.PooledComponent=e}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.displayObject=new egret.DisplayObject,i.hollowShape=new egret.Shape,i.pixelShape=new egret.Shape,i.color=0,i._areBoundsDirty=!0,i.debugRenderEnabled=!0,i._localOffset=t.Vector2.zero,i._renderLayer=0,i._bounds=new t.Rectangle,i}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.bounds.width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.bounds.height},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localOffset",{get:function(){return this._localOffset},set:function(t){this.setLocalOffset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renderLayer",{get:function(){return this._renderLayer},set:function(t){this.setRenderLayer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bounds",{get:function(){return this._areBoundsDirty&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,t.Vector2.zero,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!=t&&(this._isVisible=t,this._isVisible?this.onBecameVisible():this.onBecameInvisible())},enumerable:!0,configurable:!0}),i.prototype.onEntityTransformChanged=function(t){this._areBoundsDirty=!0},i.prototype.debugRender=function(){if(this.debugRenderEnabled){this.hollowShape.parent||this.debugDisplayObject.addChild(this.hollowShape),this.pixelShape.parent||this.debugDisplayObject.addChild(this.pixelShape);var e=t.Vector2.add(this.entity.transform.position,this._localOffset);this.pixelShape.graphics.clear(),this.pixelShape.graphics.beginFill(t.Colors.renderableCenter,0),this.pixelShape.graphics.lineStyle(4,t.Colors.renderableCenter),this.pixelShape.graphics.lineTo(e.x,e.y),this.pixelShape.graphics.moveTo(e.x,e.y),this.pixelShape.graphics.endFill()}},i.prototype.isVisibleFromCamera=function(t){return!!t&&(this.isVisible=t.bounds.intersects(this.bounds),this.isVisible)},i.prototype.setRenderLayer=function(t){if(t!=this._renderLayer){var e=this._renderLayer;this._renderLayer=t,this.entity&&this.entity.scene&&this.entity.scene.renderableComponents.updateRenderableRenderLayer(this,e,this._renderLayer)}return this},i.prototype.setColor=function(t){return this.color=t,this},i.prototype.setLocalOffset=function(t){return this._localOffset!=t&&(this._localOffset=t),this},i.prototype.sync=function(e){var i=new t.Vector2(this.entity.position.x+this.localOffset.x-e.position.x+e.origin.x,this.entity.position.y+this.localOffset.y-e.position.y+e.origin.y);this.displayObject.x!=i.x&&(this.displayObject.x=i.x),this.displayObject.y!=i.y&&(this.displayObject.y=i.y),this.displayObject.scaleX!=this.entity.scale.x&&(this.displayObject.scaleX=this.entity.scale.x),this.displayObject.scaleY!=this.entity.scale.y&&(this.displayObject.scaleY=this.entity.scale.y),this.displayObject.rotation!=this.entity.rotation&&(this.displayObject.rotation=this.entity.rotation)},i.prototype.toString=function(){return"[RenderableComponent] renderLayer: "+this.renderLayer},i.prototype.onBecameVisible=function(){this.displayObject.visible=this.isVisible,this.debugDisplayObject.visible=this.isVisible},i.prototype.onBecameInvisible=function(){this.displayObject.visible=this.isVisible,this.debugDisplayObject.visible=this.isVisible},i}(t.Component);t.RenderableComponent=e}(es||(es={})),function(t){var e=function(){function e(){this.updateOrder=0,this._enabled=!0}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.onRemovedFromScene=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled),this},e.prototype.setUpdateOrder=function(e){return this.updateOrder!=e&&(this.updateOrder=e,t.Core.scene._sceneComponents.sort(this.compareTo)),this},e.prototype.compareTo=function(t){return this.updateOrder-t.updateOrder},e}();t.SceneComponent=e}(es||(es={})),function(t){var e=egret.Bitmap,i=function(i){function n(e){void 0===e&&(e=null);var n=i.call(this)||this;return e instanceof t.Sprite?n.setSprite(e):e instanceof egret.Texture&&n.setSprite(new t.Sprite(e)),n}return __extends(n,i),Object.defineProperty(n.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this._sprite.sourceRect.width,this._sprite.sourceRect.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"originNormalized",{get:function(){return new t.Vector2(this._origin.x/this.width*this.entity.transform.scale.x,this._origin.y/this.height*this.entity.transform.scale.y)},set:function(e){this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"origin",{get:function(){return this._origin},set:function(t){this.setOrigin(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"sprite",{get:function(){return this._sprite},set:function(t){this.setSprite(t)},enumerable:!0,configurable:!0}),n.prototype.setSprite=function(t){return this._sprite=t,this._sprite&&(this._origin=this._sprite.origin,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y),this.displayObject=new e(t.texture2D),this},n.prototype.setOrigin=function(t){return this._origin!=t&&(this._origin=t,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y,this._areBoundsDirty=!0),this},n.prototype.setOriginNormalized=function(e){return this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y)),this},n.prototype.render=function(e){this.sync(e);var i=new t.Vector2(this.entity.position.x+this.localOffset.x-this.origin.x-e.position.x+e.origin.x,this.entity.position.y+this.localOffset.y-this.origin.y-e.position.y+e.origin.y);this.displayObject.x!=i.x&&(this.displayObject.x=i.x),this.displayObject.y!=i.y&&(this.displayObject.y=i.y)},n}(t.RenderableComponent);t.SpriteRenderer=i}(es||(es={})),function(t){var e=egret.Bitmap,i=egret.RenderTexture,n=function(n){function r(e){var i=n.call(this,e)||this;return i._textureScale=t.Vector2.one,i._inverseTexScale=t.Vector2.one,i._gapX=0,i._gapY=0,i._sourceRect=e.sourceRect,i.displayObject.$fillMode=egret.BitmapFillMode.REPEAT,i}return __extends(r,n),Object.defineProperty(r.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollX",{get:function(){return this._sourceRect.x},set:function(t){this._sourceRect.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollY",{get:function(){return this._sourceRect.y},set:function(t){this._sourceRect.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y),this._sourceRect.width=this._sprite.sourceRect.width*this._inverseTexScale.x,this._sourceRect.height=this._sprite.sourceRect.height*this._inverseTexScale.y},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this._sourceRect.width},set:function(t){this._areBoundsDirty=!0,this._sourceRect.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._sourceRect.height},set:function(t){this._areBoundsDirty=!0,this._sourceRect.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"gapXY",{get:function(){return new t.Vector2(this._gapX,this._gapY)},set:function(t){this._gapX=t.x,this._gapY=t.y;var n=new i,r=this.sprite.sourceRect;r.x=0,r.y=0,r.width+=this._gapX,r.height+=this._gapY,n.drawToTexture(this.displayObject,r),this.displayObject?this.displayObject.texture=n:this.displayObject=new e(n)},enumerable:!0,configurable:!0}),r.prototype.setGapXY=function(t){return this.gapXY=t,this},r.prototype.render=function(t){n.prototype.render.call(this,t);var e=this.displayObject;e.width=this.width,e.height=this.height,e.scrollRect=this._sourceRect},r}(t.SpriteRenderer);t.TiledSpriteRenderer=n}(es||(es={})),function(t){var e=function(e){function i(t){var i=e.call(this,t)||this;return i.scrollSpeedX=15,i.scroolSpeedY=0,i._scrollX=0,i._scrollY=0,i._scrollWidth=0,i._scrollHeight=0,i._scrollWidth=i.width,i._scrollHeight=i.height,i}return __extends(i,e),Object.defineProperty(i.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollWidth",{get:function(){return this._scrollWidth},set:function(t){this._scrollWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollHeight",{get:function(){return this._scrollHeight},set:function(t){this._scrollHeight=t},enumerable:!0,configurable:!0}),i.prototype.update=function(){this.sprite&&(this._scrollX+=this.scrollSpeedX*t.Time.deltaTime,this._scrollY+=this.scroolSpeedY*t.Time.deltaTime,this._sourceRect.x=this._scrollX,this._sourceRect.y=this._scrollY,this._sourceRect.width=this._scrollWidth+Math.abs(this._scrollX),this._sourceRect.height=this._scrollHeight+Math.abs(this._scrollY))},i}(t.TiledSpriteRenderer);t.ScrollingSpriteRenderer=e}(es||(es={})),function(t){var e=egret.SpriteSheet,i=function(){function i(e,i,n){void 0===i&&(i=new t.Rectangle(0,0,e.textureWidth,e.textureHeight)),void 0===n&&(n=i.getHalfSize()),this.uvs=new t.Rectangle,this.texture2D=e,this.sourceRect=i,this.center=new t.Vector2(.5*i.width,.5*i.height),this.origin=n;var r=1/e.textureWidth,o=1/e.textureHeight;this.uvs.x=i.x*r,this.uvs.y=i.y*o,this.uvs.width=i.width*r,this.uvs.height=i.height*o}return i.spritesFromAtlas=function(t,n,r,o,s){void 0===o&&(o=0),void 0===s&&(s=Number.MAX_VALUE);for(var a=[],h=t.textureWidth/n,c=t.textureHeight/r,l=0,u=new e(t),p=0;po||this._loopMode==e.pingPongOnce&&s>2*o)return this.animationState=i.completed,this._elapsedTime=0,this.currentFrame=0,void(this.displayObject.texture=n.sprites[this.currentFrame].texture2D);var a=Math.floor(s/r),h=n.sprites.length;if(h>2&&(this._loopMode==e.pingPong||this._loopMode==e.pingPongOnce)){var c=h-1;this.currentFrame=c-Math.abs(c-a%(2*c))}else this.currentFrame=a%h;this.displayObject.texture=n.sprites[this.currentFrame].texture2D}},r.prototype.addAnimation=function(t,e){return!this.sprite&&e.sprites.length>0&&this.setSprite(e.sprites[0]),this._animations[t]=e,this},r.prototype.play=function(t,n){void 0===n&&(n=null),this.currentAnimation=this._animations[t],this.currentAnimationName=t,this.currentFrame=0,this.animationState=i.running,this.displayObject.texture=this.currentAnimation.sprites[0].texture2D,this._elapsedTime=0,this._loopMode=n||e.loop},r.prototype.isAnimationActive=function(t){return this.currentAnimation&&this.currentAnimationName==t},r.prototype.pause=function(){this.animationState=i.paused},r.prototype.unPause=function(){this.animationState=i.running},r.prototype.stop=function(){this.currentAnimation=null,this.currentAnimationName=null,this.currentFrame=0,this.animationState=i.none},r}(t.SpriteRenderer);t.SpriteAnimator=n}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"hasCollision",{get:function(){return this.below||this.right||this.left||this.above},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.becameGroundedThisFrame=this.isGroundedOnOnewayPlatform=this.right=this.left=this.above=this.below=!1,this.slopAngle=0},t.prototype.toString=function(){return"[CollisionState] r: "+this.right+", l: "+this.left+", a: "+this.above+", b: "+this.below+", angle: "+this.slopAngle+", wasGroundedLastFrame: "+this.wasGroundedLastFrame+", becameGroundedThisFrame: "+this.becameGroundedThisFrame},t}();t.CollisionState=e;var i=function(e){function i(){var t=e.call(this)||this;return t.colliderHorizontalInset=2,t.colliderVerticalInset=6,t}return __extends(i,e),i.prototype.testCollisions=function(e,i,n){this._boxColliderBounds=i,n.wasGroundedLastFrame=n.below,n.reset();var r=e.x;e.y;if(0!=r){var o=r>0?t.Edge.right:t.Edge.left,s=this.collisionRectForSide(o,r);this.testMapCollision(s,o,n,0)?(e.x=0-t.RectangleExt.getSide(i,o),n.left=o==t.Edge.left,n.right=o==t.Edge.right,n._movementRemainderX.reset()):(n.left=!1,n.right=!1)}},i.prototype.testMapCollision=function(e,i,n,r){var o=t.EdgeExt.oppositeEdge(i);t.EdgeExt.isVertical(o)?e.center.x:e.center.y,t.RectangleExt.getSide(e,i),t.EdgeExt.isVertical(o)},i.prototype.collisionRectForSide=function(e,i){var n;return n=t.EdgeExt.isHorizontal(e)?t.RectangleExt.getRectEdgePortion(this._boxColliderBounds,e):t.RectangleExt.getHalfRect(this._boxColliderBounds,e),t.EdgeExt.isVertical(e)?t.RectangleExt.contract(n,this.colliderHorizontalInset,0):t.RectangleExt.contract(n,0,this.colliderVerticalInset),t.RectangleExt.expandSide(n,e,i),n},i}(t.Component);t.TiledMapMover=i}(es||(es={})),function(t){var e=function(e){function i(t,i,n){void 0===i&&(i=null),void 0===n&&(n=!0);var r=e.call(this)||this;return r.physicsLayer=1,r.toContainer=!1,r.tiledMap=t,r._shouldCreateColliders=n,r.displayObject=new egret.DisplayObjectContainer,i&&(r.collisionLayer=t.tileLayers[i]),r}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.tiledMap.width*this.tiledMap.tileWidth},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.tiledMap.height*this.tiledMap.tileHeight},enumerable:!0,configurable:!0}),i.prototype.setLayerToRender=function(t){this.layerIndicesToRender=[],this.layerIndicesToRender[0]=this.getLayerIndex(t)},i.prototype.setLayersToRender=function(){for(var t=[],e=0;e=2){this.polygonShape.graphics.beginFill(t.Colors.colliderEdge,0),this.polygonShape.graphics.lineStyle(t.Size.lineSizeMultiplier,t.Colors.colliderEdge);for(var i=0;i>6;0!=(e&t.LONG_MASK)&&i++,this._bits=new Array(i)}return t.prototype.and=function(t){for(var e,i=Math.min(this._bits.length,t._bits.length),n=0;n=0;)this._bits[e]&=~t._bits[e]},t.prototype.cardinality=function(){for(var t=0,e=this._bits.length-1;e>=0;e--){var i=this._bits[e];if(0!=i)if(-1!=i){var n=((i=((i=(i>>1&0x5555555555555400)+(0x5555555555555400&i))>>2&0x3333333333333400)+(0x3333333333333400&i))>>32)+i;t+=((n=((n=(n>>4&252645135)+(252645135&n))>>8&16711935)+(16711935&n))>>16&65535)+(65535&n)}else t+=64}return t},t.prototype.clear=function(t){if(null!=t){var e=t>>6;this.ensure(e),this._bits[e]&=~(1<>6;return!(e>=this._bits.length)&&0!=(this._bits[e]&1<=0;)if(0!=(this._bits[e]&t._bits[e]))return!0;return!1},t.prototype.isEmpty=function(){for(var t=this._bits.length-1;t>=0;t--)if(this._bits[t])return!1;return!0},t.prototype.nextSetBit=function(t){for(var e=t>>6,i=1<>6;this.ensure(i),this._bits[i]|=1<=this._bits.length){var e=new Number[t+1];e=this._bits.copyWithin(0,0,this._bits.length),this._bits=e}},t.LONG_MASK=63,t}();t.BitSet=e}(es||(es={})),function(t){var e=function(){function e(t){this._components=[],this._componentsToAdd=[],this._componentsToRemove=[],this._tempBufferList=[],this._entity=t}return Object.defineProperty(e.prototype,"count",{get:function(){return this._components.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._components},enumerable:!0,configurable:!0}),e.prototype.markEntityListUnsorted=function(){this._isComponentListUnsorted=!0},e.prototype.add=function(t){this._componentsToAdd.push(t)},e.prototype.remove=function(t){this._componentsToRemove.contains(t)&&console.warn("You are trying to remove a Component ("+t+") that you already removed"),this._componentsToAdd.contains(t)?this._componentsToAdd.remove(t):this._componentsToRemove.push(t)},e.prototype.removeAllComponents=function(){for(var t=0;t0){for(var i=0;i0){i=0;for(var n=this._componentsToAdd.length;i0){var e=this._entitiesToRemove;this._entitiesToRemove=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t.removeFromTagList(e),t._entities.remove(e),e.onRemovedFromScene(),e.scene=null,t.scene.entityProcessors.onEntityRemoved(e)}),this._tempEntityList.length=0}if(this._entitiesToAdded.length>0){e=this._entitiesToAdded;this._entitiesToAdded=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t._entities.contains(e)||(t._entities.push(e),e.scene=t.scene,t.addToTagList(e),t.scene.entityProcessors.onEntityAdded(e))}),this._tempEntityList.forEach(function(t){return t.onAddedToScene()}),this._tempEntityList.length=0,this._isEntityListUnsorted=!0}this._isEntityListUnsorted&&(this._entities.sort(),this._isEntityListUnsorted=!1),this._unsortedTags.length>0&&(this._unsortedTags.forEach(function(e){t._entityDict.get(e).sort()}),this._unsortedTags.length=0)},e.prototype.findEntity=function(t){for(var e=0;e=0;e=this.allSet.nextSetBit(e+1))if(!t.componentBits.get(e))return!1;return!(!this.exclusionSet.isEmpty()&&this.exclusionSet.intersects(t.componentBits))&&!(!this.oneSet.isEmpty()&&!this.oneSet.intersects(t.componentBits))},e.prototype.all=function(){for(var e=this,i=[],n=0;n0){for(var t=0,i=this._unsortedRenderLayers.length;t=e)return t;var n=!1;"-"==t.substr(0,1)&&(n=!0,t=t.substr(1));for(var r=e-i,o=0;o1?this.reverse(t.substring(1))+t.substring(0,1):t},t.cutOff=function(t,e,i,n){void 0===n&&(n=!0),e=Math.floor(e),i=Math.floor(i);var r=t.length;e>r&&(e=r);var o,s=e,a=e+i;return n?o=t.substring(0,s)+t.substr(a,r):(a=(s=r-1-e-i)+i,o=t.substring(0,s+1)+t.substr(a+1,r)),o},t.strReplace=function(t,e){for(var i=0,n=e.length;i",">",'"',""","'","'","®","®","©","©","™","™"],t}();!function(t){var e=function(){function e(){}return e.convertImageToCanvas=function(e,i){this.sharedCanvas||(this.sharedCanvas=egret.sys.createCanvas(),this.sharedContext=this.sharedCanvas.getContext("2d"));var n=e.$getTextureWidth(),r=e.$getTextureHeight();i||((i=egret.$TempRectangle).x=0,i.y=0,i.width=n,i.height=r),i.x=Math.min(i.x,n-1),i.y=Math.min(i.y,r-1),i.width=Math.min(i.width,n-i.x),i.height=Math.min(i.height,r-i.y);var o=Math.floor(i.width),s=Math.floor(i.height),a=this.sharedCanvas;if(a.style.width=o+"px",a.style.height=s+"px",this.sharedCanvas.width=o,this.sharedCanvas.height=s,"webgl"==egret.Capabilities.renderMode){var h=void 0;e.$renderBuffer?h=e:(egret.sys.systemRenderer.renderClear&&egret.sys.systemRenderer.renderClear(),(h=new egret.RenderTexture).drawToTexture(new egret.Bitmap(e)));for(var c=h.$renderBuffer.getPixels(i.x,i.y,o,s),l=0,u=0,p=0;p=0?"png":"jpg"});return wx.getFileSystemManager().saveFile({tempFilePath:o,filePath:wx.env.USER_DATA_PATH+"/"+i,success:function(t){}}),o},e.getPixel32=function(t,e,i){return egret.$warn(1041,"getPixel32","getPixels"),t.getPixels(e,i)},e.getPixels=function(t,e,i,n,r){if(void 0===n&&(n=1),void 0===r&&(r=1),"webgl"==egret.Capabilities.renderMode){var o=void 0;return t.$renderBuffer?o=t:(o=new egret.RenderTexture).drawToTexture(new egret.Bitmap(t)),o.$renderBuffer.getPixels(e,i,n,r)}try{this.convertImageToCanvas(t);return this.sharedContext.getImageData(e,i,n,r).data}catch(t){egret.$error(1039)}},e}();t.TextureUtils=e}(es||(es={})),function(t){var e=function(){function t(){}return t.update=function(t){var e=(t-this._lastTime)/1e3;this.deltaTime=e*this.timeScale,this.unscaledDeltaTime=e,this._timeSinceSceneLoad+=e,this.frameCount++,this._lastTime=t},t.sceneChanged=function(){this._timeSinceSceneLoad=0},t.checkEvery=function(t){return this._timeSinceSceneLoad/t>(this._timeSinceSceneLoad-this.deltaTime)/t},t.deltaTime=0,t.timeScale=1,t.frameCount=0,t._lastTime=0,t}();t.Time=e}(es||(es={}));var TimeUtils=function(){function t(){}return t.monthId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getFullYear(),i=t.getMonth()+1;return parseInt(e+(i<10?"0":"")+i)},t.dateId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getMonth()+1,i=e<10?"0":"",n=t.getDate(),r=n<10?"0":"";return parseInt(t.getFullYear()+i+e+r+n)},t.weekId=function(t,e){void 0===t&&(t=null),void 0===e&&(e=!0),t=t||new Date;var i=new Date;i.setTime(t.getTime()),i.setDate(1),i.setMonth(0);var n=i.getFullYear(),r=i.getDay();0==r&&(r=7);var o=!1;r<=4?(o=r>1,i.setDate(i.getDate()-(r-1))):i.setDate(i.getDate()+7-r+1);var s=this.diffDay(t,i,!1);if(s<0)return i.setDate(1),i.setMonth(0),i.setDate(i.getDate()-1),this.weekId(i,!1);var a=s/7,h=Math.floor(a)+1;if(53==h){i.setTime(t.getTime()),i.setDate(i.getDate()-1);var c=i.getDay();if(0==c&&(c=7),e&&(!o||c<4))return i.setFullYear(i.getFullYear()+1),i.setDate(1),i.setMonth(0),this.weekId(i,!1)}return parseInt(n+"00"+(h>9?"":"0")+h)},t.diffDay=function(t,e,i){void 0===i&&(i=!1);var n=(t.getTime()-e.getTime())/864e5;return i?Math.ceil(n):Math.floor(n)},t.getFirstDayOfWeek=function(t){var e=(t=t||new Date).getDay()||7;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1-e,0,0,0,0)},t.getFirstOfDay=function(t){return(t=t||new Date).setHours(0,0,0,0),t},t.getNextFirstOfDay=function(t){return new Date(this.getFirstOfDay(t).getTime()+864e5)},t.formatDate=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();return e+"-"+i+"-"+(n=n<10?"0"+n:n)},t.formatDateTime=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var r=t.getHours(),o=t.getMinutes();o=o<10?"0"+o:o;var s=t.getSeconds();return e+"-"+i+"-"+n+" "+r+":"+o+":"+(s=s<10?"0"+s:s)},t.parseDate=function(t){var e=Date.parse(t);return isNaN(e)?new Date:new Date(Date.parse(t.replace(/-/g,"/")))},t.secondToTime=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=":"),void 0===i&&(i=!0);var n=Math.floor(t/3600),r=Math.floor(t%3600/60),o=Math.floor(t%3600%60),s=n.toString(),a=r.toString(),h=o.toString();return n<10&&(s="0"+s),r<10&&(a="0"+a),o<10&&(h="0"+h),i?s+e+a+e+h:a+e+h},t.timeToMillisecond=function(t,e){void 0===e&&(e=":");for(var i=t.split(e),n=0,r=i.length,o=0;o-1?this.os="iOS":n.indexOf("android")>-1&&(this.os="Android");var r=i.language;r=r.indexOf("zh")>-1?"zh-CN":"en-US",this.language=r}},e}(egret.Capabilities);t.GraphicsCapabilities=e}(es||(es={})),function(t){var e=function(){function e(){this.setup(),this.graphicsCapabilities=new t.GraphicsCapabilities,this.graphicsCapabilities.initialize(this)}return Object.defineProperty(e.prototype,"viewport",{get:function(){return this._viewport},enumerable:!0,configurable:!0}),e.prototype.setup=function(){this._viewport=new t.Viewport(0,0,t.Core._instance.stage.stageWidth,t.Core._instance.stage.stageHeight)},e}();t.GraphicsDevice=e}(es||(es={})),function(t){var e=function(){function e(t,e,i,n){this._x=t,this._y=e,this._width=i,this._height=n,this._minDepth=0,this._maxDepth=1}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return 0!=this._height&&0!=this._width?this._width/this._height:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new t.Rectangle(this._x,this._y,this._width,this._height)},set:function(t){this._x=t.x,this._y=t.y,this._width=t.width,this._height=t.height},enumerable:!0,configurable:!0}),e}();t.Viewport=e}(es||(es={})),function(t){var e=function(e){function i(){return e.call(this,t.PostProcessor.default_vert,i.blur_frag,{screenWidth:t.Core.graphicsDevice.viewport.width,screenHeight:t.Core.graphicsDevice.viewport.height})||this}return __extends(i,e),i.blur_frag="precision mediump float;\nuniform sampler2D uSampler;\nuniform float screenWidth;\nuniform float screenHeight;\nfloat normpdf(in float x, in float sigma)\n{\nreturn 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma;\n}\nvoid main()\n{\nvec3 c = texture2D(uSampler, gl_FragCoord.xy / vec2(screenWidth, screenHeight).xy).rgb;\nconst int mSize = 11;\nconst int kSize = (mSize - 1)/2;\nfloat kernel[mSize];\nvec3 final_colour = vec3(0.0);\nfloat sigma = 7.0;\nfloat z = 0.0;\nfor (int j = 0; j <= kSize; ++j)\n{\nkernel[kSize+j] = kernel[kSize-j] = normpdf(float(j),sigma);\n}\nfor (int j = 0; j < mSize; ++j)\n{\nz += kernel[j];\n}\nfor (int i = -kSize; i <= kSize; ++i)\n{\nfor (int j = -kSize; j <= kSize; ++j)\n{\nfinal_colour += kernel[kSize+j]*kernel[kSize+i]*texture2D(uSampler, (gl_FragCoord.xy+vec2(float(i),float(j))) / vec2(screenWidth, screenHeight).xy).rgb;\n}\n}\ngl_FragColor = vec4(final_colour/(z*z), 1.0);\n}",i}(egret.CustomFilter);t.GaussianBlurEffect=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,e.vertSrc,e.fragmentSrc)||this}return __extends(e,t),e.vertSrc="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",e.fragmentSrc="precision lowp float;\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n#define SAMPLE_COUNT 15\nuniform vec2 _sampleOffsets[SAMPLE_COUNT];\nuniform float _sampleWeights[SAMPLE_COUNT];\nvoid main(void) {\nvec4 c = vec4(0, 0, 0, 0);\nfor( int i = 0; i < SAMPLE_COUNT; i++ )\n c += texture2D( uSampler, vTextureCoord + _sampleOffsets[i] ) * _sampleWeights[i];\ngl_FragColor = c;\n}",e}(egret.CustomFilter);t.PolygonLightEffect=e}(es||(es={})),function(t){var e=function(){function e(t){void 0===t&&(t=null),this.enabled=!0,this.effect=t}return e.prototype.onAddedToScene=function(e){this.scene=e,this.shape=new egret.Shape,this.shape.graphics.beginFill(16777215,1),this.shape.graphics.drawRect(0,0,t.Core.graphicsDevice.viewport.width,t.Core.graphicsDevice.viewport.height),this.shape.graphics.endFill(),e.addChild(this.shape)},e.prototype.process=function(){this.drawFullscreenQuad()},e.prototype.onSceneBackBufferSizeChanged=function(t,e){},e.prototype.unload=function(){this.effect&&(this.effect=null),this.scene.removeChild(this.shape),this.scene=null},e.prototype.drawFullscreenQuad=function(){this.scene.filters=[this.effect]},e.default_vert="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\ngl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\nvTextureCoord = aTextureCoord;\nvColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}",e}();t.PostProcessor=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.prototype.onAddedToScene=function(i){e.prototype.onAddedToScene.call(this,i),this.effect=new t.GaussianBlurEffect},i}(t.PostProcessor);t.GaussianBlurPostProcessor=e}(es||(es={})),function(t){var e=function(){function t(t,e){void 0===e&&(e=null),this.renderOrder=0,this.shouldDebugRender=!0,this.camera=e,this.renderOrder=t}return Object.defineProperty(t.prototype,"wantsToRenderToSceneRenderTarget",{get:function(){return!!this.renderTexture},enumerable:!0,configurable:!0}),t.prototype.onAddedToScene=function(t){},t.prototype.unload=function(){},t.prototype.onSceneBackBufferSizeChanged=function(t,e){},t.prototype.compareTo=function(t){return this.renderOrder-t.renderOrder},t.prototype.beginRender=function(t){},t.prototype.renderAfterStateCheck=function(t,e){t.render(e)},t.prototype.debugRender=function(t,e){for(var i=0;ii?i:t},e.pointOnCirlce=function(i,n,r){var o=e.toRadians(r);return new t.Vector2(Math.cos(o)*o+i.x,Math.sin(o)*o+i.y)},e.isEven=function(t){return t%2==0},e.clamp01=function(t){return t<0?0:t>1?1:t},e.angleBetweenVectors=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e.incrementWithWrap=function(t,e){return++t==e?0:t},e.approach=function(t,e,i){return tn&&(n=s.x),s.yr&&(r=s.y)}return this.fromMinMax(e,i,n,r)},i.prototype.intersects=function(t){return t.leftthis.x+this.width)return!1}else{var n=1/t.direction.x,r=(this.x-t.start.x)*n,o=(this.x+this.width-t.start.x)*n;if(r>o){var s=r;r=o,o=s}if(e.value=Math.max(r,e.value),i=Math.min(o,i),e.value>i)return!1}if(Math.abs(t.direction.y)<1e-6){if(t.start.ythis.y+this.height)return!1}else{var a=1/t.direction.y,h=(this.y-t.start.y)*a,c=(this.y+this.height-t.start.y)*a;if(h>c){var l=h;h=c,c=l}if(e.value=Math.max(h,e.value),i=Math.max(c,i),e.value>i)return!1}return!0},i.prototype.containsRect=function(t){return this.x<=t.x&&t.x1)return!1;var l=(h.x*o.y-h.y*o.x)/a;return!(l<0||l>1)},i.lineToLineIntersection=function(e,i,n,r){var o=new t.Vector2(0,0),s=t.Vector2.subtract(i,e),a=t.Vector2.subtract(r,n),h=s.x*a.y-s.y*a.x;if(0==h)return o;var c=t.Vector2.subtract(n,e),l=(c.x*a.y-c.y*a.x)/h;if(l<0||l>1)return o;var u=(c.x*s.y-c.y*s.x)/h;return u<0||u>1?o:o=t.Vector2.add(e,new t.Vector2(l*s.x,l*s.y))},i.closestPointOnLine=function(e,i,n){var r=t.Vector2.subtract(i,e),o=t.Vector2.subtract(n,e),s=t.Vector2.dot(o,r)/t.Vector2.dot(r,r);return s=t.MathHelper.clamp(s,0,1),t.Vector2.add(e,new t.Vector2(r.x*s,r.y*s))},i.isCircleToCircle=function(e,i,n,r){return t.Vector2.distanceSquared(e,n)<(i+r)*(i+r)},i.isCircleToLine=function(e,i,n,r){return t.Vector2.distanceSquared(e,this.closestPointOnLine(n,r,e))=t&&r.y>=e&&r.x=t+n&&(s|=e.right),o.y=i+r&&(s|=e.bottom),s},i}();t.Collisions=i}(es||(es={})),function(t){var e=function(){function e(e,i,n,r,o){this.fraction=0,this.distance=0,this.point=t.Vector2.zero,this.normal=t.Vector2.zero,this.collider=e,this.fraction=i,this.distance=n,this.point=r,this.centroid=t.Vector2.zero}return e.prototype.setValues=function(t,e,i,n){this.collider=t,this.fraction=e,this.distance=i,this.point=n},e.prototype.setValuesNonCollider=function(t,e,i,n){this.fraction=t,this.distance=e,this.point=i,this.normal=n},e.prototype.reset=function(){this.collider=null,this.fraction=this.distance=0},e.prototype.toString=function(){return"[RaycastHit] fraction: "+this.fraction+", distance: "+this.distance+", normal: "+this.normal+", centroid: "+this.centroid+", point: "+this.point},e}();t.RaycastHit=e}(es||(es={})),function(t){var e=function(){function e(){}return e.reset=function(){this._spatialHash=new t.SpatialHash(this.spatialHashCellSize)},e.clear=function(){this._spatialHash.clear()},e.overlapCircleAll=function(t,e,i,n){if(void 0===n&&(n=-1),0!=i.length)return this._spatialHash.overlapCircle(t,e,i,n);console.error("An empty results array was passed in. No results will ever be returned.")},e.boxcastBroadphase=function(t,e){return void 0===e&&(e=this.allLayers),this._spatialHash.aabbBroadphase(t,null,e)},e.boxcastBroadphaseExcludingSelf=function(t,e,i){return void 0===i&&(i=this.allLayers),this._spatialHash.aabbBroadphase(e,t,i)},e.addCollider=function(t){e._spatialHash.register(t)},e.removeCollider=function(t){e._spatialHash.remove(t)},e.updateCollider=function(t){this._spatialHash.remove(t),this._spatialHash.register(t)},e.linecast=function(t,i,n){return void 0===n&&(n=e.allLayers),this._hitArray[0].reset(),this.linecastAll(t,i,this._hitArray,n),this._hitArray[0]},e.linecastAll=function(t,i,n,r){return void 0===r&&(r=e.allLayers),0==n.length?(console.warn("传入了一个空的hits数组。没有点击会被返回"),0):this._spatialHash.linecast(t,i,n,r)},e.debugDraw=function(t){this._spatialHash.debugDraw(t,2)},e.spatialHashCellSize=100,e.allLayers=-1,e.raycastsHitTriggers=!1,e.raycastsStartInColliders=!1,e._hitArray=[new t.RaycastHit],e}();t.Physics=e}(es||(es={})),function(t){var e=function(){return function(e,i){this.start=e,this.end=i,this.direction=t.Vector2.subtract(this.end,this.start)}}();t.Ray2D=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.clone=function(){return ObjectUtils.clone(this)},t}();t.Shape=e}(es||(es={})),function(t){var e=function(e){function i(t,i){var n=e.call(this)||this;return n._areEdgeNormalsDirty=!0,n.isUnrotated=!0,n.setPoints(t),n.isBox=i,n}return __extends(i,e),Object.defineProperty(i.prototype,"edgeNormals",{get:function(){return this._areEdgeNormalsDirty&&this.buildEdgeNormals(),this._edgeNormals},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t){this.points=t,this.recalculateCenterAndEdgeNormals(),this._originalPoints=[];for(var e=0;e=this.points.length?this.points[0]:this.points[n+1];var o=t.Vector2Ext.perpendicular(r,e);t.Vector2Ext.normalize(o),this._edgeNormals[n]=o}},i.buildSymmetricalPolygon=function(e,i){for(var n=new Array(e),r=0;rr&&(r=s,n=o)}return e[n]},i.getClosestPointOnPolygonToPoint=function(e,i,n,r){n.value=Number.MAX_VALUE,r.x=0,r.y=0;for(var o,s=new t.Vector2(0,0),a=0;at.y!=this.points[n].y>t.y&&t.x<(this.points[n].x-this.points[i].x)*(t.y-this.points[i].y)/(this.points[n].y-this.points[i].y)+this.points[i].x&&(e=!e);return e},i.prototype.pointCollidesWithShape=function(e,i){return t.ShapeCollisions.pointToPoly(e,this,i)},i}(t.Shape);t.Polygon=e}(es||(es={})),function(t){var e=function(e){function i(t,n){var r=e.call(this,i.buildBox(t,n),!0)||this;return r.width=t,r.height=n,r}return __extends(i,e),i.buildBox=function(e,i){var n=e/2,r=i/2,o=new Array(4);return o[0]=new t.Vector2(-n,-r),o[1]=new t.Vector2(n,-r),o[2]=new t.Vector2(n,r),o[3]=new t.Vector2(-n,r),o},i.prototype.updateBox=function(e,i){this.width=e,this.height=i;var n=e/2,r=i/2;this.points[0]=new t.Vector2(-n,-r),this.points[1]=new t.Vector2(n,-r),this.points[2]=new t.Vector2(n,r),this.points[3]=new t.Vector2(-n,r);for(var o=0;o1)return!1;var a,h=t.Vector2.add(s.start,t.Vector2.add(s.direction,new t.Vector2(r.value))),c=0;h.xi.bounds.right&&(c|=1),h.yi.bounds.bottom&&(c|=2);var l=a+c;return 3==l&&console.log("m == 3. corner "+t.Time.frameCount),!0},e}();t.RealtimeCollisions=e}(es||(es={})),function(t){var e=function(){function e(){}return e.polygonToPolygon=function(e,i,n){for(var r,o=!0,s=e.edgeNormals,a=i.edgeNormals,h=Number.POSITIVE_INFINITY,c=new t.Vector2,l=t.Vector2.subtract(e.position,i.position),u=0;u0&&(o=!1),!o)return!1;(y=Math.abs(y))r&&(r=o);return{min:n,max:r}},e.circleToPolygon=function(e,i,n){var r,o=t.Vector2.subtract(e.position,i.position),s=new t.Ref(0),a=t.Polygon.getClosestPointOnPolygonToPoint(i.points,o,s,n.normal),h=i.containsPoint(e.position);if(s.value>e.radius*e.radius&&!h)return!1;if(h)r=t.Vector2.multiply(n.normal,new t.Vector2(Math.sqrt(s.value)-e.radius));else if(0==s.value)r=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else{var c=Math.sqrt(s.value);r=t.Vector2.multiply(new t.Vector2(-t.Vector2.subtract(o,a)),new t.Vector2((e.radius-s.value)/c))}return n.minimumTranslationVector=r,n.point=t.Vector2.add(a,i.position),!0},e.circleToBox=function(e,i,n){var r=i.bounds.getClosestPointOnRectangleBorderToPoint(e.position,n.normal);if(i.containsPoint(e.position)){n.point=r;var o=t.Vector2.add(r,t.Vector2.multiply(n.normal,new t.Vector2(e.radius)));return n.minimumTranslationVector=t.Vector2.subtract(e.position,o),!0}var s=t.Vector2.distanceSquared(r,e.position);if(0==s)n.minimumTranslationVector=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else if(s<=e.radius*e.radius){n.normal=t.Vector2.subtract(e.position,r);var a=n.normal.length()-e.radius;return n.point=r,t.Vector2Ext.normalize(n.normal),n.minimumTranslationVector=t.Vector2.multiply(new t.Vector2(a),n.normal),!0}return!1},e.pointToCircle=function(e,i,n){var r=t.Vector2.distanceSquared(e,i.position),o=1+i.radius;if(r1)return!1;var u=(c.x*s.y-c.y*s.x)/h;return!(u<0||u>1)&&(o=o.add(e).add(t.Vector2.multiply(new t.Vector2(l),s)),!0)},e.lineToCircle=function(e,i,n,r){var o=t.Vector2.distance(e,i),s=t.Vector2.divide(t.Vector2.subtract(i,e),new t.Vector2(o)),a=t.Vector2.subtract(e,n.position),h=t.Vector2.dot(a,s),c=t.Vector2.dot(a,a)-n.radius*n.radius;if(c>0&&h>0)return!1;var l=h*h-c;return!(l<0)&&(r.fraction=-h-Math.sqrt(l),r.fraction<0&&(r.fraction=0),r.point=t.Vector2.add(e,t.Vector2.multiply(new t.Vector2(r.fraction),s)),r.distance=t.Vector2.distance(e,r.point),r.normal=t.Vector2.normalize(t.Vector2.subtract(r.point,n.position)),r.fraction=r.distance/o,!0)},e.boxToBoxCast=function(e,i,n,r){var o=this.minkowskiDifference(e,i);if(o.contains(0,0)){var s=o.getClosestPointOnBoundsToOrigin();return!s.equals(t.Vector2.zero)&&(r.normal=new t.Vector2(-s.x),r.normal.normalize(),r.distance=0,r.fraction=0,!0)}var a=new t.Ray2D(t.Vector2.zero,new t.Vector2(-n.x)),h=new t.Ref(0);return!!(o.rayIntersects(a,h)&&h.value<=1)&&(r.fraction=h.value,r.distance=n.length()*h.value,r.normal=new t.Vector2(-n.x,-n.y),r.normal.normalize(),r.centroid=t.Vector2.add(e.bounds.center,t.Vector2.multiply(n,new t.Vector2(h.value))),!0)},e}();t.ShapeCollisions=e}(es||(es={})),function(t){var e=function(){function e(e){void 0===e&&(e=100),this.gridBounds=new t.Rectangle,this._overlapTestCircle=new t.Circle(0),this._cellDict=new i,this._tempHashSet=[],this._cellSize=e,this._inverseCellSize=1/this._cellSize,this._raycastParser=new n}return e.prototype.register=function(e){var i=e.bounds;e.registeredPhysicsBounds=i;var n=this.cellCoords(i.x,i.y),r=this.cellCoords(i.right,i.bottom);this.gridBounds.contains(n.x,n.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,n)),this.gridBounds.contains(r.x,r.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,r));for(var o=n.x;o<=r.x;o++)for(var s=n.y;s<=r.y;s++){var a=this.cellAtPosition(o,s,!0);a.firstOrDefault(function(t){return t.hashCode==e.hashCode})||a.push(e)}},e.prototype.remove=function(t){for(var e=t.registeredPhysicsBounds,i=this.cellCoords(e.x,e.y),n=this.cellCoords(e.right,e.bottom),r=i.x;r<=n.x;r++)for(var o=i.y;o<=n.y;o++){var s=this.cellAtPosition(r,o);s?s.remove(t):console.log("从不存在碰撞器的单元格中移除碰撞器: ["+t+"]")}},e.prototype.removeWithBruteForce=function(t){this._cellDict.remove(t)},e.prototype.clear=function(){this._cellDict.clear()},e.prototype.debugDraw=function(t,e){void 0===e&&(e=1);for(var i=this.gridBounds.x;i<=this.gridBounds.right;i++)for(var n=this.gridBounds.y;n<=this.gridBounds.bottom;n++){var r=this.cellAtPosition(i,n);r&&r.length>0&&this.debugDrawCellDetails(i,n,r.length,t,e)}},e.prototype.aabbBroadphase=function(e,i,n){this._tempHashSet.length=0;for(var r=this.cellCoords(e.x,e.y),o=this.cellCoords(e.right,e.bottom),s=r.x;s<=o.x;s++)for(var a=r.y;a<=o.y;a++){var h=this.cellAtPosition(s,a);if(h)for(var c=function(r){var o=h[r];if(o==i||!t.Flags.isFlagSet(n,o.physicsLayer))return"continue";e.intersects(o.bounds)&&(l._tempHashSet.firstOrDefault(function(t){return t.hashCode==o.hashCode})||l._tempHashSet.push(o))},l=this,u=0;u=0&&(e.push(this.findBoundsRect(i,o,r,t)),i=-1)}i>=0&&(e.push(this.findBoundsRect(i,this.map.width,r,t)),i=-1)}return e},e.prototype.findBoundsRect=function(e,i,n,r){for(var o=-1,s=n+1;sthis.tileHeight||this.maxTileWidth>this.tileWidth},enumerable:!0,configurable:!0}),i.prototype.getTilesetForTileGid=function(t){if(0==t)return null;for(var e=this.tilesets.length-1;e>=0;e--)if(this.tilesets[e].firstGid<=t)return this.tilesets[e];console.error("tile gid"+t+"未在任何tileset中找到")},i.prototype.worldToTilePositionX=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileWidth);return i?t.MathHelper.clamp(n,0,this.width-1):n},i.prototype.worldToTilePositionY=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileHeight);return i?t.MathHelper.clamp(n,0,this.height-1):n},i.prototype.getLayer=function(t){return this.layers[t]},i.prototype.update=function(){this.tilesets.forEach(function(t){t.update()})},i.prototype.dispose=function(t){void 0===t&&(t=!0),this._isDisposed||(t&&(this.tilesets.forEach(function(t){t.image&&t.image.dispose()}),this.imageLayers.forEach(function(t){t.image&&t.image.dispose()})),this._isDisposed=!0)},i}(t.TmxDocument);t.TmxMap=e,function(t){t[t.unknown=0]="unknown",t[t.orthogonal=1]="orthogonal",t[t.isometric=2]="isometric",t[t.staggered=3]="staggered",t[t.hexagonal=4]="hexagonal"}(t.OrientationType||(t.OrientationType={})),function(t){t[t.x=0]="x",t[t.y=1]="y"}(t.StaggerAxisType||(t.StaggerAxisType={})),function(t){t[t.odd=0]="odd",t[t.even=1]="even"}(t.StaggerIndexType||(t.StaggerIndexType={})),function(t){t[t.rightDown=0]="rightDown",t[t.rightUp=1]="rightUp",t[t.leftDown=2]="leftDown",t[t.leftUp=3]="leftUp"}(t.RenderOrderType||(t.RenderOrderType={}))}(es||(es={})),function(t){var e=function(){return function(){}}();t.TmxObjectGroup=e;var i=function(){return function(){this.shape=new egret.Shape,this.textField=new egret.TextField}}();t.TmxObject=i;var n=function(){return function(){}}();t.TmxText=n;var r=function(){return function(){}}();t.TmxAlignment=r,function(t){t[t.basic=0]="basic",t[t.point=1]="point",t[t.tile=2]="tile",t[t.ellipse=3]="ellipse",t[t.polygon=4]="polygon",t[t.polyline=5]="polyline",t[t.text=6]="text"}(t.TmxObjectType||(t.TmxObjectType={})),function(t){t[t.unkownOrder=-1]="unkownOrder",t[t.TopDown=0]="TopDown",t[t.IndexOrder=1]="IndexOrder"}(t.DrawOrderType||(t.DrawOrderType={})),function(t){t[t.left=0]="left",t[t.center=1]="center",t[t.right=2]="right",t[t.justify=3]="justify"}(t.TmxHorizontalAlignment||(t.TmxHorizontalAlignment={})),function(t){t[t.top=0]="top",t[t.center=1]="center",t[t.bottom=2]="bottom"}(t.TmxVerticalAlignment||(t.TmxVerticalAlignment={}))}(es||(es={})),function(t){var e=function(){function e(){}return e.loadTmxMap=function(t,e){var i=RES.getRes(e);return this.loadTmxMapData(t,i,RES.getResourceInfo(e))},e.loadTmxMapData=function(e,i,n){return __awaiter(this,void 0,void 0,function(){var r,o,s,a;return __generator(this,function(h){switch(h.label){case 0:e.version=i.version,e.tiledVersion=i.tiledversion,e.width=i.width,e.height=i.height,e.tileWidth=i.tilewidth,e.tileHeight=i.tileheight,e.hexSideLength=i.hexsidelength,e.orientation=this.parseOrientationType(i.orientation),e.staggerAxis=this.parseStaggerAxisType(i.staggeraxis),e.staggerIndex=this.parseStaggerIndexType(i.staggerindex),e.renderOrder=this.parseRenderOrderType(i.renderorder),e.nextObjectID=i.nextobjectid,e.backgroundColor=t.TmxUtils.color16ToUnit(i.color),e.properties=this.parsePropertyDict(i.properties),e.maxTileWidth=e.tileWidth,e.maxTileHeight=e.tileHeight,e.tmxDirectory=n.root+n.url.replace(".","_").replace(n.name,""),e.tilesets=[],r=0,o=i.tilesets,h.label=1;case 1:return rt.map.maxTileWidth&&(t.map.maxTileWidth=e.image.width),e.image.height>t.map.maxTileHeight&&(t.map.maxTileHeight=e.image.height))}),t.tileRegions.forEach(function(e){var i=e.width,n=e.height;i>t.map.maxTileWidth&&(t.map.maxTileWidth=i),i>t.map.maxTileHeight&&(t.map.maxTileHeight=n)})},e.parseOrientationType=function(e){return"unknown"==e?t.OrientationType.unknown:"orthogonal"==e?t.OrientationType.orthogonal:"isometric"==e?t.OrientationType.isometric:"staggered"==e?t.OrientationType.staggered:"hexagonal"==e?t.OrientationType.hexagonal:t.OrientationType.unknown},e.parseStaggerAxisType=function(e){return"y"==e?t.StaggerAxisType.y:t.StaggerAxisType.x},e.parseStaggerIndexType=function(e){return"even"==e?t.StaggerIndexType.even:t.StaggerIndexType.odd},e.parseRenderOrderType=function(e){return"right-up"==e?t.RenderOrderType.rightUp:"left-down"==e?t.RenderOrderType.leftDown:"left-up"==e?t.RenderOrderType.leftUp:t.RenderOrderType.rightDown},e.parsePropertyDict=function(e){if(!e)return null;for(var i=new Map,n=0,r=e;n=e.columns));m+=e.tileWidth+e.spacing);else e.tiles.forEach(function(i,n){e.tileRegions.set(n,new t.Rectangle(0,0,i.image.width,i.image.height))});return[2,e]}})})},e.loadTmxTilesetTile=function(e,i,n,r,o){return __awaiter(this,void 0,void 0,function(){var s,a,h,c,l,u,p,d,f,g,y,m,_;return __generator(this,function(v){switch(v.label){case 0:if(e.tileset=i,e.id=n.id,s=n.terrain)for(e.terrainEdges=new Array(4),a=0,h=0,c=s;h0){a.shape.x=h.x,a.shape.y=h.y,i.addChild(a.shape),a.shape.graphics.clear(),a.shape.graphics.lineStyle(1,10526884);for(u=0;u0&&(l=u.currentAnimationFrameGid);var p=i.tileset.tileRegions.get(l),d=Math.floor(i.x)*s,f=Math.floor(i.y)*a;i.horizontalFlip&&i.verticalFlip?(d+=a+(p.height*o.y-a),f-=p.width*o.x-s):i.horizontalFlip?d+=s+(p.height*o.y-a):i.verticalFlip?f+=s-p.width*o.x:f+=a-p.height*o.y;var g=new t.Vector2(d,f).add(r);if(i.tileset.image){if(n){var y=i.tileset.image.bitmap.getTexture(""+l);y||(y=i.tileset.image.bitmap.createTexture(""+l,p.x,p.y,p.width,p.height)),i.tileset.image.texture=new e(y),n.addChild(i.tileset.image.texture),i.tileset.image.texture.x!=g.x&&(i.tileset.image.texture.x=g.x),i.tileset.image.texture.y!=g.y&&(i.tileset.image.texture.y=g.y),i.verticalFlip&&i.horizontalFlip?(i.tileset.image.texture.scaleX=-1,i.tileset.image.texture.scaleY=-1):i.verticalFlip?(i.tileset.image.texture.scaleX=o.x,i.tileset.image.texture.scaleY=-1):i.horizontalFlip?(i.tileset.image.texture.scaleX=-1,i.tileset.image.texture.scaleY=o.y):(i.tileset.image.texture.scaleX=o.x,i.tileset.image.texture.scaleY=o.y),0!=i.tileset.image.texture.rotation&&(i.tileset.image.texture.rotation=0),0!=i.tileset.image.texture.anchorOffsetX&&(i.tileset.image.texture.anchorOffsetX=0),0!=i.tileset.image.texture.anchorOffsetY&&(i.tileset.image.texture.anchorOffsetY=0)}}else u.image.texture&&(u.image.bitmap.getTexture(l.toString())||(u.image.texture=new e(u.image.bitmap.createTexture(l.toString(),p.x,p.y,p.width,p.height)),n.addChild(u.image.texture)),u.image.texture.x=g.x,u.image.texture.y=g.y,u.image.texture.scaleX=o.x,u.image.texture.scaleY=o.y,u.image.texture.rotation=0,u.image.texture.anchorOffsetX=0,u.image.texture.anchorOffsetY=0,u.image.texture.filters=[h])},i}();t.TiledRendering=i}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.update=function(){this.tiles.forEach(function(t){t.updateAnimatedTiles()})},e}(t.TmxDocument);t.TmxTileset=e;var i=function(){return function(){}}();t.TmxTileOffset=i;var n=function(){return function(){}}();t.TmxTerrain=n}(es||(es={})),function(t){var e=function(){function e(){}return Object.defineProperty(e.prototype,"currentAnimationFrameGid",{get:function(){return this.animationFrames[this._animationCurrentFrame].gid+this.tileset.firstGid},enumerable:!0,configurable:!0}),e.prototype.processProperties=function(){var t;(t=this.properties.get("engine.isDestructable"))&&(this.isDestructable=Boolean(t)),(t=this.properties.get("engine:isSlope"))&&(this.isSlope=Boolean(t)),(t=this.properties.get("engine:isOneWayPlatform"))&&(this.isOneWayPlatform=Boolean(t)),(t=this.properties.get("engine:slopeTopLeft"))&&(this.slopeTopLeft=Number(t)),(t=this.properties.get("engine:slopeTopRight"))&&(this.slopeTopRight=Number(t))},e.prototype.updateAnimatedTiles=function(){0!=this.animationFrames.length&&(this._animationElapsedTime+=t.Time.deltaTime,this._animationElapsedTime>this.animationFrames[this._animationCurrentFrame].duration&&(this._animationCurrentFrame=t.MathHelper.incrementWithWrap(this._animationCurrentFrame,this.animationFrames.length),this._animationElapsedTime=0))},e}();t.TmxTilesetTile=e;var i=function(){return function(){}}();t.TmxAnimationFrame=i}(es||(es={})),function(t){var e=function(){function e(){}return e.decode=function(e,i,n){switch(n=n||"none",i=i||"none"){case"base64":var r=t.Base64Utils.decodeBase64AsArray(e,4);return"none"===n?r:t.Base64Utils.decompress(e,r,n);case"csv":return t.Base64Utils.decodeCSV(e);case"none":for(var o=[],s=0;si;n--)if(t[n]0&&t[r-1]>n;r--)t[r]=t[r-1];t[r]=n}},t.binarySearch=function(t,e){for(var i=0,n=t.length,r=i+n>>1;i=t[r]&&(i=r+1),r=i+n>>1;return t[i]==e?i:-1},t.findElementIndex=function(t,e){for(var i=t.length,n=0;nt[e]&&(e=n);return e},t.getMinElementIndex=function(t){for(var e=0,i=t.length,n=1;n=0;--r)i.unshift(e[r]);return i},t.getDifferAry=function(t,e){t=this.getUniqueAry(t),e=this.getUniqueAry(e);for(var i=t.concat(e),n={},r=[],o=i.length,s=0;s=0;e-=1)t.splice(e,1)},t.cloneList=function(t){return t?t.slice(0,t.length):null},t.equals=function(t,e){if(t==e)return!0;var i=t.length;if(i!=e.length)return!1;for(;i--;)if(t[i]!=e[i])return!1;return!0},t.insert=function(t,e,i){if(!t)return null;var n=t.length;if(e>n&&(e=n),e<0&&(e=0),e==n)t.push(i);else if(0==e)t.unshift(i);else{for(var r=n-1;r>=e;r-=1)t[r+1]=t[r];t[e]=i}return i},t}();!function(t){var e=function(){function t(){}return Object.defineProperty(t,"nativeBase64",{get:function(){return"function"==typeof window.atob},enumerable:!0,configurable:!0}),t.decode=function(t){if(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),this.nativeBase64)return window.atob(t);for(var e,i,n,r,o,s,a=[],h=0;h>4,i=(15&r)<<4|(o=this._keyStr.indexOf(t.charAt(h++)))>>2,n=(3&o)<<6|(s=this._keyStr.indexOf(t.charAt(h++))),a.push(String.fromCharCode(e)),64!==o&&a.push(String.fromCharCode(i)),64!==s&&a.push(String.fromCharCode(n));return a=a.join("")},t.encode=function(t){if(t=t.replace(/\r\n/g,"\n"),!this.nativeBase64){for(var e,i,n,r,o,s,a,h=[],c=0;c>2,o=(3&e)<<4|(i=t.charCodeAt(c++))>>4,s=(15&i)<<2|(n=t.charCodeAt(c++))>>6,a=63&n,isNaN(i)?s=a=64:isNaN(n)&&(a=64),h.push(this._keyStr.charAt(r)),h.push(this._keyStr.charAt(o)),h.push(this._keyStr.charAt(s)),h.push(this._keyStr.charAt(a));return h=h.join("")}window.btoa(t)},t.decodeBase64AsArray=function(e,i){i=i||1;var n,r,o,s=t.decode(e),a=new Uint32Array(s.length/i);for(n=0,o=s.length/i;n=0;--r)a[n]+=s.charCodeAt(n*i+r)<<(r<<3);return a},t.decompress=function(t,e,i){throw new Error("GZIP/ZLIB compressed TMX Tile Map not supported!")},t.decodeCSV=function(t){for(var e=t.replace("\n","").trim().split(","),i=[],n=0;n>16},set:function(t){this._packedValue=4278255615&this._packedValue|t<<16},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._packedValue>>8},set:function(t){this._packedValue=4294902015&this._packedValue|t<<8},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"r",{get:function(){return this._packedValue},set:function(t){this._packedValue=4294967040&this._packedValue|t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._packedValue>>24},set:function(t){this._packedValue=16777215&this._packedValue|t<<24},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"packedValue",{get:function(){return this._packedValue},set:function(t){this._packedValue=t},enumerable:!0,configurable:!0}),e.prototype.equals=function(t){return this._packedValue==t._packedValue},e}();t.Color=e}(es||(es={})),function(t){var e=function(){function t(){this.loadedAssets=new Map}return t.prototype.loadRes=function(t,e){var i=this;return void 0===e&&(e=!0),new Promise(function(n,r){var o=i.loadedAssets.get(t);o?n(o):e?RES.getResAsync(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)}):RES.getResByUrl(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)})})},t.prototype.dispose=function(){this.loadedAssets.forEach(function(t){var e=t;RES.destroyRes(e)&&e.dispose()}),this.loadedAssets.clear()},t}();t.ContentManager=e}(es||(es={})),function(t){var e=function(){function t(){}return t.getColorMatrix=function(t){var e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];return e[0]=Math.floor(t/256/256)/255,e[6]=Math.floor(t/256%256)/255,e[12]=t%256/255,new egret.ColorMatrixFilter(e)},t}();t.DrawUtils=e}(es||(es={})),function(t){var e=function(){function e(){}return e.oppositeEdge=function(e){switch(e){case t.Edge.bottom:return t.Edge.top;case t.Edge.top:return t.Edge.bottom;case t.Edge.left:return t.Edge.right;case t.Edge.right:return t.Edge.left}},e.isHorizontal=function(e){return e==t.Edge.right||e==t.Edge.left},e.isVertical=function(e){return e==t.Edge.top||e==t.Edge.bottom},e}();t.EdgeExt=e}(es||(es={})),function(t){var e=function(){return function(t,e){this.func=t,this.context=e}}();t.FuncPack=e;var i=function(){function t(){this._messageTable=new Map}return t.prototype.addObserver=function(t,i,n){var r=this._messageTable.get(t);r||(r=[],this._messageTable.set(t,r)),-1!=r.findIndex(function(t){return t.func==i})&&console.warn("您试图添加相同的观察者两次"),r.push(new e(i,n))},t.prototype.removeObserver=function(t,e){var i=this._messageTable.get(t),n=i.findIndex(function(t){return t.func==e});-1!=n&&i.removeAt(n)},t.prototype.emit=function(t,e){var i=this._messageTable.get(t);if(i)for(var n=i.length-1;n>=0;n--)i[n].func.call(i[n].context,e)},t}();t.Emitter=i}(es||(es={})),function(t){!function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.left=2]="left",t[t.right=3]="right"}(t.Edge||(t.Edge={}))}(es||(es={})),function(t){var e=function(){function t(){}return t.repeat=function(t,e){for(var i=[];e--;)i.push(t);return i},t}();t.Enumerable=e}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),t.prototype.setEnabled=function(t){this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled())},t.prototype.onEnabled=function(){},t.prototype.onDisabled=function(){},t.prototype.update=function(){},t}();t.GlobalManager=e}(es||(es={})),function(t){var e=function(){function e(){this.x=0,this.y=0,this.touchPoint=-1,this.touchDown=!1}return Object.defineProperty(e.prototype,"position",{get:function(){return new t.Vector2(this.x,this.y)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.x=0,this.y=0,this.touchDown=!1,this.touchPoint=-1},e}();t.TouchState=e;var i=function(){function i(){}return Object.defineProperty(i,"gameTouchs",{get:function(){return this._gameTouchs},enumerable:!0,configurable:!0}),Object.defineProperty(i,"resolutionScale",{get:function(){return this._resolutionScale},enumerable:!0,configurable:!0}),Object.defineProperty(i,"totalTouchCount",{get:function(){return this._totalTouchCount},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPosition",{get:function(){return this._gameTouchs[0]?this._gameTouchs[0].position:t.Vector2.zero},enumerable:!0,configurable:!0}),Object.defineProperty(i,"maxSupportedTouch",{get:function(){return t.Core._instance.stage.maxTouches},set:function(e){t.Core._instance.stage.maxTouches=e,this.initTouchCache()},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPositionDelta",{get:function(){var e=t.Vector2.subtract(this.touchPosition,this._previousTouchState.position);return e.length()>0&&this.setpreviousTouchState(this._gameTouchs[0]),e},enumerable:!0,configurable:!0}),i.initialize=function(){this._init||(this._init=!0,t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.touchBegin,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.touchMove,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.touchEnd,this),this.initTouchCache())},i.scaledPosition=function(e){var i=new t.Vector2(e.x-this._resolutionOffset.x,e.y-this._resolutionOffset.y);return t.Vector2.multiply(i,this.resolutionScale)},i.initTouchCache=function(){this._totalTouchCount=0,this._touchIndex=0,this._gameTouchs.length=0;for(var t=0;t0)for(var e=0;ethis._objectQueue.length;)this._objectQueue.shift()},t.clearCache=function(){this._objectQueue.length=0},t.obtain=function(){return this._objectQueue.length>0?this._objectQueue.shift():[]},t.free=function(t){this._objectQueue.unshift(t),t.length=0},t._objectQueue=[],t}();t.ListPool=e}(es||(es={})),function(t){var e=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.clear=function(){this.first=this.second=null},t.prototype.equals=function(t){return this.first==t.first&&this.second==t.second},t}();t.Pair=e}(es||(es={}));var RandomUtils=function(){function t(){}return t.randrange=function(t,e,i){if(void 0===i&&(i=1),0==i)throw new Error("step 不能为 0");var n=e-t;if(0==n)throw new Error("没有可用的范围("+t+","+e+")");n<0&&(n=t-e);var r=Math.floor((n+i-1)/i);return Math.floor(this.random()*r)*i+Math.min(t,e)},t.randint=function(t,e){return(t=Math.floor(t))>(e=Math.floor(e))?t++:e++,this.randrange(t,e)},t.randnum=function(t,e){return this.random()*(e-t)+t},t.shuffle=function(t){return t.sort(this._randomCompare),t},t.choice=function(t){if(!t.hasOwnProperty("length"))throw new Error("无法对此对象执行此操作");var e=Math.floor(this.random()*t.length);return t instanceof String?String(t).charAt(e):t[e]},t.sample=function(t,e){var i=t.length;if(e<=0||i=0;)s=Math.floor(this.random()*i);n.push(t[s]),r.push(s)}return n},t.random=function(){return Math.random()},t.boolean=function(t){return void 0===t&&(t=.5),this.random().5?1:-1},t}();!function(t){var e=function(){function e(){}return e.getSide=function(e,i){switch(i){case t.Edge.top:return e.top;case t.Edge.bottom:return e.bottom;case t.Edge.left:return e.left;case t.Edge.right:return e.right}},e.union=function(e,i){var n=new t.Rectangle(i.x,i.y,0,0),r=new t.Rectangle;return r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.width=Math.max(e.right,n.right)-r.x,r.height=Math.max(e.bottom,r.bottom)-r.y,r},e.getHalfRect=function(e,i){switch(i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,e.height/2);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height/2,e.width,e.height/2);case t.Edge.left:return new t.Rectangle(e.x,e.y,e.width/2,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width/2,e.y,e.width/2,e.height)}},e.getRectEdgePortion=function(e,i,n){switch(void 0===n&&(n=1),i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,n);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height-n,e.width,n);case t.Edge.left:return new t.Rectangle(e.x,e.y,n,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width-n,e.y,n,e.height)}},e.expandSide=function(e,i,n){switch(n=Math.abs(n),i){case t.Edge.top:e.y-=n,e.height+=n;break;case t.Edge.bottom:e.height+=n;break;case t.Edge.left:e.x-=n,e.width+=n;break;case t.Edge.right:e.width+=n}},e.contract=function(t,e,i){t.x+=e,t.y+=i,t.width-=2*e,t.height-=2*i},e}();t.RectangleExt=e}(es||(es={})),function(t){var e=function(){return function(t){this.value=t}}();t.Ref=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.update=function(t){this.remainder+=t;var e=Math.trunc(this.remainder);return this.remainder-=e,e},t.prototype.reset=function(){this.remainder=0},t}();t.SubpixelNumber=e}(es||(es={})),function(t){var e=function(){function e(){this.triangleIndices=[],this._triPrev=new Array(12),this._triNext=new Array(12)}return e.testPointTriangle=function(e,i,n,r){return!(t.Vector2Ext.cross(t.Vector2.subtract(e,i),t.Vector2.subtract(n,i))<0)&&(!(t.Vector2Ext.cross(t.Vector2.subtract(e,n),t.Vector2.subtract(r,n))<0)&&!(t.Vector2Ext.cross(t.Vector2.subtract(e,r),t.Vector2.subtract(i,r))<0))},e.prototype.triangulate=function(i,n){void 0===n&&(n=!0);var r=i.length;this.initialize(r);for(var o=0,s=0;r>3&&o<500;){o++;var a=!0,h=i[this._triPrev[s]],c=i[s],l=i[this._triNext[s]];if(t.Vector2Ext.isTriangleCCW(h,c,l)){var u=this._triNext[this._triNext[s]];do{if(e.testPointTriangle(i[u],h,c,l)){a=!1;break}u=this._triNext[u]}while(u!=this._triPrev[s])}else a=!1;a?(this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),this._triNext[this._triPrev[s]]=this._triNext[s],this._triPrev[this._triNext[s]]=this._triPrev[s],r--,s=this._triPrev[s]):s=this._triNext[s]}this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),n||this.triangleIndices.reverse()},e.prototype.initialize=function(t){this.triangleIndices.length=0,this._triNext.lengtht.MathHelper.Epsilon?e.divide(new t.Vector2(i)):e.x=e.y=0},e.transformA=function(t,e,i,n,r,o){for(var s=0;sthis.safeArea.right&&(s.x=this.safeArea.right-s.width),s.topthis.safeArea.bottom&&(s.y=this.safeArea.bottom-s.height),s},i}();t.Layout=i,function(t){t[t.none=0]="none",t[t.left=1]="left",t[t.right=2]="right",t[t.horizontalCenter=4]="horizontalCenter",t[t.top=8]="top",t[t.bottom=16]="bottom",t[t.verticalCenter=32]="verticalCenter",t[t.topLeft=9]="topLeft",t[t.topRight=10]="topRight",t[t.topCenter=12]="topCenter",t[t.bottomLeft=17]="bottomLeft",t[t.bottomRight=18]="bottomRight",t[t.bottomCenter=20]="bottomCenter",t[t.centerLeft=33]="centerLeft",t[t.centerRight=34]="centerRight",t[t.center=36]="center"}(e=t.Alignment||(t.Alignment={}))}(es||(es={})),function(t){var e,i=function(){function t(t){void 0===t&&(t=n),this.getSystemTime=t,this._stopDuration=0,this._completeSlices=[]}return t.prototype.getState=function(){return void 0===this._startSystemTime?e.IDLE:void 0===this._stopSystemTime?e.RUNNING:e.STOPPED},t.prototype.isIdle=function(){return this.getState()===e.IDLE},t.prototype.isRunning=function(){return this.getState()===e.RUNNING},t.prototype.isStopped=function(){return this.getState()===e.STOPPED},t.prototype.slice=function(){return this.recordPendingSlice()},t.prototype.getCompletedSlices=function(){return Array.from(this._completeSlices)},t.prototype.getCompletedAndPendingSlices=function(){return this._completeSlices.concat([this.getPendingSlice()])},t.prototype.getPendingSlice=function(){return this.calculatePendingSlice()},t.prototype.getTime=function(){return this.caculateStopwatchTime()},t.prototype.reset=function(){this._startSystemTime=this._pendingSliceStartStopwatchTime=this._stopSystemTime=void 0,this._stopDuration=0,this._completeSlices=[]},t.prototype.start=function(t){if(void 0===t&&(t=!1),t&&this.reset(),void 0!==this._stopSystemTime){var e=(i=this.getSystemTime())-this._stopSystemTime;this._stopDuration+=e,this._stopSystemTime=void 0}else if(void 0===this._startSystemTime){var i=this.getSystemTime();this._startSystemTime=i,this._pendingSliceStartStopwatchTime=0}},t.prototype.stop=function(t){if(void 0===t&&(t=!1),void 0===this._startSystemTime)return 0;var e=this.getSystemTimeOfCurrentStopwatchTime();return t&&this.recordPendingSlice(this.caculateStopwatchTime(e)),this._stopSystemTime=e,this.getTime()},t.prototype.calculatePendingSlice=function(t){return void 0===this._pendingSliceStartStopwatchTime?Object.freeze({startTime:0,endTime:0,duration:0}):(void 0===t&&(t=this.getTime()),Object.freeze({startTime:this._pendingSliceStartStopwatchTime,endTime:t,duration:t-this._pendingSliceStartStopwatchTime}))},t.prototype.caculateStopwatchTime=function(t){return void 0===this._startSystemTime?0:(void 0===t&&(t=this.getSystemTimeOfCurrentStopwatchTime()),t-this._startSystemTime-this._stopDuration)},t.prototype.getSystemTimeOfCurrentStopwatchTime=function(){return void 0===this._stopSystemTime?this.getSystemTime():this._stopSystemTime},t.prototype.recordPendingSlice=function(t){if(void 0!==this._pendingSliceStartStopwatchTime){void 0===t&&(t=this.getTime());var e=this.calculatePendingSlice(t);return this._pendingSliceStartStopwatchTime=e.endTime,this._completeSlices.push(e),e}return this.calculatePendingSlice()},t}();t.Stopwatch=i,function(t){t.IDLE="IDLE",t.RUNNING="RUNNING",t.STOPPED="STOPPED"}(e||(e={})),t.setDefaultSystemTimeGetter=function(t){void 0===t&&(t=Date.now),n=t};var n=Date.now}(stopwatch||(stopwatch={})),function(t){var e=function(){function e(){this.showLog=!1,this.markers=[],this.stopwacth=new stopwatch.Stopwatch,this._markerNameToIdMap=new Map,this._rectShape1=new egret.Shape,this._rectShape2=new egret.Shape,this._rectShape3=new egret.Shape,this._rectShape4=new egret.Shape,this._rectShape5=new egret.Shape,this._rectShape6=new egret.Shape,this._logs=new Array(2);for(var e=0;e=e.logSnapDuration&&(l.logs[n].snapMin=l.logs[n].min,l.logs[n].snapMax=l.logs[n].max,l.logs[n].snapAvg=l.logs[n].avg,l.logs[n].samples=0)):(l.logs[n].min=h,l.logs[n].max=h,l.logs[n].avg=h,l.logs[n].initialized=!0)}o.markCount=r.nestCount,o.nestCount=r.nestCount}this.stopwacth.reset(),this.stopwacth.start()}},e.prototype.beginMark=function(t,i,n){if(void 0===n&&(n=0),n<0||n>=e.maxBars)throw new Error("barIndex argument out of range");var r=this._curLog.bars[n];if(r.markCount>=e.maxSamples)throw new Error("exceeded sample count. either set larger number to timeruler.maxsaple or lower sample count");if(r.nestCount>=e.maxNestCall)throw new Error("exceeded nest count. either set larger number to timeruler.maxnestcall or lower nest calls");var o=this._markerNameToIdMap.get(t);isNaN(o)&&(o=this.markers.length,this._markerNameToIdMap.set(t,o)),r.markerNests[r.nestCount++]=r.markCount,r.markers[r.markCount].markerId=o,r.markers[r.markCount].color=i,r.markers[r.markCount].beginTime=this.stopwacth.getTime(),r.markers[r.markCount].endTime=-1},e.prototype.endMark=function(t,i){if(void 0===i&&(i=0),i<0||i>=e.maxBars)throw new Error("barIndex argument out of range");var n=this._curLog.bars[i];if(n.nestCount<=0)throw new Error("call beginMark method before calling endMark method");var r=this._markerNameToIdMap.get(t);if(isNaN(r))throw new Error("Marker "+t+" is not registered. Make sure you specifed same name as you used for beginMark method");var o=n.markerNests[--n.nestCount];if(n.markers[o].markerId!=r)throw new Error("Incorrect call order of beginMark/endMark method. beginMark(A), beginMark(B), endMark(B), endMark(A) But you can't called it like beginMark(A), beginMark(B), endMark(A), endMark(B).");n.markers[o].endTime=this.stopwacth.getTime()},e.prototype.getAverageTime=function(t,i){if(t<0||t>=e.maxBars)throw new Error("barIndex argument out of range");var n=0,r=this._markerNameToIdMap.get(i);return r&&(n=this.markers[r].logs[t].avg),n},e.prototype.resetLog=function(){this.markers.forEach(function(t){for(var e=0;e0&&(r+=e.barHeight+2*e.barPadding,o=Math.max(o,t.markers[t.markCount-1].endTime))});var s=this.sampleFrames*(1/60*1e3);this._frameAdjust=o>s?Math.max(0,this._frameAdjust)+1:Math.min(0,this._frameAdjust)-1,Math.max(this._frameAdjust)>e.autoAdjustDelay&&(this.sampleFrames=Math.min(e.maxSampleFrames,this.sampleFrames),this.sampleFrames=Math.max(this.targetSampleFrames,o/(1/60*1e3)+1),this._frameAdjust=0);var a=n/s,h=i.y-(r-e.barHeight),c=h,l=new t.Rectangle(i.x,c,n,r);this._rectShape1.graphics.clear(),this._rectShape1.graphics.beginFill(0,128/255),this._rectShape1.graphics.drawRect(l.x,l.y,l.width,l.height),this._rectShape1.graphics.endFill(),l.height=e.barHeight,this._rectShape2.graphics.clear();for(var u=0,p=this._prevLog.bars;u0)for(var f=0;fa||i[c].height>a)throw new Error("一个纹理的大小比图集的大小大");h.push(new t.Rectangle(0,0,i[c].width,i[c].height))}for(;h.length>0;){var l=new egret.RenderTexture,u=new t.RectanglePacker(a,a,1);for(c=0;c0){for(var p=new t.IntegerRectangle,d=[],f=[],g=[],y=[],m=0;m0;)this.freeRectangle(this._insertedRectangles.pop());for(;this._freeAreas.length>0;)this.freeRectangle(this._freeAreas.pop());for(this._width=t,this._height=e,this._packedWidth=0,this._packedHeight=0,this._freeAreas.push(this.allocateRectangle(0,0,this._width,this._height));this._insertedRectangles.length>0;)this.freeSize(this._insertList.pop());this._padding=i},e.prototype.insertRectangle=function(t,e,i){var n=this.allocateSize(t,e,i);this._insertList.push(n)},e.prototype.packRectangles=function(t){for(void 0===t&&(t=!0),t&&this._insertList.sort(function(t,e){return t.width-e.width});this._insertList.length>0;){var e=this._insertList.pop(),i=e.width,n=e.height,r=this.getFreeAreaIndex(i,n);if(r>=0){var o=this._freeAreas[r],s=this.allocateRectangle(o.x,o.y,i,n);for(s.id=e.id,this.generateNewFreeAreas(s,this._freeAreas,this._newFreeAreas);this._newFreeAreas.length>0;)this._freeAreas.push(this._newFreeAreas.pop());this._insertedRectangles.push(s),s.right>this._packedWidth&&(this._packedWidth=s.right),s.bottom>this._packedHeight&&(this._packedHeight=s.bottom)}this.freeSize(e)}return this.rectangleCount},e.prototype.getRectangle=function(t,e){var i=this._insertedRectangles[t];return e.x=i.x,e.y=i.y,e.width=i.width,e.height=i.height,e},e.prototype.getRectangleId=function(t){return this._insertedRectangles[t].id},e.prototype.generateNewFreeAreas=function(t,e,i){var n=t.x,r=t.y,o=t.right+1+this._padding,s=t.bottom+1+this._padding,a=null;0==this._padding&&(a=t);for(var h=e.length-1;h>=0;h--){var c=e[h];if(!(n>=c.right||o<=c.x||r>=c.bottom||s<=c.y)){null==a&&(a=this.allocateRectangle(t.x,t.y,t.width+this._padding,t.height+this._padding)),this.generateDividedAreas(a,c,i);var l=e.pop();h=0;e--)for(var i=t[e],n=t.length-1;n>=0;n--)if(e!=n){var r=t[n];if(i.x>=r.x&&i.y>=r.y&&i.right<=r.right&&i.bottom<=r.bottom){this.freeRectangle(i);var o=t.pop();e0&&(i.push(this.allocateRectangle(t.right,e.y,r,e.height)),n++);var o=t.x-e.x;o>0&&(i.push(this.allocateRectangle(e.x,e.y,o,e.height)),n++);var s=e.bottom-t.bottom;s>0&&(i.push(this.allocateRectangle(e.x,t.bottom,e.width,s)),n++);var a=t.y-e.y;a>0&&(i.push(this.allocateRectangle(e.x,e.y,e.width,a)),n++),0==n&&(t.width=0;s--){var a=this._freeAreas[s];if(a.x0){var r=this._sortableSizeStack.pop();return r.width=e,r.height=i,r.id=n,r}return new t.SortableSize(e,i,n)},e.prototype.freeSize=function(t){this._sortableSizeStack.push(t)},e.prototype.allocateRectangle=function(e,i,n,r){if(this._rectangleStack.length>0){var o=this._rectangleStack.pop();return o.x=e,o.y=i,o.width=n,o.height=r,o.right=e+n,o.bottom=i+r,o}return new t.IntegerRectangle(e,i,n,r)},e.prototype.freeRectangle=function(t){this._rectangleStack.push(t)},e}();t.RectanglePacker=e}(es||(es={})),function(t){var e=function(){return function(t,e,i){this.width=t,this.height=e,this.id=i}}();t.SortableSize=e}(es||(es={})),function(t){var e=function(){return function(t){this.assets=t}}();t.TextureAssets=e;var i=function(){return function(){}}();t.TextureAsset=i}(es||(es={})),function(t){var e=function(){return function(t,e){this.texture=t,this.id=e}}();t.TextureToPack=e}(es||(es={})),function(t){var e=function(){function e(){this._timeInSeconds=0,this._repeats=!1,this._isDone=!1,this._elapsedTime=0}return e.prototype.getContext=function(){return this.context},e.prototype.reset=function(){this._elapsedTime=0},e.prototype.stop=function(){this._isDone=!0},e.prototype.tick=function(){return!this._isDone&&this._elapsedTime>this._timeInSeconds&&(this._elapsedTime-=this._timeInSeconds,this._onTime(this),this._isDone||this._repeats||(this._isDone=!0)),this._elapsedTime+=t.Time.deltaTime,this._isDone},e.prototype.initialize=function(t,e,i,n){this._timeInSeconds=t,this._repeats=e,this.context=i,this._onTime=n},e.prototype.unload=function(){this.context=null,this._onTime=null},e}();t.Timer=e}(es||(es={})),function(t){var e=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._timers=[],t}return __extends(i,e),i.prototype.update=function(){for(var t=this._timers.length-1;t>=0;t--)this._timers[t].tick()&&(this._timers[t].unload(),this._timers.removeAt(t))},i.prototype.schedule=function(e,i,n,r){var o=new t.Timer;return o.initialize(e,i,n,r),this._timers.push(o),o},i}(t.GlobalManager);t.TimerManager=e}(es||(es={})); \ No newline at end of file +window.es={},window.__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var transform,__awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(s,a)}h((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]-1}(this,t)},Array.prototype.firstOrDefault=function(t){return function(t,e){var i=t.findIndex(e);return-1==i?null:t[i]}(this,t)},Array.prototype.find=function(t){return function(t,e){return t.firstOrDefault(e)}(this,t)},Array.prototype.where=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return e.call(arguments[2],n,r,t)&&i.push(n),i},[]);for(var i=[],n=0,r=t.length;n=0&&t.splice(i,1)}while(i>=0)}(this,t)},Array.prototype.remove=function(t){return function(t,e){var i=t.findIndex(function(t){return t===e});return i>=0&&(t.splice(i,1),!0)}(this,t)},Array.prototype.removeAt=function(t){return function(t,e){t.splice(e,1)}(this,t)},Array.prototype.removeRange=function(t,e){return function(t,e,i){t.splice(e,i)}(this,t,e)},Array.prototype.select=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return i.push(e.call(arguments[2],n,r,t)),i},[]);for(var i=[],n=0,r=t.length;no?1:-1}),t}(this,t,e)},Array.prototype.orderByDescending=function(t,e){return function(t,e,i){return t.sort(function(t,n){var r=e(t),o=e(n);return i?-i(r,o):r0;){if("break"===l())break}return s?this.recontructPath(a,n,r):null},e.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},e}();t.AStarPathfinder=e;var i=function(t){function e(e){var i=t.call(this)||this;return i.data=e,i}return __extends(e,t),e}(t.PriorityQueueNode);t.AStarNode=i}(es||(es={})),function(t){var e=function(){function e(e,i){this.dirs=[new t.Vector2(1,0),new t.Vector2(0,-1),new t.Vector2(-1,0),new t.Vector2(0,1)],this.walls=[],this.weightedNodes=[],this.defaultWeight=1,this.weightedNodeWeight=5,this._neighbors=new Array(4),this._width=e,this._height=i}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x=this._nodes.length?(console.error("node.QueueIndex has been corrupted. Did you change it manually? Or add this node to another queue?"),!1):this._nodes[t.queueIndex]==t:(console.error("node cannot be null"),!1)},t.prototype.enqueue=function(t,e){t.priority=e,this._numNodes++,this._nodes[this._numNodes]=t,t.queueIndex=this._numNodes,t.insertionIndex=this._numNodesEverEnqueued++,this.cascadeUp(this._nodes[this._numNodes])},t.prototype.dequeue=function(){var t=this._nodes[1];return this.remove(t),t},t.prototype.remove=function(t){if(t.queueIndex==this._numNodes)return this._nodes[this._numNodes]=null,void this._numNodes--;var e=this._nodes[this._numNodes];this.swap(t,e),delete this._nodes[this._numNodes],this._numNodes--,this.onNodeUpdated(e)},t.prototype.isValidQueue=function(){for(var t=1;t0&&this.hasHigherPriority(t,i)?this.cascadeUp(t):this.cascadeDown(t)},t.prototype.cascadeDown=function(t){for(var e,i=t.queueIndex;;){e=t;var n=2*i;if(n>this._numNodes){t.queueIndex=i,this._nodes[i]=t;break}var r=this._nodes[n];this.hasHigherPriority(r,e)&&(e=r);var o=n+1;if(o<=this._numNodes){var s=this._nodes[o];this.hasHigherPriority(s,e)&&(e=s)}if(e==t){t.queueIndex=i,this._nodes[i]=t;break}this._nodes[i]=e;var a=e.queueIndex;e.queueIndex=i,i=a}},t.prototype.cascadeUp=function(t){for(var e=Math.floor(t.queueIndex/2);e>=1;){var i=this._nodes[e];if(this.hasHigherPriority(i,t))break;this.swap(t,i),e=Math.floor(t.queueIndex/2)}},t.prototype.swap=function(t,e){this._nodes[t.queueIndex]=e,this._nodes[e.queueIndex]=t;var i=t.queueIndex;t.queueIndex=e.queueIndex,e.queueIndex=i},t.prototype.hasHigherPriority=function(t,e){return t.priority0;){if("break"===h())break}return o?t.AStarPathfinder.recontructPath(a,i,n):null},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e}();t.BreadthFirstPathfinder=e}(es||(es={})),function(t){var e=function(){function t(){this.edges=new Map}return t.prototype.addEdgesForNode=function(t,e){return this.edges.set(t,e),this},t.prototype.getNeighbors=function(t){return this.edges.get(t)},t}();t.UnweightedGraph=e}(es||(es={})),function(t){var e=function(){function e(t,e){this.x=0,this.y=0,this.x=t||0,this.y=null!=e?e:this.x}return Object.defineProperty(e,"zero",{get:function(){return new e(0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return new e(1,1)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitX",{get:function(){return new e(1,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitY",{get:function(){return new e(0,1)},enumerable:!0,configurable:!0}),e.add=function(t,i){var n=new e(0,0);return n.x=t.x+i.x,n.y=t.y+i.y,n},e.divide=function(t,i){var n=new e(0,0);return n.x=t.x/i.x,n.y=t.y/i.y,n},e.multiply=function(t,i){var n=new e(0,0);return n.x=t.x*i.x,n.y=t.y*i.y,n},e.subtract=function(t,i){var n=new e(0,0);return n.x=t.x-i.x,n.y=t.y-i.y,n},e.normalize=function(t){var i=new e(t.x,t.y),n=1/Math.sqrt(i.x*i.x+i.y*i.y);return i.x*=n,i.y*=n,i},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.distanceSquared=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},e.clamp=function(i,n,r){return new e(t.MathHelper.clamp(i.x,n.x,r.x),t.MathHelper.clamp(i.y,n.y,r.y))},e.lerp=function(i,n,r){return new e(t.MathHelper.lerp(i.x,n.x,r),t.MathHelper.lerp(i.y,n.y,r))},e.transform=function(t,i){return new e(t.x*i.m11+t.y*i.m21+i.m31,t.x*i.m12+t.y*i.m22+i.m32)},e.distance=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},e.angle=function(i,n){return i=e.normalize(i),n=e.normalize(n),Math.acos(t.MathHelper.clamp(e.dot(i,n),-1,1))*t.MathHelper.Rad2Deg},e.negate=function(t){var i=new e;return i.x=-t.x,i.y=-t.y,i},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.normalize=function(){var t=1/Math.sqrt(this.x*this.x+this.y*this.y);this.x*=t,this.y*=t},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.round=function(){return new e(Math.round(this.x),Math.round(this.y))},e.prototype.equals=function(t){return t.x==this.x&&t.y==this.y},e}();t.Vector2=e}(es||(es={})),function(t){var e=function(){function e(t,i,n){void 0===n&&(n=!1),this.walls=[],this._neighbors=new Array(4),this._width=t,this._hegiht=i,this._dirs=n?e.COMPASS_DIRS:e.CARDINAL_DIRS}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x0;){if("break"===l())break}return s?this.recontructPath(a,n,r):null},i.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},i.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},i.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},i}();t.WeightedPathfinder=i}(es||(es={})),function(t){var e=function(e){function i(){var n=e.call(this)||this;return n._globalManagers=[],n._timerManager=new t.TimerManager,i._instance=n,i.emitter=new t.Emitter,i.content=new t.ContentManager,n.addEventListener(egret.Event.ADDED_TO_STAGE,n.onAddToStage,n),i.registerGlobalManager(n._timerManager),n}return __extends(i,e),Object.defineProperty(i,"Instance",{get:function(){return this._instance},enumerable:!0,configurable:!0}),Object.defineProperty(i,"scene",{get:function(){return this._instance?this._instance._scene:null},set:function(t){t?null==this._instance._scene?(this._instance.addChild(t),this._instance._scene=t,this._instance._scene.begin(),i.Instance.onSceneChanged()):this._instance._nextScene=t:console.error("场景不能为空")},enumerable:!0,configurable:!0}),i.startSceneTransition=function(t){if(!this._instance._sceneTransition)return this._instance._sceneTransition=t,t;console.warn("在前一个场景完成之前,不能开始一个新的场景转换。")},i.registerGlobalManager=function(t){this._instance._globalManagers.push(t),t.enabled=!0},i.unregisterGlobalManager=function(t){this._instance._globalManagers.remove(t),t.enabled=!1},i.getGlobalManager=function(t){for(var e=0;e=0;e--)this._globalManagers[e].enabled&&this._globalManagers[e].update();return this._sceneTransition&&(!this._sceneTransition||this._sceneTransition.loadsNewScene&&!this._sceneTransition.isNewSceneLoaded)||this._scene.update(),this._nextScene?(this._scene.parent&&this._scene.parent.removeChild(this._scene),this._scene.end(),this._scene=this._nextScene,this._nextScene=null,this.onSceneChanged(),[4,this._scene.begin()]):[3,2];case 1:i.sent(),this.addChild(this._scene),i.label=2;case 2:return this.endDebugUpdate(),[4,this.draw()];case 3:return i.sent(),[2]}})})},i.prototype.onAddToStage=function(){i.graphicsDevice=new t.GraphicsDevice,this.addEventListener(egret.Event.RESIZE,this.onGraphicsDeviceReset,this),this.addEventListener(egret.StageOrientationEvent.ORIENTATION_CHANGE,this.onOrientationChanged,this),this.addEventListener(egret.Event.ENTER_FRAME,this.update,this),t.Input.initialize(),KeyboardUtils.init(),this.initialize()},i.debugRenderEndabled=!1,i}(egret.DisplayObjectContainer);t.Core=e}(es||(es={})),function(t){var e=function(){function t(){}return t.renderableBounds=16776960,t.renderableCenter=10040012,t.colliderBounds=5592405,t.colliderEdge=9109504,t.colliderPosition=16776960,t.colliderCenter=16711680,t}();t.Colors=e;var i=function(){function e(){}return Object.defineProperty(e,"lineSizeMultiplier",{get:function(){return Math.max(Math.ceil(t.Core.scene.x/t.Core.scene.width),1)},enumerable:!0,configurable:!0}),e}();t.Size=i;var n=function(){function e(){}return e.drawHollowRect=function(e,i,n){void 0===n&&(n=0),this._debugDrawItems.push(new t.DebugDrawItem(e,i,n))},e.render=function(){if(this._debugDrawItems.length>0){var e=new egret.Shape;t.Core.scene&&t.Core.scene.addChild(e);for(var i=this._debugDrawItems.length-1;i>=0;i--){this._debugDrawItems[i].draw(e)&&this._debugDrawItems.removeAt(i)}}},e._debugDrawItems=[],e}();t.Debug=n}(es||(es={})),function(t){var e=function(){function t(){}return t.verletParticle=14431326,t.verletConstraintEdge=4406838,t}();t.DebugDefaults=e}(es||(es={})),function(t){var e;!function(t){t[t.line=0]="line",t[t.hollowRectangle=1]="hollowRectangle",t[t.pixel=2]="pixel",t[t.text=3]="text"}(e=t.DebugDrawType||(t.DebugDrawType={}));var i=function(){function i(t,i,n){this.rectangle=t,this.color=i,this.duration=n,this.drawType=e.hollowRectangle}return i.prototype.draw=function(i){switch(this.drawType){case e.line:case e.hollowRectangle:case e.pixel:case e.text:}return this.duration-=t.Time.deltaTime,this.duration<0},i}();t.DebugDrawItem=i}(es||(es={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.updateInterval=1,e.debugDisplayObject=new egret.DisplayObjectContainer,e._enabled=!0,e._updateOrder=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"transform",{get:function(){return this.entity.transform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this.entity?this.entity.enabled&&this._enabled:this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){},e.prototype.onAddedToEntity=function(){},e.prototype.onRemovedFromEntity=function(){},e.prototype.onEntityTransformChanged=function(t){},e.prototype.debugRender=function(){},e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled()),this},e.prototype.setUpdateOrder=function(t){return this._updateOrder!=t&&(this._updateOrder=t),this},e}(egret.HashObject);t.Component=e}(es||(es={})),function(t){!function(t){t[t.GraphicsDeviceReset=0]="GraphicsDeviceReset",t[t.SceneChanged=1]="SceneChanged",t[t.OrientationChanged=2]="OrientationChanged"}(t.CoreEvents||(t.CoreEvents={}))}(es||(es={})),function(t){var e=function(){function e(i){this.updateInterval=1,this._tag=0,this._enabled=!0,this._updateOrder=0,this.components=new t.ComponentList(this),this.transform=new t.Transform(this),this.name=i,this.id=e._idGenerator++,this.componentBits=new t.BitSet}return Object.defineProperty(e.prototype,"isDestroyed",{get:function(){return this._isDestroyed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tag",{get:function(){return this._tag},set:function(t){this.setTag(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.transform.parent},set:function(t){this.transform.setParent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childCount",{get:function(){return this.transform.childCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.setPosition(t.x,t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localPosition",{get:function(){return this.transform.localPosition},set:function(t){this.transform.setLocalPosition(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.setRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationDegrees",{get:function(){return this.transform.rotationDegrees},set:function(t){this.transform.setRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotation",{get:function(){return this.transform.localRotation},set:function(t){this.transform.setLocalRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotationDegrees",{get:function(){return this.transform.localRotationDegrees},set:function(t){this.transform.setLocalRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.setScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localScale",{get:function(){return this.transform.localScale},set:function(t){this.transform.setLocalScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldInverseTransform",{get:function(){return this.transform.worldInverseTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localToWorldTransform",{get:function(){return this.transform.localToWorldTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldToLocalTransform",{get:function(){return this.transform.worldToLocalTransform},enumerable:!0,configurable:!0}),e.prototype.onTransformChanged=function(t){this.components.onEntityTransformChanged(t)},e.prototype.setTag=function(t){return this._tag!=t&&(this.scene&&this.scene.entities.removeFromTagList(this),this._tag=t,this.scene&&this.scene.entities.addToTagList(this)),this},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.components.onEntityEnabled():this.components.onEntityDisabled()),this},e.prototype.setUpdateOrder=function(t){if(this._updateOrder!=t)return this._updateOrder=t,this.scene&&(this.scene.entities.markEntityListUnsorted(),this.scene.entities.markTagUnsorted(this.tag)),this},e.prototype.destroy=function(){this._isDestroyed=!0,this.scene.entities.remove(this),this.transform.parent=null;for(var t=this.transform.childCount-1;t>=0;t--){this.transform.getChild(t).entity.destroy()}},e.prototype.detachFromScene=function(){this.scene.entities.remove(this),this.components.deregisterAllComponents();for(var t=0;t=0;t--)this._sceneComponents[t].enabled&&this._sceneComponents[t].update();this.entityProcessors&&this.entityProcessors.update(),this.entities.update(),this.entityProcessors&&this.entityProcessors.lateUpdate(),this.renderableComponents.updateList()},i.prototype.render=function(){if(0!=this._renderers.length)for(var t=0;te.x?-1:1,n=t.Vector2.normalize(t.Vector2.subtract(this.position,e));this.rotation=i*Math.acos(t.Vector2.dot(n,t.Vector2.unitY))},n.prototype.setLocalRotation=function(t){return this._localRotation=t,this._localDirty=this._positionDirty=this._localPositionDirty=this._localRotationDirty=this._localScaleDirty=!0,this.setDirty(e.rotationDirty),this},n.prototype.setLocalRotationDegrees=function(e){return this.setLocalRotation(t.MathHelper.toRadians(e))},n.prototype.setScale=function(e){return this._scale=e,this.parent?this.localScale=t.Vector2.divide(e,this.parent._scale):this.localScale=e,this},n.prototype.setLocalScale=function(t){return this._localScale=t,this._localDirty=this._positionDirty=this._localScaleDirty=!0,this.setDirty(e.scaleDirty),this},n.prototype.roundPosition=function(){this.position=this._position.round()},n.prototype.updateTransform=function(){this.hierarchyDirty!=e.clean&&(this.parent&&this.parent.updateTransform(),this._localDirty&&(this._localPositionDirty&&(this._translationMatrix=t.Matrix2D.create().translate(this._localPosition.x,this._localPosition.y),this._localPositionDirty=!1),this._localRotationDirty&&(this._rotationMatrix=t.Matrix2D.create().rotate(this._localRotation),this._localRotationDirty=!1),this._localScaleDirty&&(this._scaleMatrix=t.Matrix2D.create().scale(this._localScale.x,this._localScale.y),this._localScaleDirty=!1),this._localTransform=this._scaleMatrix.multiply(this._rotationMatrix),this._localTransform=this._localTransform.multiply(this._translationMatrix),this.parent||(this._worldTransform=this._localTransform,this._rotation=this._localRotation,this._scale=this._localScale,this._worldInverseDirty=!0),this._localDirty=!1),this.parent&&(this._worldTransform=this._localTransform.multiply(this.parent._worldTransform),this._rotation=this._localRotation+this.parent._rotation,this._scale=t.Vector2.multiply(this.parent._scale,this._localScale),this._worldInverseDirty=!0),this._worldToLocalDirty=!0,this._positionDirty=!0,this.hierarchyDirty=e.clean)},n.prototype.setDirty=function(e){if(0==(this.hierarchyDirty&e)){switch(this.hierarchyDirty|=e,e){case t.DirtyType.positionDirty:this.entity.onTransformChanged(transform.Component.position);break;case t.DirtyType.rotationDirty:this.entity.onTransformChanged(transform.Component.rotation);break;case t.DirtyType.scaleDirty:this.entity.onTransformChanged(transform.Component.scale)}this._children||(this._children=[]);for(var i=0;it&&(this._zoom=t),this._maximumZoom=t,this;console.error("maximumZoom must be greater than zero")},n.prototype.forceMatrixUpdate=function(){this._areMatrixedDirty=!0},n.prototype.onEntityTransformChanged=function(t){this._areMatrixedDirty=!0},n.prototype.zoomIn=function(t){this.zoom+=t},n.prototype.zoomOut=function(t){this.zoom-=t},n.prototype.worldToScreenPoint=function(e){return this.updateMatrixes(),e=t.Vector2Ext.transformR(e,this._transformMatrix)},n.prototype.screenToWorldPoint=function(e){return this.updateMatrixes(),e=t.Vector2Ext.transformR(e,this._inverseTransformMatrix)},n.prototype.onSceneRenderTargetSizeChanged=function(e,i){this._isProjectionMatrixDirty=!0;var n=this._origin;this.origin=new t.Vector2(e/2,i/2),this.entity.transform.position.add(t.Vector2.subtract(this._origin,n))},n.prototype.mouseToWorldPoint=function(){return this.screenToWorldPoint(t.Input.touchPosition)},n.prototype.updateMatrixes=function(){var e;this._areMatrixedDirty&&(this._transformMatrix=t.Matrix2D.create().translate(-this.entity.transform.position.x,-this.entity.transform.position.y),1!=this._zoom&&(e=t.Matrix2D.create().scale(this._zoom,this._zoom),this._transformMatrix=this._transformMatrix.multiply(e)),0!=this.entity.transform.rotation&&(e=t.Matrix2D.create().rotate(this.entity.transform.rotation),this._transformMatrix=this._transformMatrix.multiply(e)),e=t.Matrix2D.create().translate(this._origin.x,this._origin.y),this._transformMatrix=this._transformMatrix.multiply(e),this._inverseTransformMatrix=this._transformMatrix.invert(),this._areBoundsDirty=!0,this._areMatrixedDirty=!1)},n}(t.Component);t.Camera=i}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i._shakeDirection=t.Vector2.zero,i._shakeOffset=t.Vector2.zero,i._shakeIntensity=0,i._shakeDegredation=.95,i}return __extends(i,e),i.prototype.shake=function(e,i,n){void 0===e&&(e=15),void 0===i&&(i=.9),void 0===n&&(n=t.Vector2.zero),this.enabled=!0,this._shakeIntensity=1)&&(i=.95),this._shakeDegredation=i)},i.prototype.update=function(){Math.abs(this._shakeIntensity)>0&&(this._shakeOffset=this._shakeDirection,0!=this._shakeOffset.x||0!=this._shakeOffset.y?this._shakeOffset.normalize():(this._shakeOffset.x=this._shakeOffset.x+Math.random()-.5,this._shakeOffset.y=this._shakeOffset.y+Math.random()-.5),this._shakeOffset.multiply(new t.Vector2(this._shakeIntensity)),this._shakeIntensity*=-this._shakeDegredation,Math.abs(this._shakeIntensity)<=.01&&(this._shakeIntensity=0,this.enabled=!1)),this.entity.scene.camera.position.add(this._shakeOffset)},i}(t.Component);t.CameraShake=e}(es||(es={})),function(t){var e=function(){function t(t){this._type=t,this._cache=[]}return t.prototype.obtain=function(){try{return this._cache.length>0?this._cache.shift():new this._type}catch(t){throw new Error(this._type+t)}},t.prototype.free=function(t){t.reset(),this._cache.push(t)},t}();t.ComponentPool=e}(es||(es={})),function(t){var e;!function(t){t[t.lockOn=0]="lockOn",t[t.cameraWindow=1]="cameraWindow"}(e=t.CameraStyle||(t.CameraStyle={}));var i=function(i){function n(n,r,o){void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=e.lockOn);var s=i.call(this)||this;return s.followLerp=.1,s.deadzone=new t.Rectangle,s.focusOffset=t.Vector2.zero,s.mapLockEnabled=!1,s.mapSize=new t.Rectangle,s._desiredPositionDelta=new t.Vector2,s._worldSpaceDeadZone=new t.Rectangle,s.rectShape=new egret.Shape,s._targetEntity=n,s._cameraStyle=o,s.camera=r,s}return __extends(n,i),n.prototype.onAddedToEntity=function(){this.camera||(this.camera=this.entity.scene.camera),this.follow(this._targetEntity,this._cameraStyle),t.Core.emitter.addObserver(t.CoreEvents.GraphicsDeviceReset,this.onGraphicsDeviceReset,this)},n.prototype.onGraphicsDeviceReset=function(){t.Core.schedule(0,!1,this,function(t){var e=t.context;e.follow(e._targetEntity,e._cameraStyle)})},n.prototype.update=function(){var e=t.Vector2.multiply(this.camera.bounds.size,new t.Vector2(.5));this._worldSpaceDeadZone.x=this.camera.position.x-e.x*t.Core.scene.scaleX+this.deadzone.x+this.focusOffset.x,this._worldSpaceDeadZone.y=this.camera.position.y-e.y*t.Core.scene.scaleY+this.deadzone.y+this.focusOffset.y,this._worldSpaceDeadZone.width=this.deadzone.width,this._worldSpaceDeadZone.height=this.deadzone.height,this._targetEntity&&this.updateFollow(),this.camera.position=t.Vector2.lerp(this.camera.position,t.Vector2.add(this.camera.position,this._desiredPositionDelta),this.followLerp),this.entity.transform.roundPosition(),this.mapLockEnabled&&(this.camera.position=this.clampToMapSize(this.camera.position),this.entity.transform.roundPosition())},n.prototype.debugRender=function(){this.rectShape||this.debugDisplayObject.addChild(this.rectShape),this.rectShape.graphics.clear(),this._cameraStyle==e.lockOn?(this.rectShape.graphics.beginFill(9109504,0),this.rectShape.graphics.lineStyle(1,9109504),this.rectShape.graphics.drawRect(this._worldSpaceDeadZone.x-5,this._worldSpaceDeadZone.y-5,this._worldSpaceDeadZone.width,this._worldSpaceDeadZone.height),this.rectShape.graphics.endFill()):(this.rectShape.graphics.beginFill(9109504,0),this.rectShape.graphics.lineStyle(1,9109504),this.rectShape.graphics.drawRect(this._worldSpaceDeadZone.x,this._worldSpaceDeadZone.y,this._worldSpaceDeadZone.width,this._worldSpaceDeadZone.height),this.rectShape.graphics.endFill())},n.prototype.clampToMapSize=function(e){var i=t.Vector2.multiply(this.camera.bounds.size,new t.Vector2(.5)).add(new t.Vector2(this.mapSize.x,this.mapSize.y)),n=new t.Vector2(this.mapSize.width-i.x,this.mapSize.height-i.y);return t.Vector2.clamp(e,i,n)},n.prototype.follow=function(i,n){void 0===n&&(n=e.cameraWindow),this._targetEntity=i,this._cameraStyle=n;var r=this.camera.bounds;switch(this._cameraStyle){case e.cameraWindow:var o=r.width/6,s=r.height/3;this.deadzone=new t.Rectangle((r.width-o)/2,(r.height-s)/2,o,s);break;case e.lockOn:this.deadzone=new t.Rectangle(r.width/2,r.height/2,10,10)}},n.prototype.updateFollow=function(){if(this._desiredPositionDelta.x=this._desiredPositionDelta.y=0,this._cameraStyle==e.lockOn){var i=this._targetEntity.transform.position.x,n=this._targetEntity.transform.position.y;this._worldSpaceDeadZone.x>i?this._desiredPositionDelta.x=i-this._worldSpaceDeadZone.x:this._worldSpaceDeadZone.xn&&(this._desiredPositionDelta.y=n-this._worldSpaceDeadZone.y)}else{if(!this._targetCollider&&(this._targetCollider=this._targetEntity.getComponent(t.Collider),!this._targetCollider))return;var r=this._targetEntity.getComponent(t.Collider).bounds;this._worldSpaceDeadZone.containsRect(r)||(this._worldSpaceDeadZone.left>r.left?this._desiredPositionDelta.x=r.left-this._worldSpaceDeadZone.left:this._worldSpaceDeadZone.rightr.top&&(this._desiredPositionDelta.y=r.top-this._worldSpaceDeadZone.top))}},n.prototype.setCenteredDeadzone=function(e,i){if(this.camera){var n=this.camera.bounds;this.deadzone=new t.Rectangle((n.width-e)/2,(n.height-i)/2,e,i)}else console.error("相机是null。我们不能得到它的边界。请等到该组件添加到实体之后")},n}(t.Component);t.FollowCamera=i}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.compare=function(t,e){return t.updateOrder-e.updateOrder},t}();t.IUpdatableComparer=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Component);t.PooledComponent=e}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.displayObject=new egret.DisplayObject,i.hollowShape=new egret.Shape,i.pixelShape=new egret.Shape,i.color=0,i._areBoundsDirty=!0,i.debugRenderEnabled=!0,i._localOffset=t.Vector2.zero,i._renderLayer=0,i._bounds=new t.Rectangle,i}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.bounds.width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.bounds.height},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localOffset",{get:function(){return this._localOffset},set:function(t){this.setLocalOffset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renderLayer",{get:function(){return this._renderLayer},set:function(t){this.setRenderLayer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bounds",{get:function(){return this._areBoundsDirty&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,t.Vector2.zero,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!=t&&(this._isVisible=t,this._isVisible?this.onBecameVisible():this.onBecameInvisible())},enumerable:!0,configurable:!0}),i.prototype.onEntityTransformChanged=function(t){this._areBoundsDirty=!0},i.prototype.debugRender=function(){if(this.debugRenderEnabled){this.hollowShape.parent||this.debugDisplayObject.addChild(this.hollowShape),this.pixelShape.parent||this.debugDisplayObject.addChild(this.pixelShape);var e=t.Vector2.add(this.entity.transform.position,this._localOffset);this.pixelShape.graphics.clear(),this.pixelShape.graphics.beginFill(t.Colors.renderableCenter,0),this.pixelShape.graphics.lineStyle(4,t.Colors.renderableCenter),this.pixelShape.graphics.lineTo(e.x,e.y),this.pixelShape.graphics.moveTo(e.x,e.y),this.pixelShape.graphics.endFill()}},i.prototype.isVisibleFromCamera=function(t){return!!t&&(this.isVisible=t.bounds.intersects(this.bounds),this.isVisible)},i.prototype.setRenderLayer=function(t){if(t!=this._renderLayer){var e=this._renderLayer;this._renderLayer=t,this.entity&&this.entity.scene&&this.entity.scene.renderableComponents.updateRenderableRenderLayer(this,e,this._renderLayer)}return this},i.prototype.setColor=function(t){return this.color=t,this},i.prototype.setLocalOffset=function(t){return this._localOffset!=t&&(this._localOffset=t),this},i.prototype.sync=function(e){var i=new t.Vector2(this.entity.position.x+this.localOffset.x-e.position.x+e.origin.x,this.entity.position.y+this.localOffset.y-e.position.y+e.origin.y);this.displayObject.x!=i.x&&(this.displayObject.x=i.x),this.displayObject.y!=i.y&&(this.displayObject.y=i.y),this.displayObject.scaleX!=this.entity.scale.x&&(this.displayObject.scaleX=this.entity.scale.x),this.displayObject.scaleY!=this.entity.scale.y&&(this.displayObject.scaleY=this.entity.scale.y),this.displayObject.rotation!=this.entity.rotation&&(this.displayObject.rotation=this.entity.rotation)},i.prototype.toString=function(){return"[RenderableComponent] renderLayer: "+this.renderLayer},i.prototype.onBecameVisible=function(){this.displayObject.visible=this.isVisible,this.debugDisplayObject.visible=this.isVisible},i.prototype.onBecameInvisible=function(){this.displayObject.visible=this.isVisible,this.debugDisplayObject.visible=this.isVisible},i}(t.Component);t.RenderableComponent=e}(es||(es={})),function(t){var e=function(){function e(){this.updateOrder=0,this._enabled=!0}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.onRemovedFromScene=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled),this},e.prototype.setUpdateOrder=function(e){return this.updateOrder!=e&&(this.updateOrder=e,t.Core.scene._sceneComponents.sort(this.compareTo)),this},e.prototype.compareTo=function(t){return this.updateOrder-t.updateOrder},e}();t.SceneComponent=e}(es||(es={})),function(t){var e=egret.Bitmap,i=function(i){function n(e){void 0===e&&(e=null);var n=i.call(this)||this;return e instanceof t.Sprite?n.setSprite(e):e instanceof egret.Texture&&n.setSprite(new t.Sprite(e)),n}return __extends(n,i),Object.defineProperty(n.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this._sprite.sourceRect.width,this._sprite.sourceRect.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"originNormalized",{get:function(){return new t.Vector2(this._origin.x/this.width*this.entity.transform.scale.x,this._origin.y/this.height*this.entity.transform.scale.y)},set:function(e){this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"origin",{get:function(){return this._origin},set:function(t){this.setOrigin(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"sprite",{get:function(){return this._sprite},set:function(t){this.setSprite(t)},enumerable:!0,configurable:!0}),n.prototype.setSprite=function(t){return this._sprite=t,this._sprite&&(this._origin=this._sprite.origin,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y),this.displayObject=new e(t.texture2D),this},n.prototype.setOrigin=function(t){return this._origin!=t&&(this._origin=t,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y,this._areBoundsDirty=!0),this},n.prototype.setOriginNormalized=function(e){return this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y)),this},n.prototype.render=function(e){this.sync(e);var i=new t.Vector2(this.entity.position.x+this.localOffset.x-this.origin.x-e.position.x+e.origin.x,this.entity.position.y+this.localOffset.y-this.origin.y-e.position.y+e.origin.y);this.displayObject.x!=i.x&&(this.displayObject.x=i.x),this.displayObject.y!=i.y&&(this.displayObject.y=i.y)},n}(t.RenderableComponent);t.SpriteRenderer=i}(es||(es={})),function(t){var e=egret.Bitmap,i=egret.RenderTexture,n=function(n){function r(e){var i=n.call(this,e)||this;return i._textureScale=t.Vector2.one,i._inverseTexScale=t.Vector2.one,i._gapX=0,i._gapY=0,i._sourceRect=e.sourceRect,i.displayObject.$fillMode=egret.BitmapFillMode.REPEAT,i}return __extends(r,n),Object.defineProperty(r.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollX",{get:function(){return this._sourceRect.x},set:function(t){this._sourceRect.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollY",{get:function(){return this._sourceRect.y},set:function(t){this._sourceRect.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y),this._sourceRect.width=this._sprite.sourceRect.width*this._inverseTexScale.x,this._sourceRect.height=this._sprite.sourceRect.height*this._inverseTexScale.y},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this._sourceRect.width},set:function(t){this._areBoundsDirty=!0,this._sourceRect.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._sourceRect.height},set:function(t){this._areBoundsDirty=!0,this._sourceRect.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"gapXY",{get:function(){return new t.Vector2(this._gapX,this._gapY)},set:function(t){this._gapX=t.x,this._gapY=t.y;var n=new i,r=this.sprite.sourceRect;r.x=0,r.y=0,r.width+=this._gapX,r.height+=this._gapY,n.drawToTexture(this.displayObject,r),this.displayObject?this.displayObject.texture=n:this.displayObject=new e(n)},enumerable:!0,configurable:!0}),r.prototype.setGapXY=function(t){return this.gapXY=t,this},r.prototype.render=function(t){n.prototype.render.call(this,t);var e=this.displayObject;e.width=this.width,e.height=this.height,e.scrollRect=this._sourceRect},r}(t.SpriteRenderer);t.TiledSpriteRenderer=n}(es||(es={})),function(t){var e=function(e){function i(t){var i=e.call(this,t)||this;return i.scrollSpeedX=15,i.scroolSpeedY=0,i._scrollX=0,i._scrollY=0,i._scrollWidth=0,i._scrollHeight=0,i._scrollWidth=i.width,i._scrollHeight=i.height,i}return __extends(i,e),Object.defineProperty(i.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollWidth",{get:function(){return this._scrollWidth},set:function(t){this._scrollWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollHeight",{get:function(){return this._scrollHeight},set:function(t){this._scrollHeight=t},enumerable:!0,configurable:!0}),i.prototype.update=function(){this.sprite&&(this._scrollX+=this.scrollSpeedX*t.Time.deltaTime,this._scrollY+=this.scroolSpeedY*t.Time.deltaTime,this._sourceRect.x=this._scrollX,this._sourceRect.y=this._scrollY,this._sourceRect.width=this._scrollWidth+Math.abs(this._scrollX),this._sourceRect.height=this._scrollHeight+Math.abs(this._scrollY))},i}(t.TiledSpriteRenderer);t.ScrollingSpriteRenderer=e}(es||(es={})),function(t){var e=egret.SpriteSheet,i=function(){function i(e,i,n){void 0===i&&(i=new t.Rectangle(0,0,e.textureWidth,e.textureHeight)),void 0===n&&(n=i.getHalfSize()),this.uvs=new t.Rectangle,this.texture2D=e,this.sourceRect=i,this.center=new t.Vector2(.5*i.width,.5*i.height),this.origin=n;var r=1/e.textureWidth,o=1/e.textureHeight;this.uvs.x=i.x*r,this.uvs.y=i.y*o,this.uvs.width=i.width*r,this.uvs.height=i.height*o}return i.spritesFromAtlas=function(t,n,r,o,s){void 0===o&&(o=0),void 0===s&&(s=Number.MAX_VALUE);for(var a=[],h=t.textureWidth/n,c=t.textureHeight/r,l=0,u=new e(t),p=0;po||this._loopMode==e.pingPongOnce&&s>2*o)return this.animationState=i.completed,this._elapsedTime=0,this.currentFrame=0,void(this.displayObject.texture=n.sprites[this.currentFrame].texture2D);var a=Math.floor(s/r),h=n.sprites.length;if(h>2&&(this._loopMode==e.pingPong||this._loopMode==e.pingPongOnce)){var c=h-1;this.currentFrame=c-Math.abs(c-a%(2*c))}else this.currentFrame=a%h;this.displayObject.texture=n.sprites[this.currentFrame].texture2D}},r.prototype.addAnimation=function(t,e){return!this.sprite&&e.sprites.length>0&&this.setSprite(e.sprites[0]),this._animations[t]=e,this},r.prototype.play=function(t,n){void 0===n&&(n=null),this.currentAnimation=this._animations[t],this.currentAnimationName=t,this.currentFrame=0,this.animationState=i.running,this.displayObject.texture=this.currentAnimation.sprites[0].texture2D,this._elapsedTime=0,this._loopMode=n||e.loop},r.prototype.isAnimationActive=function(t){return this.currentAnimation&&this.currentAnimationName==t},r.prototype.pause=function(){this.animationState=i.paused},r.prototype.unPause=function(){this.animationState=i.running},r.prototype.stop=function(){this.currentAnimation=null,this.currentAnimationName=null,this.currentFrame=0,this.animationState=i.none},r}(t.SpriteRenderer);t.SpriteAnimator=n}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"hasCollision",{get:function(){return this.below||this.right||this.left||this.above},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.becameGroundedThisFrame=this.isGroundedOnOnewayPlatform=this.right=this.left=this.above=this.below=!1,this.slopAngle=0},t.prototype.toString=function(){return"[CollisionState] r: "+this.right+", l: "+this.left+", a: "+this.above+", b: "+this.below+", angle: "+this.slopAngle+", wasGroundedLastFrame: "+this.wasGroundedLastFrame+", becameGroundedThisFrame: "+this.becameGroundedThisFrame},t}();t.CollisionState=e;var i=function(e){function i(){var t=e.call(this)||this;return t.colliderHorizontalInset=2,t.colliderVerticalInset=6,t}return __extends(i,e),i.prototype.testCollisions=function(e,i,n){this._boxColliderBounds=i,n.wasGroundedLastFrame=n.below,n.reset();var r=e.x;e.y;if(0!=r){var o=r>0?t.Edge.right:t.Edge.left,s=this.collisionRectForSide(o,r);this.testMapCollision(s,o,n,0)?(e.x=0-t.RectangleExt.getSide(i,o),n.left=o==t.Edge.left,n.right=o==t.Edge.right,n._movementRemainderX.reset()):(n.left=!1,n.right=!1)}},i.prototype.testMapCollision=function(e,i,n,r){var o=t.EdgeExt.oppositeEdge(i);t.EdgeExt.isVertical(o)?e.center.x:e.center.y,t.RectangleExt.getSide(e,i),t.EdgeExt.isVertical(o)},i.prototype.collisionRectForSide=function(e,i){var n;return n=t.EdgeExt.isHorizontal(e)?t.RectangleExt.getRectEdgePortion(this._boxColliderBounds,e):t.RectangleExt.getHalfRect(this._boxColliderBounds,e),t.EdgeExt.isVertical(e)?t.RectangleExt.contract(n,this.colliderHorizontalInset,0):t.RectangleExt.contract(n,0,this.colliderVerticalInset),t.RectangleExt.expandSide(n,e,i),n},i}(t.Component);t.TiledMapMover=i}(es||(es={})),function(t){var e=function(e){function i(i,n,r){void 0===n&&(n=null),void 0===r&&(r=!0);var o=e.call(this)||this;return o.physicsLayer=new t.Ref(1),o.toContainer=!1,o.tiledMap=i,o._shouldCreateColliders=r,o.displayObject=new egret.DisplayObjectContainer,n&&(o.collisionLayer=i.tileLayers.find(function(t){return t.name==n})),o}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.tiledMap.width*this.tiledMap.tileWidth},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.tiledMap.height*this.tiledMap.tileHeight},enumerable:!0,configurable:!0}),i.prototype.setLayerToRender=function(t){this.layerIndicesToRender=[],this.layerIndicesToRender[0]=this.getLayerIndex(t)},i.prototype.setLayersToRender=function(){for(var t=[],e=0;e=2){this.polygonShape.graphics.beginFill(t.Colors.colliderEdge,0),this.polygonShape.graphics.lineStyle(t.Size.lineSizeMultiplier,t.Colors.colliderEdge);for(var i=0;i>6;0!=(e&t.LONG_MASK)&&i++,this._bits=new Array(i)}return t.prototype.and=function(t){for(var e,i=Math.min(this._bits.length,t._bits.length),n=0;n=0;)this._bits[e]&=~t._bits[e]},t.prototype.cardinality=function(){for(var t=0,e=this._bits.length-1;e>=0;e--){var i=this._bits[e];if(0!=i)if(-1!=i){var n=((i=((i=(i>>1&0x5555555555555400)+(0x5555555555555400&i))>>2&0x3333333333333400)+(0x3333333333333400&i))>>32)+i;t+=((n=((n=(n>>4&252645135)+(252645135&n))>>8&16711935)+(16711935&n))>>16&65535)+(65535&n)}else t+=64}return t},t.prototype.clear=function(t){if(null!=t){var e=t>>6;this.ensure(e),this._bits[e]&=~(1<>6;return!(e>=this._bits.length)&&0!=(this._bits[e]&1<=0;)if(0!=(this._bits[e]&t._bits[e]))return!0;return!1},t.prototype.isEmpty=function(){for(var t=this._bits.length-1;t>=0;t--)if(this._bits[t])return!1;return!0},t.prototype.nextSetBit=function(t){for(var e=t>>6,i=1<>6;this.ensure(i),this._bits[i]|=1<=this._bits.length){var e=new Number[t+1];e=this._bits.copyWithin(0,0,this._bits.length),this._bits=e}},t.LONG_MASK=63,t}();t.BitSet=e}(es||(es={})),function(t){var e=function(){function e(t){this._components=[],this._componentsToAdd=[],this._componentsToRemove=[],this._tempBufferList=[],this._entity=t}return Object.defineProperty(e.prototype,"count",{get:function(){return this._components.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._components},enumerable:!0,configurable:!0}),e.prototype.markEntityListUnsorted=function(){this._isComponentListUnsorted=!0},e.prototype.add=function(t){this._componentsToAdd.push(t)},e.prototype.remove=function(t){this._componentsToRemove.contains(t)&&console.warn("You are trying to remove a Component ("+t+") that you already removed"),this._componentsToAdd.contains(t)?this._componentsToAdd.remove(t):this._componentsToRemove.push(t)},e.prototype.removeAllComponents=function(){for(var t=0;t0){for(var i=0;i0){i=0;for(var n=this._componentsToAdd.length;i0){var e=this._entitiesToRemove;this._entitiesToRemove=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t.removeFromTagList(e),t._entities.remove(e),e.onRemovedFromScene(),e.scene=null,t.scene.entityProcessors.onEntityRemoved(e)}),this._tempEntityList.length=0}if(this._entitiesToAdded.length>0){e=this._entitiesToAdded;this._entitiesToAdded=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t._entities.contains(e)||(t._entities.push(e),e.scene=t.scene,t.addToTagList(e),t.scene.entityProcessors.onEntityAdded(e))}),this._tempEntityList.forEach(function(t){return t.onAddedToScene()}),this._tempEntityList.length=0,this._isEntityListUnsorted=!0}this._isEntityListUnsorted&&(this._entities.sort(),this._isEntityListUnsorted=!1),this._unsortedTags.length>0&&(this._unsortedTags.forEach(function(e){t._entityDict.get(e).sort()}),this._unsortedTags.length=0)},e.prototype.findEntity=function(t){for(var e=0;e=0;e=this.allSet.nextSetBit(e+1))if(!t.componentBits.get(e))return!1;return!(!this.exclusionSet.isEmpty()&&this.exclusionSet.intersects(t.componentBits))&&!(!this.oneSet.isEmpty()&&!this.oneSet.intersects(t.componentBits))},e.prototype.all=function(){for(var e=this,i=[],n=0;n0){for(var t=0,i=this._unsortedRenderLayers.length;t=e)return t;var n=!1;"-"==t.substr(0,1)&&(n=!0,t=t.substr(1));for(var r=e-i,o=0;o1?this.reverse(t.substring(1))+t.substring(0,1):t},t.cutOff=function(t,e,i,n){void 0===n&&(n=!0),e=Math.floor(e),i=Math.floor(i);var r=t.length;e>r&&(e=r);var o,s=e,a=e+i;return n?o=t.substring(0,s)+t.substr(a,r):(a=(s=r-1-e-i)+i,o=t.substring(0,s+1)+t.substr(a+1,r)),o},t.strReplace=function(t,e){for(var i=0,n=e.length;i",">",'"',""","'","'","®","®","©","©","™","™"],t}();!function(t){var e=function(){function e(){}return e.convertImageToCanvas=function(e,i){this.sharedCanvas||(this.sharedCanvas=egret.sys.createCanvas(),this.sharedContext=this.sharedCanvas.getContext("2d"));var n=e.$getTextureWidth(),r=e.$getTextureHeight();i||((i=egret.$TempRectangle).x=0,i.y=0,i.width=n,i.height=r),i.x=Math.min(i.x,n-1),i.y=Math.min(i.y,r-1),i.width=Math.min(i.width,n-i.x),i.height=Math.min(i.height,r-i.y);var o=Math.floor(i.width),s=Math.floor(i.height),a=this.sharedCanvas;if(a.style.width=o+"px",a.style.height=s+"px",this.sharedCanvas.width=o,this.sharedCanvas.height=s,"webgl"==egret.Capabilities.renderMode){var h=void 0;e.$renderBuffer?h=e:(egret.sys.systemRenderer.renderClear&&egret.sys.systemRenderer.renderClear(),(h=new egret.RenderTexture).drawToTexture(new egret.Bitmap(e)));for(var c=h.$renderBuffer.getPixels(i.x,i.y,o,s),l=0,u=0,p=0;p=0?"png":"jpg"});return wx.getFileSystemManager().saveFile({tempFilePath:o,filePath:wx.env.USER_DATA_PATH+"/"+i,success:function(t){}}),o},e.getPixel32=function(t,e,i){return egret.$warn(1041,"getPixel32","getPixels"),t.getPixels(e,i)},e.getPixels=function(t,e,i,n,r){if(void 0===n&&(n=1),void 0===r&&(r=1),"webgl"==egret.Capabilities.renderMode){var o=void 0;return t.$renderBuffer?o=t:(o=new egret.RenderTexture).drawToTexture(new egret.Bitmap(t)),o.$renderBuffer.getPixels(e,i,n,r)}try{this.convertImageToCanvas(t);return this.sharedContext.getImageData(e,i,n,r).data}catch(t){egret.$error(1039)}},e}();t.TextureUtils=e}(es||(es={})),function(t){var e=function(){function t(){}return t.update=function(t){var e=(t-this._lastTime)/1e3;this.deltaTime=e*this.timeScale,this.unscaledDeltaTime=e,this._timeSinceSceneLoad+=e,this.frameCount++,this._lastTime=t},t.sceneChanged=function(){this._timeSinceSceneLoad=0},t.checkEvery=function(t){return this._timeSinceSceneLoad/t>(this._timeSinceSceneLoad-this.deltaTime)/t},t.deltaTime=0,t.timeScale=1,t.frameCount=0,t._lastTime=0,t}();t.Time=e}(es||(es={}));var TimeUtils=function(){function t(){}return t.monthId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getFullYear(),i=t.getMonth()+1;return parseInt(e+(i<10?"0":"")+i)},t.dateId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getMonth()+1,i=e<10?"0":"",n=t.getDate(),r=n<10?"0":"";return parseInt(t.getFullYear()+i+e+r+n)},t.weekId=function(t,e){void 0===t&&(t=null),void 0===e&&(e=!0),t=t||new Date;var i=new Date;i.setTime(t.getTime()),i.setDate(1),i.setMonth(0);var n=i.getFullYear(),r=i.getDay();0==r&&(r=7);var o=!1;r<=4?(o=r>1,i.setDate(i.getDate()-(r-1))):i.setDate(i.getDate()+7-r+1);var s=this.diffDay(t,i,!1);if(s<0)return i.setDate(1),i.setMonth(0),i.setDate(i.getDate()-1),this.weekId(i,!1);var a=s/7,h=Math.floor(a)+1;if(53==h){i.setTime(t.getTime()),i.setDate(i.getDate()-1);var c=i.getDay();if(0==c&&(c=7),e&&(!o||c<4))return i.setFullYear(i.getFullYear()+1),i.setDate(1),i.setMonth(0),this.weekId(i,!1)}return parseInt(n+"00"+(h>9?"":"0")+h)},t.diffDay=function(t,e,i){void 0===i&&(i=!1);var n=(t.getTime()-e.getTime())/864e5;return i?Math.ceil(n):Math.floor(n)},t.getFirstDayOfWeek=function(t){var e=(t=t||new Date).getDay()||7;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1-e,0,0,0,0)},t.getFirstOfDay=function(t){return(t=t||new Date).setHours(0,0,0,0),t},t.getNextFirstOfDay=function(t){return new Date(this.getFirstOfDay(t).getTime()+864e5)},t.formatDate=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();return e+"-"+i+"-"+(n=n<10?"0"+n:n)},t.formatDateTime=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var r=t.getHours(),o=t.getMinutes();o=o<10?"0"+o:o;var s=t.getSeconds();return e+"-"+i+"-"+n+" "+r+":"+o+":"+(s=s<10?"0"+s:s)},t.parseDate=function(t){var e=Date.parse(t);return isNaN(e)?new Date:new Date(Date.parse(t.replace(/-/g,"/")))},t.secondToTime=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=":"),void 0===i&&(i=!0);var n=Math.floor(t/3600),r=Math.floor(t%3600/60),o=Math.floor(t%3600%60),s=n.toString(),a=r.toString(),h=o.toString();return n<10&&(s="0"+s),r<10&&(a="0"+a),o<10&&(h="0"+h),i?s+e+a+e+h:a+e+h},t.timeToMillisecond=function(t,e){void 0===e&&(e=":");for(var i=t.split(e),n=0,r=i.length,o=0;o-1?this.os="iOS":n.indexOf("android")>-1&&(this.os="Android");var r=i.language;r=r.indexOf("zh")>-1?"zh-CN":"en-US",this.language=r}},e}(egret.Capabilities);t.GraphicsCapabilities=e}(es||(es={})),function(t){var e=function(){function e(){this.setup(),this.graphicsCapabilities=new t.GraphicsCapabilities,this.graphicsCapabilities.initialize(this)}return Object.defineProperty(e.prototype,"viewport",{get:function(){return this._viewport},enumerable:!0,configurable:!0}),e.prototype.setup=function(){this._viewport=new t.Viewport(0,0,t.Core._instance.stage.stageWidth,t.Core._instance.stage.stageHeight)},e}();t.GraphicsDevice=e}(es||(es={})),function(t){var e=function(){function e(t,e,i,n){this._x=t,this._y=e,this._width=i,this._height=n,this._minDepth=0,this._maxDepth=1}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return 0!=this._height&&0!=this._width?this._width/this._height:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new t.Rectangle(this._x,this._y,this._width,this._height)},set:function(t){this._x=t.x,this._y=t.y,this._width=t.width,this._height=t.height},enumerable:!0,configurable:!0}),e}();t.Viewport=e}(es||(es={})),function(t){var e=function(e){function i(){return e.call(this,t.PostProcessor.default_vert,i.blur_frag,{screenWidth:t.Core.graphicsDevice.viewport.width,screenHeight:t.Core.graphicsDevice.viewport.height})||this}return __extends(i,e),i.blur_frag="precision mediump float;\nuniform sampler2D uSampler;\nuniform float screenWidth;\nuniform float screenHeight;\nfloat normpdf(in float x, in float sigma)\n{\nreturn 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma;\n}\nvoid main()\n{\nvec3 c = texture2D(uSampler, gl_FragCoord.xy / vec2(screenWidth, screenHeight).xy).rgb;\nconst int mSize = 11;\nconst int kSize = (mSize - 1)/2;\nfloat kernel[mSize];\nvec3 final_colour = vec3(0.0);\nfloat sigma = 7.0;\nfloat z = 0.0;\nfor (int j = 0; j <= kSize; ++j)\n{\nkernel[kSize+j] = kernel[kSize-j] = normpdf(float(j),sigma);\n}\nfor (int j = 0; j < mSize; ++j)\n{\nz += kernel[j];\n}\nfor (int i = -kSize; i <= kSize; ++i)\n{\nfor (int j = -kSize; j <= kSize; ++j)\n{\nfinal_colour += kernel[kSize+j]*kernel[kSize+i]*texture2D(uSampler, (gl_FragCoord.xy+vec2(float(i),float(j))) / vec2(screenWidth, screenHeight).xy).rgb;\n}\n}\ngl_FragColor = vec4(final_colour/(z*z), 1.0);\n}",i}(egret.CustomFilter);t.GaussianBlurEffect=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,e.vertSrc,e.fragmentSrc)||this}return __extends(e,t),e.vertSrc="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",e.fragmentSrc="precision lowp float;\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n#define SAMPLE_COUNT 15\nuniform vec2 _sampleOffsets[SAMPLE_COUNT];\nuniform float _sampleWeights[SAMPLE_COUNT];\nvoid main(void) {\nvec4 c = vec4(0, 0, 0, 0);\nfor( int i = 0; i < SAMPLE_COUNT; i++ )\n c += texture2D( uSampler, vTextureCoord + _sampleOffsets[i] ) * _sampleWeights[i];\ngl_FragColor = c;\n}",e}(egret.CustomFilter);t.PolygonLightEffect=e}(es||(es={})),function(t){var e=function(){function e(t){void 0===t&&(t=null),this.enabled=!0,this.effect=t}return e.prototype.onAddedToScene=function(e){this.scene=e,this.shape=new egret.Shape,this.shape.graphics.beginFill(16777215,1),this.shape.graphics.drawRect(0,0,t.Core.graphicsDevice.viewport.width,t.Core.graphicsDevice.viewport.height),this.shape.graphics.endFill(),e.addChild(this.shape)},e.prototype.process=function(){this.drawFullscreenQuad()},e.prototype.onSceneBackBufferSizeChanged=function(t,e){},e.prototype.unload=function(){this.effect&&(this.effect=null),this.scene.removeChild(this.shape),this.scene=null},e.prototype.drawFullscreenQuad=function(){this.scene.filters=[this.effect]},e.default_vert="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\ngl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\nvTextureCoord = aTextureCoord;\nvColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}",e}();t.PostProcessor=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.prototype.onAddedToScene=function(i){e.prototype.onAddedToScene.call(this,i),this.effect=new t.GaussianBlurEffect},i}(t.PostProcessor);t.GaussianBlurPostProcessor=e}(es||(es={})),function(t){var e=function(){function t(t,e){void 0===e&&(e=null),this.renderOrder=0,this.shouldDebugRender=!0,this.camera=e,this.renderOrder=t}return Object.defineProperty(t.prototype,"wantsToRenderToSceneRenderTarget",{get:function(){return!!this.renderTexture},enumerable:!0,configurable:!0}),t.prototype.onAddedToScene=function(t){},t.prototype.unload=function(){},t.prototype.onSceneBackBufferSizeChanged=function(t,e){},t.prototype.compareTo=function(t){return this.renderOrder-t.renderOrder},t.prototype.beginRender=function(t){},t.prototype.renderAfterStateCheck=function(t,e){t.render(e)},t.prototype.debugRender=function(t,e){for(var i=0;ii?i:t},e.pointOnCirlce=function(i,n,r){var o=e.toRadians(r);return new t.Vector2(Math.cos(o)*o+i.x,Math.sin(o)*o+i.y)},e.isEven=function(t){return t%2==0},e.clamp01=function(t){return t<0?0:t>1?1:t},e.angleBetweenVectors=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e.incrementWithWrap=function(t,e){return++t==e?0:t},e.approach=function(t,e,i){return tn&&(n=s.x),s.yr&&(r=s.y)}return this.fromMinMax(e,i,n,r)},i.prototype.intersects=function(t){return t.leftthis.x+this.width)return!1}else{var n=1/t.direction.x,r=(this.x-t.start.x)*n,o=(this.x+this.width-t.start.x)*n;if(r>o){var s=r;r=o,o=s}if(e.value=Math.max(r,e.value),i=Math.min(o,i),e.value>i)return!1}if(Math.abs(t.direction.y)<1e-6){if(t.start.ythis.y+this.height)return!1}else{var a=1/t.direction.y,h=(this.y-t.start.y)*a,c=(this.y+this.height-t.start.y)*a;if(h>c){var l=h;h=c,c=l}if(e.value=Math.max(h,e.value),i=Math.max(c,i),e.value>i)return!1}return!0},i.prototype.containsRect=function(t){return this.x<=t.x&&t.x1)return!1;var l=(h.x*o.y-h.y*o.x)/a;return!(l<0||l>1)},i.lineToLineIntersection=function(e,i,n,r){var o=new t.Vector2(0,0),s=t.Vector2.subtract(i,e),a=t.Vector2.subtract(r,n),h=s.x*a.y-s.y*a.x;if(0==h)return o;var c=t.Vector2.subtract(n,e),l=(c.x*a.y-c.y*a.x)/h;if(l<0||l>1)return o;var u=(c.x*s.y-c.y*s.x)/h;return u<0||u>1?o:o=t.Vector2.add(e,new t.Vector2(l*s.x,l*s.y))},i.closestPointOnLine=function(e,i,n){var r=t.Vector2.subtract(i,e),o=t.Vector2.subtract(n,e),s=t.Vector2.dot(o,r)/t.Vector2.dot(r,r);return s=t.MathHelper.clamp(s,0,1),t.Vector2.add(e,new t.Vector2(r.x*s,r.y*s))},i.circleToCircle=function(e,i,n,r){return t.Vector2.distanceSquared(e,n)<(i+r)*(i+r)},i.circleToLine=function(e,i,n,r){return t.Vector2.distanceSquared(e,this.closestPointOnLine(n,r,e))=t&&r.y>=e&&r.x=t+n&&(s|=e.right),o.y=i+r&&(s|=e.bottom),s},i}();t.Collisions=i}(es||(es={})),function(t){var e=function(){function e(e,i,n,r,o){this.fraction=0,this.distance=0,this.point=t.Vector2.zero,this.normal=t.Vector2.zero,this.collider=e,this.fraction=i,this.distance=n,this.point=r,this.centroid=t.Vector2.zero}return e.prototype.setValues=function(t,e,i,n){this.collider=t,this.fraction=e,this.distance=i,this.point=n},e.prototype.setValuesNonCollider=function(t,e,i,n){this.fraction=t,this.distance=e,this.point=i,this.normal=n},e.prototype.reset=function(){this.collider=null,this.fraction=this.distance=0},e.prototype.toString=function(){return"[RaycastHit] fraction: "+this.fraction+", distance: "+this.distance+", normal: "+this.normal+", centroid: "+this.centroid+", point: "+this.point},e}();t.RaycastHit=e}(es||(es={})),function(t){var e=function(){function e(){}return e.reset=function(){this._spatialHash=new t.SpatialHash(this.spatialHashCellSize)},e.clear=function(){this._spatialHash.clear()},e.overlapCircleAll=function(t,e,i,n){if(void 0===n&&(n=-1),0!=i.length)return this._spatialHash.overlapCircle(t,e,i,n);console.error("An empty results array was passed in. No results will ever be returned.")},e.boxcastBroadphase=function(t,e){return void 0===e&&(e=this.allLayers),this._spatialHash.aabbBroadphase(t,null,e)},e.boxcastBroadphaseExcludingSelf=function(t,e,i){return void 0===i&&(i=this.allLayers),this._spatialHash.aabbBroadphase(e,t,i)},e.addCollider=function(t){e._spatialHash.register(t)},e.removeCollider=function(t){e._spatialHash.remove(t)},e.updateCollider=function(t){this._spatialHash.remove(t),this._spatialHash.register(t)},e.linecast=function(t,i,n){return void 0===n&&(n=e.allLayers),this._hitArray[0].reset(),this.linecastAll(t,i,this._hitArray,n),this._hitArray[0]},e.linecastAll=function(t,i,n,r){return void 0===r&&(r=e.allLayers),0==n.length?(console.warn("传入了一个空的hits数组。没有点击会被返回"),0):this._spatialHash.linecast(t,i,n,r)},e.debugDraw=function(t){this._spatialHash.debugDraw(t,2)},e.spatialHashCellSize=100,e.allLayers=-1,e.raycastsHitTriggers=!1,e.raycastsStartInColliders=!1,e._hitArray=[new t.RaycastHit],e}();t.Physics=e}(es||(es={})),function(t){var e=function(){return function(e,i){this.start=e,this.end=i,this.direction=t.Vector2.subtract(this.end,this.start)}}();t.Ray2D=e}(es||(es={})),function(t){var e=function(){return function(){}}();t.Shape=e}(es||(es={})),function(t){var e=function(e){function i(t,i){var n=e.call(this)||this;return n._areEdgeNormalsDirty=!0,n.isUnrotated=!0,n.setPoints(t),n.isBox=i,n}return __extends(i,e),Object.defineProperty(i.prototype,"edgeNormals",{get:function(){return this._areEdgeNormalsDirty&&this.buildEdgeNormals(),this._edgeNormals},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t){this.points=t,this.recalculateCenterAndEdgeNormals(),this._originalPoints=[];for(var e=0;e=this.points.length?this.points[0]:this.points[n+1];var o=t.Vector2Ext.perpendicular(r,e);t.Vector2Ext.normalize(o),this._edgeNormals[n]=o}},i.buildSymmetricalPolygon=function(e,i){for(var n=new Array(e),r=0;rr&&(r=s,n=o)}return e[n]},i.getClosestPointOnPolygonToPoint=function(e,i,n,r){n.value=Number.MAX_VALUE,r.x=0,r.y=0;for(var o=new t.Vector2(0,0),s=0,a=0;at.y!=this.points[n].y>t.y&&t.x<(this.points[n].x-this.points[i].x)*(t.y-this.points[i].y)/(this.points[n].y-this.points[i].y)+this.points[i].x&&(e=!e);return e},i.prototype.pointCollidesWithShape=function(e,i){return t.ShapeCollisions.pointToPoly(e,this,i)},i}(t.Shape);t.Polygon=e}(es||(es={})),function(t){var e=function(e){function i(t,n){var r=e.call(this,i.buildBox(t,n),!0)||this;return r.width=t,r.height=n,r}return __extends(i,e),i.buildBox=function(e,i){var n=e/2,r=i/2,o=new Array(4);return o[0]=new t.Vector2(-n,-r),o[1]=new t.Vector2(n,-r),o[2]=new t.Vector2(n,r),o[3]=new t.Vector2(-n,r),o},i.prototype.updateBox=function(e,i){this.width=e,this.height=i;var n=e/2,r=i/2;this.points[0]=new t.Vector2(-n,-r),this.points[1]=new t.Vector2(n,-r),this.points[2]=new t.Vector2(n,r),this.points[3]=new t.Vector2(-n,r);for(var o=0;o1)return!1;var a,h=t.Vector2.add(s.start,t.Vector2.add(s.direction,new t.Vector2(r.value))),c=0;h.xi.bounds.right&&(c|=1),h.yi.bounds.bottom&&(c|=2);var l=a+c;return 3==l&&console.log("m == 3. corner "+t.Time.frameCount),!0},e}();t.RealtimeCollisions=e}(es||(es={})),function(t){var e=function(){function e(){}return e.polygonToPolygon=function(e,i,n){for(var r,o=!0,s=e.edgeNormals,a=i.edgeNormals,h=Number.POSITIVE_INFINITY,c=new t.Vector2,l=t.Vector2.subtract(e.position,i.position),u=0;u0&&(o=!1),!o)return!1;(y=Math.abs(y))r&&(r=o);return{min:n,max:r}},e.circleToPolygon=function(e,i,n){var r,o=t.Vector2.subtract(e.position,i.position),s=new t.Ref(0),a=t.Polygon.getClosestPointOnPolygonToPoint(i.points,o,s,n.normal),h=i.containsPoint(e.position);if(s.value>e.radius*e.radius&&!h)return!1;if(h)r=t.Vector2.multiply(n.normal,new t.Vector2(Math.sqrt(s.value)-e.radius));else if(0==s.value)r=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else{var c=Math.sqrt(s.value);r=t.Vector2.multiply(new t.Vector2(-t.Vector2.subtract(o,a)),new t.Vector2((e.radius-s.value)/c))}return n.minimumTranslationVector=r,n.point=t.Vector2.add(a,i.position),!0},e.circleToBox=function(e,i,n){var r=i.bounds.getClosestPointOnRectangleBorderToPoint(e.position,n.normal);if(i.containsPoint(e.position)){n.point=r;var o=t.Vector2.add(r,t.Vector2.multiply(n.normal,new t.Vector2(e.radius)));return n.minimumTranslationVector=t.Vector2.subtract(e.position,o),!0}var s=t.Vector2.distanceSquared(r,e.position);if(0==s)n.minimumTranslationVector=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else if(s<=e.radius*e.radius){n.normal=t.Vector2.subtract(e.position,r);var a=n.normal.length()-e.radius;return n.point=r,t.Vector2Ext.normalize(n.normal),n.minimumTranslationVector=t.Vector2.multiply(new t.Vector2(a),n.normal),!0}return!1},e.pointToCircle=function(e,i,n){var r=t.Vector2.distanceSquared(e,i.position),o=1+i.radius;if(r1)return!1;var u=(c.x*s.y-c.y*s.x)/h;return!(u<0||u>1)&&(o=o.add(e).add(t.Vector2.multiply(new t.Vector2(l),s)),!0)},e.lineToCircle=function(e,i,n,r){var o=t.Vector2.distance(e,i),s=t.Vector2.divide(t.Vector2.subtract(i,e),new t.Vector2(o)),a=t.Vector2.subtract(e,n.position),h=t.Vector2.dot(a,s),c=t.Vector2.dot(a,a)-n.radius*n.radius;if(c>0&&h>0)return!1;var l=h*h-c;return!(l<0)&&(r.fraction=-h-Math.sqrt(l),r.fraction<0&&(r.fraction=0),r.point=t.Vector2.add(e,t.Vector2.multiply(new t.Vector2(r.fraction),s)),r.distance=t.Vector2.distance(e,r.point),r.normal=t.Vector2.normalize(t.Vector2.subtract(r.point,n.position)),r.fraction=r.distance/o,!0)},e.boxToBoxCast=function(e,i,n,r){var o=this.minkowskiDifference(e,i);if(o.contains(0,0)){var s=o.getClosestPointOnBoundsToOrigin();return!s.equals(t.Vector2.zero)&&(r.normal=new t.Vector2(-s.x),r.normal.normalize(),r.distance=0,r.fraction=0,!0)}var a=new t.Ray2D(t.Vector2.zero,new t.Vector2(-n.x)),h=new t.Ref(0);return!!(o.rayIntersects(a,h)&&h.value<=1)&&(r.fraction=h.value,r.distance=n.length()*h.value,r.normal=new t.Vector2(-n.x,-n.y),r.normal.normalize(),r.centroid=t.Vector2.add(e.bounds.center,t.Vector2.multiply(n,new t.Vector2(h.value))),!0)},e}();t.ShapeCollisions=e}(es||(es={})),function(t){var e=function(){function e(e){void 0===e&&(e=100),this.gridBounds=new t.Rectangle,this._overlapTestCircle=new t.Circle(0),this._cellDict=new i,this._tempHashSet=[],this._cellSize=e,this._inverseCellSize=1/this._cellSize,this._raycastParser=new n}return e.prototype.register=function(e){var i=e.bounds;e.registeredPhysicsBounds=i;var n=this.cellCoords(i.x,i.y),r=this.cellCoords(i.right,i.bottom);this.gridBounds.contains(n.x,n.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,n)),this.gridBounds.contains(r.x,r.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,r));for(var o=n.x;o<=r.x;o++)for(var s=n.y;s<=r.y;s++){var a=this.cellAtPosition(o,s,!0);a.firstOrDefault(function(t){return t.hashCode==e.hashCode})||a.push(e)}},e.prototype.remove=function(t){for(var e=t.registeredPhysicsBounds,i=this.cellCoords(e.x,e.y),n=this.cellCoords(e.right,e.bottom),r=i.x;r<=n.x;r++)for(var o=i.y;o<=n.y;o++){var s=this.cellAtPosition(r,o);s?s.remove(t):console.log("从不存在碰撞器的单元格中移除碰撞器: ["+t+"]")}},e.prototype.removeWithBruteForce=function(t){this._cellDict.remove(t)},e.prototype.clear=function(){this._cellDict.clear()},e.prototype.debugDraw=function(t,e){void 0===e&&(e=1);for(var i=this.gridBounds.x;i<=this.gridBounds.right;i++)for(var n=this.gridBounds.y;n<=this.gridBounds.bottom;n++){var r=this.cellAtPosition(i,n);r&&r.length>0&&this.debugDrawCellDetails(i,n,r.length,t,e)}},e.prototype.aabbBroadphase=function(e,i,n){this._tempHashSet.length=0;for(var r=this.cellCoords(e.x,e.y),o=this.cellCoords(e.right,e.bottom),s=r.x;s<=o.x;s++)for(var a=r.y;a<=o.y;a++){var h=this.cellAtPosition(s,a);if(h)for(var c=function(r){var o=h[r];if(o==i||!t.Flags.isFlagSet(n,o.physicsLayer.value))return"continue";e.intersects(o.bounds)&&(l._tempHashSet.firstOrDefault(function(t){return t.hashCode==o.hashCode})||l._tempHashSet.push(o))},l=this,u=0;u=0&&(e.push(this.findBoundsRect(i,o,r,t)),i=-1)}i>=0&&(e.push(this.findBoundsRect(i,this.map.width,r,t)),i=-1)}return e},e.prototype.findBoundsRect=function(e,i,n,r){for(var o=-1,s=n+1;sthis.tileHeight||this.maxTileWidth>this.tileWidth},enumerable:!0,configurable:!0}),i.prototype.getTilesetForTileGid=function(t){if(0==t)return null;for(var e=this.tilesets.length-1;e>=0;e--)if(this.tilesets[e].firstGid<=t)return this.tilesets[e];console.error("tile gid"+t+"未在任何tileset中找到")},i.prototype.worldToTilePositionX=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileWidth);return i?t.MathHelper.clamp(n,0,this.width-1):n},i.prototype.worldToTilePositionY=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileHeight);return i?t.MathHelper.clamp(n,0,this.height-1):n},i.prototype.getLayer=function(t){return this.layers[t]},i.prototype.update=function(){this.tilesets.forEach(function(t){t.update()})},i.prototype.dispose=function(t){void 0===t&&(t=!0),this._isDisposed||(t&&(this.tilesets.forEach(function(t){t.image&&t.image.dispose()}),this.imageLayers.forEach(function(t){t.image&&t.image.dispose()})),this._isDisposed=!0)},i}(t.TmxDocument);t.TmxMap=e,function(t){t[t.unknown=0]="unknown",t[t.orthogonal=1]="orthogonal",t[t.isometric=2]="isometric",t[t.staggered=3]="staggered",t[t.hexagonal=4]="hexagonal"}(t.OrientationType||(t.OrientationType={})),function(t){t[t.x=0]="x",t[t.y=1]="y"}(t.StaggerAxisType||(t.StaggerAxisType={})),function(t){t[t.odd=0]="odd",t[t.even=1]="even"}(t.StaggerIndexType||(t.StaggerIndexType={})),function(t){t[t.rightDown=0]="rightDown",t[t.rightUp=1]="rightUp",t[t.leftDown=2]="leftDown",t[t.leftUp=3]="leftUp"}(t.RenderOrderType||(t.RenderOrderType={}))}(es||(es={})),function(t){var e=function(){return function(){}}();t.TmxObjectGroup=e;var i=function(){return function(){this.shape=new egret.Shape,this.textField=new egret.TextField}}();t.TmxObject=i;var n=function(){return function(){}}();t.TmxText=n;var r=function(){return function(){}}();t.TmxAlignment=r,function(t){t[t.basic=0]="basic",t[t.point=1]="point",t[t.tile=2]="tile",t[t.ellipse=3]="ellipse",t[t.polygon=4]="polygon",t[t.polyline=5]="polyline",t[t.text=6]="text"}(t.TmxObjectType||(t.TmxObjectType={})),function(t){t[t.unkownOrder=-1]="unkownOrder",t[t.TopDown=0]="TopDown",t[t.IndexOrder=1]="IndexOrder"}(t.DrawOrderType||(t.DrawOrderType={})),function(t){t[t.left=0]="left",t[t.center=1]="center",t[t.right=2]="right",t[t.justify=3]="justify"}(t.TmxHorizontalAlignment||(t.TmxHorizontalAlignment={})),function(t){t[t.top=0]="top",t[t.center=1]="center",t[t.bottom=2]="bottom"}(t.TmxVerticalAlignment||(t.TmxVerticalAlignment={}))}(es||(es={})),function(t){var e=function(){function e(){}return e.loadTmxMap=function(t,e){var i=RES.getRes(e);return this.loadTmxMapData(t,i,RES.getResourceInfo(e))},e.loadTmxMapData=function(e,i,n){return __awaiter(this,void 0,void 0,function(){var r,o,s,a;return __generator(this,function(h){switch(h.label){case 0:e.version=i.version,e.tiledVersion=i.tiledversion,e.width=i.width,e.height=i.height,e.tileWidth=i.tilewidth,e.tileHeight=i.tileheight,e.hexSideLength=i.hexsidelength,e.orientation=this.parseOrientationType(i.orientation),e.staggerAxis=this.parseStaggerAxisType(i.staggeraxis),e.staggerIndex=this.parseStaggerIndexType(i.staggerindex),e.renderOrder=this.parseRenderOrderType(i.renderorder),e.nextObjectID=i.nextobjectid,e.backgroundColor=t.TmxUtils.color16ToUnit(i.color),e.properties=this.parsePropertyDict(i.properties),e.maxTileWidth=e.tileWidth,e.maxTileHeight=e.tileHeight,e.tmxDirectory=n.root+n.url.replace(".","_").replace(n.name,""),e.tilesets=[],r=0,o=i.tilesets,h.label=1;case 1:return rt.map.maxTileWidth&&(t.map.maxTileWidth=e.image.width),e.image.height>t.map.maxTileHeight&&(t.map.maxTileHeight=e.image.height))}),t.tileRegions.forEach(function(e){var i=e.width,n=e.height;i>t.map.maxTileWidth&&(t.map.maxTileWidth=i),i>t.map.maxTileHeight&&(t.map.maxTileHeight=n)})},e.parseOrientationType=function(e){return"unknown"==e?t.OrientationType.unknown:"orthogonal"==e?t.OrientationType.orthogonal:"isometric"==e?t.OrientationType.isometric:"staggered"==e?t.OrientationType.staggered:"hexagonal"==e?t.OrientationType.hexagonal:t.OrientationType.unknown},e.parseStaggerAxisType=function(e){return"y"==e?t.StaggerAxisType.y:t.StaggerAxisType.x},e.parseStaggerIndexType=function(e){return"even"==e?t.StaggerIndexType.even:t.StaggerIndexType.odd},e.parseRenderOrderType=function(e){return"right-up"==e?t.RenderOrderType.rightUp:"left-down"==e?t.RenderOrderType.leftDown:"left-up"==e?t.RenderOrderType.leftUp:t.RenderOrderType.rightDown},e.parsePropertyDict=function(e){if(!e)return null;for(var i=new Map,n=0,r=e;n=e.columns));m+=e.tileWidth+e.spacing);else e.tiles.forEach(function(i,n){e.tileRegions.set(n,new t.Rectangle(0,0,i.image.width,i.image.height))});return[2,e]}})})},e.loadTmxTilesetTile=function(e,i,n,r,o){return __awaiter(this,void 0,void 0,function(){var s,a,h,c,l,u,p,d,f,g,y,m,_;return __generator(this,function(v){switch(v.label){case 0:if(e.tileset=i,e.id=n.id,s=n.terrain)for(e.terrainEdges=new Array(4),a=0,h=0,c=s;h0){a.shape.x=h.x,a.shape.y=h.y,i.addChild(a.shape),a.shape.graphics.clear(),a.shape.graphics.lineStyle(1,10526884);for(u=0;u0&&(l=u.currentAnimationFrameGid);var p=i.tileset.tileRegions.get(l),d=Math.floor(i.x)*s,f=Math.floor(i.y)*a;i.horizontalFlip&&i.verticalFlip?(d+=a+(p.height*o.y-a),f-=p.width*o.x-s):i.horizontalFlip?d+=s+(p.height*o.y-a):i.verticalFlip?f+=s-p.width*o.x:f+=a-p.height*o.y;var g=new t.Vector2(d,f).add(r);if(i.tileset.image){if(n){var y=i.tileset.image.bitmap.getTexture(""+l);y||(y=i.tileset.image.bitmap.createTexture(""+l,p.x,p.y,p.width,p.height)),i.tileset.image.texture=new e(y),n.addChild(i.tileset.image.texture),i.tileset.image.texture.x!=g.x&&(i.tileset.image.texture.x=g.x),i.tileset.image.texture.y!=g.y&&(i.tileset.image.texture.y=g.y),i.verticalFlip&&i.horizontalFlip?(i.tileset.image.texture.scaleX=-1,i.tileset.image.texture.scaleY=-1):i.verticalFlip?(i.tileset.image.texture.scaleX=o.x,i.tileset.image.texture.scaleY=-1):i.horizontalFlip?(i.tileset.image.texture.scaleX=-1,i.tileset.image.texture.scaleY=o.y):(i.tileset.image.texture.scaleX=o.x,i.tileset.image.texture.scaleY=o.y),0!=i.tileset.image.texture.rotation&&(i.tileset.image.texture.rotation=0),0!=i.tileset.image.texture.anchorOffsetX&&(i.tileset.image.texture.anchorOffsetX=0),0!=i.tileset.image.texture.anchorOffsetY&&(i.tileset.image.texture.anchorOffsetY=0)}}else u.image.texture&&(u.image.bitmap.getTexture(l.toString())||(u.image.texture=new e(u.image.bitmap.createTexture(l.toString(),p.x,p.y,p.width,p.height)),n.addChild(u.image.texture)),u.image.texture.x=g.x,u.image.texture.y=g.y,u.image.texture.scaleX=o.x,u.image.texture.scaleY=o.y,u.image.texture.rotation=0,u.image.texture.anchorOffsetX=0,u.image.texture.anchorOffsetY=0,u.image.texture.filters=[h])},i}();t.TiledRendering=i}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.update=function(){this.tiles.forEach(function(t){t.updateAnimatedTiles()})},e}(t.TmxDocument);t.TmxTileset=e;var i=function(){return function(){}}();t.TmxTileOffset=i;var n=function(){return function(){}}();t.TmxTerrain=n}(es||(es={})),function(t){var e=function(){function e(){}return Object.defineProperty(e.prototype,"currentAnimationFrameGid",{get:function(){return this.animationFrames[this._animationCurrentFrame].gid+this.tileset.firstGid},enumerable:!0,configurable:!0}),e.prototype.processProperties=function(){var t;(t=this.properties.get("engine.isDestructable"))&&(this.isDestructable=Boolean(t)),(t=this.properties.get("engine:isSlope"))&&(this.isSlope=Boolean(t)),(t=this.properties.get("engine:isOneWayPlatform"))&&(this.isOneWayPlatform=Boolean(t)),(t=this.properties.get("engine:slopeTopLeft"))&&(this.slopeTopLeft=Number(t)),(t=this.properties.get("engine:slopeTopRight"))&&(this.slopeTopRight=Number(t))},e.prototype.updateAnimatedTiles=function(){0!=this.animationFrames.length&&(this._animationElapsedTime+=t.Time.deltaTime,this._animationElapsedTime>this.animationFrames[this._animationCurrentFrame].duration&&(this._animationCurrentFrame=t.MathHelper.incrementWithWrap(this._animationCurrentFrame,this.animationFrames.length),this._animationElapsedTime=0))},e}();t.TmxTilesetTile=e;var i=function(){return function(){}}();t.TmxAnimationFrame=i}(es||(es={})),function(t){var e=function(){function e(){}return e.decode=function(e,i,n){switch(n=n||"none",i=i||"none"){case"base64":var r=t.Base64Utils.decodeBase64AsArray(e,4);return"none"===n?r:t.Base64Utils.decompress(e,r,n);case"csv":return t.Base64Utils.decodeCSV(e);case"none":for(var o=[],s=0;si;n--)if(t[n]0&&t[r-1]>n;r--)t[r]=t[r-1];t[r]=n}},t.binarySearch=function(t,e){for(var i=0,n=t.length,r=i+n>>1;i=t[r]&&(i=r+1),r=i+n>>1;return t[i]==e?i:-1},t.findElementIndex=function(t,e){for(var i=t.length,n=0;nt[e]&&(e=n);return e},t.getMinElementIndex=function(t){for(var e=0,i=t.length,n=1;n=0;--r)i.unshift(e[r]);return i},t.getDifferAry=function(t,e){t=this.getUniqueAry(t),e=this.getUniqueAry(e);for(var i=t.concat(e),n={},r=[],o=i.length,s=0;s=0;e-=1)t.splice(e,1)},t.cloneList=function(t){return t?t.slice(0,t.length):null},t.equals=function(t,e){if(t==e)return!0;var i=t.length;if(i!=e.length)return!1;for(;i--;)if(t[i]!=e[i])return!1;return!0},t.insert=function(t,e,i){if(!t)return null;var n=t.length;if(e>n&&(e=n),e<0&&(e=0),e==n)t.push(i);else if(0==e)t.unshift(i);else{for(var r=n-1;r>=e;r-=1)t[r+1]=t[r];t[e]=i}return i},t}();!function(t){var e=function(){function t(){}return Object.defineProperty(t,"nativeBase64",{get:function(){return"function"==typeof window.atob},enumerable:!0,configurable:!0}),t.decode=function(t){if(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),this.nativeBase64)return window.atob(t);for(var e,i,n,r,o,s,a=[],h=0;h>4,i=(15&r)<<4|(o=this._keyStr.indexOf(t.charAt(h++)))>>2,n=(3&o)<<6|(s=this._keyStr.indexOf(t.charAt(h++))),a.push(String.fromCharCode(e)),64!==o&&a.push(String.fromCharCode(i)),64!==s&&a.push(String.fromCharCode(n));return a=a.join("")},t.encode=function(t){if(t=t.replace(/\r\n/g,"\n"),!this.nativeBase64){for(var e,i,n,r,o,s,a,h=[],c=0;c>2,o=(3&e)<<4|(i=t.charCodeAt(c++))>>4,s=(15&i)<<2|(n=t.charCodeAt(c++))>>6,a=63&n,isNaN(i)?s=a=64:isNaN(n)&&(a=64),h.push(this._keyStr.charAt(r)),h.push(this._keyStr.charAt(o)),h.push(this._keyStr.charAt(s)),h.push(this._keyStr.charAt(a));return h=h.join("")}window.btoa(t)},t.decodeBase64AsArray=function(e,i){i=i||1;var n,r,o,s=t.decode(e),a=new Uint32Array(s.length/i);for(n=0,o=s.length/i;n=0;--r)a[n]+=s.charCodeAt(n*i+r)<<(r<<3);return a},t.decompress=function(t,e,i){throw new Error("GZIP/ZLIB compressed TMX Tile Map not supported!")},t.decodeCSV=function(t){for(var e=t.replace("\n","").trim().split(","),i=[],n=0;n>16},set:function(t){this._packedValue=4278255615&this._packedValue|t<<16},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._packedValue>>8},set:function(t){this._packedValue=4294902015&this._packedValue|t<<8},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"r",{get:function(){return this._packedValue},set:function(t){this._packedValue=4294967040&this._packedValue|t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._packedValue>>24},set:function(t){this._packedValue=16777215&this._packedValue|t<<24},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"packedValue",{get:function(){return this._packedValue},set:function(t){this._packedValue=t},enumerable:!0,configurable:!0}),e.prototype.equals=function(t){return this._packedValue==t._packedValue},e}();t.Color=e}(es||(es={})),function(t){var e=function(){function t(){this.loadedAssets=new Map}return t.prototype.loadRes=function(t,e){var i=this;return void 0===e&&(e=!0),new Promise(function(n,r){var o=i.loadedAssets.get(t);o?n(o):e?RES.getResAsync(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)}):RES.getResByUrl(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)})})},t.prototype.dispose=function(){this.loadedAssets.forEach(function(t){var e=t;RES.destroyRes(e)&&e.dispose()}),this.loadedAssets.clear()},t}();t.ContentManager=e}(es||(es={})),function(t){var e=function(){function t(){}return t.getColorMatrix=function(t){var e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];return e[0]=Math.floor(t/256/256)/255,e[6]=Math.floor(t/256%256)/255,e[12]=t%256/255,new egret.ColorMatrixFilter(e)},t}();t.DrawUtils=e}(es||(es={})),function(t){var e=function(){function e(){}return e.oppositeEdge=function(e){switch(e){case t.Edge.bottom:return t.Edge.top;case t.Edge.top:return t.Edge.bottom;case t.Edge.left:return t.Edge.right;case t.Edge.right:return t.Edge.left}},e.isHorizontal=function(e){return e==t.Edge.right||e==t.Edge.left},e.isVertical=function(e){return e==t.Edge.top||e==t.Edge.bottom},e}();t.EdgeExt=e}(es||(es={})),function(t){var e=function(){return function(t,e){this.func=t,this.context=e}}();t.FuncPack=e;var i=function(){function t(){this._messageTable=new Map}return t.prototype.addObserver=function(t,i,n){var r=this._messageTable.get(t);r||(r=[],this._messageTable.set(t,r)),-1!=r.findIndex(function(t){return t.func==i})&&console.warn("您试图添加相同的观察者两次"),r.push(new e(i,n))},t.prototype.removeObserver=function(t,e){var i=this._messageTable.get(t),n=i.findIndex(function(t){return t.func==e});-1!=n&&i.removeAt(n)},t.prototype.emit=function(t,e){var i=this._messageTable.get(t);if(i)for(var n=i.length-1;n>=0;n--)i[n].func.call(i[n].context,e)},t}();t.Emitter=i}(es||(es={})),function(t){!function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.left=2]="left",t[t.right=3]="right"}(t.Edge||(t.Edge={}))}(es||(es={})),function(t){var e=function(){function t(){}return t.repeat=function(t,e){for(var i=[];e--;)i.push(t);return i},t}();t.Enumerable=e}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),t.prototype.setEnabled=function(t){this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled())},t.prototype.onEnabled=function(){},t.prototype.onDisabled=function(){},t.prototype.update=function(){},t}();t.GlobalManager=e}(es||(es={})),function(t){var e=function(){function t(){}return t.warmCache=function(t){if((t-=this._objectQueue.length)>0)for(var e=0;ethis._objectQueue.length;)this._objectQueue.shift()},t.clearCache=function(){this._objectQueue.length=0},t.obtain=function(){return this._objectQueue.length>0?this._objectQueue.shift():[]},t.free=function(t){this._objectQueue.unshift(t),t.length=0},t._objectQueue=[],t}();t.ListPool=e}(es||(es={})),function(t){var e=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.clear=function(){this.first=this.second=null},t.prototype.equals=function(t){return this.first==t.first&&this.second==t.second},t}();t.Pair=e}(es||(es={}));var RandomUtils=function(){function t(){}return t.randrange=function(t,e,i){if(void 0===i&&(i=1),0==i)throw new Error("step 不能为 0");var n=e-t;if(0==n)throw new Error("没有可用的范围("+t+","+e+")");n<0&&(n=t-e);var r=Math.floor((n+i-1)/i);return Math.floor(this.random()*r)*i+Math.min(t,e)},t.randint=function(t,e){return(t=Math.floor(t))>(e=Math.floor(e))?t++:e++,this.randrange(t,e)},t.randnum=function(t,e){return this.random()*(e-t)+t},t.shuffle=function(t){return t.sort(this._randomCompare),t},t.choice=function(t){if(!t.hasOwnProperty("length"))throw new Error("无法对此对象执行此操作");var e=Math.floor(this.random()*t.length);return t instanceof String?String(t).charAt(e):t[e]},t.sample=function(t,e){var i=t.length;if(e<=0||i=0;)s=Math.floor(this.random()*i);n.push(t[s]),r.push(s)}return n},t.random=function(){return Math.random()},t.boolean=function(t){return void 0===t&&(t=.5),this.random().5?1:-1},t}();!function(t){var e=function(){function e(){}return e.getSide=function(e,i){switch(i){case t.Edge.top:return e.top;case t.Edge.bottom:return e.bottom;case t.Edge.left:return e.left;case t.Edge.right:return e.right}},e.union=function(e,i){var n=new t.Rectangle(i.x,i.y,0,0),r=new t.Rectangle;return r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.width=Math.max(e.right,n.right)-r.x,r.height=Math.max(e.bottom,r.bottom)-r.y,r},e.getHalfRect=function(e,i){switch(i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,e.height/2);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height/2,e.width,e.height/2);case t.Edge.left:return new t.Rectangle(e.x,e.y,e.width/2,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width/2,e.y,e.width/2,e.height)}},e.getRectEdgePortion=function(e,i,n){switch(void 0===n&&(n=1),i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,n);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height-n,e.width,n);case t.Edge.left:return new t.Rectangle(e.x,e.y,n,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width-n,e.y,n,e.height)}},e.expandSide=function(e,i,n){switch(n=Math.abs(n),i){case t.Edge.top:e.y-=n,e.height+=n;break;case t.Edge.bottom:e.height+=n;break;case t.Edge.left:e.x-=n,e.width+=n;break;case t.Edge.right:e.width+=n}},e.contract=function(t,e,i){t.x+=e,t.y+=i,t.width-=2*e,t.height-=2*i},e}();t.RectangleExt=e}(es||(es={})),function(t){var e=function(){return function(t){this.value=t}}();t.Ref=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.update=function(t){this.remainder+=t;var e=Math.trunc(this.remainder);return this.remainder-=e,e},t.prototype.reset=function(){this.remainder=0},t}();t.SubpixelNumber=e}(es||(es={})),function(t){var e=function(){function e(){this.triangleIndices=[],this._triPrev=new Array(12),this._triNext=new Array(12)}return e.testPointTriangle=function(e,i,n,r){return!(t.Vector2Ext.cross(t.Vector2.subtract(e,i),t.Vector2.subtract(n,i))<0)&&(!(t.Vector2Ext.cross(t.Vector2.subtract(e,n),t.Vector2.subtract(r,n))<0)&&!(t.Vector2Ext.cross(t.Vector2.subtract(e,r),t.Vector2.subtract(i,r))<0))},e.prototype.triangulate=function(i,n){void 0===n&&(n=!0);var r=i.length;this.initialize(r);for(var o=0,s=0;r>3&&o<500;){o++;var a=!0,h=i[this._triPrev[s]],c=i[s],l=i[this._triNext[s]];if(t.Vector2Ext.isTriangleCCW(h,c,l)){var u=this._triNext[this._triNext[s]];do{if(e.testPointTriangle(i[u],h,c,l)){a=!1;break}u=this._triNext[u]}while(u!=this._triPrev[s])}else a=!1;a?(this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),this._triNext[this._triPrev[s]]=this._triNext[s],this._triPrev[this._triNext[s]]=this._triPrev[s],r--,s=this._triPrev[s]):s=this._triNext[s]}this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),n||this.triangleIndices.reverse()},e.prototype.initialize=function(t){this.triangleIndices.length=0,this._triNext.lengtht.MathHelper.Epsilon?e.divide(new t.Vector2(i)):e.x=e.y=0},e.transformA=function(t,e,i,n,r,o){for(var s=0;sthis.safeArea.right&&(s.x=this.safeArea.right-s.width),s.topthis.safeArea.bottom&&(s.y=this.safeArea.bottom-s.height),s},i}();t.Layout=i,function(t){t[t.none=0]="none",t[t.left=1]="left",t[t.right=2]="right",t[t.horizontalCenter=4]="horizontalCenter",t[t.top=8]="top",t[t.bottom=16]="bottom",t[t.verticalCenter=32]="verticalCenter",t[t.topLeft=9]="topLeft",t[t.topRight=10]="topRight",t[t.topCenter=12]="topCenter",t[t.bottomLeft=17]="bottomLeft",t[t.bottomRight=18]="bottomRight",t[t.bottomCenter=20]="bottomCenter",t[t.centerLeft=33]="centerLeft",t[t.centerRight=34]="centerRight",t[t.center=36]="center"}(e=t.Alignment||(t.Alignment={}))}(es||(es={})),function(t){var e,i=function(){function t(t){void 0===t&&(t=n),this.getSystemTime=t,this._stopDuration=0,this._completeSlices=[]}return t.prototype.getState=function(){return void 0===this._startSystemTime?e.IDLE:void 0===this._stopSystemTime?e.RUNNING:e.STOPPED},t.prototype.isIdle=function(){return this.getState()===e.IDLE},t.prototype.isRunning=function(){return this.getState()===e.RUNNING},t.prototype.isStopped=function(){return this.getState()===e.STOPPED},t.prototype.slice=function(){return this.recordPendingSlice()},t.prototype.getCompletedSlices=function(){return Array.from(this._completeSlices)},t.prototype.getCompletedAndPendingSlices=function(){return this._completeSlices.concat([this.getPendingSlice()])},t.prototype.getPendingSlice=function(){return this.calculatePendingSlice()},t.prototype.getTime=function(){return this.caculateStopwatchTime()},t.prototype.reset=function(){this._startSystemTime=this._pendingSliceStartStopwatchTime=this._stopSystemTime=void 0,this._stopDuration=0,this._completeSlices=[]},t.prototype.start=function(t){if(void 0===t&&(t=!1),t&&this.reset(),void 0!==this._stopSystemTime){var e=(i=this.getSystemTime())-this._stopSystemTime;this._stopDuration+=e,this._stopSystemTime=void 0}else if(void 0===this._startSystemTime){var i=this.getSystemTime();this._startSystemTime=i,this._pendingSliceStartStopwatchTime=0}},t.prototype.stop=function(t){if(void 0===t&&(t=!1),void 0===this._startSystemTime)return 0;var e=this.getSystemTimeOfCurrentStopwatchTime();return t&&this.recordPendingSlice(this.caculateStopwatchTime(e)),this._stopSystemTime=e,this.getTime()},t.prototype.calculatePendingSlice=function(t){return void 0===this._pendingSliceStartStopwatchTime?Object.freeze({startTime:0,endTime:0,duration:0}):(void 0===t&&(t=this.getTime()),Object.freeze({startTime:this._pendingSliceStartStopwatchTime,endTime:t,duration:t-this._pendingSliceStartStopwatchTime}))},t.prototype.caculateStopwatchTime=function(t){return void 0===this._startSystemTime?0:(void 0===t&&(t=this.getSystemTimeOfCurrentStopwatchTime()),t-this._startSystemTime-this._stopDuration)},t.prototype.getSystemTimeOfCurrentStopwatchTime=function(){return void 0===this._stopSystemTime?this.getSystemTime():this._stopSystemTime},t.prototype.recordPendingSlice=function(t){if(void 0!==this._pendingSliceStartStopwatchTime){void 0===t&&(t=this.getTime());var e=this.calculatePendingSlice(t);return this._pendingSliceStartStopwatchTime=e.endTime,this._completeSlices.push(e),e}return this.calculatePendingSlice()},t}();t.Stopwatch=i,function(t){t.IDLE="IDLE",t.RUNNING="RUNNING",t.STOPPED="STOPPED"}(e||(e={})),t.setDefaultSystemTimeGetter=function(t){void 0===t&&(t=Date.now),n=t};var n=Date.now}(stopwatch||(stopwatch={})),function(t){var e=function(){function e(){this.showLog=!1,this.markers=[],this.stopwacth=new stopwatch.Stopwatch,this._markerNameToIdMap=new Map,this._rectShape1=new egret.Shape,this._rectShape2=new egret.Shape,this._rectShape3=new egret.Shape,this._rectShape4=new egret.Shape,this._rectShape5=new egret.Shape,this._rectShape6=new egret.Shape,this._logs=new Array(2);for(var e=0;e=e.logSnapDuration&&(l.logs[n].snapMin=l.logs[n].min,l.logs[n].snapMax=l.logs[n].max,l.logs[n].snapAvg=l.logs[n].avg,l.logs[n].samples=0)):(l.logs[n].min=h,l.logs[n].max=h,l.logs[n].avg=h,l.logs[n].initialized=!0)}o.markCount=r.nestCount,o.nestCount=r.nestCount}this.stopwacth.reset(),this.stopwacth.start()}},e.prototype.beginMark=function(t,i,n){if(void 0===n&&(n=0),n<0||n>=e.maxBars)throw new Error("barIndex argument out of range");var r=this._curLog.bars[n];if(r.markCount>=e.maxSamples)throw new Error("exceeded sample count. either set larger number to timeruler.maxsaple or lower sample count");if(r.nestCount>=e.maxNestCall)throw new Error("exceeded nest count. either set larger number to timeruler.maxnestcall or lower nest calls");var o=this._markerNameToIdMap.get(t);isNaN(o)&&(o=this.markers.length,this._markerNameToIdMap.set(t,o)),r.markerNests[r.nestCount++]=r.markCount,r.markers[r.markCount].markerId=o,r.markers[r.markCount].color=i,r.markers[r.markCount].beginTime=this.stopwacth.getTime(),r.markers[r.markCount].endTime=-1},e.prototype.endMark=function(t,i){if(void 0===i&&(i=0),i<0||i>=e.maxBars)throw new Error("barIndex argument out of range");var n=this._curLog.bars[i];if(n.nestCount<=0)throw new Error("call beginMark method before calling endMark method");var r=this._markerNameToIdMap.get(t);if(isNaN(r))throw new Error("Marker "+t+" is not registered. Make sure you specifed same name as you used for beginMark method");var o=n.markerNests[--n.nestCount];if(n.markers[o].markerId!=r)throw new Error("Incorrect call order of beginMark/endMark method. beginMark(A), beginMark(B), endMark(B), endMark(A) But you can't called it like beginMark(A), beginMark(B), endMark(A), endMark(B).");n.markers[o].endTime=this.stopwacth.getTime()},e.prototype.getAverageTime=function(t,i){if(t<0||t>=e.maxBars)throw new Error("barIndex argument out of range");var n=0,r=this._markerNameToIdMap.get(i);return r&&(n=this.markers[r].logs[t].avg),n},e.prototype.resetLog=function(){this.markers.forEach(function(t){for(var e=0;e0&&(r+=e.barHeight+2*e.barPadding,o=Math.max(o,t.markers[t.markCount-1].endTime))});var s=this.sampleFrames*(1/60*1e3);this._frameAdjust=o>s?Math.max(0,this._frameAdjust)+1:Math.min(0,this._frameAdjust)-1,Math.max(this._frameAdjust)>e.autoAdjustDelay&&(this.sampleFrames=Math.min(e.maxSampleFrames,this.sampleFrames),this.sampleFrames=Math.max(this.targetSampleFrames,o/(1/60*1e3)+1),this._frameAdjust=0);var a=n/s,h=i.y-(r-e.barHeight),c=h,l=new t.Rectangle(i.x,c,n,r);this._rectShape1.graphics.clear(),this._rectShape1.graphics.beginFill(0,128/255),this._rectShape1.graphics.drawRect(l.x,l.y,l.width,l.height),this._rectShape1.graphics.endFill(),l.height=e.barHeight,this._rectShape2.graphics.clear();for(var u=0,p=this._prevLog.bars;u0)for(var f=0;f0&&this.setpreviousTouchState(this._gameTouchs[0]),e},enumerable:!0,configurable:!0}),i.initialize=function(){this._init||(this._init=!0,t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.touchBegin,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.touchMove,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.touchEnd,this),this.initTouchCache())},i.update=function(){KeyboardUtils.update();for(var t=0;t0,this._willRepeat||(this.isRepeating=!1)},i.prototype.update=function(){this._bufferCounter-=t.Time.unscaledDeltaTime,this.isRepeating=!1;for(var e=!1,i=0;i0||this.isRepeating)return!0;for(var t=0,e=this.nodes;ta||i[c].height>a)throw new Error("一个纹理的大小比图集的大小大");h.push(new t.Rectangle(0,0,i[c].width,i[c].height))}for(;h.length>0;){var l=new egret.RenderTexture,u=new t.RectanglePacker(a,a,1);for(c=0;c0){for(var p=new t.IntegerRectangle,d=[],f=[],g=[],y=[],m=0;m0;)this.freeRectangle(this._insertedRectangles.pop());for(;this._freeAreas.length>0;)this.freeRectangle(this._freeAreas.pop());for(this._width=t,this._height=e,this._packedWidth=0,this._packedHeight=0,this._freeAreas.push(this.allocateRectangle(0,0,this._width,this._height));this._insertedRectangles.length>0;)this.freeSize(this._insertList.pop());this._padding=i},e.prototype.insertRectangle=function(t,e,i){var n=this.allocateSize(t,e,i);this._insertList.push(n)},e.prototype.packRectangles=function(t){for(void 0===t&&(t=!0),t&&this._insertList.sort(function(t,e){return t.width-e.width});this._insertList.length>0;){var e=this._insertList.pop(),i=e.width,n=e.height,r=this.getFreeAreaIndex(i,n);if(r>=0){var o=this._freeAreas[r],s=this.allocateRectangle(o.x,o.y,i,n);for(s.id=e.id,this.generateNewFreeAreas(s,this._freeAreas,this._newFreeAreas);this._newFreeAreas.length>0;)this._freeAreas.push(this._newFreeAreas.pop());this._insertedRectangles.push(s),s.right>this._packedWidth&&(this._packedWidth=s.right),s.bottom>this._packedHeight&&(this._packedHeight=s.bottom)}this.freeSize(e)}return this.rectangleCount},e.prototype.getRectangle=function(t,e){var i=this._insertedRectangles[t];return e.x=i.x,e.y=i.y,e.width=i.width,e.height=i.height,e},e.prototype.getRectangleId=function(t){return this._insertedRectangles[t].id},e.prototype.generateNewFreeAreas=function(t,e,i){var n=t.x,r=t.y,o=t.right+1+this._padding,s=t.bottom+1+this._padding,a=null;0==this._padding&&(a=t);for(var h=e.length-1;h>=0;h--){var c=e[h];if(!(n>=c.right||o<=c.x||r>=c.bottom||s<=c.y)){null==a&&(a=this.allocateRectangle(t.x,t.y,t.width+this._padding,t.height+this._padding)),this.generateDividedAreas(a,c,i);var l=e.pop();h=0;e--)for(var i=t[e],n=t.length-1;n>=0;n--)if(e!=n){var r=t[n];if(i.x>=r.x&&i.y>=r.y&&i.right<=r.right&&i.bottom<=r.bottom){this.freeRectangle(i);var o=t.pop();e0&&(i.push(this.allocateRectangle(t.right,e.y,r,e.height)),n++);var o=t.x-e.x;o>0&&(i.push(this.allocateRectangle(e.x,e.y,o,e.height)),n++);var s=e.bottom-t.bottom;s>0&&(i.push(this.allocateRectangle(e.x,t.bottom,e.width,s)),n++);var a=t.y-e.y;a>0&&(i.push(this.allocateRectangle(e.x,e.y,e.width,a)),n++),0==n&&(t.width=0;s--){var a=this._freeAreas[s];if(a.x0){var r=this._sortableSizeStack.pop();return r.width=e,r.height=i,r.id=n,r}return new t.SortableSize(e,i,n)},e.prototype.freeSize=function(t){this._sortableSizeStack.push(t)},e.prototype.allocateRectangle=function(e,i,n,r){if(this._rectangleStack.length>0){var o=this._rectangleStack.pop();return o.x=e,o.y=i,o.width=n,o.height=r,o.right=e+n,o.bottom=i+r,o}return new t.IntegerRectangle(e,i,n,r)},e.prototype.freeRectangle=function(t){this._rectangleStack.push(t)},e}();t.RectanglePacker=e}(es||(es={})),function(t){var e=function(){return function(t,e,i){this.width=t,this.height=e,this.id=i}}();t.SortableSize=e}(es||(es={})),function(t){var e=function(){return function(t){this.assets=t}}();t.TextureAssets=e;var i=function(){return function(){}}();t.TextureAsset=i}(es||(es={})),function(t){var e=function(){return function(t,e){this.texture=t,this.id=e}}();t.TextureToPack=e}(es||(es={})),function(t){var e=function(){function e(){this._timeInSeconds=0,this._repeats=!1,this._isDone=!1,this._elapsedTime=0}return e.prototype.getContext=function(){return this.context},e.prototype.reset=function(){this._elapsedTime=0},e.prototype.stop=function(){this._isDone=!0},e.prototype.tick=function(){return!this._isDone&&this._elapsedTime>this._timeInSeconds&&(this._elapsedTime-=this._timeInSeconds,this._onTime(this),this._isDone||this._repeats||(this._isDone=!0)),this._elapsedTime+=t.Time.deltaTime,this._isDone},e.prototype.initialize=function(t,e,i,n){this._timeInSeconds=t,this._repeats=e,this.context=i,this._onTime=n},e.prototype.unload=function(){this.context=null,this._onTime=null},e}();t.Timer=e}(es||(es={})),function(t){var e=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._timers=[],t}return __extends(i,e),i.prototype.update=function(){for(var t=this._timers.length-1;t>=0;t--)this._timers[t].tick()&&(this._timers[t].unload(),this._timers.removeAt(t))},i.prototype.schedule=function(e,i,n,r){var o=new t.Timer;return o.initialize(e,i,n,r),this._timers.push(o),o},i}(t.GlobalManager);t.TimerManager=e}(es||(es={})); \ No newline at end of file diff --git a/demo/manifest.json b/demo/manifest.json index 96ddfde6..98368b7c 100644 --- a/demo/manifest.json +++ b/demo/manifest.json @@ -17,7 +17,7 @@ "bin-debug/SampleHelpers/SampleScene.js", "bin-debug/Scenes/Ninja Adventure/ProjectileHitDetector.js", "bin-debug/UI/loading/LoadingView.js", - "bin-debug/Scenes/LineCasting/LineCastingScene.js", + "bin-debug/Scenes/Ninja Adventure/CameraBounds.js", "bin-debug/Fgui/loading/loadingBinder.js", "bin-debug/Fgui/loading/UI_View_loading.js", "bin-debug/Fgui/sc/scBinder.js", @@ -28,7 +28,9 @@ "bin-debug/Scenes/Animated Tiles/AnimatedTilesScene.js", "bin-debug/Scenes/Empty Scene/BasicScene.js", "bin-debug/Scenes/LineCasting/LineCaster.js", + "bin-debug/Scenes/LineCasting/LineCastingScene.js", "bin-debug/Main.js", + "bin-debug/Scenes/Ninja Adventure/FireballProjectileController.js", "bin-debug/Scenes/Ninja Adventure/Ninja.js", "bin-debug/Scenes/Ninja Adventure/NinjaAdventureScene.js", "bin-debug/ThemeAdapter.js", diff --git a/demo/resource/default.res.json b/demo/resource/default.res.json index e1f582e3..8ea95f5a 100644 --- a/demo/resource/default.res.json +++ b/demo/resource/default.res.json @@ -1,7 +1,7 @@ { "groups": [ { - "keys": "bg_png,bgNorm_png,moon_png,orange_png,moonNorm_png,orangeNorm_png,orthogonal-outside_json", + "keys": "bg_png,bgNorm_png,moon_png,orange_png,moonNorm_png,orangeNorm_png,tiledMap_json,orthogonal-outside_json,tilemap_json,plume_png", "name": "preload" }, { @@ -52,11 +52,6 @@ "type": "image", "name": "orangeNorm_png" }, - { - "url": "preload/orthogonal-outside.json", - "type": "json", - "name": "orthogonal-outside_json" - }, { "url": "characters/1.png", "type": "image", @@ -101,6 +96,26 @@ "url": "fgui/loading.zip", "type": "bin", "name": "loading" + }, + { + "url": "preload/caveman/tiledMap.json", + "type": "json", + "name": "tiledMap_json" + }, + { + "url": "preload/orthogonal/orthogonal-outside.json", + "type": "json", + "name": "orthogonal-outside_json" + }, + { + "url": "preload/ninja/tilemap.json", + "type": "json", + "name": "tilemap_json" + }, + { + "url": "preload/plume.png", + "type": "image", + "name": "plume_png" } ] } \ No newline at end of file diff --git a/demo/resource/preload/caveman/caveman.png b/demo/resource/preload/caveman/caveman.png new file mode 100644 index 0000000000000000000000000000000000000000..0dd80b8839d4f3454c77edd053c76d629d40c6d2 GIT binary patch literal 11371 zcmb`t2{=^o7dL*#XtK;8ilJl+3CS+oOiF|(gluEUmWmXLF*B8=QiM=sOOibyAv1)K zozTWu29>gmZH6)P-ckL2&;S3t@AJOz^SsZaT<3o8_kQp9e9k$abI$k9DN7Rsj~EXC z0EiQ&$E*PW0$y@Ra>2k~=e4T4060L+#VfY*b{^h zU0x>)YV!JVV4%*Y&+zvNLh`>GdM(Dh1LdQm8#OAE=3X>)G~EBzJI=TrCw~x=vG((A zZSDFOCnv|een-h}`{YcQ1HaEm4=z?hwIwk2)<6*(T9LB0?yx z^^OQP59-=pSTE2Pkbqjvhdd+lg9dj3C$LK<}Ta-x*PwCG__E+KpbG|)^ov>k9DXgXN!C5AvQtyFaGHuBg1}IxR$V}_RbhI$N#XFERWOn9#JReFY)k@(i{0db3v*4eG1j4&1h{@YkJK>}$KuTFOa$ZBAoy=hdoK!XZyB8%y#w98qu znvkm;PuWYnNw;(ZUMNc@T0sGY;ob_B7WgDul#opKrMZXa3I%GRhKIdf?_OemvCknu z;waK2K)UoCQ1CjlW}ChYNgKwV=wzYhLUCQWwdyZ#puoXfPVz2h*7J)_FZbLg&H1Tf)Ii+Dvtq+6 zq1;!GaAxavTg*@5*rMV)pxC2tAHnO7tn~wHWlC7gK)>RQk{EGISk@NPp%VCJ?8W$F zWsg2;340~sXAEs|&LOcSB%7X2;c{QP-EXvET>Sxw1E_;_PJxvWhvuhKPE}C4&T1j{ z#kZ*xA|xz{T#(NZ>rja;3Xzm(bxr0^!t=zb)K}je{i$)+O9S;*XvgNM59*6PBYeNC zh&k&LY5b`H!0hqwh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pEO?S)XH}Iiu+#YTe||o$>VhS}*UAR3UgX+;NA_axrj^#+c*|&sHU+N2 zeGQF|T%D(3ziBfsf8D8RQ*GJP8qxHX@Ko|9>ijyVYBqgml+gO=VV~QOuKfKkdgE&i zkFp_jOOIAnibX?OOy6VzZfD5Py8h+GfSMmp6YUWx%`z?re?I@j zdE79Ts40AoW126f)Dv*cYvx7GBt8#bckK6@^_w!C{OoKB)iH-37D{W$$_2X_b7#Z? z{GZrbf2ZhyAIIF2CwTOgIsQ2GrOv+3&OYB6;I1(a7mA0^Jm)3#h+j$7snM}6%cBgk z3z>zwM`ui03DZ40_#rPMyL;*EkH4}{6=+X!t?0-otXLC3`bMKgt>-xH>7c3Lp~bV{2xX2(MBL)!EA-=1KvrDAexAelZAZoBmsaGd*0 zDCl0>@*$@_?#n?)wy-ZaTiRzd^dQ}W&_t`#0(pr&+>f!DR?zGhjZY!ZJhLIE%x8U- zRbajPo6jbM0>#wN-}-?S7H%^7FG~Icm;YB6wiQeX>*7&_kkflk@DMR@!r1aysgc{w F{{c-y6zl*1 literal 0 HcmV?d00001 diff --git a/demo/resource/preload/caveman/tiledMap.json b/demo/resource/preload/caveman/tiledMap.json new file mode 100644 index 00000000..7bf28972 --- /dev/null +++ b/demo/resource/preload/caveman/tiledMap.json @@ -0,0 +1,193 @@ +{ "height":30, + "infinite":false, + "layers":[ + { + "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 1, 1, 1, 1, 4, 0, 0, 0, 0, 0, 0, 0, 2147483652, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + "height":30, + "id":1, + "name":"main", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":40, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":2, + "name":"objects", + "objects":[ + { + "height":14.8796, + "id":6, + "name":"spawn", + "rotation":0, + "type":"", + "visible":true, + "width":14.8796, + "x":48.4346, + "y":240.503 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }], + "nextlayerid":3, + "nextobjectid":7, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"1.2.1", + "tileheight":16, + "tilesets":[ + { + "columns":2, + "firstgid":1, + "image":"tileset.png", + "imageheight":32, + "imagewidth":32, + "margin":0, + "name":"tileset", + "spacing":0, + "tilecount":4, + "tileheight":16, + "tiles":[ + { + "id":0, + "objectgroup": + { + "draworder":"index", + "name":"", + "objects":[ + { + "height":16, + "id":1, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":0, + "y":0 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + } + }, + { + "id":2, + "objectgroup": + { + "draworder":"index", + "name":"", + "objects":[ + { + "height":3, + "id":1, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":0, + "y":0 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }, + "properties":[ + { + "name":"filewtf", + "type":"file", + "value":"" + }, + { + "name":"floaty", + "type":"float", + "value":0 + }, + { + "name":"inty", + "type":"int", + "value":0 + }, + { + "name":"nez:isOneWayPlatform", + "type":"bool", + "value":true + }, + { + "name":"poop", + "type":"color", + "value":"" + }] + }, + { + "id":3, + "objectgroup": + { + "draworder":"index", + "name":"", + "objects":[ + { + "height":0, + "id":1, + "name":"", + "polygon":[ + { + "x":0, + "y":0 + }, + { + "x":0, + "y":16 + }, + { + "x":16, + "y":16 + }], + "rotation":0, + "type":"", + "visible":true, + "width":0, + "x":0, + "y":0 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }, + "properties":[ + { + "name":"nez:isSlope", + "type":"bool", + "value":true + }, + { + "name":"nez:slopeTopLeft", + "type":"int", + "value":0 + }, + { + "name":"nez:slopeTopRight", + "type":"int", + "value":15 + }] + }], + "tilewidth":16 + }], + "tilewidth":16, + "type":"map", + "version":1.2, + "width":40 +} \ No newline at end of file diff --git a/demo/resource/preload/caveman/tileset.png b/demo/resource/preload/caveman/tileset.png new file mode 100644 index 0000000000000000000000000000000000000000..b83d1d890675625910a86560ed88fe720122f726 GIT binary patch literal 1055 zcmaJ=OGp%993Of}`63On#NczJa-p5aZu^+Y(bk>aTxo1s7u;@+GoL!>Jev7z$2~+ag2ZD78~pWpBIe}1>p0~Z@=TWbk| zXh`*m8N37UKU9NPr%>3&+XXhtZC|9>In;^P+TuW9aAOa(BOfv*>^Vv%hXsSRCg(OC@;&5E+E7)+bFpyOW z6AGu2J>8(o<*|SckqlgY(r|cJAd9*@K6_@G1Vsp%5Xjx2a#9+^O&fv`74|DE%Yq0; zv7u-%5IPG23>%^uj%FD@!}2V{2N+QLNbJp4NBNAHEcwDWfgDH3;%Pdc&r|szW!hsj z%W)jd1n5A(j}d-n+CZ}FH=K^Lf(RYO)-0r%2JjT+5pxO&B#v}91>LI18cwN9xL~v^ zTQo~CUP@)4B>f+%>lL(vGH@^6e+oO{Lhr&rN8f7__O@z5b zDA*fGunZfFL?cPA%oR;#N{0q2bJaa=tSZ+V2;IV-MQCf+pqjKz9TXGiwd%1%s_K=v zYV}y6Rk<_{hW6U~SG&t5JVV~GGQ9Xw8GmTtnYZz9Ki1zp!4Kn3N{nUQwI8cO<8@G9 zlV&!))P* zw35FM?~sAu<>$FyZSQ;L&o!UE0%CIuUptqdHr@tr>fW|2FEqbsU+@2Uba|;|`^d)1 px4VbF-y9Ni=ewKcw=Trn_SF+JOTP8?Pxn81E>ejBaj|#!#vjLqP|W}U literal 0 HcmV?d00001 diff --git a/demo/resource/preload/ninja/tilemap.json b/demo/resource/preload/ninja/tilemap.json new file mode 100644 index 00000000..19b786a6 --- /dev/null +++ b/demo/resource/preload/ninja/tilemap.json @@ -0,0 +1,370 @@ +{ "height":42, + "infinite":false, + "layers":[ + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 848, 850, 850, 850, 850, 850, 850, 850, 850, 851, 852, 852, 852, 852, 852, 853, 355, 383, 411, 384, 355, 383, 383, 356, 383, 412, 383, 384, 412, 412, 384, 384, 412, 383, 383, 412, 328, 412, 411, 355, 0, 0, 876, 878, 878, 878, 878, 878, 878, 878, 878, 879, 906, 906, 906, 906, 906, 881, 356, 411, 328, 384, 327, 328, 384, 355, 383, 383, 327, 356, 412, 412, 384, 356, 327, 328, 383, 356, 356, 356, 356, 356, 0, 0, 904, 906, 906, 906, 906, 906, 906, 906, 906, 907, 906, 906, 906, 906, 906, 909, 355, 384, 398, 400, 327, 383, 330, 327, 399, 328, 398, 330, 399, 384, 399, 327, 398, 356, 398, 327, 399, 328, 383, 411, 0, 0, 932, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 937, 411, 384, 399, 327, 427, 356, 328, 399, 328, 356, 427, 398, 398, 328, 327, 327, 330, 412, 399, 366, 400, 355, 384, 356, 0, 0, 904, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 909, 383, 384, 427, 427, 327, 327, 327, 330, 399, 356, 398, 427, 398, 328, 328, 427, 330, 356, 398, 399, 327, 412, 356, 356, 0, 0, 904, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 909, 356, 355, 327, 399, 330, 327, 398, 328, 328, 328, 427, 399, 327, 356, 327, 328, 330, 412, 427, 398, 328, 411, 356, 411, 0, 0, 904, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 909, 411, 327, 399, 330, 399, 356, 327, 398, 398, 355, 328, 327, 327, 412, 400, 398, 398, 411, 328, 330, 399, 327, 328, 383, 0, 0, 904, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 909, 356, 327, 412, 327, 383, 383, 328, 412, 383, 356, 412, 355, 412, 328, 356, 384, 383, 355, 328, 411, 355, 355, 383, 356, 0, 0, 904, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 906, 909, 355, 355, 398, 399, 398, 412, 399, 328, 398, 355, 327, 327, 330, 383, 399, 327, 330, 411, 328, 398, 330, 355, 356, 328, 0, 0, 960, 961, 961, 961, 961, 961, 961, 961, 962, 906, 964, 961, 961, 961, 961, 965, 327, 328, 330, 328, 330, 355, 399, 327, 399, 383, 427, 399, 328, 356, 330, 366, 398, 384, 427, 328, 398, 411, 328, 355, 0, 0, 411, 327, 411, 384, 355, 384, 383, 328, 904, 906, 909, 383, 412, 328, 383, 411, 328, 411, 327, 427, 399, 411, 400, 427, 330, 412, 427, 398, 328, 356, 398, 328, 327, 412, 399, 427, 398, 327, 411, 383, 0, 0, 356, 328, 412, 412, 383, 412, 356, 411, 904, 906, 909, 384, 411, 328, 356, 411, 356, 411, 328, 400, 327, 355, 327, 399, 399, 328, 427, 328, 327, 327, 398, 399, 328, 384, 330, 328, 327, 328, 355, 355, 0, 0, 411, 327, 412, 411, 384, 355, 411, 356, 904, 906, 909, 327, 384, 356, 412, 412, 328, 356, 399, 330, 328, 411, 327, 398, 399, 383, 327, 330, 427, 356, 427, 399, 328, 328, 398, 328, 327, 327, 355, 383, 0, 0, 327, 327, 355, 328, 411, 356, 328, 411, 384, 383, 328, 328, 384, 383, 328, 384, 328, 327, 383, 412, 383, 383, 411, 411, 327, 328, 411, 412, 384, 327, 412, 328, 328, 356, 411, 327, 355, 412, 384, 411, 0, 0, 384, 383, 411, 383, 384, 328, 355, 411, 355, 328, 328, 411, 412, 411, 384, 411, 411, 412, 328, 328, 384, 328, 327, 327, 356, 383, 411, 384, 412, 411, 412, 356, 383, 328, 384, 384, 328, 327, 383, 383, 0, 0, 383, 412, 411, 328, 355, 355, 328, 383, 412, 355, 412, 412, 328, 356, 327, 355, 328, 411, 356, 383, 412, 356, 412, 383, 328, 356, 355, 412, 327, 411, 384, 356, 383, 356, 355, 384, 384, 383, 328, 355, 0, 0, 328, 384, 384, 355, 356, 356, 328, 356, 384, 355, 356, 328, 355, 384, 327, 355, 383, 328, 411, 328, 384, 383, 384, 327, 411, 411, 411, 384, 327, 328, 328, 412, 327, 327, 412, 356, 356, 328, 411, 411, 0, 0, 328, 327, 356, 356, 383, 356, 328, 328, 355, 412, 383, 355, 356, 411, 355, 328, 356, 356, 356, 412, 327, 411, 384, 327, 412, 328, 356, 328, 327, 327, 355, 328, 327, 327, 383, 383, 327, 412, 328, 356, 0, 0, 384, 327, 328, 328, 327, 383, 327, 328, 327, 411, 356, 412, 384, 384, 328, 327, 412, 328, 328, 383, 356, 355, 356, 327, 383, 356, 356, 383, 411, 355, 384, 328, 411, 384, 384, 328, 356, 355, 355, 327, 0, 0, 355, 383, 356, 384, 412, 327, 356, 411, 328, 412, 383, 327, 356, 355, 355, 327, 383, 383, 412, 383, 384, 383, 327, 355, 383, 412, 327, 412, 355, 356, 355, 412, 383, 412, 411, 411, 327, 412, 328, 328, 0, 0, 411, 384, 411, 412, 328, 355, 328, 327, 383, 412, 355, 412, 411, 355, 356, 327, 383, 328, 411, 356, 355, 384, 356, 411, 412, 411, 327, 383, 356, 356, 355, 327, 383, 383, 356, 327, 327, 383, 383, 356, 0, 0, 356, 328, 384, 356, 384, 412, 383, 412, 384, 328, 328, 383, 327, 383, 328, 384, 412, 355, 355, 412, 412, 411, 327, 383, 327, 412, 328, 411, 356, 328, 355, 384, 355, 411, 384, 384, 383, 356, 327, 412, 0, 0, 383, 383, 384, 355, 412, 412, 355, 412, 384, 411, 412, 327, 328, 328, 411, 328, 355, 411, 327, 411, 356, 356, 327, 411, 355, 383, 383, 411, 355, 356, 411, 412, 328, 411, 384, 356, 356, 384, 411, 411, 0, 0, 327, 411, 328, 412, 384, 411, 412, 356, 383, 412, 327, 328, 328, 355, 355, 356, 412, 355, 384, 412, 383, 327, 356, 383, 355, 384, 383, 412, 327, 412, 384, 383, 328, 327, 412, 328, 383, 412, 355, 355, 0, 0, 383, 327, 384, 355, 355, 411, 327, 384, 356, 328, 411, 384, 412, 384, 383, 384, 383, 356, 327, 384, 383, 356, 412, 355, 355, 383, 384, 328, 327, 383, 328, 384, 328, 327, 383, 412, 412, 356, 355, 355, 0, 0, 412, 411, 411, 328, 411, 327, 327, 383, 328, 383, 356, 383, 327, 411, 328, 384, 356, 356, 356, 356, 327, 412, 355, 356, 411, 384, 328, 355, 411, 327, 328, 384, 383, 412, 355, 384, 383, 383, 411, 355, 0, 0, 327, 356, 355, 411, 327, 355, 356, 412, 328, 355, 383, 328, 327, 383, 411, 383, 327, 411, 328, 328, 412, 327, 411, 356, 383, 411, 328, 356, 411, 356, 328, 384, 355, 328, 411, 384, 384, 327, 383, 356, 0, 0, 383, 384, 328, 356, 355, 384, 411, 355, 384, 384, 328, 355, 411, 355, 328, 328, 411, 412, 411, 384, 327, 412, 384, 327, 384, 384, 356, 384, 327, 327, 327, 412, 328, 327, 384, 327, 327, 411, 328, 412, 0, 0, 383, 328, 384, 327, 412, 356, 412, 412, 383, 355, 355, 328, 383, 412, 355, 412, 412, 328, 356, 327, 412, 327, 411, 411, 411, 327, 412, 356, 327, 412, 412, 412, 384, 384, 412, 411, 411, 356, 327, 328, 0, 0, 411, 355, 384, 356, 411, 384, 328, 328, 355, 356, 356, 328, 356, 384, 355, 356, 328, 355, 384, 327, 412, 356, 327, 327, 328, 328, 356, 383, 327, 383, 383, 383, 384, 327, 327, 412, 327, 412, 383, 356, 0, 0, 328, 328, 412, 328, 355, 356, 327, 411, 384, 383, 356, 328, 328, 355, 412, 383, 355, 356, 411, 355, 355, 328, 327, 412, 384, 411, 384, 356, 384, 412, 356, 327, 328, 383, 327, 383, 412, 412, 356, 327, 0, 0, 383, 327, 327, 356, 327, 356, 411, 327, 327, 327, 383, 327, 328, 327, 411, 356, 412, 384, 384, 328, 383, 411, 328, 411, 383, 355, 383, 412, 383, 328, 356, 355, 412, 411, 327, 383, 383, 383, 384, 412, 0, 0, 411, 328, 383, 355, 355, 327, 412, 356, 355, 412, 327, 356, 411, 328, 412, 383, 327, 356, 355, 355, 384, 384, 328, 411, 412, 383, 384, 383, 384, 412, 355, 328, 328, 411, 356, 328, 383, 355, 411, 355, 0, 0, 328, 383, 328, 327, 411, 383, 383, 384, 355, 328, 355, 328, 327, 383, 412, 355, 412, 411, 355, 356, 412, 384, 355, 355, 355, 355, 328, 412, 383, 384, 384, 384, 356, 384, 327, 412, 412, 383, 412, 383, 0, 0, 384, 384, 384, 411, 384, 328, 384, 411, 327, 384, 412, 383, 412, 384, 328, 328, 383, 327, 383, 328, 355, 384, 356, 328, 328, 355, 383, 383, 384, 411, 412, 384, 384, 328, 384, 327, 355, 384, 411, 412, 0, 0, 327, 356, 384, 327, 383, 328, 327, 328, 328, 412, 412, 355, 412, 384, 411, 412, 327, 328, 328, 411, 327, 411, 355, 356, 412, 412, 383, 383, 383, 327, 356, 355, 412, 355, 412, 355, 327, 411, 384, 328, 0, 0, 412, 411, 384, 356, 383, 356, 356, 328, 355, 384, 411, 412, 356, 383, 412, 327, 328, 328, 355, 355, 355, 327, 327, 327, 411, 411, 383, 328, 327, 412, 412, 411, 327, 327, 328, 412, 327, 327, 411, 383, 0, 0, 411, 412, 328, 412, 412, 356, 328, 383, 327, 356, 328, 328, 327, 327, 355, 327, 412, 328, 412, 384, 328, 411, 383, 411, 327, 412, 411, 411, 356, 356, 412, 327, 327, 327, 412, 355, 355, 412, 384, 328, 0, 0, 355, 355, 383, 411, 383, 355, 355, 327, 327, 412, 383, 356, 327, 411, 412, 356, 411, 412, 412, 411, 327, 327, 411, 328, 411, 328, 384, 411, 384, 355, 355, 328, 411, 412, 327, 411, 356, 383, 412, 355, 0, 0, 411, 327, 383, 412, 327, 383, 327, 411, 383, 327, 384, 356, 411, 328, 328, 328, 328, 412, 411, 356, 328, 411, 327, 411, 328, 328, 384, 384, 356, 327, 355, 411, 383, 355, 383, 412, 411, 355, 412, 356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":42, + "id":1, + "name":"tiles", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":42, + "x":0, + "y":0 + }, + { + "data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 362, 363, 364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 362, 363, 363, 363, 389, 391, 388, 363, 363, 363, 363, 364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 388, 364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 392, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 362, 363, 389, 391, 391, 391, 391, 391, 391, 391, 391, 391, 391, 360, 420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 390, 391, 391, 391, 360, 419, 419, 419, 419, 419, 419, 419, 419, 420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 418, 419, 419, 419, 420, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 441, 442, 442, 442, 442, 442, 442, 442, 442, 442, 442, 443, 0, 0, 0, 446, 447, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 441, 468, 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 467, 443, 0, 0, 502, 445, 472, 447, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 469, 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 471, 0, 0, 0, 502, 503, 445, 472, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 469, 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 471, 0, 0, 0, 0, 0, 474, 475, 472, 448, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 497, 440, 470, 470, 470, 470, 470, 470, 470, 470, 470, 470, 439, 499, 0, 0, 0, 0, 446, 473, 475, 444, 504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 497, 498, 498, 498, 498, 498, 498, 498, 498, 498, 498, 499, 0, 0, 0, 446, 447, 473, 444, 503, 504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 446, 473, 475, 444, 504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 502, 503, 503, 504, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + "height":42, + "id":4, + "name":"above-details", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":42, + "x":0, + "y":0 + }, + { + "data":[300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 301, 302, 303, 300, 300, 300, 300, 300, 300, 300, 301, 187, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 187, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 0, 0, 0, 0, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 187, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 0, 0, 0, 0, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 187, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 187, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 0, 928, 898, 899, 0, 898, 926, 927, 0, 898, 899, 899, 0, 928, 898, 899, 0, 928, 898, 899, 0, 0, 0, 187, 187, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 0, 928, 926, 927, 0, 898, 926, 927, 0, 898, 898, 899, 0, 928, 926, 927, 0, 928, 926, 927, 0, 0, 0, 187, 187, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 0, 928, 928, 928, 0, 926, 926, 927, 0, 926, 926, 927, 0, 928, 928, 928, 0, 928, 928, 928, 0, 0, 0, 187, 187, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 187, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 187, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 0, 1073, 1073, 1073, 1073, 1073, 1073, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 187, 187, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 1073, 0, 0, 0, 0, 0, 0, 0, 928, 928, 928, 0, 898, 898, 899, 0, 928, 898, 899, 0, 928, 898, 899, 0, 928, 898, 899, 0, 0, 0, 215, 187, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 1073, 0, 0, 0, 0, 0, 0, 0, 928, 928, 928, 0, 898, 898, 899, 0, 928, 926, 927, 0, 928, 926, 927, 0, 928, 926, 927, 0, 0, 0, 243, 187, 0, 0, 0, 0, 0, 0, 0, 0, 1073, 0, 1073, 0, 0, 0, 0, 0, 0, 0, 928, 928, 928, 0, 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0, 0, 299, 327, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 215, 215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 327, 355, 0, 0, 215, 0, 0, 0, 0, 215, 0, 215, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 355, 383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 383, 300, 301, 302, 303, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 301, 302, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 301, 302, 300, 300, 300, 301, 302, 303, 411], + "height":42, + "id":5, + "name":"collision", + "opacity":1, + "type":"tilelayer", + "visible":false, + "width":42, + "x":0, + "y":0 + }], + "nextlayerid":6, + "nextobjectid":1, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"1.2.1", + "tileheight":16, + "tilesets":[ + { + "columns":28, + "firstgid":1, + "image":"tileset.png", + "imageheight":640, + "imagewidth":448, + "margin":0, + "name":"tileset", + "spacing":0, + "terrains":[ + { + "name":"snow", + "tile":553 + }, + { + "name":"dirt", + "tile":385 + }, + { + "name":"dirt temple", + "tile":390 + }, + { + "name":"farm", + "tile":469 + }, + { + "name":"dark farm", + "tile":474 + }], + "tilecount":1120, + "tileheight":16, + "tiles":[ + { + "id":354, + "terrain":[1, 1, 1, -1] + }, + { + "id":355, + "terrain":[1, 1, -1, 1] + }, + { + "id":356, + "terrain":[-1, -1, -1, 1] + }, + { + "id":357, + "terrain":[-1, -1, 1, 1] + }, + { + "id":358, + "terrain":[-1, -1, 1, -1] + }, + { + "id":359, + "terrain":[2, 2, 2, -1] + }, + { + "id":360, + "terrain":[2, 2, -1, 2] + }, + { + "id":361, + "terrain":[-1, -1, -1, 2] + }, + { + "id":362, + "terrain":[-1, -1, 2, 2] + }, + { + "id":363, + "terrain":[-1, -1, 2, -1] + }, + { + "id":382, + "terrain":[1, -1, 1, 1] + }, + { + "id":383, + "terrain":[-1, 1, 1, 1] + }, + { + "id":384, + "terrain":[-1, 1, -1, 1] + }, + { + "id":385, + "terrain":[1, 1, 1, 1] + }, + { + "id":386, + "terrain":[1, -1, 1, -1] + }, + { + "id":387, + "terrain":[2, -1, 2, 2] + }, + { + "id":388, + "terrain":[-1, 2, 2, 2] + }, + { + "id":389, + "terrain":[-1, 2, -1, 2] + }, + { + "id":390, + "terrain":[2, 2, 2, 2] + }, + { + "id":391, + "terrain":[2, -1, 2, -1] + }, + { + "id":412, + "terrain":[-1, 1, -1, -1] + }, + { + "id":413, + "terrain":[1, 1, -1, -1] + }, + { + "id":414, + "terrain":[1, -1, -1, -1] + }, + { + "id":417, + "terrain":[-1, 2, -1, -1] + }, + { + "id":418, + "terrain":[2, 2, -1, -1] + }, + { + "id":419, + "terrain":[2, -1, -1, -1] + }, + { + "id":438, + "terrain":[3, 3, 3, -1] + }, + { + "id":439, + "terrain":[3, 3, -1, 3] + }, + { + "id":440, + "terrain":[-1, -1, -1, 3] + }, + { + "id":441, + "terrain":[-1, -1, 3, 3] + }, + { + "id":442, + "terrain":[-1, -1, 3, -1] + }, + { + "id":443, + "terrain":[4, 4, 4, -1] + }, + { + "id":444, + "terrain":[4, 4, -1, 4] + }, + { + "id":445, + "terrain":[-1, -1, -1, 4] + }, + { + "id":446, + "terrain":[-1, -1, 4, 4] + }, + { + "id":447, + "terrain":[-1, -1, 4, -1] + }, + { + "id":466, + "terrain":[3, -1, 3, 3] + }, + { + "id":467, + "terrain":[-1, 3, 3, 3] + }, + { + "id":468, + "terrain":[-1, 3, -1, 3] + }, + { + "id":469, + "terrain":[3, 3, 3, 3] + }, + { + "id":470, + "terrain":[3, -1, 3, -1] + }, + { + "id":471, + "terrain":[4, -1, 4, 4] + }, + { + "id":472, + "terrain":[-1, 4, 4, 4] + }, + { + "id":473, + "terrain":[-1, 4, -1, 4] + }, + { + "id":474, + "terrain":[4, 4, 4, 4] + }, + { + "id":475, + "terrain":[4, -1, 4, -1] + }, + { + "id":496, + "terrain":[-1, 3, -1, -1] + }, + { + "id":497, + "terrain":[3, 3, -1, -1] + }, + { + "id":498, + "terrain":[3, -1, -1, -1] + }, + { + "id":501, + "terrain":[-1, 4, -1, -1] + }, + { + "id":502, + "terrain":[4, 4, -1, -1] + }, + { + "id":503, + "terrain":[4, -1, -1, -1] + }, + { + "id":522, + "terrain":[0, 0, 0, -1] + }, + { + "id":523, + "terrain":[0, 0, -1, 0] + }, + { + "id":524, + "terrain":[-1, -1, -1, 0] + }, + { + "id":525, + "terrain":[-1, -1, 0, 0] + }, + { + "id":526, + "terrain":[-1, -1, 0, -1] + }, + { + "id":550, + "terrain":[0, -1, 0, 0] + }, + { + "id":551, + "terrain":[-1, 0, 0, 0] + }, + { + "id":552, + "terrain":[-1, 0, -1, 0] + }, + { + "id":553, + "terrain":[0, 0, 0, 0] + }, + { + "id":554, + "terrain":[0, -1, 0, -1] + }, + { + "id":580, + "terrain":[-1, 0, -1, -1] + }, + { + "id":581, + "terrain":[0, 0, -1, -1] + }, + { + "id":582, + "terrain":[0, -1, -1, -1] + }], + "tilewidth":16 + }], + "tilewidth":16, + "type":"map", + "version":1.2, + "width":42 +} \ No newline at end of file diff --git a/demo/resource/preload/ninja/tileset.png b/demo/resource/preload/ninja/tileset.png new file mode 100644 index 0000000000000000000000000000000000000000..1379fb4a78ec1a089d9ade45a5e0154f9ccec30c GIT binary patch literal 88026 zcmYg%1yCGKwC)f*Xn>$WLm;?AaJS$Af=htKEx3D-V8Pwp-JK8!?ykWWcUYV||9f?- zZWY7KZtcQ!_vv#!ITNO=D2?%&_%#3k7_u@FUjP8E8vtJUp&)_pp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7;UcAW?G!KNPz5CDz0A8iEKu*8BJNzL(qv00+d!X?SgQ6ZmAc zzc2x>qR6-@BeXBKpU|&tR}0#8&Xn>31pxSR`-v2gkr1T82LP_a&ji3fedJEK69SG0 zz^1KhFd>LPQW+V4eKt(~FwfNsSq8zxvkVf1s0H%iCt8?_CbkD40_5kzV{pr-BgGJ8 zfsePH1;QkhjuigH+^*b?u^;c)vTb>Zuz9uQA`yRg7a#c13J&qeU?sR$x zt>Kef^@C4zfQHwaLlPQ3xfMY0{O@fytTfJ9pXQ!>(l^|lVm|oJOEOaNnHsAF5i#K*Op0UN(<|_k$cYKvTMcbW@ zFDMBz8MYVIAncs~qfd>5850&LO$1#)*J=B(d>vG|6O{beyh?{8mkdU$3 z&rUn1eYy=ml^ZlW0A#fn#jNr^V{Lajz6gL7@BAZiF8_Z3NW!QcI!hQV00000NkvXX Hu0mjfWp@jj literal 0 HcmV?d00001 diff --git a/demo/resource/preload/buch-outdoor.png b/demo/resource/preload/orthogonal/buch-outdoor.png similarity index 100% rename from demo/resource/preload/buch-outdoor.png rename to demo/resource/preload/orthogonal/buch-outdoor.png diff --git a/demo/resource/preload/orthogonal-outside.json b/demo/resource/preload/orthogonal/orthogonal-outside.json similarity index 100% rename from demo/resource/preload/orthogonal-outside.json rename to demo/resource/preload/orthogonal/orthogonal-outside.json diff --git a/demo/resource/preload/plume.png b/demo/resource/preload/plume.png new file mode 100644 index 0000000000000000000000000000000000000000..fe8aee47a1cf2f7ea1266ac728b80093cd498a8d GIT binary patch literal 1138 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!SkfJR9T^xl_H+M9WCijSl0AZa z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP{Jv|C&cwX5S(H7U%~MI z55r?`hE3KCO-)S)4<1~yWJyj=PHb!}rYukjr~oJhQ~=by_vuv~H@8xq>rj?y!oa?`BqQSHH&RX-s0Z)08Wb8L4^Q@gKQ0o?* zxc`26aMnAa-unC2hn!izFeeHy*fB>MUD$VD&@jwibxPNFYvEPur`8G zW(~jEl*IdGYugqd*|q<(;(?v##XcA-I90@dt&F>F6J8suUpnQ((LM%`%uA0;=Xo!_ z{XF65H4T<8?n!4<|Myg+2i^_um?#~}I6=z!fDEgGAgA~0hnqV7Pk7lAXx`FWb!b(p zV}ZJ=QiE%OMk(X*gO_6&*jEQLJn=U)X4t0wkICcGZNrV{G=!c#kor6`lhJZ{3xnlH zo+t)Sh5%OvN!Bz$h4dIECLSgaA-}jLf1d_!*+uDAVn=H>r}en}aP1Iyy)9RlLHLpy zgTj#|qG4(&e|j5AU5`XDrg;n19Iu{uE8XYDs+gDcZ@nEh#xm9!_r_0>J{-JZbL6GA z$4OR)esO&Wtua|s?|Wu{{?eEKnlD*Bu-$lm##!#O%&QKon%|Pqxe%rIbM;Gug%-+H z?G>l*e46%5xMJ=y?tcy`o3F4;@MfQ3ec-U*1$L$C&C~j|UX(^=y`O6^{dDu{i*{TK z1YQc;?!UX|-edLySES_59sa$1mOk^d-&d9XA7A~0_0Oh&DyQRjd4QQlwZt`|BqgyV z)hf9t6-Y4{85kMp8d&HWnTHsdTbUYK8JlSv7+4t?C^bP0l+XkKsguw2 literal 0 HcmV?d00001 diff --git a/demo/src/Scenes/LineCasting/LineCaster.ts b/demo/src/Scenes/LineCasting/LineCaster.ts index 60b248e4..56b441f3 100644 --- a/demo/src/Scenes/LineCasting/LineCaster.ts +++ b/demo/src/Scenes/LineCasting/LineCaster.ts @@ -38,22 +38,6 @@ module samples { displayContainer.addChild(this._lineShape); } - public onAddedToEntity(): void { - KeyboardUtils.registerKey(KeyboardUtils.SPACE, this.spaceDown, this, KeyboardUtils.TYPE_KEY_DOWN); - } - - public onRemovedFromEntity(): void { - KeyboardUtils.unregisterKey(KeyboardUtils.SPACE, KeyboardUtils.TYPE_KEY_DOWN); - } - - private spaceDown(){ - let hit = Physics.linecast(this._lastPosition, this.transform.position); - if (hit.collider){ - this._collisionPosition = hit.point; - } - } - - public render(camera: es.Camera): any { this._pixelShape1.graphics.clear(); this._pixelShape1.graphics.beginFill(0xffff00); diff --git a/demo/src/Scenes/Ninja Adventure/CameraBounds.ts b/demo/src/Scenes/Ninja Adventure/CameraBounds.ts new file mode 100644 index 00000000..182c6401 --- /dev/null +++ b/demo/src/Scenes/Ninja Adventure/CameraBounds.ts @@ -0,0 +1,37 @@ +module samples { + import Component = es.Component; + import Vector2 = es.Vector2; + + export class CameraBounds extends Component { + public min: Vector2; + public max: Vector2; + + constructor(min: Vector2 = Vector2.zero, max: Vector2 = Vector2.zero){ + super(); + + this.min = min; + this.max = max; + this.setUpdateOrder(Number.MAX_VALUE); + } + + public onAddedToEntity(): void { + this.entity.updateOrder = Number.MAX_VALUE; + } + + public update(): void { + let cameraBounds = this.entity.scene.camera.bounds; + + if (cameraBounds.top < this.min.y) + this.entity.scene.camera.position.add(new Vector2(0, this.min.y - cameraBounds.top)); + + if (cameraBounds.left < this.min.x) + this.entity.scene.camera.position.add(new Vector2(this.min.x - cameraBounds.left, 0)); + + if (cameraBounds.bottom > this.max.y) + this.entity.scene.camera.position.add(new Vector2(0, this.max.y - cameraBounds.bottom)); + + if (cameraBounds.right > this.max.x) + this.entity.scene.camera.position.add(new Vector2(this.max.x - cameraBounds.right, 0)); + } + } +} \ No newline at end of file diff --git a/demo/src/Scenes/Ninja Adventure/FireballProjectileController.ts b/demo/src/Scenes/Ninja Adventure/FireballProjectileController.ts new file mode 100644 index 00000000..5e53a7f6 --- /dev/null +++ b/demo/src/Scenes/Ninja Adventure/FireballProjectileController.ts @@ -0,0 +1,28 @@ +module samples { + import Component = es.Component; + import Vector2 = es.Vector2; + import ProjectileMover = es.ProjectileMover; + import Time = es.Time; + + /** + * 移动一个投射器并在它击中任何东西时摧毁它 + */ + export class FireballProjectileController extends Component { + public velocity: Vector2; + public _mover: ProjectileMover; + + constructor(velocity: Vector2){ + super(); + this.velocity = velocity; + } + + public onAddedToEntity(): void { + this._mover = this.entity.getComponent(ProjectileMover); + } + + public update(): void { + if (this._mover.move(Vector2.multiply(this.velocity, new Vector2(Time.deltaTime)))) + this.entity.destroy(); + } + } +} \ No newline at end of file diff --git a/demo/src/Scenes/Ninja Adventure/Ninja.ts b/demo/src/Scenes/Ninja Adventure/Ninja.ts index b23de2c6..1d1944a3 100644 --- a/demo/src/Scenes/Ninja Adventure/Ninja.ts +++ b/demo/src/Scenes/Ninja Adventure/Ninja.ts @@ -1,50 +1,145 @@ module samples { import SpriteAnimator = es.SpriteAnimator; import Mover = es.Mover; + import VirtualButton = es.VirtualButton; + import VirtualIntegerAxis = es.VirtualIntegerAxis; + import KeyboardKey = es.KeyboardKey; + import KeyboardKeys = es.KeyboardKeys; + import OverlapBehavior = es.OverlapBehavior; + import Vector2 = es.Vector2; + import Time = es.Time; + import Keys = es.Keys; + import CollisionResult = es.CollisionResult; + import SubpixelVector2 = es.SubpixelVector2; + import ITriggerListener = es.ITriggerListener; - export class Ninja extends es.Component { + export class Ninja extends es.Component implements ITriggerListener{ public _animator: SpriteAnimator; + public _subpixelV2: SubpixelVector2 = new SubpixelVector2(); public _mover: Mover; + public _moveSpeed = 100; + public _projectileVelocity: Vector2 = new Vector2(175); + + public _fireInput: VirtualButton; + public _xAxisInput: VirtualIntegerAxis; + public _yAxisInput: VirtualIntegerAxis; public onAddedToEntity(): void { let characterPng = RandomUtils.randint(1, 6); - this.entity.scene.content.loadRes(`${characterPng}_png`).then(texture => { - let sprites = es.Sprite.spritesFromAtlas(texture, 16, 16); + let texture = RES.getRes(`${characterPng}_png`); + let sprites = es.Sprite.spritesFromAtlas(texture, 16, 16); - this._mover = this.entity.addComponent(new Mover()); - this._animator = this.entity.addComponent(new SpriteAnimator()); + this._mover = this.entity.addComponent(new Mover()); + this._animator = this.entity.addComponent(new SpriteAnimator()); - this._animator.addAnimation("walkLeft", new es.SpriteAnimation([ - sprites[2], - sprites[6], - sprites[10], - sprites[14] - ], 4)); + this._animator.addAnimation("walkLeft", new es.SpriteAnimation([ + sprites[2], + sprites[6], + sprites[10], + sprites[14] + ], 4)); - this._animator.addAnimation("walkRight", new es.SpriteAnimation([ - sprites[3], - sprites[7], - sprites[11], - sprites[15] - ], 4)); + this._animator.addAnimation("walkRight", new es.SpriteAnimation([ + sprites[3], + sprites[7], + sprites[11], + sprites[15] + ], 4)); - this._animator.addAnimation("walkDown", new es.SpriteAnimation([ - sprites[0], - sprites[4], - sprites[8], - sprites[12] - ], 4)); + this._animator.addAnimation("walkDown", new es.SpriteAnimation([ + sprites[0], + sprites[4], + sprites[8], + sprites[12] + ], 4)); - this._animator.addAnimation("walkUp", new es.SpriteAnimation([ - sprites[1], - sprites[5], - sprites[9], - sprites[13] - ], 4)); + this._animator.addAnimation("walkUp", new es.SpriteAnimation([ + sprites[1], + sprites[5], + sprites[9], + sprites[13] + ], 4)); - this._animator.play("walkDown"); - }); + this.setupInput(); + } + + public onRemovedFromEntity(): void { + this._fireInput.deregister(); + } + + public setupInput(){ + // 设置输入射击一个火球。我们允许在键盘z上使用 + this._fireInput = new VirtualButton(); + this._fireInput.nodes.push(new KeyboardKey(Keys.z)); + + this._xAxisInput = new VirtualIntegerAxis(); + this._xAxisInput.nodes.push(new KeyboardKeys(OverlapBehavior.takeNewer, Keys.left, Keys.right)); + + this._yAxisInput = new VirtualIntegerAxis(); + this._yAxisInput.nodes.push(new KeyboardKeys(OverlapBehavior.takeNewer, Keys.up, Keys.down)); + } + + public update(): void { + let moveDir = new Vector2(this._xAxisInput.value, this._yAxisInput.value); + let animation = "walkDown"; + + if (moveDir.x < 0) + animation = "walkLeft"; + else if(moveDir.x > 0) + animation = "walkRight"; + + if (moveDir.y < 0) + animation = "walkUp"; + else if(moveDir.y > 0) + animation = "walkDown"; + + if (!moveDir.equals(Vector2.zero)){ + if (!this._animator.isAnimationActive(animation)) + this._animator.play(animation); + else + this._animator.unPause(); + + let movement = Vector2.multiply(moveDir, new Vector2(this._moveSpeed * Time.deltaTime)); + let res: CollisionResult = new CollisionResult(); + this._mover.calculateMovement(movement, res); + this._subpixelV2.update(movement); + this._mover.applyMovement(movement); + }else{ + this._animator.pause(); + } + + if (this._fireInput.isPressed){ + let dir = Vector2.zero; + switch (this._animator.currentAnimationName) { + case "walkUp": + dir.y = -1; + break; + case "walkDown": + dir.y = 1; + break; + case "walkRight": + dir.x = 1; + break; + case "walkLeft": + dir.x = -1; + break; + default: + dir = new Vector2(1, 0); + break; + } + + let ninjaScene = this.entity.scene as NinjaAdventureScene; + ninjaScene.createProjectiles(this.entity.transform.position, Vector2.multiply(this._projectileVelocity, dir)); + } + } + + public onTriggerEnter(other: es.Collider, local: es.Collider): any { + console.log(`triggerEnter: ${other.entity.name}`); + } + + public onTriggerExit(other: es.Collider, local: es.Collider): any { + console.log(`triggerExit: ${other.entity.name}`); } } } \ No newline at end of file diff --git a/demo/src/Scenes/Ninja Adventure/NinjaAdventureScene.ts b/demo/src/Scenes/Ninja Adventure/NinjaAdventureScene.ts index f654781f..35279895 100644 --- a/demo/src/Scenes/Ninja Adventure/NinjaAdventureScene.ts +++ b/demo/src/Scenes/Ninja Adventure/NinjaAdventureScene.ts @@ -4,13 +4,38 @@ module samples { import SpriteRenderer = es.SpriteRenderer; import ProjectileHitDetector = es.ProjectileHitDetector; import FollowCamera = es.FollowCamera; + import TiledMapLoader = es.TiledMapLoader; + import TiledMapRenderer = es.TiledMapRenderer; + import Vector2 = es.Vector2; + import ProjectileMover = es.ProjectileMover; + import Sprite = es.Sprite; + import SpriteAnimator = es.SpriteAnimator; + import SpriteAnimation = es.SpriteAnimation; export class NinjaAdventureScene extends SampleScene { public async onStart() { super.onStart(); + let tiledEntity = this.createEntity("tiled-map-entity"); + TiledMapLoader.loadTmxMap(new es.TmxMap(), "tilemap_json").then(map => { + let tiledMapRenderer = tiledEntity.addComponent(new TiledMapRenderer(map, "collision")); + tiledMapRenderer.setLayersToRender("tiles", "terrain", "details"); + + tiledMapRenderer.renderLayer = 10; + + let tiledMapDetailsComp = tiledEntity.addComponent(new TiledMapRenderer(map)); + tiledMapRenderer.setLayerToRender("above-details"); + tiledMapRenderer.renderLayer = -1; + + let topLeft = new Vector2(map.tileWidth, map.tileWidth); + let bottomRight = new Vector2(map.tileWidth * (map.width - 1), + map.tileWidth * (map.height - 1)); + tiledEntity.addComponent(new CameraBounds(topLeft, bottomRight)); + }); + + let playerEntity = this.createEntity("player"); - playerEntity.position = new es.Vector2(256, 224); + playerEntity.position = new es.Vector2(256 / 2, 224 / 2); playerEntity.addComponent(new Ninja()); let collider = playerEntity.addComponent(new CircleCollider()); @@ -21,20 +46,39 @@ module samples { this.camera.entity.addComponent(new FollowCamera(playerEntity)); - this.content.loadRes("moon_png").then(moonTexture => { - let moonEntity = this.createEntity("moon"); - moonEntity.position = new es.Vector2(412, 460); - moonEntity.addComponent(new SpriteRenderer(moonTexture)); - moonEntity.addComponent(new ProjectileHitDetector()); - moonEntity.addComponent(new CircleCollider()); - }); + let moonTexture = RES.getRes("moon_png"); + let moonEntity = this.createEntity("moon"); + moonEntity.position = new es.Vector2(412, 460); + moonEntity.addComponent(new SpriteRenderer(moonTexture)); + moonEntity.addComponent(new ProjectileHitDetector()); + moonEntity.addComponent(new CircleCollider()); } - public update(){ - super.update(); + /** + * 创建抛射物并使其运动 + * @param position + * @param velocity + */ + public createProjectiles(position: Vector2, velocity: Vector2) { + // 创建一个实体来存放投射程序及其逻辑 + let entity = this.createEntity("projectile"); + entity.position = position; + entity.addComponent(new ProjectileMover()); + entity.addComponent(new FireballProjectileController(velocity)); - this.findEntity("player").position.x -= es.Time.deltaTime * 10; - this.findEntity("player").position.y -= es.Time.deltaTime * 10; + let collider = entity.addComponent(new CircleCollider()); + Flags.setFlagExclusive(collider.collidesWithLayers, 0); + Flags.setFlagExclusive(collider.physicsLayer, 1); + + let texture = RES.getRes("plume_png"); + let sprites = Sprite.spritesFromAtlas(texture, 16, 16); + let animator = entity.addComponent(new SpriteAnimator()); + animator.renderLayer = 1; + + animator.addAnimation("default", new SpriteAnimation(sprites)); + animator.play("default"); + + return entity; } } } \ No newline at end of file diff --git a/source/bin/framework.d.ts b/source/bin/framework.d.ts index cfdf66e7..3e948d6b 100644 --- a/source/bin/framework.d.ts +++ b/source/bin/framework.d.ts @@ -285,7 +285,6 @@ declare module es { update(): void; setEnabled(isEnabled: boolean): this; setUpdateOrder(updateOrder: number): this; - clone(): Component; } } declare module es { @@ -334,7 +333,6 @@ declare module es { destroy(): void; detachFromScene(): void; attachToScene(newScene: Scene): void; - clone(position?: Vector2): Entity; onAddedToScene(): void; onRemovedFromScene(): void; update(): void; @@ -349,7 +347,6 @@ declare module es { removeAllComponents(): void; compareTo(other: Entity): number; toString(): string; - protected copyFrom(entity: Entity): void; } } declare module es { @@ -691,7 +688,7 @@ declare module es { class SpriteAnimation { readonly sprites: Sprite[]; readonly frameRate: number; - constructor(sprites: Sprite[], frameRate: number); + constructor(sprites: Sprite[], frameRate?: number); } } declare module es { @@ -759,7 +756,7 @@ declare module es { declare module es { class TiledMapRenderer extends RenderableComponent { tiledMap: TmxMap; - physicsLayer: number; + physicsLayer: Ref; layerIndicesToRender: number[]; private toContainer; readonly width: number; @@ -808,11 +805,10 @@ declare module es { } declare module es { abstract class Collider extends Component { - debug: any; shape: Shape; isTrigger: boolean; - physicsLayer: number; - collidesWithLayers: number; + physicsLayer: Ref; + collidesWithLayers: Ref; shouldColliderScaleAndRotateWithTransform: boolean; registeredPhysicsBounds: Rectangle; _localOffsetLength: number; @@ -837,7 +833,6 @@ declare module es { unregisterColliderWithPhysicsSystem(): void; overlaps(other: Collider): boolean; collidesWith(collider: Collider, motion: Vector2, result: CollisionResult): boolean; - clone(): Component; } } declare module es { @@ -846,10 +841,9 @@ declare module es { polygonShape: egret.Shape; pixelShape1: egret.Shape; pixelShape2: egret.Shape; - constructor(); + constructor(x?: number, y?: number, width?: number, height?: number); width: number; height: number; - createBoxRect(x: number, y: number, width: number, height: number): BoxCollider; setSize(width: number, height: number): this; setWidth(width: number): BoxCollider; setHeight(height: number): void; @@ -1303,10 +1297,10 @@ declare module es { class Flags { static isFlagSet(self: number, flag: number): boolean; static isUnshiftedFlagSet(self: number, flag: number): boolean; - static setFlagExclusive(self: number, flag: number): number; - static setFlag(self: number, flag: number): number; - static unsetFlag(self: number, flag: number): number; - static invertFlags(self: number): number; + static setFlagExclusive(self: Ref, flag: number): void; + static setFlag(self: Ref, flag: number): void; + static unsetFlag(self: Ref, flag: number): void; + static invertFlags(self: Ref): void; } } declare module es { @@ -1422,12 +1416,12 @@ declare module es { static isLineToLine(a1: Vector2, a2: Vector2, b1: Vector2, b2: Vector2): boolean; static lineToLineIntersection(a1: Vector2, a2: Vector2, b1: Vector2, b2: Vector2): Vector2; static closestPointOnLine(lineA: Vector2, lineB: Vector2, closestTo: Vector2): Vector2; - static isCircleToCircle(circleCenter1: Vector2, circleRadius1: number, circleCenter2: Vector2, circleRadius2: number): boolean; - static isCircleToLine(circleCenter: Vector2, radius: number, lineFrom: Vector2, lineTo: Vector2): boolean; - static isCircleToPoint(circleCenter: Vector2, radius: number, point: Vector2): boolean; - static isRectToCircle(rect: egret.Rectangle, cPosition: Vector2, cRadius: number): boolean; - static isRectToLine(rect: Rectangle, lineFrom: Vector2, lineTo: Vector2): boolean; - static isRectToPoint(rX: number, rY: number, rW: number, rH: number, point: Vector2): boolean; + static circleToCircle(circleCenter1: Vector2, circleRadius1: number, circleCenter2: Vector2, circleRadius2: number): boolean; + static circleToLine(circleCenter: Vector2, radius: number, lineFrom: Vector2, lineTo: Vector2): boolean; + static circleToPoint(circleCenter: Vector2, radius: number, point: Vector2): boolean; + static rectToCircle(rect: egret.Rectangle, cPosition: Vector2, cRadius: number): boolean; + static rectToLine(rect: Rectangle, lineFrom: Vector2, lineTo: Vector2): boolean; + static rectToPoint(rX: number, rY: number, rW: number, rH: number, point: Vector2): boolean; static getSector(rX: number, rY: number, rW: number, rH: number, point: Vector2): PointSectors; } } @@ -1486,7 +1480,6 @@ declare module es { abstract collidesWithLine(start: Vector2, end: Vector2, hit: RaycastHit): boolean; abstract containsPoint(point: Vector2): any; abstract pointCollidesWithShape(point: Vector2, result: CollisionResult): boolean; - clone(): Shape; } } declare module es { @@ -1508,7 +1501,7 @@ declare module es { static findPolygonCenter(points: Vector2[]): Vector2; static getFarthestPointInDirection(points: Vector2[], direction: Vector2): Vector2; static getClosestPointOnPolygonToPoint(points: Vector2[], point: Vector2, distanceSquared: Ref, edgeNormal: Vector2): Vector2; - static rotatePolygonVerts(radians: number, originalPoints: Vector2[], rotatedPoints: any): void; + static rotatePolygonVerts(radians: number, originalPoints: Vector2[], rotatedPoints: Vector2[]): void; recalculateBounds(collider: Collider): void; overlaps(other: Shape): any; collidesWithShape(other: Shape, result: CollisionResult): boolean; @@ -2051,122 +2044,6 @@ declare module es { update(): void; } } -declare module es { - class TouchState { - x: number; - y: number; - touchPoint: number; - touchDown: boolean; - readonly position: Vector2; - reset(): void; - } - class Input { - private static _init; - private static _previousTouchState; - private static _resolutionOffset; - private static _touchIndex; - private static _gameTouchs; - static readonly gameTouchs: TouchState[]; - private static _resolutionScale; - static readonly resolutionScale: Vector2; - private static _totalTouchCount; - static readonly totalTouchCount: number; - static readonly touchPosition: Vector2; - static maxSupportedTouch: number; - static readonly touchPositionDelta: Vector2; - static initialize(): void; - static scaledPosition(position: Vector2): Vector2; - private static initTouchCache; - private static touchBegin; - private static touchMove; - private static touchEnd; - private static setpreviousTouchState; - } -} -declare class KeyboardUtils { - static TYPE_KEY_DOWN: number; - static TYPE_KEY_UP: number; - static A: string; - static B: string; - static C: string; - static D: string; - static E: string; - static F: string; - static G: string; - static H: string; - static I: string; - static J: string; - static K: string; - static L: string; - static M: string; - static N: string; - static O: string; - static P: string; - static Q: string; - static R: string; - static S: string; - static T: string; - static U: string; - static V: string; - static W: string; - static X: string; - static Y: string; - static Z: string; - static ESC: string; - static F1: string; - static F2: string; - static F3: string; - static F4: string; - static F5: string; - static F6: string; - static F7: string; - static F8: string; - static F9: string; - static F10: string; - static F11: string; - static F12: string; - static NUM_1: string; - static NUM_2: string; - static NUM_3: string; - static NUM_4: string; - static NUM_5: string; - static NUM_6: string; - static NUM_7: string; - static NUM_8: string; - static NUM_9: string; - static NUM_0: string; - static TAB: string; - static CTRL: string; - static ALT: string; - static SHIFT: string; - static CAPS_LOCK: string; - static ENTER: string; - static SPACE: string; - static BACK_SPACE: string; - static INSERT: string; - static DELETE: string; - static HOME: string; - static END: string; - static PAGE_UP: string; - static PAGE_DOWN: string; - static LEFT: string; - static RIGHT: string; - static UP: string; - static DOWN: string; - static PAUSE_BREAK: string; - static NUM_LOCK: string; - static SCROLL_LOCK: string; - static WINDOWS: string; - private static keyDownDict; - private static keyUpDict; - static init(): void; - static registerKey(key: string, fun: Function, thisObj: any, type?: number, ...args: any[]): void; - static unregisterKey(key: string, type?: number): void; - static destroy(): void; - private static onKeyDonwHander; - private static onKeyUpHander; - private static keyCodeToString; -} declare module es { class ListPool { private static readonly _objectQueue; @@ -2386,6 +2263,250 @@ declare module es { initialized: boolean; } } +declare module es { + class TouchState { + x: number; + y: number; + touchPoint: number; + touchDown: boolean; + readonly position: Vector2; + reset(): void; + } + class Input { + private static _init; + private static _previousTouchState; + private static _resolutionOffset; + private static _touchIndex; + private static _gameTouchs; + static readonly gameTouchs: TouchState[]; + private static _resolutionScale; + static readonly resolutionScale: Vector2; + private static _totalTouchCount; + static readonly totalTouchCount: number; + static readonly touchPosition: Vector2; + static _virtualInputs: VirtualInput[]; + static maxSupportedTouch: number; + static readonly touchPositionDelta: Vector2; + static initialize(): void; + static update(): void; + static scaledPosition(position: Vector2): Vector2; + static isKeyPressed(key: Keys): boolean; + static isKeyPressedBoth(keyA: Keys, keyB: Keys): boolean; + static isKeyDown(key: Keys): boolean; + static isKeyDownBoth(keyA: Keys, keyB: Keys): boolean; + static isKeyReleased(key: Keys): boolean; + static isKeyReleasedBoth(keyA: Keys, keyB: Keys): boolean; + private static initTouchCache; + private static touchBegin; + private static touchMove; + private static touchEnd; + private static setpreviousTouchState; + } +} +import Keys = es.Keys; +declare class KeyboardUtils { + static currentKeys: Keys[]; + static previousKeys: Keys[]; + private static keyStatusKeys; + static init(): void; + static update(): void; + static destroy(): void; + private static onKeyDownHandler; + private static onKeyUpHandler; +} +declare module es { + enum Keys { + none = 0, + back = 8, + tab = 9, + enter = 13, + capsLock = 20, + escape = 27, + space = 32, + pageUp = 33, + pageDown = 34, + end = 35, + home = 36, + left = 37, + up = 38, + right = 39, + down = 40, + select = 41, + print = 42, + execute = 43, + printScreen = 44, + insert = 45, + delete = 46, + help = 47, + d0 = 48, + d1 = 49, + d2 = 50, + d3 = 51, + d4 = 52, + d5 = 53, + d6 = 54, + d7 = 55, + d8 = 56, + d9 = 57, + 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, + leftWindows = 91, + rightWindows = 92, + apps = 93, + sleep = 95, + numPad0 = 96, + numPad1 = 97, + numPad2 = 98, + numPad3 = 99, + numPad4 = 100, + numPad5 = 101, + numPad6 = 102, + numPad7 = 103, + numPad8 = 104, + numPad9 = 105, + multiply = 106, + add = 107, + seperator = 108, + subtract = 109, + decimal = 110, + divide = 111, + f1 = 112, + f2 = 113, + f3 = 114, + f4 = 115, + f5 = 116, + f6 = 117, + f7 = 118, + f8 = 119, + f9 = 120, + f10 = 121, + f11 = 122, + f12 = 123, + f13 = 124, + f14 = 125, + f15 = 126, + f16 = 127, + f17 = 128, + f18 = 129, + f19 = 130, + f20 = 131, + f21 = 132, + f22 = 133, + f23 = 134, + f24 = 135, + numLock = 144, + scroll = 145, + leftShift = 160, + rightShift = 161, + leftControl = 162, + rightControl = 163, + leftAlt = 164, + rightAlt = 165, + browserBack = 166, + browserForward = 167 + } +} +declare module es { + enum OverlapBehavior { + cancelOut = 0, + takeOlder = 1, + takeNewer = 2 + } + abstract class VirtualInput { + protected constructor(); + deregister(): void; + abstract update(): any; + } + abstract class VirtualInputNode { + update(): void; + } +} +declare module es { + class VirtualIntegerAxis extends VirtualInput { + nodes: VirtualAxisNode[]; + readonly value: number; + constructor(...nodes: VirtualAxisNode[]); + update(): void; + addKeyboardKeys(overlapBehavior: OverlapBehavior, negative: Keys, positive: Keys): this; + } + abstract class VirtualAxisNode extends VirtualInputNode { + abstract value: number; + } +} +declare module es { + class VirtualAxis extends VirtualInput { + nodes: VirtualAxisNode[]; + readonly value: number; + constructor(...nodes: VirtualAxisNode[]); + update(): void; + } + class KeyboardKeys extends VirtualAxisNode { + overlapBehavior: OverlapBehavior; + positive: Keys; + negative: Keys; + _value: number; + _turned: boolean; + constructor(overlapBehavior: OverlapBehavior, negative: Keys, positive: Keys); + update(): void; + readonly value: number; + } +} +declare module es { + class VirtualButton extends VirtualInput { + nodes: Node[]; + bufferTime: number; + firstRepeatTime: number; + mutiRepeatTime: number; + isRepeating: boolean; + _bufferCounter: number; + _repeatCounter: number; + _willRepeat: boolean; + constructor(bufferTime?: number, ...nodes: Node[]); + setRepeat(firstRepeatTime: number, mutiRepeatTime?: number): void; + update(): void; + readonly isDown: boolean; + readonly isPressed: boolean; + readonly isReleased: boolean; + consumeBuffer(): void; + addKeyboardKey(key: Keys): VirtualButton; + } + abstract class Node extends VirtualInputNode { + abstract isDown: boolean; + abstract isPressed: boolean; + abstract isReleased: boolean; + } + class KeyboardKey extends Node { + key: Keys; + constructor(key: Keys); + readonly isDown: boolean; + readonly isPressed: boolean; + readonly isReleased: boolean; + } +} declare module es { class AssetPacker { protected itemsToRaster: TextureToPack[]; diff --git a/source/bin/framework.js b/source/bin/framework.js index 1261c84d..d5a7d6fe 100644 --- a/source/bin/framework.js +++ b/source/bin/framework.js @@ -1096,6 +1096,7 @@ var es; case 0: this.startDebugUpdate(); es.Time.update(egret.getTimer()); + es.Input.update(); if (!this._scene) return [3, 2]; for (i = this._globalManagers.length - 1; i >= 0; i--) { if (this._globalManagers[i].enabled) @@ -1311,11 +1312,6 @@ var es; } return this; }; - Component.prototype.clone = function () { - var component = ObjectUtils.clone(this); - component.entity = null; - return component; - }; return Component; }(egret.HashObject)); es.Component = Component; @@ -1554,13 +1550,6 @@ var es; this.transform.getChild(i).entity.attachToScene(newScene); } }; - Entity.prototype.clone = function (position) { - if (position === void 0) { position = new es.Vector2(); } - var entity = new Entity(this.name + "(clone)"); - entity.copyFrom(this); - entity.transform.position = position; - return entity; - }; Entity.prototype.onAddedToScene = function () { }; Entity.prototype.onRemovedFromScene = function () { @@ -1620,24 +1609,6 @@ var es; Entity.prototype.toString = function () { return "[Entity: name: " + this.name + ", tag: " + this.tag + ", enabled: " + this.enabled + ", depth: " + this.updateOrder + "]"; }; - Entity.prototype.copyFrom = function (entity) { - this.tag = entity.tag; - this.updateInterval = entity.updateInterval; - this.updateOrder = entity.updateOrder; - this.enabled = entity.enabled; - this.transform.scale = entity.transform.scale; - this.transform.rotation = entity.transform.rotation; - for (var i = 0; i < entity.components.count; i++) - this.addComponent(entity.components.buffer[i].clone()); - for (var i = 0; i < entity.components._componentsToAdd.length; i++) - this.addComponent(entity.components._componentsToAdd[i].clone()); - for (var i = 0; i < entity.transform.childCount; i++) { - var child = entity.transform.getChild(i).entity; - var childClone = child.clone(); - childClone.transform.copyFrom(child.transform); - childClone.transform.parent = this.transform; - } - }; Entity._idGenerator = 0; return Entity; }()); @@ -3264,6 +3235,7 @@ var es; (function (es) { var SpriteAnimation = (function () { function SpriteAnimation(sprites, frameRate) { + if (frameRate === void 0) { frameRate = 10; } this.sprites = sprites; this.frameRate = frameRate; } @@ -3461,13 +3433,13 @@ var es; if (collisionLayerName === void 0) { collisionLayerName = null; } if (shouldCreateColliders === void 0) { shouldCreateColliders = true; } var _this = _super.call(this) || this; - _this.physicsLayer = 1 << 0; + _this.physicsLayer = new es.Ref(1 << 0); _this.toContainer = false; _this.tiledMap = tiledMap; _this._shouldCreateColliders = shouldCreateColliders; _this.displayObject = new egret.DisplayObjectContainer(); if (collisionLayerName) { - _this.collisionLayer = tiledMap.tileLayers[collisionLayerName]; + _this.collisionLayer = tiledMap.tileLayers.find(function (layer) { return layer.name == collisionLayerName; }); } return _this; } @@ -3554,7 +3526,7 @@ var es; var collisionRects = this.collisionLayer.getCollisionRectangles(); this._colliders = []; for (var i = 0; i < collisionRects.length; i++) { - var collider = new es.BoxCollider().createBoxRect(collisionRects[i].x + this._localOffset.x, collisionRects[i].y + this._localOffset.y, collisionRects[i].width, collisionRects[i].height); + var collider = new es.BoxCollider(collisionRects[i].x + this._localOffset.x, collisionRects[i].y + this._localOffset.y, collisionRects[i].width, collisionRects[i].height); collider.physicsLayer = this.physicsLayer; collider.entity = this.entity; this._colliders[i] = collider; @@ -3596,7 +3568,7 @@ var es; var bounds = collider.bounds; bounds.x += motion.x; bounds.y += motion.y; - var neighbors = es.Physics.boxcastBroadphaseExcludingSelf(collider, bounds, collider.collidesWithLayers); + var neighbors = es.Physics.boxcastBroadphaseExcludingSelf(collider, bounds, collider.collidesWithLayers.value); for (var j = 0; j < neighbors.length; j++) { var neighbor = neighbors[j]; if (neighbor.isTrigger) @@ -3645,10 +3617,10 @@ var es; if (!this._collider) return false; var didCollide = false; - this.entity.position = es.Vector2.add(this.entity.position, motion); - var neighbors = es.Physics.boxcastBroadphase(this._collider.bounds, this._collider.collidesWithLayers); - for (var i = 0; i < neighbors.length; i++) { - var neighbor = neighbors[i]; + this.entity.position.add(motion); + var neighbors = es.Physics.boxcastBroadphase(this._collider.bounds, this._collider.collidesWithLayers.value); + for (var _i = 0, neighbors_1 = neighbors; _i < neighbors_1.length; _i++) { + var neighbor = neighbors_1[_i]; if (this._collider.overlaps(neighbor) && neighbor.enabled) { didCollide = true; this.notifyTriggerListeners(this._collider, neighbor); @@ -3678,8 +3650,8 @@ var es; __extends(Collider, _super); function Collider() { var _this = _super !== null && _super.apply(this, arguments) || this; - _this.physicsLayer = 1 << 0; - _this.collidesWithLayers = es.Physics.allLayers; + _this.physicsLayer = new es.Ref(1 << 0); + _this.collidesWithLayers = new es.Ref(es.Physics.allLayers); _this.shouldColliderScaleAndRotateWithTransform = true; _this.registeredPhysicsBounds = new es.Rectangle(); _this._isPositionDirty = true; @@ -3748,8 +3720,8 @@ var es; var renderable = this.entity.getComponent(es.RenderableComponent); if (renderable) { var renderableBounds = renderable.bounds; - var width = renderableBounds.width / this.entity.scale.x; - var height = renderableBounds.height / this.entity.scale.y; + var width = renderableBounds.width / this.entity.transform.scale.x; + var height = renderableBounds.height / this.entity.transform.scale.y; if (this instanceof es.CircleCollider) { this.radius = Math.max(width, height) * 0.5; } @@ -3809,20 +3781,13 @@ var es; }; Collider.prototype.collidesWith = function (collider, motion, result) { var oldPosition = this.entity.position; - this.entity.position = this.entity.position.add(motion); + this.entity.position.add(motion); var didCollide = this.shape.collidesWithShape(collider.shape, result); if (didCollide) result.collider = collider; this.entity.position = oldPosition; return didCollide; }; - Collider.prototype.clone = function () { - var collider = ObjectUtils.clone(this); - collider.entity = null; - if (this.shape) - collider.shape = this.shape.clone(); - return collider; - }; return Collider; }(es.Component)); es.Collider = Collider; @@ -3831,14 +3796,28 @@ var es; (function (es) { var BoxCollider = (function (_super) { __extends(BoxCollider, _super); - function BoxCollider() { + function BoxCollider(x, y, width, height) { var _this = _super.call(this) || this; _this.hollowShape = new egret.Shape(); _this.polygonShape = new egret.Shape(); _this.pixelShape1 = new egret.Shape(); _this.pixelShape2 = new egret.Shape(); - _this.shape = new es.Box(1, 1); - _this._colliderRequiresAutoSizing = true; + if (x == undefined && y == undefined) { + if (width == undefined && height == undefined) { + _this.shape = new es.Box(1, 1); + _this._colliderRequiresAutoSizing = true; + } + else if (width != undefined && height != undefined) { + x = -width / 2; + y = -height / 2; + _this._localOffset = new es.Vector2(x + width / 2, y + height / 2); + _this.shape = new es.Box(width, height); + } + } + else if (x != undefined && y != undefined && width != undefined && height != undefined) { + _this._localOffset = new es.Vector2(x + width / 2, y + height / 2); + _this.shape = new es.Box(width, height); + } return _this; } Object.defineProperty(BoxCollider.prototype, "width", { @@ -3861,12 +3840,6 @@ var es; enumerable: true, configurable: true }); - BoxCollider.prototype.createBoxRect = function (x, y, width, height) { - this._localOffset = new es.Vector2(x + width / 2, y + width / 2); - this.shape = new es.Box(width, height); - this._colliderRequiresAutoSizing = false; - return this; - }; BoxCollider.prototype.setSize = function (width, height) { this._colliderRequiresAutoSizing = false; var box = this.shape; @@ -3906,6 +3879,11 @@ var es; this.debugDisplayObject.addChild(this.pixelShape1); if (!this.pixelShape2.parent) this.debugDisplayObject.addChild(this.pixelShape2); + this.hollowShape.graphics.clear(); + this.hollowShape.graphics.beginFill(es.Colors.colliderBounds, 0); + this.hollowShape.graphics.lineStyle(es.Size.lineSizeMultiplier, es.Colors.colliderBounds); + this.hollowShape.graphics.drawRect(this.bounds.x, this.bounds.y, this.bounds.width, this.bounds.height); + this.hollowShape.graphics.endFill(); this.polygonShape.graphics.clear(); if (poly.points.length >= 2) { this.polygonShape.graphics.beginFill(es.Colors.colliderEdge, 0); @@ -3951,9 +3929,13 @@ var es; _this.circleShape = new egret.Shape(); _this.pixelShape1 = new egret.Shape(); _this.pixelShape2 = new egret.Shape(); - if (radius) + if (radius == undefined) { + _this.shape = new es.Circle(1); _this._colliderRequiresAutoSizing = true; - _this.shape = new es.Circle(radius ? radius : 1); + } + else { + _this.shape = new es.Circle(radius); + } return _this; } Object.defineProperty(CircleCollider.prototype, "radius", { @@ -6155,17 +6137,17 @@ var es; return (self & flag) != 0; }; Flags.setFlagExclusive = function (self, flag) { - return 1 << flag; + self.value = 1 << flag; }; Flags.setFlag = function (self, flag) { - return (self | 1 << flag); + self.value = (self.value | 1 << flag); }; Flags.unsetFlag = function (self, flag) { flag = 1 << flag; - return (self & (~flag)); + self.value = (self.value & (~flag)); }; Flags.invertFlags = function (self) { - return ~self; + self.value = ~self.value; }; return Flags; }()); @@ -6828,23 +6810,42 @@ var es; t = es.MathHelper.clamp(t, 0, 1); return es.Vector2.add(lineA, new es.Vector2(v.x * t, v.y * t)); }; - Collisions.isCircleToCircle = function (circleCenter1, circleRadius1, circleCenter2, circleRadius2) { + Collisions.circleToCircle = function (circleCenter1, circleRadius1, circleCenter2, circleRadius2) { return es.Vector2.distanceSquared(circleCenter1, circleCenter2) < (circleRadius1 + circleRadius2) * (circleRadius1 + circleRadius2); }; - Collisions.isCircleToLine = function (circleCenter, radius, lineFrom, lineTo) { + Collisions.circleToLine = function (circleCenter, radius, lineFrom, lineTo) { return es.Vector2.distanceSquared(circleCenter, this.closestPointOnLine(lineFrom, lineTo, circleCenter)) < radius * radius; }; - Collisions.isCircleToPoint = function (circleCenter, radius, point) { + Collisions.circleToPoint = function (circleCenter, radius, point) { return es.Vector2.distanceSquared(circleCenter, point) < radius * radius; }; - Collisions.isRectToCircle = function (rect, cPosition, cRadius) { - var ew = rect.width * 0.5; - var eh = rect.height * 0.5; - var vx = Math.max(0, Math.max(cPosition.x - rect.x) - ew); - var vy = Math.max(0, Math.max(cPosition.y - rect.y) - eh); - return vx * vx + vy * vy < cRadius * cRadius; + Collisions.rectToCircle = function (rect, cPosition, cRadius) { + if (this.rectToPoint(rect.x, rect.y, rect.width, rect.height, cPosition)) + return true; + var edgeFrom = es.Vector2.zero; + var edgeTo = es.Vector2.zero; + var sector = this.getSector(rect.x, rect.y, rect.width, rect.height, cPosition); + if ((sector & PointSectors.top) != 0) { + edgeFrom = new es.Vector2(rect.x, rect.y); + edgeTo = new es.Vector2(rect.x + rect.width, rect.y); + if (this.circleToLine(cPosition, cRadius, edgeFrom, edgeTo)) + return true; + } + if ((sector & PointSectors.bottom) != 0) { + edgeFrom = new es.Vector2(rect.x, rect.y + rect.width); + edgeTo = new es.Vector2(rect.x + rect.width, rect.y + rect.height); + if (this.circleToLine(cPosition, cRadius, edgeFrom, edgeTo)) + return true; + } + if ((sector & PointSectors.left) != 0) { + edgeFrom = new es.Vector2(rect.x + rect.width, rect.y); + edgeTo = new es.Vector2(rect.x + rect.width, rect.y + rect.height); + if (this.circleToLine(cPosition, cRadius, edgeFrom, edgeTo)) + return true; + } + return false; }; - Collisions.isRectToLine = function (rect, lineFrom, lineTo) { + Collisions.rectToLine = function (rect, lineFrom, lineTo) { var fromSector = this.getSector(rect.x, rect.y, rect.width, rect.height, lineFrom); var toSector = this.getSector(rect.x, rect.y, rect.width, rect.height, lineTo); if (fromSector == PointSectors.center || toSector == PointSectors.center) { @@ -6884,7 +6885,7 @@ var es; } return false; }; - Collisions.isRectToPoint = function (rX, rY, rW, rH, point) { + Collisions.rectToPoint = function (rX, rY, rW, rH, point) { return point.x >= rX && point.y >= rY && point.x < rX + rW && point.y < rY + rH; }; Collisions.getSector = function (rX, rY, rW, rH, point) { @@ -7022,9 +7023,6 @@ var es; var Shape = (function () { function Shape() { } - Shape.prototype.clone = function () { - return ObjectUtils.clone(this); - }; return Shape; }()); es.Shape = Shape; @@ -7064,7 +7062,7 @@ var es; }; Polygon.prototype.buildEdgeNormals = function () { var totalEdges = this.isBox ? 2 : this.points.length; - if (this._edgeNormals == null || this._edgeNormals.length != totalEdges) + if (this._edgeNormals == undefined || this._edgeNormals.length != totalEdges) this._edgeNormals = new Array(totalEdges); var p2; for (var i = 0; i < totalEdges; i++) { @@ -7116,7 +7114,7 @@ var es; edgeNormal.x = 0; edgeNormal.y = 0; var closestPoint = new es.Vector2(0, 0); - var tempDistanceSquared; + var tempDistanceSquared = 0; for (var i = 0; i < points.length; i++) { var j = i + 1; if (j == points.length) @@ -7136,7 +7134,7 @@ var es; }; Polygon.rotatePolygonVerts = function (radians, originalPoints, rotatedPoints) { var cos = Math.cos(radians); - var sin = Math.sign(radians); + var sin = Math.sin(radians); for (var i = 0; i < originalPoints.length; i++) { var position = originalPoints[i]; rotatedPoints[i] = new es.Vector2(position.x * cos + position.y * -sin, position.x * sin + position.y * cos); @@ -7258,7 +7256,7 @@ var es; if (other instanceof Box && other.isUnrotated) return this.bounds.intersects(other.bounds); if (other instanceof es.Circle) - return es.Collisions.isRectToCircle(this.bounds, other.position, other.radius); + return es.Collisions.rectToCircle(this.bounds, other.position, other.radius); } return _super.prototype.overlaps.call(this, other); }; @@ -7302,18 +7300,18 @@ var es; if (collider.entity.transform.rotation != 0) { var offsetAngle = Math.atan2(collider.localOffset.y, collider.localOffset.x) * es.MathHelper.Rad2Deg; var offsetLength = hasUnitScale ? collider._localOffsetLength : es.Vector2.multiply(collider.localOffset, collider.entity.transform.scale).length(); - this.center = es.MathHelper.pointOnCirlce(es.Vector2.zero, offsetLength, collider.entity.transform.rotation + offsetAngle); + this.center = es.MathHelper.pointOnCirlce(es.Vector2.zero, offsetLength, collider.entity.transform.rotationDegrees + offsetAngle); } } - this.position = es.Vector2.add(collider.transform.position, this.center); + this.position = es.Vector2.add(collider.entity.transform.position, this.center); this.bounds = new es.Rectangle(this.position.x - this.radius, this.position.y - this.radius, this.radius * 2, this.radius * 2); }; Circle.prototype.overlaps = function (other) { var result = new es.CollisionResult(); if (other instanceof es.Box && other.isUnrotated) - return es.Collisions.isRectToCircle(other.bounds, this.position, this.radius); + return es.Collisions.rectToCircle(other.bounds, this.position, this.radius); if (other instanceof Circle) - return es.Collisions.isCircleToCircle(this.position, this.radius, other.position, other.radius); + return es.Collisions.circleToCircle(this.position, this.radius, other.position, other.radius); if (other instanceof es.Polygon) return es.ShapeCollisions.circleToPolygon(this, other, result); throw new Error("overlaps of circle to " + other + " are not supported"); @@ -7760,7 +7758,7 @@ var es; continue; var _loop_8 = function (i) { var collider = cell[i]; - if (collider == excludeCollider || !es.Flags.isFlagSet(layerMask, collider.physicsLayer)) + if (collider == excludeCollider || !es.Flags.isFlagSet(layerMask, collider.physicsLayer.value)) return "continue"; if (bounds.intersects(collider.bounds)) { if (!this_4._tempHashSet.firstOrDefault(function (c) { return c.hashCode == collider.hashCode; })) @@ -7916,7 +7914,7 @@ var es; this._checkedColliders.push(potential); if (potential.isTrigger && !es.Physics.raycastsHitTriggers) continue; - if (!es.Flags.isFlagSet(this._layerMask, potential.physicsLayer)) + if (!es.Flags.isFlagSet(this._layerMask, potential.physicsLayer.value)) continue; var colliderBounds = potential.bounds; if (colliderBounds.rayIntersects(this._ray, fraction) && fraction.value <= 1) { @@ -7992,7 +7990,7 @@ var es; return this.tiles[x + y * this.width]; }; TmxLayer.prototype.getCollisionRectangles = function () { - var checkedIndexes = []; + var checkedIndexes = new Array(this.tiles.length); var rectangles = []; var startCol = -1; var index = -1; @@ -8005,7 +8003,7 @@ var es; startCol = x; checkedIndexes[index] = true; } - else if (tile || checkedIndexes[index]) { + else if (!tile || checkedIndexes[index] == true) { if (startCol >= 0) { rectangles.push(this.findBoundsRect(startCol, x, y, checkedIndexes)); startCol = -1; @@ -8025,7 +8023,7 @@ var es; for (var x = startX; x < endX; x++) { index = y * this.map.width + x; var tile = this.getTile(x, y); - if (tile || checkedIndexes[index]) { + if (!tile || checkedIndexes[index]) { for (var _x = startX; _x < x; _x++) { index = y * this.map.width + _x; checkedIndexes[index] = false; @@ -8063,7 +8061,7 @@ var es; }); Object.defineProperty(TmxLayerTile.prototype, "tilesetTile", { get: function () { - if (this._tilesetTileIndex == undefined) { + if (!this._tilesetTileIndex) { this._tilesetTileIndex = -1; if (this.tileset.firstGid <= this.gid) { var tilesetTile = this.tileset.tiles.get(this.gid - this.tileset.firstGid); @@ -9892,364 +9890,6 @@ var es; es.GlobalManager = GlobalManager; })(es || (es = {})); var es; -(function (es) { - var TouchState = (function () { - function TouchState() { - this.x = 0; - this.y = 0; - this.touchPoint = -1; - this.touchDown = false; - } - Object.defineProperty(TouchState.prototype, "position", { - get: function () { - return new es.Vector2(this.x, this.y); - }, - enumerable: true, - configurable: true - }); - TouchState.prototype.reset = function () { - this.x = 0; - this.y = 0; - this.touchDown = false; - this.touchPoint = -1; - }; - return TouchState; - }()); - es.TouchState = TouchState; - var Input = (function () { - function Input() { - } - Object.defineProperty(Input, "gameTouchs", { - get: function () { - return this._gameTouchs; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Input, "resolutionScale", { - get: function () { - return this._resolutionScale; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Input, "totalTouchCount", { - get: function () { - return this._totalTouchCount; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Input, "touchPosition", { - get: function () { - if (!this._gameTouchs[0]) - return es.Vector2.zero; - return this._gameTouchs[0].position; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Input, "maxSupportedTouch", { - get: function () { - return es.Core._instance.stage.maxTouches; - }, - set: function (value) { - es.Core._instance.stage.maxTouches = value; - this.initTouchCache(); - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(Input, "touchPositionDelta", { - get: function () { - var delta = es.Vector2.subtract(this.touchPosition, this._previousTouchState.position); - if (delta.length() > 0) { - this.setpreviousTouchState(this._gameTouchs[0]); - } - return delta; - }, - enumerable: true, - configurable: true - }); - Input.initialize = function () { - if (this._init) - return; - this._init = true; - es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.touchBegin, this); - es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.touchMove, this); - es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.touchEnd, this); - es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL, this.touchEnd, this); - es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.touchEnd, this); - this.initTouchCache(); - }; - Input.scaledPosition = function (position) { - var scaledPos = new es.Vector2(position.x - this._resolutionOffset.x, position.y - this._resolutionOffset.y); - return es.Vector2.multiply(scaledPos, this.resolutionScale); - }; - Input.initTouchCache = function () { - this._totalTouchCount = 0; - this._touchIndex = 0; - this._gameTouchs.length = 0; - for (var i = 0; i < this.maxSupportedTouch; i++) { - this._gameTouchs.push(new TouchState()); - } - }; - Input.touchBegin = function (evt) { - if (this._touchIndex < this.maxSupportedTouch) { - this._gameTouchs[this._touchIndex].touchPoint = evt.touchPointID; - this._gameTouchs[this._touchIndex].touchDown = evt.touchDown; - this._gameTouchs[this._touchIndex].x = evt.stageX; - this._gameTouchs[this._touchIndex].y = evt.stageY; - if (this._touchIndex == 0) { - this.setpreviousTouchState(this._gameTouchs[0]); - } - this._touchIndex++; - this._totalTouchCount++; - } - }; - Input.touchMove = function (evt) { - if (evt.touchPointID == this._gameTouchs[0].touchPoint) { - this.setpreviousTouchState(this._gameTouchs[0]); - } - var touchIndex = this._gameTouchs.findIndex(function (touch) { return touch.touchPoint == evt.touchPointID; }); - if (touchIndex != -1) { - var touchData = this._gameTouchs[touchIndex]; - touchData.x = evt.stageX; - touchData.y = evt.stageY; - } - }; - Input.touchEnd = function (evt) { - var touchIndex = this._gameTouchs.findIndex(function (touch) { return touch.touchPoint == evt.touchPointID; }); - if (touchIndex != -1) { - var touchData = this._gameTouchs[touchIndex]; - touchData.reset(); - if (touchIndex == 0) - this._previousTouchState.reset(); - this._totalTouchCount--; - if (this.totalTouchCount == 0) { - this._touchIndex = 0; - } - } - }; - Input.setpreviousTouchState = function (touchState) { - this._previousTouchState = new TouchState(); - this._previousTouchState.x = touchState.position.x; - this._previousTouchState.y = touchState.position.y; - this._previousTouchState.touchPoint = touchState.touchPoint; - this._previousTouchState.touchDown = touchState.touchDown; - }; - Input._init = false; - Input._previousTouchState = new TouchState(); - Input._resolutionOffset = new es.Vector2(); - Input._touchIndex = 0; - Input._gameTouchs = []; - Input._resolutionScale = es.Vector2.one; - Input._totalTouchCount = 0; - return Input; - }()); - es.Input = Input; -})(es || (es = {})); -var KeyboardUtils = (function () { - function KeyboardUtils() { - } - KeyboardUtils.init = function () { - KeyboardUtils.keyDownDict = {}; - KeyboardUtils.keyUpDict = {}; - document.addEventListener("keydown", KeyboardUtils.onKeyDonwHander); - document.addEventListener("keyup", KeyboardUtils.onKeyUpHander); - }; - KeyboardUtils.registerKey = function (key, fun, thisObj, type) { - if (type === void 0) { type = 0; } - var args = []; - for (var _i = 4; _i < arguments.length; _i++) { - args[_i - 4] = arguments[_i]; - } - var keyDict = type ? this.keyUpDict : this.keyDownDict; - keyDict[key] = { "fun": fun, args: args, "thisObj": thisObj }; - }; - KeyboardUtils.unregisterKey = function (key, type) { - if (type === void 0) { type = 0; } - var keyDict = type ? this.keyUpDict : this.keyDownDict; - delete keyDict[key]; - }; - KeyboardUtils.destroy = function () { - KeyboardUtils.keyDownDict = null; - KeyboardUtils.keyUpDict = null; - document.removeEventListener("keydown", this.onKeyDonwHander); - document.removeEventListener("keyup", this.onKeyUpHander); - }; - KeyboardUtils.onKeyDonwHander = function (event) { - if (!KeyboardUtils.keyDownDict) - return; - var key = KeyboardUtils.keyCodeToString(event.keyCode); - var o = KeyboardUtils.keyDownDict[key]; - if (o) { - var fun = o["fun"]; - var thisObj = o["thisObj"]; - var args = o["args"]; - fun.apply(thisObj, args); - } - }; - KeyboardUtils.onKeyUpHander = function (event) { - if (!KeyboardUtils.keyUpDict) - return; - var key = KeyboardUtils.keyCodeToString(event.keyCode); - var o = KeyboardUtils.keyUpDict[key]; - if (o) { - var fun = o["fun"]; - var thisObj = o["thisObj"]; - var args = o["args"]; - fun.apply(thisObj, args); - } - }; - KeyboardUtils.keyCodeToString = function (keyCode) { - switch (keyCode) { - case 8: - return this.BACK_SPACE; - case 9: - return this.TAB; - case 13: - return this.ENTER; - case 16: - return this.SHIFT; - case 17: - return this.CTRL; - case 19: - return this.PAUSE_BREAK; - case 20: - return this.CAPS_LOCK; - case 27: - return this.ESC; - case 32: - return this.SPACE; - case 33: - return this.PAGE_UP; - case 34: - return this.PAGE_DOWN; - case 35: - return this.END; - case 36: - return this.HOME; - case 37: - return this.LEFT; - case 38: - return this.UP; - case 39: - return this.RIGHT; - case 40: - return this.DOWN; - case 45: - return this.INSERT; - case 46: - return this.DELETE; - case 91: - return this.WINDOWS; - case 112: - return this.F1; - case 113: - return this.F2; - case 114: - return this.F3; - case 115: - return this.F4; - case 116: - return this.F5; - case 117: - return this.F6; - case 118: - return this.F7; - case 119: - return this.F8; - case 120: - return this.F9; - case 122: - return this.F11; - case 123: - return this.F12; - case 144: - return this.NUM_LOCK; - case 145: - return this.SCROLL_LOCK; - default: - return String.fromCharCode(keyCode); - } - }; - KeyboardUtils.TYPE_KEY_DOWN = 0; - KeyboardUtils.TYPE_KEY_UP = 1; - KeyboardUtils.A = "A"; - KeyboardUtils.B = "B"; - KeyboardUtils.C = "C"; - KeyboardUtils.D = "D"; - KeyboardUtils.E = "E"; - KeyboardUtils.F = "F"; - KeyboardUtils.G = "G"; - KeyboardUtils.H = "H"; - KeyboardUtils.I = "I"; - KeyboardUtils.J = "J"; - KeyboardUtils.K = "K"; - KeyboardUtils.L = "L"; - KeyboardUtils.M = "M"; - KeyboardUtils.N = "N"; - KeyboardUtils.O = "O"; - KeyboardUtils.P = "P"; - KeyboardUtils.Q = "Q"; - KeyboardUtils.R = "R"; - KeyboardUtils.S = "S"; - KeyboardUtils.T = "T"; - KeyboardUtils.U = "U"; - KeyboardUtils.V = "V"; - KeyboardUtils.W = "W"; - KeyboardUtils.X = "X"; - KeyboardUtils.Y = "Y"; - KeyboardUtils.Z = "Z"; - KeyboardUtils.ESC = "Esc"; - KeyboardUtils.F1 = "F1"; - KeyboardUtils.F2 = "F2"; - KeyboardUtils.F3 = "F3"; - KeyboardUtils.F4 = "F4"; - KeyboardUtils.F5 = "F5"; - KeyboardUtils.F6 = "F6"; - KeyboardUtils.F7 = "F7"; - KeyboardUtils.F8 = "F8"; - KeyboardUtils.F9 = "F9"; - KeyboardUtils.F10 = "F10"; - KeyboardUtils.F11 = "F11"; - KeyboardUtils.F12 = "F12"; - KeyboardUtils.NUM_1 = "1"; - KeyboardUtils.NUM_2 = "2"; - KeyboardUtils.NUM_3 = "3"; - KeyboardUtils.NUM_4 = "4"; - KeyboardUtils.NUM_5 = "5"; - KeyboardUtils.NUM_6 = "6"; - KeyboardUtils.NUM_7 = "7"; - KeyboardUtils.NUM_8 = "8"; - KeyboardUtils.NUM_9 = "9"; - KeyboardUtils.NUM_0 = "0"; - KeyboardUtils.TAB = "Tab"; - KeyboardUtils.CTRL = "Ctrl"; - KeyboardUtils.ALT = "Alt"; - KeyboardUtils.SHIFT = "Shift"; - KeyboardUtils.CAPS_LOCK = "Caps Lock"; - KeyboardUtils.ENTER = "Enter"; - KeyboardUtils.SPACE = "Space"; - KeyboardUtils.BACK_SPACE = "Back Space"; - KeyboardUtils.INSERT = "Insert"; - KeyboardUtils.DELETE = "Page Down"; - KeyboardUtils.HOME = "Home"; - KeyboardUtils.END = "Page Down"; - KeyboardUtils.PAGE_UP = "Page Up"; - KeyboardUtils.PAGE_DOWN = "Page Down"; - KeyboardUtils.LEFT = "Left"; - KeyboardUtils.RIGHT = "Right"; - KeyboardUtils.UP = "Up"; - KeyboardUtils.DOWN = "Down"; - KeyboardUtils.PAUSE_BREAK = "Pause Break"; - KeyboardUtils.NUM_LOCK = "Num Lock"; - KeyboardUtils.SCROLL_LOCK = "Scroll Lock"; - KeyboardUtils.WINDOWS = "Windows"; - return KeyboardUtils; -}()); -var es; (function (es) { var ListPool = (function () { function ListPool() { @@ -11097,6 +10737,651 @@ var es; es.MarkerLog = MarkerLog; })(es || (es = {})); var es; +(function (es) { + var TouchState = (function () { + function TouchState() { + this.x = 0; + this.y = 0; + this.touchPoint = -1; + this.touchDown = false; + } + Object.defineProperty(TouchState.prototype, "position", { + get: function () { + return new es.Vector2(this.x, this.y); + }, + enumerable: true, + configurable: true + }); + TouchState.prototype.reset = function () { + this.x = 0; + this.y = 0; + this.touchDown = false; + this.touchPoint = -1; + }; + return TouchState; + }()); + es.TouchState = TouchState; + var Input = (function () { + function Input() { + } + Object.defineProperty(Input, "gameTouchs", { + get: function () { + return this._gameTouchs; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Input, "resolutionScale", { + get: function () { + return this._resolutionScale; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Input, "totalTouchCount", { + get: function () { + return this._totalTouchCount; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Input, "touchPosition", { + get: function () { + if (!this._gameTouchs[0]) + return es.Vector2.zero; + return this._gameTouchs[0].position; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Input, "maxSupportedTouch", { + get: function () { + return es.Core._instance.stage.maxTouches; + }, + set: function (value) { + es.Core._instance.stage.maxTouches = value; + this.initTouchCache(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(Input, "touchPositionDelta", { + get: function () { + var delta = es.Vector2.subtract(this.touchPosition, this._previousTouchState.position); + if (delta.length() > 0) { + this.setpreviousTouchState(this._gameTouchs[0]); + } + return delta; + }, + enumerable: true, + configurable: true + }); + Input.initialize = function () { + if (this._init) + return; + this._init = true; + es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.touchBegin, this); + es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.touchMove, this); + es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.touchEnd, this); + es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL, this.touchEnd, this); + es.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.touchEnd, this); + this.initTouchCache(); + }; + Input.update = function () { + KeyboardUtils.update(); + for (var i = 0; i < this._virtualInputs.length; i++) + this._virtualInputs[i].update(); + }; + Input.scaledPosition = function (position) { + var scaledPos = new es.Vector2(position.x - this._resolutionOffset.x, position.y - this._resolutionOffset.y); + return es.Vector2.multiply(scaledPos, this.resolutionScale); + }; + Input.isKeyPressed = function (key) { + return KeyboardUtils.currentKeys.contains(key) && !KeyboardUtils.previousKeys.contains(key); + }; + Input.isKeyPressedBoth = function (keyA, keyB) { + return this.isKeyPressed(keyA) || this.isKeyPressed(keyB); + }; + Input.isKeyDown = function (key) { + return KeyboardUtils.currentKeys.contains(key); + }; + Input.isKeyDownBoth = function (keyA, keyB) { + return this.isKeyDown(keyA) || this.isKeyDown(keyB); + }; + Input.isKeyReleased = function (key) { + return !KeyboardUtils.currentKeys.contains(key) && KeyboardUtils.previousKeys.contains(key); + }; + Input.isKeyReleasedBoth = function (keyA, keyB) { + return this.isKeyReleased(keyA) || this.isKeyReleased(keyB); + }; + Input.initTouchCache = function () { + this._totalTouchCount = 0; + this._touchIndex = 0; + this._gameTouchs.length = 0; + for (var i = 0; i < this.maxSupportedTouch; i++) { + this._gameTouchs.push(new TouchState()); + } + }; + Input.touchBegin = function (evt) { + if (this._touchIndex < this.maxSupportedTouch) { + this._gameTouchs[this._touchIndex].touchPoint = evt.touchPointID; + this._gameTouchs[this._touchIndex].touchDown = evt.touchDown; + this._gameTouchs[this._touchIndex].x = evt.stageX; + this._gameTouchs[this._touchIndex].y = evt.stageY; + if (this._touchIndex == 0) { + this.setpreviousTouchState(this._gameTouchs[0]); + } + this._touchIndex++; + this._totalTouchCount++; + } + }; + Input.touchMove = function (evt) { + if (evt.touchPointID == this._gameTouchs[0].touchPoint) { + this.setpreviousTouchState(this._gameTouchs[0]); + } + var touchIndex = this._gameTouchs.findIndex(function (touch) { return touch.touchPoint == evt.touchPointID; }); + if (touchIndex != -1) { + var touchData = this._gameTouchs[touchIndex]; + touchData.x = evt.stageX; + touchData.y = evt.stageY; + } + }; + Input.touchEnd = function (evt) { + var touchIndex = this._gameTouchs.findIndex(function (touch) { return touch.touchPoint == evt.touchPointID; }); + if (touchIndex != -1) { + var touchData = this._gameTouchs[touchIndex]; + touchData.reset(); + if (touchIndex == 0) + this._previousTouchState.reset(); + this._totalTouchCount--; + if (this.totalTouchCount == 0) { + this._touchIndex = 0; + } + } + }; + Input.setpreviousTouchState = function (touchState) { + this._previousTouchState = new TouchState(); + this._previousTouchState.x = touchState.position.x; + this._previousTouchState.y = touchState.position.y; + this._previousTouchState.touchPoint = touchState.touchPoint; + this._previousTouchState.touchDown = touchState.touchDown; + }; + Input._init = false; + Input._previousTouchState = new TouchState(); + Input._resolutionOffset = new es.Vector2(); + Input._touchIndex = 0; + Input._gameTouchs = []; + Input._resolutionScale = es.Vector2.one; + Input._totalTouchCount = 0; + Input._virtualInputs = []; + return Input; + }()); + es.Input = Input; +})(es || (es = {})); +var Keys = es.Keys; +var KeyboardUtils = (function () { + function KeyboardUtils() { + } + KeyboardUtils.init = function () { + document.addEventListener("keydown", KeyboardUtils.onKeyDownHandler); + document.addEventListener("keyup", KeyboardUtils.onKeyUpHandler); + }; + KeyboardUtils.update = function () { + KeyboardUtils.previousKeys.length = 0; + for (var _i = 0, _a = KeyboardUtils.currentKeys; _i < _a.length; _i++) { + var key = _a[_i]; + KeyboardUtils.previousKeys.push(key); + KeyboardUtils.currentKeys.remove(key); + } + KeyboardUtils.currentKeys.length = 0; + for (var _b = 0, _c = KeyboardUtils.keyStatusKeys; _b < _c.length; _b++) { + var key = _c[_b]; + KeyboardUtils.currentKeys.push(key); + } + }; + KeyboardUtils.destroy = function () { + KeyboardUtils.currentKeys.length = 0; + document.removeEventListener("keyup", KeyboardUtils.onKeyUpHandler); + document.removeEventListener("keypress", KeyboardUtils.onKeyDownHandler); + }; + KeyboardUtils.onKeyDownHandler = function (event) { + if (!KeyboardUtils.keyStatusKeys.contains(event.keyCode)) + KeyboardUtils.keyStatusKeys.push(event.keyCode); + }; + KeyboardUtils.onKeyUpHandler = function (event) { + if (KeyboardUtils.keyStatusKeys.contains(event.keyCode)) + KeyboardUtils.keyStatusKeys.remove(event.keyCode); + }; + KeyboardUtils.currentKeys = []; + KeyboardUtils.previousKeys = []; + KeyboardUtils.keyStatusKeys = []; + return KeyboardUtils; +}()); +var es; +(function (es) { + var Keys; + (function (Keys) { + Keys[Keys["none"] = 0] = "none"; + Keys[Keys["back"] = 8] = "back"; + Keys[Keys["tab"] = 9] = "tab"; + Keys[Keys["enter"] = 13] = "enter"; + Keys[Keys["capsLock"] = 20] = "capsLock"; + Keys[Keys["escape"] = 27] = "escape"; + Keys[Keys["space"] = 32] = "space"; + Keys[Keys["pageUp"] = 33] = "pageUp"; + Keys[Keys["pageDown"] = 34] = "pageDown"; + Keys[Keys["end"] = 35] = "end"; + Keys[Keys["home"] = 36] = "home"; + Keys[Keys["left"] = 37] = "left"; + Keys[Keys["up"] = 38] = "up"; + Keys[Keys["right"] = 39] = "right"; + Keys[Keys["down"] = 40] = "down"; + Keys[Keys["select"] = 41] = "select"; + Keys[Keys["print"] = 42] = "print"; + Keys[Keys["execute"] = 43] = "execute"; + Keys[Keys["printScreen"] = 44] = "printScreen"; + Keys[Keys["insert"] = 45] = "insert"; + Keys[Keys["delete"] = 46] = "delete"; + Keys[Keys["help"] = 47] = "help"; + Keys[Keys["d0"] = 48] = "d0"; + Keys[Keys["d1"] = 49] = "d1"; + Keys[Keys["d2"] = 50] = "d2"; + Keys[Keys["d3"] = 51] = "d3"; + Keys[Keys["d4"] = 52] = "d4"; + Keys[Keys["d5"] = 53] = "d5"; + Keys[Keys["d6"] = 54] = "d6"; + Keys[Keys["d7"] = 55] = "d7"; + Keys[Keys["d8"] = 56] = "d8"; + Keys[Keys["d9"] = 57] = "d9"; + Keys[Keys["a"] = 65] = "a"; + Keys[Keys["b"] = 66] = "b"; + Keys[Keys["c"] = 67] = "c"; + Keys[Keys["d"] = 68] = "d"; + Keys[Keys["e"] = 69] = "e"; + Keys[Keys["f"] = 70] = "f"; + Keys[Keys["g"] = 71] = "g"; + Keys[Keys["h"] = 72] = "h"; + Keys[Keys["i"] = 73] = "i"; + Keys[Keys["j"] = 74] = "j"; + Keys[Keys["k"] = 75] = "k"; + Keys[Keys["l"] = 76] = "l"; + Keys[Keys["m"] = 77] = "m"; + Keys[Keys["n"] = 78] = "n"; + Keys[Keys["o"] = 79] = "o"; + Keys[Keys["p"] = 80] = "p"; + Keys[Keys["q"] = 81] = "q"; + Keys[Keys["r"] = 82] = "r"; + Keys[Keys["s"] = 83] = "s"; + Keys[Keys["t"] = 84] = "t"; + Keys[Keys["u"] = 85] = "u"; + Keys[Keys["v"] = 86] = "v"; + Keys[Keys["w"] = 87] = "w"; + Keys[Keys["x"] = 88] = "x"; + Keys[Keys["y"] = 89] = "y"; + Keys[Keys["z"] = 90] = "z"; + Keys[Keys["leftWindows"] = 91] = "leftWindows"; + Keys[Keys["rightWindows"] = 92] = "rightWindows"; + Keys[Keys["apps"] = 93] = "apps"; + Keys[Keys["sleep"] = 95] = "sleep"; + Keys[Keys["numPad0"] = 96] = "numPad0"; + Keys[Keys["numPad1"] = 97] = "numPad1"; + Keys[Keys["numPad2"] = 98] = "numPad2"; + Keys[Keys["numPad3"] = 99] = "numPad3"; + Keys[Keys["numPad4"] = 100] = "numPad4"; + Keys[Keys["numPad5"] = 101] = "numPad5"; + Keys[Keys["numPad6"] = 102] = "numPad6"; + Keys[Keys["numPad7"] = 103] = "numPad7"; + Keys[Keys["numPad8"] = 104] = "numPad8"; + Keys[Keys["numPad9"] = 105] = "numPad9"; + Keys[Keys["multiply"] = 106] = "multiply"; + Keys[Keys["add"] = 107] = "add"; + Keys[Keys["seperator"] = 108] = "seperator"; + Keys[Keys["subtract"] = 109] = "subtract"; + Keys[Keys["decimal"] = 110] = "decimal"; + Keys[Keys["divide"] = 111] = "divide"; + Keys[Keys["f1"] = 112] = "f1"; + Keys[Keys["f2"] = 113] = "f2"; + Keys[Keys["f3"] = 114] = "f3"; + Keys[Keys["f4"] = 115] = "f4"; + Keys[Keys["f5"] = 116] = "f5"; + Keys[Keys["f6"] = 117] = "f6"; + Keys[Keys["f7"] = 118] = "f7"; + Keys[Keys["f8"] = 119] = "f8"; + Keys[Keys["f9"] = 120] = "f9"; + Keys[Keys["f10"] = 121] = "f10"; + Keys[Keys["f11"] = 122] = "f11"; + Keys[Keys["f12"] = 123] = "f12"; + Keys[Keys["f13"] = 124] = "f13"; + Keys[Keys["f14"] = 125] = "f14"; + Keys[Keys["f15"] = 126] = "f15"; + Keys[Keys["f16"] = 127] = "f16"; + Keys[Keys["f17"] = 128] = "f17"; + Keys[Keys["f18"] = 129] = "f18"; + Keys[Keys["f19"] = 130] = "f19"; + Keys[Keys["f20"] = 131] = "f20"; + Keys[Keys["f21"] = 132] = "f21"; + Keys[Keys["f22"] = 133] = "f22"; + Keys[Keys["f23"] = 134] = "f23"; + Keys[Keys["f24"] = 135] = "f24"; + Keys[Keys["numLock"] = 144] = "numLock"; + Keys[Keys["scroll"] = 145] = "scroll"; + Keys[Keys["leftShift"] = 160] = "leftShift"; + Keys[Keys["rightShift"] = 161] = "rightShift"; + Keys[Keys["leftControl"] = 162] = "leftControl"; + Keys[Keys["rightControl"] = 163] = "rightControl"; + Keys[Keys["leftAlt"] = 164] = "leftAlt"; + Keys[Keys["rightAlt"] = 165] = "rightAlt"; + Keys[Keys["browserBack"] = 166] = "browserBack"; + Keys[Keys["browserForward"] = 167] = "browserForward"; + })(Keys = es.Keys || (es.Keys = {})); +})(es || (es = {})); +var es; +(function (es) { + var OverlapBehavior; + (function (OverlapBehavior) { + OverlapBehavior[OverlapBehavior["cancelOut"] = 0] = "cancelOut"; + OverlapBehavior[OverlapBehavior["takeOlder"] = 1] = "takeOlder"; + OverlapBehavior[OverlapBehavior["takeNewer"] = 2] = "takeNewer"; + })(OverlapBehavior = es.OverlapBehavior || (es.OverlapBehavior = {})); + var VirtualInput = (function () { + function VirtualInput() { + es.Input._virtualInputs.push(this); + } + VirtualInput.prototype.deregister = function () { + es.Input._virtualInputs.remove(this); + }; + return VirtualInput; + }()); + es.VirtualInput = VirtualInput; + var VirtualInputNode = (function () { + function VirtualInputNode() { + } + VirtualInputNode.prototype.update = function () { }; + return VirtualInputNode; + }()); + es.VirtualInputNode = VirtualInputNode; +})(es || (es = {})); +var es; +(function (es) { + var VirtualIntegerAxis = (function (_super) { + __extends(VirtualIntegerAxis, _super); + function VirtualIntegerAxis() { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + var _this = _super.call(this) || this; + _this.nodes = []; + _this.nodes.concat(nodes); + return _this; + } + Object.defineProperty(VirtualIntegerAxis.prototype, "value", { + get: function () { + for (var i = 0; i < this.nodes.length; i++) { + var val = this.nodes[i].value; + if (val != 0) + return Math.sign(val); + } + return 0; + }, + enumerable: true, + configurable: true + }); + VirtualIntegerAxis.prototype.update = function () { + for (var i = 0; i < this.nodes.length; i++) + this.nodes[i].update(); + }; + VirtualIntegerAxis.prototype.addKeyboardKeys = function (overlapBehavior, negative, positive) { + this.nodes.push(new es.KeyboardKeys(overlapBehavior, negative, positive)); + return this; + }; + return VirtualIntegerAxis; + }(es.VirtualInput)); + es.VirtualIntegerAxis = VirtualIntegerAxis; + var VirtualAxisNode = (function (_super) { + __extends(VirtualAxisNode, _super); + function VirtualAxisNode() { + return _super !== null && _super.apply(this, arguments) || this; + } + return VirtualAxisNode; + }(es.VirtualInputNode)); + es.VirtualAxisNode = VirtualAxisNode; +})(es || (es = {})); +var es; +(function (es) { + var VirtualAxis = (function (_super) { + __extends(VirtualAxis, _super); + function VirtualAxis() { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + var _this = _super.call(this) || this; + _this.nodes = []; + _this.nodes.concat(nodes); + return _this; + } + Object.defineProperty(VirtualAxis.prototype, "value", { + get: function () { + for (var i = 0; i < this.nodes.length; i++) { + var val = this.nodes[i].value; + if (val != 0) + return val; + } + return 0; + }, + enumerable: true, + configurable: true + }); + VirtualAxis.prototype.update = function () { + for (var i = 0; i < this.nodes.length; i++) + this.nodes[i].update(); + }; + return VirtualAxis; + }(es.VirtualInput)); + es.VirtualAxis = VirtualAxis; + var KeyboardKeys = (function (_super) { + __extends(KeyboardKeys, _super); + function KeyboardKeys(overlapBehavior, negative, positive) { + var _this = _super.call(this) || this; + _this._value = 0; + _this.overlapBehavior = overlapBehavior; + _this.negative = negative; + _this.positive = positive; + return _this; + } + KeyboardKeys.prototype.update = function () { + if (es.Input.isKeyDown(this.positive)) { + if (es.Input.isKeyDown(this.negative)) { + switch (this.overlapBehavior) { + default: + case es.OverlapBehavior.cancelOut: + this._value = 0; + break; + case es.OverlapBehavior.takeNewer: + if (!this._turned) { + this._value *= -1; + this._turned = true; + } + break; + case es.OverlapBehavior.takeOlder: + break; + } + } + else { + this._turned = false; + this._value = 1; + } + } + else if (es.Input.isKeyDown(this.negative)) { + this._turned = false; + this._value = -1; + } + else { + this._turned = false; + this._value = 0; + } + }; + Object.defineProperty(KeyboardKeys.prototype, "value", { + get: function () { + return this._value; + }, + enumerable: true, + configurable: true + }); + return KeyboardKeys; + }(es.VirtualAxisNode)); + es.KeyboardKeys = KeyboardKeys; +})(es || (es = {})); +var es; +(function (es) { + var VirtualButton = (function (_super) { + __extends(VirtualButton, _super); + function VirtualButton(bufferTime) { + if (bufferTime === void 0) { bufferTime = 0; } + var nodes = []; + for (var _i = 1; _i < arguments.length; _i++) { + nodes[_i - 1] = arguments[_i]; + } + var _this = _super.call(this) || this; + _this.nodes = []; + _this.bufferTime = 0; + _this.firstRepeatTime = 0; + _this.mutiRepeatTime = 0; + _this._bufferCounter = 0; + _this._repeatCounter = 0; + _this.nodes = nodes; + _this.bufferTime = bufferTime; + return _this; + } + VirtualButton.prototype.setRepeat = function (firstRepeatTime, mutiRepeatTime) { + if (mutiRepeatTime === void 0) { mutiRepeatTime = firstRepeatTime; } + this.firstRepeatTime = firstRepeatTime; + this.mutiRepeatTime = mutiRepeatTime; + this._willRepeat = this.firstRepeatTime > 0; + if (!this._willRepeat) + this.isRepeating = false; + }; + VirtualButton.prototype.update = function () { + this._bufferCounter -= es.Time.unscaledDeltaTime; + this.isRepeating = false; + var check = false; + for (var i = 0; i < this.nodes.length; i++) { + this.nodes[i].update(); + if (this.nodes[i].isPressed) { + this._bufferCounter = this.bufferTime; + check = true; + } + else if (this.nodes[i].isDown) { + check = true; + } + } + if (!check) { + this._repeatCounter = 0; + this._bufferCounter = 0; + } + else if (this._willRepeat) { + if (this._repeatCounter == 0) { + this._repeatCounter = this.firstRepeatTime; + } + else { + this._repeatCounter -= es.Time.unscaledDeltaTime; + if (this._repeatCounter <= 0) { + this.isRepeating = true; + this._repeatCounter = this.mutiRepeatTime; + } + } + } + }; + Object.defineProperty(VirtualButton.prototype, "isDown", { + get: function () { + for (var _i = 0, _a = this.nodes; _i < _a.length; _i++) { + var node = _a[_i]; + if (node.isDown) + return true; + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VirtualButton.prototype, "isPressed", { + get: function () { + if (this._bufferCounter > 0 || this.isRepeating) + return true; + for (var _i = 0, _a = this.nodes; _i < _a.length; _i++) { + var node = _a[_i]; + if (node.isPressed) + return true; + } + return false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(VirtualButton.prototype, "isReleased", { + get: function () { + for (var _i = 0, _a = this.nodes; _i < _a.length; _i++) { + var node = _a[_i]; + if (node.isReleased) + return true; + } + return false; + }, + enumerable: true, + configurable: true + }); + VirtualButton.prototype.consumeBuffer = function () { + this._bufferCounter = 0; + }; + VirtualButton.prototype.addKeyboardKey = function (key) { + this.nodes.push(new KeyboardKey(key)); + return this; + }; + return VirtualButton; + }(es.VirtualInput)); + es.VirtualButton = VirtualButton; + var Node = (function (_super) { + __extends(Node, _super); + function Node() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Node; + }(es.VirtualInputNode)); + es.Node = Node; + var KeyboardKey = (function (_super) { + __extends(KeyboardKey, _super); + function KeyboardKey(key) { + var _this = _super.call(this) || this; + _this.key = key; + return _this; + } + Object.defineProperty(KeyboardKey.prototype, "isDown", { + get: function () { + return es.Input.isKeyDown(this.key); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(KeyboardKey.prototype, "isPressed", { + get: function () { + return es.Input.isKeyPressed(this.key); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(KeyboardKey.prototype, "isReleased", { + get: function () { + return es.Input.isKeyReleased(this.key); + }, + enumerable: true, + configurable: true + }); + return KeyboardKey; + }(Node)); + es.KeyboardKey = KeyboardKey; +})(es || (es = {})); +var es; (function (es) { var Bitmap = egret.Bitmap; var AssetPacker = (function () { diff --git a/source/bin/framework.min.js b/source/bin/framework.min.js index 4c0da89f..5b173882 100644 --- a/source/bin/framework.min.js +++ b/source/bin/framework.min.js @@ -1 +1 @@ -window.es={},window.__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var transform,__awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(s,a)}h((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]-1}(this,t)},Array.prototype.firstOrDefault=function(t){return function(t,e){var i=t.findIndex(e);return-1==i?null:t[i]}(this,t)},Array.prototype.find=function(t){return function(t,e){return t.firstOrDefault(e)}(this,t)},Array.prototype.where=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return e.call(arguments[2],n,r,t)&&i.push(n),i},[]);for(var i=[],n=0,r=t.length;n=0&&t.splice(i,1)}while(i>=0)}(this,t)},Array.prototype.remove=function(t){return function(t,e){var i=t.findIndex(function(t){return t===e});return i>=0&&(t.splice(i,1),!0)}(this,t)},Array.prototype.removeAt=function(t){return function(t,e){t.splice(e,1)}(this,t)},Array.prototype.removeRange=function(t,e){return function(t,e,i){t.splice(e,i)}(this,t,e)},Array.prototype.select=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return i.push(e.call(arguments[2],n,r,t)),i},[]);for(var i=[],n=0,r=t.length;no?1:-1}),t}(this,t,e)},Array.prototype.orderByDescending=function(t,e){return function(t,e,i){return t.sort(function(t,n){var r=e(t),o=e(n);return i?-i(r,o):r0;){if("break"===l())break}return s?this.recontructPath(a,n,r):null},e.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},e}();t.AStarPathfinder=e;var i=function(t){function e(e){var i=t.call(this)||this;return i.data=e,i}return __extends(e,t),e}(t.PriorityQueueNode);t.AStarNode=i}(es||(es={})),function(t){var e=function(){function e(e,i){this.dirs=[new t.Vector2(1,0),new t.Vector2(0,-1),new t.Vector2(-1,0),new t.Vector2(0,1)],this.walls=[],this.weightedNodes=[],this.defaultWeight=1,this.weightedNodeWeight=5,this._neighbors=new Array(4),this._width=e,this._height=i}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x=this._nodes.length?(console.error("node.QueueIndex has been corrupted. Did you change it manually? Or add this node to another queue?"),!1):this._nodes[t.queueIndex]==t:(console.error("node cannot be null"),!1)},t.prototype.enqueue=function(t,e){t.priority=e,this._numNodes++,this._nodes[this._numNodes]=t,t.queueIndex=this._numNodes,t.insertionIndex=this._numNodesEverEnqueued++,this.cascadeUp(this._nodes[this._numNodes])},t.prototype.dequeue=function(){var t=this._nodes[1];return this.remove(t),t},t.prototype.remove=function(t){if(t.queueIndex==this._numNodes)return this._nodes[this._numNodes]=null,void this._numNodes--;var e=this._nodes[this._numNodes];this.swap(t,e),delete this._nodes[this._numNodes],this._numNodes--,this.onNodeUpdated(e)},t.prototype.isValidQueue=function(){for(var t=1;t0&&this.hasHigherPriority(t,i)?this.cascadeUp(t):this.cascadeDown(t)},t.prototype.cascadeDown=function(t){for(var e,i=t.queueIndex;;){e=t;var n=2*i;if(n>this._numNodes){t.queueIndex=i,this._nodes[i]=t;break}var r=this._nodes[n];this.hasHigherPriority(r,e)&&(e=r);var o=n+1;if(o<=this._numNodes){var s=this._nodes[o];this.hasHigherPriority(s,e)&&(e=s)}if(e==t){t.queueIndex=i,this._nodes[i]=t;break}this._nodes[i]=e;var a=e.queueIndex;e.queueIndex=i,i=a}},t.prototype.cascadeUp=function(t){for(var e=Math.floor(t.queueIndex/2);e>=1;){var i=this._nodes[e];if(this.hasHigherPriority(i,t))break;this.swap(t,i),e=Math.floor(t.queueIndex/2)}},t.prototype.swap=function(t,e){this._nodes[t.queueIndex]=e,this._nodes[e.queueIndex]=t;var i=t.queueIndex;t.queueIndex=e.queueIndex,e.queueIndex=i},t.prototype.hasHigherPriority=function(t,e){return t.priority0;){if("break"===h())break}return o?t.AStarPathfinder.recontructPath(a,i,n):null},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e}();t.BreadthFirstPathfinder=e}(es||(es={})),function(t){var e=function(){function t(){this.edges=new Map}return t.prototype.addEdgesForNode=function(t,e){return this.edges.set(t,e),this},t.prototype.getNeighbors=function(t){return this.edges.get(t)},t}();t.UnweightedGraph=e}(es||(es={})),function(t){var e=function(){function e(t,e){this.x=0,this.y=0,this.x=t||0,this.y=null!=e?e:this.x}return Object.defineProperty(e,"zero",{get:function(){return new e(0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return new e(1,1)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitX",{get:function(){return new e(1,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitY",{get:function(){return new e(0,1)},enumerable:!0,configurable:!0}),e.add=function(t,i){var n=new e(0,0);return n.x=t.x+i.x,n.y=t.y+i.y,n},e.divide=function(t,i){var n=new e(0,0);return n.x=t.x/i.x,n.y=t.y/i.y,n},e.multiply=function(t,i){var n=new e(0,0);return n.x=t.x*i.x,n.y=t.y*i.y,n},e.subtract=function(t,i){var n=new e(0,0);return n.x=t.x-i.x,n.y=t.y-i.y,n},e.normalize=function(t){var i=new e(t.x,t.y),n=1/Math.sqrt(i.x*i.x+i.y*i.y);return i.x*=n,i.y*=n,i},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.distanceSquared=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},e.clamp=function(i,n,r){return new e(t.MathHelper.clamp(i.x,n.x,r.x),t.MathHelper.clamp(i.y,n.y,r.y))},e.lerp=function(i,n,r){return new e(t.MathHelper.lerp(i.x,n.x,r),t.MathHelper.lerp(i.y,n.y,r))},e.transform=function(t,i){return new e(t.x*i.m11+t.y*i.m21+i.m31,t.x*i.m12+t.y*i.m22+i.m32)},e.distance=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},e.angle=function(i,n){return i=e.normalize(i),n=e.normalize(n),Math.acos(t.MathHelper.clamp(e.dot(i,n),-1,1))*t.MathHelper.Rad2Deg},e.negate=function(t){var i=new e;return i.x=-t.x,i.y=-t.y,i},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.normalize=function(){var t=1/Math.sqrt(this.x*this.x+this.y*this.y);this.x*=t,this.y*=t},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.round=function(){return new e(Math.round(this.x),Math.round(this.y))},e.prototype.equals=function(t){return t.x==this.x&&t.y==this.y},e}();t.Vector2=e}(es||(es={})),function(t){var e=function(){function e(t,i,n){void 0===n&&(n=!1),this.walls=[],this._neighbors=new Array(4),this._width=t,this._hegiht=i,this._dirs=n?e.COMPASS_DIRS:e.CARDINAL_DIRS}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x0;){if("break"===l())break}return s?this.recontructPath(a,n,r):null},i.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},i.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},i.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},i}();t.WeightedPathfinder=i}(es||(es={})),function(t){var e=function(e){function i(){var n=e.call(this)||this;return n._globalManagers=[],n._timerManager=new t.TimerManager,i._instance=n,i.emitter=new t.Emitter,i.content=new t.ContentManager,n.addEventListener(egret.Event.ADDED_TO_STAGE,n.onAddToStage,n),i.registerGlobalManager(n._timerManager),n}return __extends(i,e),Object.defineProperty(i,"Instance",{get:function(){return this._instance},enumerable:!0,configurable:!0}),Object.defineProperty(i,"scene",{get:function(){return this._instance?this._instance._scene:null},set:function(t){t?null==this._instance._scene?(this._instance.addChild(t),this._instance._scene=t,this._instance._scene.begin(),i.Instance.onSceneChanged()):this._instance._nextScene=t:console.error("场景不能为空")},enumerable:!0,configurable:!0}),i.startSceneTransition=function(t){if(!this._instance._sceneTransition)return this._instance._sceneTransition=t,t;console.warn("在前一个场景完成之前,不能开始一个新的场景转换。")},i.registerGlobalManager=function(t){this._instance._globalManagers.push(t),t.enabled=!0},i.unregisterGlobalManager=function(t){this._instance._globalManagers.remove(t),t.enabled=!1},i.getGlobalManager=function(t){for(var e=0;e=0;e--)this._globalManagers[e].enabled&&this._globalManagers[e].update();return this._sceneTransition&&(!this._sceneTransition||this._sceneTransition.loadsNewScene&&!this._sceneTransition.isNewSceneLoaded)||this._scene.update(),this._nextScene?(this._scene.parent&&this._scene.parent.removeChild(this._scene),this._scene.end(),this._scene=this._nextScene,this._nextScene=null,this.onSceneChanged(),[4,this._scene.begin()]):[3,2];case 1:i.sent(),this.addChild(this._scene),i.label=2;case 2:return this.endDebugUpdate(),[4,this.draw()];case 3:return i.sent(),[2]}})})},i.prototype.onAddToStage=function(){i.graphicsDevice=new t.GraphicsDevice,this.addEventListener(egret.Event.RESIZE,this.onGraphicsDeviceReset,this),this.addEventListener(egret.StageOrientationEvent.ORIENTATION_CHANGE,this.onOrientationChanged,this),this.addEventListener(egret.Event.ENTER_FRAME,this.update,this),t.Input.initialize(),KeyboardUtils.init(),this.initialize()},i.debugRenderEndabled=!1,i}(egret.DisplayObjectContainer);t.Core=e}(es||(es={})),function(t){var e=function(){function t(){}return t.renderableBounds=16776960,t.renderableCenter=10040012,t.colliderBounds=5592405,t.colliderEdge=9109504,t.colliderPosition=16776960,t.colliderCenter=16711680,t}();t.Colors=e;var i=function(){function e(){}return Object.defineProperty(e,"lineSizeMultiplier",{get:function(){return Math.max(Math.ceil(t.Core.scene.x/t.Core.scene.width),1)},enumerable:!0,configurable:!0}),e}();t.Size=i;var n=function(){function e(){}return e.drawHollowRect=function(e,i,n){void 0===n&&(n=0),this._debugDrawItems.push(new t.DebugDrawItem(e,i,n))},e.render=function(){if(this._debugDrawItems.length>0){var e=new egret.Shape;t.Core.scene&&t.Core.scene.addChild(e);for(var i=this._debugDrawItems.length-1;i>=0;i--){this._debugDrawItems[i].draw(e)&&this._debugDrawItems.removeAt(i)}}},e._debugDrawItems=[],e}();t.Debug=n}(es||(es={})),function(t){var e=function(){function t(){}return t.verletParticle=14431326,t.verletConstraintEdge=4406838,t}();t.DebugDefaults=e}(es||(es={})),function(t){var e;!function(t){t[t.line=0]="line",t[t.hollowRectangle=1]="hollowRectangle",t[t.pixel=2]="pixel",t[t.text=3]="text"}(e=t.DebugDrawType||(t.DebugDrawType={}));var i=function(){function i(t,i,n){this.rectangle=t,this.color=i,this.duration=n,this.drawType=e.hollowRectangle}return i.prototype.draw=function(i){switch(this.drawType){case e.line:case e.hollowRectangle:case e.pixel:case e.text:}return this.duration-=t.Time.deltaTime,this.duration<0},i}();t.DebugDrawItem=i}(es||(es={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.updateInterval=1,e.debugDisplayObject=new egret.DisplayObjectContainer,e._enabled=!0,e._updateOrder=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"transform",{get:function(){return this.entity.transform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this.entity?this.entity.enabled&&this._enabled:this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){},e.prototype.onAddedToEntity=function(){},e.prototype.onRemovedFromEntity=function(){},e.prototype.onEntityTransformChanged=function(t){},e.prototype.debugRender=function(){},e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled()),this},e.prototype.setUpdateOrder=function(t){return this._updateOrder!=t&&(this._updateOrder=t),this},e.prototype.clone=function(){var t=ObjectUtils.clone(this);return t.entity=null,t},e}(egret.HashObject);t.Component=e}(es||(es={})),function(t){!function(t){t[t.GraphicsDeviceReset=0]="GraphicsDeviceReset",t[t.SceneChanged=1]="SceneChanged",t[t.OrientationChanged=2]="OrientationChanged"}(t.CoreEvents||(t.CoreEvents={}))}(es||(es={})),function(t){var e=function(){function e(i){this.updateInterval=1,this._tag=0,this._enabled=!0,this._updateOrder=0,this.components=new t.ComponentList(this),this.transform=new t.Transform(this),this.name=i,this.id=e._idGenerator++,this.componentBits=new t.BitSet}return Object.defineProperty(e.prototype,"isDestroyed",{get:function(){return this._isDestroyed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tag",{get:function(){return this._tag},set:function(t){this.setTag(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.transform.parent},set:function(t){this.transform.setParent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childCount",{get:function(){return this.transform.childCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.setPosition(t.x,t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localPosition",{get:function(){return this.transform.localPosition},set:function(t){this.transform.setLocalPosition(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.setRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationDegrees",{get:function(){return this.transform.rotationDegrees},set:function(t){this.transform.setRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotation",{get:function(){return this.transform.localRotation},set:function(t){this.transform.setLocalRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotationDegrees",{get:function(){return this.transform.localRotationDegrees},set:function(t){this.transform.setLocalRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.setScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localScale",{get:function(){return this.transform.localScale},set:function(t){this.transform.setLocalScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldInverseTransform",{get:function(){return this.transform.worldInverseTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localToWorldTransform",{get:function(){return this.transform.localToWorldTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldToLocalTransform",{get:function(){return this.transform.worldToLocalTransform},enumerable:!0,configurable:!0}),e.prototype.onTransformChanged=function(t){this.components.onEntityTransformChanged(t)},e.prototype.setTag=function(t){return this._tag!=t&&(this.scene&&this.scene.entities.removeFromTagList(this),this._tag=t,this.scene&&this.scene.entities.addToTagList(this)),this},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.components.onEntityEnabled():this.components.onEntityDisabled()),this},e.prototype.setUpdateOrder=function(t){if(this._updateOrder!=t)return this._updateOrder=t,this.scene&&(this.scene.entities.markEntityListUnsorted(),this.scene.entities.markTagUnsorted(this.tag)),this},e.prototype.destroy=function(){this._isDestroyed=!0,this.scene.entities.remove(this),this.transform.parent=null;for(var t=this.transform.childCount-1;t>=0;t--){this.transform.getChild(t).entity.destroy()}},e.prototype.detachFromScene=function(){this.scene.entities.remove(this),this.components.deregisterAllComponents();for(var t=0;t=0;t--)this._sceneComponents[t].enabled&&this._sceneComponents[t].update();this.entityProcessors&&this.entityProcessors.update(),this.entities.update(),this.entityProcessors&&this.entityProcessors.lateUpdate(),this.renderableComponents.updateList()},i.prototype.render=function(){if(0!=this._renderers.length)for(var t=0;te.x?-1:1,n=t.Vector2.normalize(t.Vector2.subtract(this.position,e));this.rotation=i*Math.acos(t.Vector2.dot(n,t.Vector2.unitY))},n.prototype.setLocalRotation=function(t){return this._localRotation=t,this._localDirty=this._positionDirty=this._localPositionDirty=this._localRotationDirty=this._localScaleDirty=!0,this.setDirty(e.rotationDirty),this},n.prototype.setLocalRotationDegrees=function(e){return this.setLocalRotation(t.MathHelper.toRadians(e))},n.prototype.setScale=function(e){return this._scale=e,this.parent?this.localScale=t.Vector2.divide(e,this.parent._scale):this.localScale=e,this},n.prototype.setLocalScale=function(t){return this._localScale=t,this._localDirty=this._positionDirty=this._localScaleDirty=!0,this.setDirty(e.scaleDirty),this},n.prototype.roundPosition=function(){this.position=this._position.round()},n.prototype.updateTransform=function(){this.hierarchyDirty!=e.clean&&(this.parent&&this.parent.updateTransform(),this._localDirty&&(this._localPositionDirty&&(this._translationMatrix=t.Matrix2D.create().translate(this._localPosition.x,this._localPosition.y),this._localPositionDirty=!1),this._localRotationDirty&&(this._rotationMatrix=t.Matrix2D.create().rotate(this._localRotation),this._localRotationDirty=!1),this._localScaleDirty&&(this._scaleMatrix=t.Matrix2D.create().scale(this._localScale.x,this._localScale.y),this._localScaleDirty=!1),this._localTransform=this._scaleMatrix.multiply(this._rotationMatrix),this._localTransform=this._localTransform.multiply(this._translationMatrix),this.parent||(this._worldTransform=this._localTransform,this._rotation=this._localRotation,this._scale=this._localScale,this._worldInverseDirty=!0),this._localDirty=!1),this.parent&&(this._worldTransform=this._localTransform.multiply(this.parent._worldTransform),this._rotation=this._localRotation+this.parent._rotation,this._scale=t.Vector2.multiply(this.parent._scale,this._localScale),this._worldInverseDirty=!0),this._worldToLocalDirty=!0,this._positionDirty=!0,this.hierarchyDirty=e.clean)},n.prototype.setDirty=function(e){if(0==(this.hierarchyDirty&e)){switch(this.hierarchyDirty|=e,e){case t.DirtyType.positionDirty:this.entity.onTransformChanged(transform.Component.position);break;case t.DirtyType.rotationDirty:this.entity.onTransformChanged(transform.Component.rotation);break;case t.DirtyType.scaleDirty:this.entity.onTransformChanged(transform.Component.scale)}this._children||(this._children=[]);for(var i=0;it&&(this._zoom=t),this._maximumZoom=t,this;console.error("maximumZoom must be greater than zero")},n.prototype.forceMatrixUpdate=function(){this._areMatrixedDirty=!0},n.prototype.onEntityTransformChanged=function(t){this._areMatrixedDirty=!0},n.prototype.zoomIn=function(t){this.zoom+=t},n.prototype.zoomOut=function(t){this.zoom-=t},n.prototype.worldToScreenPoint=function(e){return this.updateMatrixes(),e=t.Vector2Ext.transformR(e,this._transformMatrix)},n.prototype.screenToWorldPoint=function(e){return this.updateMatrixes(),e=t.Vector2Ext.transformR(e,this._inverseTransformMatrix)},n.prototype.onSceneRenderTargetSizeChanged=function(e,i){this._isProjectionMatrixDirty=!0;var n=this._origin;this.origin=new t.Vector2(e/2,i/2),this.entity.transform.position.add(t.Vector2.subtract(this._origin,n))},n.prototype.mouseToWorldPoint=function(){return this.screenToWorldPoint(t.Input.touchPosition)},n.prototype.updateMatrixes=function(){var e;this._areMatrixedDirty&&(this._transformMatrix=t.Matrix2D.create().translate(-this.entity.transform.position.x,-this.entity.transform.position.y),1!=this._zoom&&(e=t.Matrix2D.create().scale(this._zoom,this._zoom),this._transformMatrix=this._transformMatrix.multiply(e)),0!=this.entity.transform.rotation&&(e=t.Matrix2D.create().rotate(this.entity.transform.rotation),this._transformMatrix=this._transformMatrix.multiply(e)),e=t.Matrix2D.create().translate(this._origin.x,this._origin.y),this._transformMatrix=this._transformMatrix.multiply(e),this._inverseTransformMatrix=this._transformMatrix.invert(),this._areBoundsDirty=!0,this._areMatrixedDirty=!1)},n}(t.Component);t.Camera=i}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i._shakeDirection=t.Vector2.zero,i._shakeOffset=t.Vector2.zero,i._shakeIntensity=0,i._shakeDegredation=.95,i}return __extends(i,e),i.prototype.shake=function(e,i,n){void 0===e&&(e=15),void 0===i&&(i=.9),void 0===n&&(n=t.Vector2.zero),this.enabled=!0,this._shakeIntensity=1)&&(i=.95),this._shakeDegredation=i)},i.prototype.update=function(){Math.abs(this._shakeIntensity)>0&&(this._shakeOffset=this._shakeDirection,0!=this._shakeOffset.x||0!=this._shakeOffset.y?this._shakeOffset.normalize():(this._shakeOffset.x=this._shakeOffset.x+Math.random()-.5,this._shakeOffset.y=this._shakeOffset.y+Math.random()-.5),this._shakeOffset.multiply(new t.Vector2(this._shakeIntensity)),this._shakeIntensity*=-this._shakeDegredation,Math.abs(this._shakeIntensity)<=.01&&(this._shakeIntensity=0,this.enabled=!1)),this.entity.scene.camera.position.add(this._shakeOffset)},i}(t.Component);t.CameraShake=e}(es||(es={})),function(t){var e=function(){function t(t){this._type=t,this._cache=[]}return t.prototype.obtain=function(){try{return this._cache.length>0?this._cache.shift():new this._type}catch(t){throw new Error(this._type+t)}},t.prototype.free=function(t){t.reset(),this._cache.push(t)},t}();t.ComponentPool=e}(es||(es={})),function(t){var e;!function(t){t[t.lockOn=0]="lockOn",t[t.cameraWindow=1]="cameraWindow"}(e=t.CameraStyle||(t.CameraStyle={}));var i=function(i){function n(n,r,o){void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=e.lockOn);var s=i.call(this)||this;return s.followLerp=.1,s.deadzone=new t.Rectangle,s.focusOffset=t.Vector2.zero,s.mapLockEnabled=!1,s.mapSize=new t.Rectangle,s._desiredPositionDelta=new t.Vector2,s._worldSpaceDeadZone=new t.Rectangle,s.rectShape=new egret.Shape,s._targetEntity=n,s._cameraStyle=o,s.camera=r,s}return __extends(n,i),n.prototype.onAddedToEntity=function(){this.camera||(this.camera=this.entity.scene.camera),this.follow(this._targetEntity,this._cameraStyle),t.Core.emitter.addObserver(t.CoreEvents.GraphicsDeviceReset,this.onGraphicsDeviceReset,this)},n.prototype.onGraphicsDeviceReset=function(){t.Core.schedule(0,!1,this,function(t){var e=t.context;e.follow(e._targetEntity,e._cameraStyle)})},n.prototype.update=function(){var e=t.Vector2.multiply(this.camera.bounds.size,new t.Vector2(.5));this._worldSpaceDeadZone.x=this.camera.position.x-e.x*t.Core.scene.scaleX+this.deadzone.x+this.focusOffset.x,this._worldSpaceDeadZone.y=this.camera.position.y-e.y*t.Core.scene.scaleY+this.deadzone.y+this.focusOffset.y,this._worldSpaceDeadZone.width=this.deadzone.width,this._worldSpaceDeadZone.height=this.deadzone.height,this._targetEntity&&this.updateFollow(),this.camera.position=t.Vector2.lerp(this.camera.position,t.Vector2.add(this.camera.position,this._desiredPositionDelta),this.followLerp),this.entity.transform.roundPosition(),this.mapLockEnabled&&(this.camera.position=this.clampToMapSize(this.camera.position),this.entity.transform.roundPosition())},n.prototype.debugRender=function(){this.rectShape||this.debugDisplayObject.addChild(this.rectShape),this.rectShape.graphics.clear(),this._cameraStyle==e.lockOn?(this.rectShape.graphics.beginFill(9109504,0),this.rectShape.graphics.lineStyle(1,9109504),this.rectShape.graphics.drawRect(this._worldSpaceDeadZone.x-5,this._worldSpaceDeadZone.y-5,this._worldSpaceDeadZone.width,this._worldSpaceDeadZone.height),this.rectShape.graphics.endFill()):(this.rectShape.graphics.beginFill(9109504,0),this.rectShape.graphics.lineStyle(1,9109504),this.rectShape.graphics.drawRect(this._worldSpaceDeadZone.x,this._worldSpaceDeadZone.y,this._worldSpaceDeadZone.width,this._worldSpaceDeadZone.height),this.rectShape.graphics.endFill())},n.prototype.clampToMapSize=function(e){var i=t.Vector2.multiply(this.camera.bounds.size,new t.Vector2(.5)).add(new t.Vector2(this.mapSize.x,this.mapSize.y)),n=new t.Vector2(this.mapSize.width-i.x,this.mapSize.height-i.y);return t.Vector2.clamp(e,i,n)},n.prototype.follow=function(i,n){void 0===n&&(n=e.cameraWindow),this._targetEntity=i,this._cameraStyle=n;var r=this.camera.bounds;switch(this._cameraStyle){case e.cameraWindow:var o=r.width/6,s=r.height/3;this.deadzone=new t.Rectangle((r.width-o)/2,(r.height-s)/2,o,s);break;case e.lockOn:this.deadzone=new t.Rectangle(r.width/2,r.height/2,10,10)}},n.prototype.updateFollow=function(){if(this._desiredPositionDelta.x=this._desiredPositionDelta.y=0,this._cameraStyle==e.lockOn){var i=this._targetEntity.transform.position.x,n=this._targetEntity.transform.position.y;this._worldSpaceDeadZone.x>i?this._desiredPositionDelta.x=i-this._worldSpaceDeadZone.x:this._worldSpaceDeadZone.xn&&(this._desiredPositionDelta.y=n-this._worldSpaceDeadZone.y)}else{if(!this._targetCollider&&(this._targetCollider=this._targetEntity.getComponent(t.Collider),!this._targetCollider))return;var r=this._targetEntity.getComponent(t.Collider).bounds;this._worldSpaceDeadZone.containsRect(r)||(this._worldSpaceDeadZone.left>r.left?this._desiredPositionDelta.x=r.left-this._worldSpaceDeadZone.left:this._worldSpaceDeadZone.rightr.top&&(this._desiredPositionDelta.y=r.top-this._worldSpaceDeadZone.top))}},n.prototype.setCenteredDeadzone=function(e,i){if(this.camera){var n=this.camera.bounds;this.deadzone=new t.Rectangle((n.width-e)/2,(n.height-i)/2,e,i)}else console.error("相机是null。我们不能得到它的边界。请等到该组件添加到实体之后")},n}(t.Component);t.FollowCamera=i}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.compare=function(t,e){return t.updateOrder-e.updateOrder},t}();t.IUpdatableComparer=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Component);t.PooledComponent=e}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.displayObject=new egret.DisplayObject,i.hollowShape=new egret.Shape,i.pixelShape=new egret.Shape,i.color=0,i._areBoundsDirty=!0,i.debugRenderEnabled=!0,i._localOffset=t.Vector2.zero,i._renderLayer=0,i._bounds=new t.Rectangle,i}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.bounds.width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.bounds.height},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localOffset",{get:function(){return this._localOffset},set:function(t){this.setLocalOffset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renderLayer",{get:function(){return this._renderLayer},set:function(t){this.setRenderLayer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bounds",{get:function(){return this._areBoundsDirty&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,t.Vector2.zero,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!=t&&(this._isVisible=t,this._isVisible?this.onBecameVisible():this.onBecameInvisible())},enumerable:!0,configurable:!0}),i.prototype.onEntityTransformChanged=function(t){this._areBoundsDirty=!0},i.prototype.debugRender=function(){if(this.debugRenderEnabled){this.hollowShape.parent||this.debugDisplayObject.addChild(this.hollowShape),this.pixelShape.parent||this.debugDisplayObject.addChild(this.pixelShape);var e=t.Vector2.add(this.entity.transform.position,this._localOffset);this.pixelShape.graphics.clear(),this.pixelShape.graphics.beginFill(t.Colors.renderableCenter,0),this.pixelShape.graphics.lineStyle(4,t.Colors.renderableCenter),this.pixelShape.graphics.lineTo(e.x,e.y),this.pixelShape.graphics.moveTo(e.x,e.y),this.pixelShape.graphics.endFill()}},i.prototype.isVisibleFromCamera=function(t){return!!t&&(this.isVisible=t.bounds.intersects(this.bounds),this.isVisible)},i.prototype.setRenderLayer=function(t){if(t!=this._renderLayer){var e=this._renderLayer;this._renderLayer=t,this.entity&&this.entity.scene&&this.entity.scene.renderableComponents.updateRenderableRenderLayer(this,e,this._renderLayer)}return this},i.prototype.setColor=function(t){return this.color=t,this},i.prototype.setLocalOffset=function(t){return this._localOffset!=t&&(this._localOffset=t),this},i.prototype.sync=function(e){var i=new t.Vector2(this.entity.position.x+this.localOffset.x-e.position.x+e.origin.x,this.entity.position.y+this.localOffset.y-e.position.y+e.origin.y);this.displayObject.x!=i.x&&(this.displayObject.x=i.x),this.displayObject.y!=i.y&&(this.displayObject.y=i.y),this.displayObject.scaleX!=this.entity.scale.x&&(this.displayObject.scaleX=this.entity.scale.x),this.displayObject.scaleY!=this.entity.scale.y&&(this.displayObject.scaleY=this.entity.scale.y),this.displayObject.rotation!=this.entity.rotation&&(this.displayObject.rotation=this.entity.rotation)},i.prototype.toString=function(){return"[RenderableComponent] renderLayer: "+this.renderLayer},i.prototype.onBecameVisible=function(){this.displayObject.visible=this.isVisible,this.debugDisplayObject.visible=this.isVisible},i.prototype.onBecameInvisible=function(){this.displayObject.visible=this.isVisible,this.debugDisplayObject.visible=this.isVisible},i}(t.Component);t.RenderableComponent=e}(es||(es={})),function(t){var e=function(){function e(){this.updateOrder=0,this._enabled=!0}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.onRemovedFromScene=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled),this},e.prototype.setUpdateOrder=function(e){return this.updateOrder!=e&&(this.updateOrder=e,t.Core.scene._sceneComponents.sort(this.compareTo)),this},e.prototype.compareTo=function(t){return this.updateOrder-t.updateOrder},e}();t.SceneComponent=e}(es||(es={})),function(t){var e=egret.Bitmap,i=function(i){function n(e){void 0===e&&(e=null);var n=i.call(this)||this;return e instanceof t.Sprite?n.setSprite(e):e instanceof egret.Texture&&n.setSprite(new t.Sprite(e)),n}return __extends(n,i),Object.defineProperty(n.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this._sprite.sourceRect.width,this._sprite.sourceRect.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"originNormalized",{get:function(){return new t.Vector2(this._origin.x/this.width*this.entity.transform.scale.x,this._origin.y/this.height*this.entity.transform.scale.y)},set:function(e){this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"origin",{get:function(){return this._origin},set:function(t){this.setOrigin(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"sprite",{get:function(){return this._sprite},set:function(t){this.setSprite(t)},enumerable:!0,configurable:!0}),n.prototype.setSprite=function(t){return this._sprite=t,this._sprite&&(this._origin=this._sprite.origin,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y),this.displayObject=new e(t.texture2D),this},n.prototype.setOrigin=function(t){return this._origin!=t&&(this._origin=t,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y,this._areBoundsDirty=!0),this},n.prototype.setOriginNormalized=function(e){return this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y)),this},n.prototype.render=function(e){this.sync(e);var i=new t.Vector2(this.entity.position.x+this.localOffset.x-this.origin.x-e.position.x+e.origin.x,this.entity.position.y+this.localOffset.y-this.origin.y-e.position.y+e.origin.y);this.displayObject.x!=i.x&&(this.displayObject.x=i.x),this.displayObject.y!=i.y&&(this.displayObject.y=i.y)},n}(t.RenderableComponent);t.SpriteRenderer=i}(es||(es={})),function(t){var e=egret.Bitmap,i=egret.RenderTexture,n=function(n){function r(e){var i=n.call(this,e)||this;return i._textureScale=t.Vector2.one,i._inverseTexScale=t.Vector2.one,i._gapX=0,i._gapY=0,i._sourceRect=e.sourceRect,i.displayObject.$fillMode=egret.BitmapFillMode.REPEAT,i}return __extends(r,n),Object.defineProperty(r.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollX",{get:function(){return this._sourceRect.x},set:function(t){this._sourceRect.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollY",{get:function(){return this._sourceRect.y},set:function(t){this._sourceRect.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y),this._sourceRect.width=this._sprite.sourceRect.width*this._inverseTexScale.x,this._sourceRect.height=this._sprite.sourceRect.height*this._inverseTexScale.y},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this._sourceRect.width},set:function(t){this._areBoundsDirty=!0,this._sourceRect.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._sourceRect.height},set:function(t){this._areBoundsDirty=!0,this._sourceRect.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"gapXY",{get:function(){return new t.Vector2(this._gapX,this._gapY)},set:function(t){this._gapX=t.x,this._gapY=t.y;var n=new i,r=this.sprite.sourceRect;r.x=0,r.y=0,r.width+=this._gapX,r.height+=this._gapY,n.drawToTexture(this.displayObject,r),this.displayObject?this.displayObject.texture=n:this.displayObject=new e(n)},enumerable:!0,configurable:!0}),r.prototype.setGapXY=function(t){return this.gapXY=t,this},r.prototype.render=function(t){n.prototype.render.call(this,t);var e=this.displayObject;e.width=this.width,e.height=this.height,e.scrollRect=this._sourceRect},r}(t.SpriteRenderer);t.TiledSpriteRenderer=n}(es||(es={})),function(t){var e=function(e){function i(t){var i=e.call(this,t)||this;return i.scrollSpeedX=15,i.scroolSpeedY=0,i._scrollX=0,i._scrollY=0,i._scrollWidth=0,i._scrollHeight=0,i._scrollWidth=i.width,i._scrollHeight=i.height,i}return __extends(i,e),Object.defineProperty(i.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollWidth",{get:function(){return this._scrollWidth},set:function(t){this._scrollWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollHeight",{get:function(){return this._scrollHeight},set:function(t){this._scrollHeight=t},enumerable:!0,configurable:!0}),i.prototype.update=function(){this.sprite&&(this._scrollX+=this.scrollSpeedX*t.Time.deltaTime,this._scrollY+=this.scroolSpeedY*t.Time.deltaTime,this._sourceRect.x=this._scrollX,this._sourceRect.y=this._scrollY,this._sourceRect.width=this._scrollWidth+Math.abs(this._scrollX),this._sourceRect.height=this._scrollHeight+Math.abs(this._scrollY))},i}(t.TiledSpriteRenderer);t.ScrollingSpriteRenderer=e}(es||(es={})),function(t){var e=egret.SpriteSheet,i=function(){function i(e,i,n){void 0===i&&(i=new t.Rectangle(0,0,e.textureWidth,e.textureHeight)),void 0===n&&(n=i.getHalfSize()),this.uvs=new t.Rectangle,this.texture2D=e,this.sourceRect=i,this.center=new t.Vector2(.5*i.width,.5*i.height),this.origin=n;var r=1/e.textureWidth,o=1/e.textureHeight;this.uvs.x=i.x*r,this.uvs.y=i.y*o,this.uvs.width=i.width*r,this.uvs.height=i.height*o}return i.spritesFromAtlas=function(t,n,r,o,s){void 0===o&&(o=0),void 0===s&&(s=Number.MAX_VALUE);for(var a=[],h=t.textureWidth/n,c=t.textureHeight/r,l=0,u=new e(t),p=0;po||this._loopMode==e.pingPongOnce&&s>2*o)return this.animationState=i.completed,this._elapsedTime=0,this.currentFrame=0,void(this.displayObject.texture=n.sprites[this.currentFrame].texture2D);var a=Math.floor(s/r),h=n.sprites.length;if(h>2&&(this._loopMode==e.pingPong||this._loopMode==e.pingPongOnce)){var c=h-1;this.currentFrame=c-Math.abs(c-a%(2*c))}else this.currentFrame=a%h;this.displayObject.texture=n.sprites[this.currentFrame].texture2D}},r.prototype.addAnimation=function(t,e){return!this.sprite&&e.sprites.length>0&&this.setSprite(e.sprites[0]),this._animations[t]=e,this},r.prototype.play=function(t,n){void 0===n&&(n=null),this.currentAnimation=this._animations[t],this.currentAnimationName=t,this.currentFrame=0,this.animationState=i.running,this.displayObject.texture=this.currentAnimation.sprites[0].texture2D,this._elapsedTime=0,this._loopMode=n||e.loop},r.prototype.isAnimationActive=function(t){return this.currentAnimation&&this.currentAnimationName==t},r.prototype.pause=function(){this.animationState=i.paused},r.prototype.unPause=function(){this.animationState=i.running},r.prototype.stop=function(){this.currentAnimation=null,this.currentAnimationName=null,this.currentFrame=0,this.animationState=i.none},r}(t.SpriteRenderer);t.SpriteAnimator=n}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"hasCollision",{get:function(){return this.below||this.right||this.left||this.above},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.becameGroundedThisFrame=this.isGroundedOnOnewayPlatform=this.right=this.left=this.above=this.below=!1,this.slopAngle=0},t.prototype.toString=function(){return"[CollisionState] r: "+this.right+", l: "+this.left+", a: "+this.above+", b: "+this.below+", angle: "+this.slopAngle+", wasGroundedLastFrame: "+this.wasGroundedLastFrame+", becameGroundedThisFrame: "+this.becameGroundedThisFrame},t}();t.CollisionState=e;var i=function(e){function i(){var t=e.call(this)||this;return t.colliderHorizontalInset=2,t.colliderVerticalInset=6,t}return __extends(i,e),i.prototype.testCollisions=function(e,i,n){this._boxColliderBounds=i,n.wasGroundedLastFrame=n.below,n.reset();var r=e.x;e.y;if(0!=r){var o=r>0?t.Edge.right:t.Edge.left,s=this.collisionRectForSide(o,r);this.testMapCollision(s,o,n,0)?(e.x=0-t.RectangleExt.getSide(i,o),n.left=o==t.Edge.left,n.right=o==t.Edge.right,n._movementRemainderX.reset()):(n.left=!1,n.right=!1)}},i.prototype.testMapCollision=function(e,i,n,r){var o=t.EdgeExt.oppositeEdge(i);t.EdgeExt.isVertical(o)?e.center.x:e.center.y,t.RectangleExt.getSide(e,i),t.EdgeExt.isVertical(o)},i.prototype.collisionRectForSide=function(e,i){var n;return n=t.EdgeExt.isHorizontal(e)?t.RectangleExt.getRectEdgePortion(this._boxColliderBounds,e):t.RectangleExt.getHalfRect(this._boxColliderBounds,e),t.EdgeExt.isVertical(e)?t.RectangleExt.contract(n,this.colliderHorizontalInset,0):t.RectangleExt.contract(n,0,this.colliderVerticalInset),t.RectangleExt.expandSide(n,e,i),n},i}(t.Component);t.TiledMapMover=i}(es||(es={})),function(t){var e=function(e){function i(t,i,n){void 0===i&&(i=null),void 0===n&&(n=!0);var r=e.call(this)||this;return r.physicsLayer=1,r.toContainer=!1,r.tiledMap=t,r._shouldCreateColliders=n,r.displayObject=new egret.DisplayObjectContainer,i&&(r.collisionLayer=t.tileLayers[i]),r}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.tiledMap.width*this.tiledMap.tileWidth},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.tiledMap.height*this.tiledMap.tileHeight},enumerable:!0,configurable:!0}),i.prototype.setLayerToRender=function(t){this.layerIndicesToRender=[],this.layerIndicesToRender[0]=this.getLayerIndex(t)},i.prototype.setLayersToRender=function(){for(var t=[],e=0;e=2){this.polygonShape.graphics.beginFill(t.Colors.colliderEdge,0),this.polygonShape.graphics.lineStyle(t.Size.lineSizeMultiplier,t.Colors.colliderEdge);for(var i=0;i>6;0!=(e&t.LONG_MASK)&&i++,this._bits=new Array(i)}return t.prototype.and=function(t){for(var e,i=Math.min(this._bits.length,t._bits.length),n=0;n=0;)this._bits[e]&=~t._bits[e]},t.prototype.cardinality=function(){for(var t=0,e=this._bits.length-1;e>=0;e--){var i=this._bits[e];if(0!=i)if(-1!=i){var n=((i=((i=(i>>1&0x5555555555555400)+(0x5555555555555400&i))>>2&0x3333333333333400)+(0x3333333333333400&i))>>32)+i;t+=((n=((n=(n>>4&252645135)+(252645135&n))>>8&16711935)+(16711935&n))>>16&65535)+(65535&n)}else t+=64}return t},t.prototype.clear=function(t){if(null!=t){var e=t>>6;this.ensure(e),this._bits[e]&=~(1<>6;return!(e>=this._bits.length)&&0!=(this._bits[e]&1<=0;)if(0!=(this._bits[e]&t._bits[e]))return!0;return!1},t.prototype.isEmpty=function(){for(var t=this._bits.length-1;t>=0;t--)if(this._bits[t])return!1;return!0},t.prototype.nextSetBit=function(t){for(var e=t>>6,i=1<>6;this.ensure(i),this._bits[i]|=1<=this._bits.length){var e=new Number[t+1];e=this._bits.copyWithin(0,0,this._bits.length),this._bits=e}},t.LONG_MASK=63,t}();t.BitSet=e}(es||(es={})),function(t){var e=function(){function e(t){this._components=[],this._componentsToAdd=[],this._componentsToRemove=[],this._tempBufferList=[],this._entity=t}return Object.defineProperty(e.prototype,"count",{get:function(){return this._components.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._components},enumerable:!0,configurable:!0}),e.prototype.markEntityListUnsorted=function(){this._isComponentListUnsorted=!0},e.prototype.add=function(t){this._componentsToAdd.push(t)},e.prototype.remove=function(t){this._componentsToRemove.contains(t)&&console.warn("You are trying to remove a Component ("+t+") that you already removed"),this._componentsToAdd.contains(t)?this._componentsToAdd.remove(t):this._componentsToRemove.push(t)},e.prototype.removeAllComponents=function(){for(var t=0;t0){for(var i=0;i0){i=0;for(var n=this._componentsToAdd.length;i0){var e=this._entitiesToRemove;this._entitiesToRemove=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t.removeFromTagList(e),t._entities.remove(e),e.onRemovedFromScene(),e.scene=null,t.scene.entityProcessors.onEntityRemoved(e)}),this._tempEntityList.length=0}if(this._entitiesToAdded.length>0){e=this._entitiesToAdded;this._entitiesToAdded=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t._entities.contains(e)||(t._entities.push(e),e.scene=t.scene,t.addToTagList(e),t.scene.entityProcessors.onEntityAdded(e))}),this._tempEntityList.forEach(function(t){return t.onAddedToScene()}),this._tempEntityList.length=0,this._isEntityListUnsorted=!0}this._isEntityListUnsorted&&(this._entities.sort(),this._isEntityListUnsorted=!1),this._unsortedTags.length>0&&(this._unsortedTags.forEach(function(e){t._entityDict.get(e).sort()}),this._unsortedTags.length=0)},e.prototype.findEntity=function(t){for(var e=0;e=0;e=this.allSet.nextSetBit(e+1))if(!t.componentBits.get(e))return!1;return!(!this.exclusionSet.isEmpty()&&this.exclusionSet.intersects(t.componentBits))&&!(!this.oneSet.isEmpty()&&!this.oneSet.intersects(t.componentBits))},e.prototype.all=function(){for(var e=this,i=[],n=0;n0){for(var t=0,i=this._unsortedRenderLayers.length;t=e)return t;var n=!1;"-"==t.substr(0,1)&&(n=!0,t=t.substr(1));for(var r=e-i,o=0;o1?this.reverse(t.substring(1))+t.substring(0,1):t},t.cutOff=function(t,e,i,n){void 0===n&&(n=!0),e=Math.floor(e),i=Math.floor(i);var r=t.length;e>r&&(e=r);var o,s=e,a=e+i;return n?o=t.substring(0,s)+t.substr(a,r):(a=(s=r-1-e-i)+i,o=t.substring(0,s+1)+t.substr(a+1,r)),o},t.strReplace=function(t,e){for(var i=0,n=e.length;i",">",'"',""","'","'","®","®","©","©","™","™"],t}();!function(t){var e=function(){function e(){}return e.convertImageToCanvas=function(e,i){this.sharedCanvas||(this.sharedCanvas=egret.sys.createCanvas(),this.sharedContext=this.sharedCanvas.getContext("2d"));var n=e.$getTextureWidth(),r=e.$getTextureHeight();i||((i=egret.$TempRectangle).x=0,i.y=0,i.width=n,i.height=r),i.x=Math.min(i.x,n-1),i.y=Math.min(i.y,r-1),i.width=Math.min(i.width,n-i.x),i.height=Math.min(i.height,r-i.y);var o=Math.floor(i.width),s=Math.floor(i.height),a=this.sharedCanvas;if(a.style.width=o+"px",a.style.height=s+"px",this.sharedCanvas.width=o,this.sharedCanvas.height=s,"webgl"==egret.Capabilities.renderMode){var h=void 0;e.$renderBuffer?h=e:(egret.sys.systemRenderer.renderClear&&egret.sys.systemRenderer.renderClear(),(h=new egret.RenderTexture).drawToTexture(new egret.Bitmap(e)));for(var c=h.$renderBuffer.getPixels(i.x,i.y,o,s),l=0,u=0,p=0;p=0?"png":"jpg"});return wx.getFileSystemManager().saveFile({tempFilePath:o,filePath:wx.env.USER_DATA_PATH+"/"+i,success:function(t){}}),o},e.getPixel32=function(t,e,i){return egret.$warn(1041,"getPixel32","getPixels"),t.getPixels(e,i)},e.getPixels=function(t,e,i,n,r){if(void 0===n&&(n=1),void 0===r&&(r=1),"webgl"==egret.Capabilities.renderMode){var o=void 0;return t.$renderBuffer?o=t:(o=new egret.RenderTexture).drawToTexture(new egret.Bitmap(t)),o.$renderBuffer.getPixels(e,i,n,r)}try{this.convertImageToCanvas(t);return this.sharedContext.getImageData(e,i,n,r).data}catch(t){egret.$error(1039)}},e}();t.TextureUtils=e}(es||(es={})),function(t){var e=function(){function t(){}return t.update=function(t){var e=(t-this._lastTime)/1e3;this.deltaTime=e*this.timeScale,this.unscaledDeltaTime=e,this._timeSinceSceneLoad+=e,this.frameCount++,this._lastTime=t},t.sceneChanged=function(){this._timeSinceSceneLoad=0},t.checkEvery=function(t){return this._timeSinceSceneLoad/t>(this._timeSinceSceneLoad-this.deltaTime)/t},t.deltaTime=0,t.timeScale=1,t.frameCount=0,t._lastTime=0,t}();t.Time=e}(es||(es={}));var TimeUtils=function(){function t(){}return t.monthId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getFullYear(),i=t.getMonth()+1;return parseInt(e+(i<10?"0":"")+i)},t.dateId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getMonth()+1,i=e<10?"0":"",n=t.getDate(),r=n<10?"0":"";return parseInt(t.getFullYear()+i+e+r+n)},t.weekId=function(t,e){void 0===t&&(t=null),void 0===e&&(e=!0),t=t||new Date;var i=new Date;i.setTime(t.getTime()),i.setDate(1),i.setMonth(0);var n=i.getFullYear(),r=i.getDay();0==r&&(r=7);var o=!1;r<=4?(o=r>1,i.setDate(i.getDate()-(r-1))):i.setDate(i.getDate()+7-r+1);var s=this.diffDay(t,i,!1);if(s<0)return i.setDate(1),i.setMonth(0),i.setDate(i.getDate()-1),this.weekId(i,!1);var a=s/7,h=Math.floor(a)+1;if(53==h){i.setTime(t.getTime()),i.setDate(i.getDate()-1);var c=i.getDay();if(0==c&&(c=7),e&&(!o||c<4))return i.setFullYear(i.getFullYear()+1),i.setDate(1),i.setMonth(0),this.weekId(i,!1)}return parseInt(n+"00"+(h>9?"":"0")+h)},t.diffDay=function(t,e,i){void 0===i&&(i=!1);var n=(t.getTime()-e.getTime())/864e5;return i?Math.ceil(n):Math.floor(n)},t.getFirstDayOfWeek=function(t){var e=(t=t||new Date).getDay()||7;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1-e,0,0,0,0)},t.getFirstOfDay=function(t){return(t=t||new Date).setHours(0,0,0,0),t},t.getNextFirstOfDay=function(t){return new Date(this.getFirstOfDay(t).getTime()+864e5)},t.formatDate=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();return e+"-"+i+"-"+(n=n<10?"0"+n:n)},t.formatDateTime=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var r=t.getHours(),o=t.getMinutes();o=o<10?"0"+o:o;var s=t.getSeconds();return e+"-"+i+"-"+n+" "+r+":"+o+":"+(s=s<10?"0"+s:s)},t.parseDate=function(t){var e=Date.parse(t);return isNaN(e)?new Date:new Date(Date.parse(t.replace(/-/g,"/")))},t.secondToTime=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=":"),void 0===i&&(i=!0);var n=Math.floor(t/3600),r=Math.floor(t%3600/60),o=Math.floor(t%3600%60),s=n.toString(),a=r.toString(),h=o.toString();return n<10&&(s="0"+s),r<10&&(a="0"+a),o<10&&(h="0"+h),i?s+e+a+e+h:a+e+h},t.timeToMillisecond=function(t,e){void 0===e&&(e=":");for(var i=t.split(e),n=0,r=i.length,o=0;o-1?this.os="iOS":n.indexOf("android")>-1&&(this.os="Android");var r=i.language;r=r.indexOf("zh")>-1?"zh-CN":"en-US",this.language=r}},e}(egret.Capabilities);t.GraphicsCapabilities=e}(es||(es={})),function(t){var e=function(){function e(){this.setup(),this.graphicsCapabilities=new t.GraphicsCapabilities,this.graphicsCapabilities.initialize(this)}return Object.defineProperty(e.prototype,"viewport",{get:function(){return this._viewport},enumerable:!0,configurable:!0}),e.prototype.setup=function(){this._viewport=new t.Viewport(0,0,t.Core._instance.stage.stageWidth,t.Core._instance.stage.stageHeight)},e}();t.GraphicsDevice=e}(es||(es={})),function(t){var e=function(){function e(t,e,i,n){this._x=t,this._y=e,this._width=i,this._height=n,this._minDepth=0,this._maxDepth=1}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return 0!=this._height&&0!=this._width?this._width/this._height:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new t.Rectangle(this._x,this._y,this._width,this._height)},set:function(t){this._x=t.x,this._y=t.y,this._width=t.width,this._height=t.height},enumerable:!0,configurable:!0}),e}();t.Viewport=e}(es||(es={})),function(t){var e=function(e){function i(){return e.call(this,t.PostProcessor.default_vert,i.blur_frag,{screenWidth:t.Core.graphicsDevice.viewport.width,screenHeight:t.Core.graphicsDevice.viewport.height})||this}return __extends(i,e),i.blur_frag="precision mediump float;\nuniform sampler2D uSampler;\nuniform float screenWidth;\nuniform float screenHeight;\nfloat normpdf(in float x, in float sigma)\n{\nreturn 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma;\n}\nvoid main()\n{\nvec3 c = texture2D(uSampler, gl_FragCoord.xy / vec2(screenWidth, screenHeight).xy).rgb;\nconst int mSize = 11;\nconst int kSize = (mSize - 1)/2;\nfloat kernel[mSize];\nvec3 final_colour = vec3(0.0);\nfloat sigma = 7.0;\nfloat z = 0.0;\nfor (int j = 0; j <= kSize; ++j)\n{\nkernel[kSize+j] = kernel[kSize-j] = normpdf(float(j),sigma);\n}\nfor (int j = 0; j < mSize; ++j)\n{\nz += kernel[j];\n}\nfor (int i = -kSize; i <= kSize; ++i)\n{\nfor (int j = -kSize; j <= kSize; ++j)\n{\nfinal_colour += kernel[kSize+j]*kernel[kSize+i]*texture2D(uSampler, (gl_FragCoord.xy+vec2(float(i),float(j))) / vec2(screenWidth, screenHeight).xy).rgb;\n}\n}\ngl_FragColor = vec4(final_colour/(z*z), 1.0);\n}",i}(egret.CustomFilter);t.GaussianBlurEffect=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,e.vertSrc,e.fragmentSrc)||this}return __extends(e,t),e.vertSrc="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",e.fragmentSrc="precision lowp float;\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n#define SAMPLE_COUNT 15\nuniform vec2 _sampleOffsets[SAMPLE_COUNT];\nuniform float _sampleWeights[SAMPLE_COUNT];\nvoid main(void) {\nvec4 c = vec4(0, 0, 0, 0);\nfor( int i = 0; i < SAMPLE_COUNT; i++ )\n c += texture2D( uSampler, vTextureCoord + _sampleOffsets[i] ) * _sampleWeights[i];\ngl_FragColor = c;\n}",e}(egret.CustomFilter);t.PolygonLightEffect=e}(es||(es={})),function(t){var e=function(){function e(t){void 0===t&&(t=null),this.enabled=!0,this.effect=t}return e.prototype.onAddedToScene=function(e){this.scene=e,this.shape=new egret.Shape,this.shape.graphics.beginFill(16777215,1),this.shape.graphics.drawRect(0,0,t.Core.graphicsDevice.viewport.width,t.Core.graphicsDevice.viewport.height),this.shape.graphics.endFill(),e.addChild(this.shape)},e.prototype.process=function(){this.drawFullscreenQuad()},e.prototype.onSceneBackBufferSizeChanged=function(t,e){},e.prototype.unload=function(){this.effect&&(this.effect=null),this.scene.removeChild(this.shape),this.scene=null},e.prototype.drawFullscreenQuad=function(){this.scene.filters=[this.effect]},e.default_vert="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\ngl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\nvTextureCoord = aTextureCoord;\nvColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}",e}();t.PostProcessor=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.prototype.onAddedToScene=function(i){e.prototype.onAddedToScene.call(this,i),this.effect=new t.GaussianBlurEffect},i}(t.PostProcessor);t.GaussianBlurPostProcessor=e}(es||(es={})),function(t){var e=function(){function t(t,e){void 0===e&&(e=null),this.renderOrder=0,this.shouldDebugRender=!0,this.camera=e,this.renderOrder=t}return Object.defineProperty(t.prototype,"wantsToRenderToSceneRenderTarget",{get:function(){return!!this.renderTexture},enumerable:!0,configurable:!0}),t.prototype.onAddedToScene=function(t){},t.prototype.unload=function(){},t.prototype.onSceneBackBufferSizeChanged=function(t,e){},t.prototype.compareTo=function(t){return this.renderOrder-t.renderOrder},t.prototype.beginRender=function(t){},t.prototype.renderAfterStateCheck=function(t,e){t.render(e)},t.prototype.debugRender=function(t,e){for(var i=0;ii?i:t},e.pointOnCirlce=function(i,n,r){var o=e.toRadians(r);return new t.Vector2(Math.cos(o)*o+i.x,Math.sin(o)*o+i.y)},e.isEven=function(t){return t%2==0},e.clamp01=function(t){return t<0?0:t>1?1:t},e.angleBetweenVectors=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e.incrementWithWrap=function(t,e){return++t==e?0:t},e.approach=function(t,e,i){return tn&&(n=s.x),s.yr&&(r=s.y)}return this.fromMinMax(e,i,n,r)},i.prototype.intersects=function(t){return t.leftthis.x+this.width)return!1}else{var n=1/t.direction.x,r=(this.x-t.start.x)*n,o=(this.x+this.width-t.start.x)*n;if(r>o){var s=r;r=o,o=s}if(e.value=Math.max(r,e.value),i=Math.min(o,i),e.value>i)return!1}if(Math.abs(t.direction.y)<1e-6){if(t.start.ythis.y+this.height)return!1}else{var a=1/t.direction.y,h=(this.y-t.start.y)*a,c=(this.y+this.height-t.start.y)*a;if(h>c){var l=h;h=c,c=l}if(e.value=Math.max(h,e.value),i=Math.max(c,i),e.value>i)return!1}return!0},i.prototype.containsRect=function(t){return this.x<=t.x&&t.x1)return!1;var l=(h.x*o.y-h.y*o.x)/a;return!(l<0||l>1)},i.lineToLineIntersection=function(e,i,n,r){var o=new t.Vector2(0,0),s=t.Vector2.subtract(i,e),a=t.Vector2.subtract(r,n),h=s.x*a.y-s.y*a.x;if(0==h)return o;var c=t.Vector2.subtract(n,e),l=(c.x*a.y-c.y*a.x)/h;if(l<0||l>1)return o;var u=(c.x*s.y-c.y*s.x)/h;return u<0||u>1?o:o=t.Vector2.add(e,new t.Vector2(l*s.x,l*s.y))},i.closestPointOnLine=function(e,i,n){var r=t.Vector2.subtract(i,e),o=t.Vector2.subtract(n,e),s=t.Vector2.dot(o,r)/t.Vector2.dot(r,r);return s=t.MathHelper.clamp(s,0,1),t.Vector2.add(e,new t.Vector2(r.x*s,r.y*s))},i.isCircleToCircle=function(e,i,n,r){return t.Vector2.distanceSquared(e,n)<(i+r)*(i+r)},i.isCircleToLine=function(e,i,n,r){return t.Vector2.distanceSquared(e,this.closestPointOnLine(n,r,e))=t&&r.y>=e&&r.x=t+n&&(s|=e.right),o.y=i+r&&(s|=e.bottom),s},i}();t.Collisions=i}(es||(es={})),function(t){var e=function(){function e(e,i,n,r,o){this.fraction=0,this.distance=0,this.point=t.Vector2.zero,this.normal=t.Vector2.zero,this.collider=e,this.fraction=i,this.distance=n,this.point=r,this.centroid=t.Vector2.zero}return e.prototype.setValues=function(t,e,i,n){this.collider=t,this.fraction=e,this.distance=i,this.point=n},e.prototype.setValuesNonCollider=function(t,e,i,n){this.fraction=t,this.distance=e,this.point=i,this.normal=n},e.prototype.reset=function(){this.collider=null,this.fraction=this.distance=0},e.prototype.toString=function(){return"[RaycastHit] fraction: "+this.fraction+", distance: "+this.distance+", normal: "+this.normal+", centroid: "+this.centroid+", point: "+this.point},e}();t.RaycastHit=e}(es||(es={})),function(t){var e=function(){function e(){}return e.reset=function(){this._spatialHash=new t.SpatialHash(this.spatialHashCellSize)},e.clear=function(){this._spatialHash.clear()},e.overlapCircleAll=function(t,e,i,n){if(void 0===n&&(n=-1),0!=i.length)return this._spatialHash.overlapCircle(t,e,i,n);console.error("An empty results array was passed in. No results will ever be returned.")},e.boxcastBroadphase=function(t,e){return void 0===e&&(e=this.allLayers),this._spatialHash.aabbBroadphase(t,null,e)},e.boxcastBroadphaseExcludingSelf=function(t,e,i){return void 0===i&&(i=this.allLayers),this._spatialHash.aabbBroadphase(e,t,i)},e.addCollider=function(t){e._spatialHash.register(t)},e.removeCollider=function(t){e._spatialHash.remove(t)},e.updateCollider=function(t){this._spatialHash.remove(t),this._spatialHash.register(t)},e.linecast=function(t,i,n){return void 0===n&&(n=e.allLayers),this._hitArray[0].reset(),this.linecastAll(t,i,this._hitArray,n),this._hitArray[0]},e.linecastAll=function(t,i,n,r){return void 0===r&&(r=e.allLayers),0==n.length?(console.warn("传入了一个空的hits数组。没有点击会被返回"),0):this._spatialHash.linecast(t,i,n,r)},e.debugDraw=function(t){this._spatialHash.debugDraw(t,2)},e.spatialHashCellSize=100,e.allLayers=-1,e.raycastsHitTriggers=!1,e.raycastsStartInColliders=!1,e._hitArray=[new t.RaycastHit],e}();t.Physics=e}(es||(es={})),function(t){var e=function(){return function(e,i){this.start=e,this.end=i,this.direction=t.Vector2.subtract(this.end,this.start)}}();t.Ray2D=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.clone=function(){return ObjectUtils.clone(this)},t}();t.Shape=e}(es||(es={})),function(t){var e=function(e){function i(t,i){var n=e.call(this)||this;return n._areEdgeNormalsDirty=!0,n.isUnrotated=!0,n.setPoints(t),n.isBox=i,n}return __extends(i,e),Object.defineProperty(i.prototype,"edgeNormals",{get:function(){return this._areEdgeNormalsDirty&&this.buildEdgeNormals(),this._edgeNormals},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t){this.points=t,this.recalculateCenterAndEdgeNormals(),this._originalPoints=[];for(var e=0;e=this.points.length?this.points[0]:this.points[n+1];var o=t.Vector2Ext.perpendicular(r,e);t.Vector2Ext.normalize(o),this._edgeNormals[n]=o}},i.buildSymmetricalPolygon=function(e,i){for(var n=new Array(e),r=0;rr&&(r=s,n=o)}return e[n]},i.getClosestPointOnPolygonToPoint=function(e,i,n,r){n.value=Number.MAX_VALUE,r.x=0,r.y=0;for(var o,s=new t.Vector2(0,0),a=0;at.y!=this.points[n].y>t.y&&t.x<(this.points[n].x-this.points[i].x)*(t.y-this.points[i].y)/(this.points[n].y-this.points[i].y)+this.points[i].x&&(e=!e);return e},i.prototype.pointCollidesWithShape=function(e,i){return t.ShapeCollisions.pointToPoly(e,this,i)},i}(t.Shape);t.Polygon=e}(es||(es={})),function(t){var e=function(e){function i(t,n){var r=e.call(this,i.buildBox(t,n),!0)||this;return r.width=t,r.height=n,r}return __extends(i,e),i.buildBox=function(e,i){var n=e/2,r=i/2,o=new Array(4);return o[0]=new t.Vector2(-n,-r),o[1]=new t.Vector2(n,-r),o[2]=new t.Vector2(n,r),o[3]=new t.Vector2(-n,r),o},i.prototype.updateBox=function(e,i){this.width=e,this.height=i;var n=e/2,r=i/2;this.points[0]=new t.Vector2(-n,-r),this.points[1]=new t.Vector2(n,-r),this.points[2]=new t.Vector2(n,r),this.points[3]=new t.Vector2(-n,r);for(var o=0;o1)return!1;var a,h=t.Vector2.add(s.start,t.Vector2.add(s.direction,new t.Vector2(r.value))),c=0;h.xi.bounds.right&&(c|=1),h.yi.bounds.bottom&&(c|=2);var l=a+c;return 3==l&&console.log("m == 3. corner "+t.Time.frameCount),!0},e}();t.RealtimeCollisions=e}(es||(es={})),function(t){var e=function(){function e(){}return e.polygonToPolygon=function(e,i,n){for(var r,o=!0,s=e.edgeNormals,a=i.edgeNormals,h=Number.POSITIVE_INFINITY,c=new t.Vector2,l=t.Vector2.subtract(e.position,i.position),u=0;u0&&(o=!1),!o)return!1;(y=Math.abs(y))r&&(r=o);return{min:n,max:r}},e.circleToPolygon=function(e,i,n){var r,o=t.Vector2.subtract(e.position,i.position),s=new t.Ref(0),a=t.Polygon.getClosestPointOnPolygonToPoint(i.points,o,s,n.normal),h=i.containsPoint(e.position);if(s.value>e.radius*e.radius&&!h)return!1;if(h)r=t.Vector2.multiply(n.normal,new t.Vector2(Math.sqrt(s.value)-e.radius));else if(0==s.value)r=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else{var c=Math.sqrt(s.value);r=t.Vector2.multiply(new t.Vector2(-t.Vector2.subtract(o,a)),new t.Vector2((e.radius-s.value)/c))}return n.minimumTranslationVector=r,n.point=t.Vector2.add(a,i.position),!0},e.circleToBox=function(e,i,n){var r=i.bounds.getClosestPointOnRectangleBorderToPoint(e.position,n.normal);if(i.containsPoint(e.position)){n.point=r;var o=t.Vector2.add(r,t.Vector2.multiply(n.normal,new t.Vector2(e.radius)));return n.minimumTranslationVector=t.Vector2.subtract(e.position,o),!0}var s=t.Vector2.distanceSquared(r,e.position);if(0==s)n.minimumTranslationVector=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else if(s<=e.radius*e.radius){n.normal=t.Vector2.subtract(e.position,r);var a=n.normal.length()-e.radius;return n.point=r,t.Vector2Ext.normalize(n.normal),n.minimumTranslationVector=t.Vector2.multiply(new t.Vector2(a),n.normal),!0}return!1},e.pointToCircle=function(e,i,n){var r=t.Vector2.distanceSquared(e,i.position),o=1+i.radius;if(r1)return!1;var u=(c.x*s.y-c.y*s.x)/h;return!(u<0||u>1)&&(o=o.add(e).add(t.Vector2.multiply(new t.Vector2(l),s)),!0)},e.lineToCircle=function(e,i,n,r){var o=t.Vector2.distance(e,i),s=t.Vector2.divide(t.Vector2.subtract(i,e),new t.Vector2(o)),a=t.Vector2.subtract(e,n.position),h=t.Vector2.dot(a,s),c=t.Vector2.dot(a,a)-n.radius*n.radius;if(c>0&&h>0)return!1;var l=h*h-c;return!(l<0)&&(r.fraction=-h-Math.sqrt(l),r.fraction<0&&(r.fraction=0),r.point=t.Vector2.add(e,t.Vector2.multiply(new t.Vector2(r.fraction),s)),r.distance=t.Vector2.distance(e,r.point),r.normal=t.Vector2.normalize(t.Vector2.subtract(r.point,n.position)),r.fraction=r.distance/o,!0)},e.boxToBoxCast=function(e,i,n,r){var o=this.minkowskiDifference(e,i);if(o.contains(0,0)){var s=o.getClosestPointOnBoundsToOrigin();return!s.equals(t.Vector2.zero)&&(r.normal=new t.Vector2(-s.x),r.normal.normalize(),r.distance=0,r.fraction=0,!0)}var a=new t.Ray2D(t.Vector2.zero,new t.Vector2(-n.x)),h=new t.Ref(0);return!!(o.rayIntersects(a,h)&&h.value<=1)&&(r.fraction=h.value,r.distance=n.length()*h.value,r.normal=new t.Vector2(-n.x,-n.y),r.normal.normalize(),r.centroid=t.Vector2.add(e.bounds.center,t.Vector2.multiply(n,new t.Vector2(h.value))),!0)},e}();t.ShapeCollisions=e}(es||(es={})),function(t){var e=function(){function e(e){void 0===e&&(e=100),this.gridBounds=new t.Rectangle,this._overlapTestCircle=new t.Circle(0),this._cellDict=new i,this._tempHashSet=[],this._cellSize=e,this._inverseCellSize=1/this._cellSize,this._raycastParser=new n}return e.prototype.register=function(e){var i=e.bounds;e.registeredPhysicsBounds=i;var n=this.cellCoords(i.x,i.y),r=this.cellCoords(i.right,i.bottom);this.gridBounds.contains(n.x,n.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,n)),this.gridBounds.contains(r.x,r.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,r));for(var o=n.x;o<=r.x;o++)for(var s=n.y;s<=r.y;s++){var a=this.cellAtPosition(o,s,!0);a.firstOrDefault(function(t){return t.hashCode==e.hashCode})||a.push(e)}},e.prototype.remove=function(t){for(var e=t.registeredPhysicsBounds,i=this.cellCoords(e.x,e.y),n=this.cellCoords(e.right,e.bottom),r=i.x;r<=n.x;r++)for(var o=i.y;o<=n.y;o++){var s=this.cellAtPosition(r,o);s?s.remove(t):console.log("从不存在碰撞器的单元格中移除碰撞器: ["+t+"]")}},e.prototype.removeWithBruteForce=function(t){this._cellDict.remove(t)},e.prototype.clear=function(){this._cellDict.clear()},e.prototype.debugDraw=function(t,e){void 0===e&&(e=1);for(var i=this.gridBounds.x;i<=this.gridBounds.right;i++)for(var n=this.gridBounds.y;n<=this.gridBounds.bottom;n++){var r=this.cellAtPosition(i,n);r&&r.length>0&&this.debugDrawCellDetails(i,n,r.length,t,e)}},e.prototype.aabbBroadphase=function(e,i,n){this._tempHashSet.length=0;for(var r=this.cellCoords(e.x,e.y),o=this.cellCoords(e.right,e.bottom),s=r.x;s<=o.x;s++)for(var a=r.y;a<=o.y;a++){var h=this.cellAtPosition(s,a);if(h)for(var c=function(r){var o=h[r];if(o==i||!t.Flags.isFlagSet(n,o.physicsLayer))return"continue";e.intersects(o.bounds)&&(l._tempHashSet.firstOrDefault(function(t){return t.hashCode==o.hashCode})||l._tempHashSet.push(o))},l=this,u=0;u=0&&(e.push(this.findBoundsRect(i,o,r,t)),i=-1)}i>=0&&(e.push(this.findBoundsRect(i,this.map.width,r,t)),i=-1)}return e},e.prototype.findBoundsRect=function(e,i,n,r){for(var o=-1,s=n+1;sthis.tileHeight||this.maxTileWidth>this.tileWidth},enumerable:!0,configurable:!0}),i.prototype.getTilesetForTileGid=function(t){if(0==t)return null;for(var e=this.tilesets.length-1;e>=0;e--)if(this.tilesets[e].firstGid<=t)return this.tilesets[e];console.error("tile gid"+t+"未在任何tileset中找到")},i.prototype.worldToTilePositionX=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileWidth);return i?t.MathHelper.clamp(n,0,this.width-1):n},i.prototype.worldToTilePositionY=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileHeight);return i?t.MathHelper.clamp(n,0,this.height-1):n},i.prototype.getLayer=function(t){return this.layers[t]},i.prototype.update=function(){this.tilesets.forEach(function(t){t.update()})},i.prototype.dispose=function(t){void 0===t&&(t=!0),this._isDisposed||(t&&(this.tilesets.forEach(function(t){t.image&&t.image.dispose()}),this.imageLayers.forEach(function(t){t.image&&t.image.dispose()})),this._isDisposed=!0)},i}(t.TmxDocument);t.TmxMap=e,function(t){t[t.unknown=0]="unknown",t[t.orthogonal=1]="orthogonal",t[t.isometric=2]="isometric",t[t.staggered=3]="staggered",t[t.hexagonal=4]="hexagonal"}(t.OrientationType||(t.OrientationType={})),function(t){t[t.x=0]="x",t[t.y=1]="y"}(t.StaggerAxisType||(t.StaggerAxisType={})),function(t){t[t.odd=0]="odd",t[t.even=1]="even"}(t.StaggerIndexType||(t.StaggerIndexType={})),function(t){t[t.rightDown=0]="rightDown",t[t.rightUp=1]="rightUp",t[t.leftDown=2]="leftDown",t[t.leftUp=3]="leftUp"}(t.RenderOrderType||(t.RenderOrderType={}))}(es||(es={})),function(t){var e=function(){return function(){}}();t.TmxObjectGroup=e;var i=function(){return function(){this.shape=new egret.Shape,this.textField=new egret.TextField}}();t.TmxObject=i;var n=function(){return function(){}}();t.TmxText=n;var r=function(){return function(){}}();t.TmxAlignment=r,function(t){t[t.basic=0]="basic",t[t.point=1]="point",t[t.tile=2]="tile",t[t.ellipse=3]="ellipse",t[t.polygon=4]="polygon",t[t.polyline=5]="polyline",t[t.text=6]="text"}(t.TmxObjectType||(t.TmxObjectType={})),function(t){t[t.unkownOrder=-1]="unkownOrder",t[t.TopDown=0]="TopDown",t[t.IndexOrder=1]="IndexOrder"}(t.DrawOrderType||(t.DrawOrderType={})),function(t){t[t.left=0]="left",t[t.center=1]="center",t[t.right=2]="right",t[t.justify=3]="justify"}(t.TmxHorizontalAlignment||(t.TmxHorizontalAlignment={})),function(t){t[t.top=0]="top",t[t.center=1]="center",t[t.bottom=2]="bottom"}(t.TmxVerticalAlignment||(t.TmxVerticalAlignment={}))}(es||(es={})),function(t){var e=function(){function e(){}return e.loadTmxMap=function(t,e){var i=RES.getRes(e);return this.loadTmxMapData(t,i,RES.getResourceInfo(e))},e.loadTmxMapData=function(e,i,n){return __awaiter(this,void 0,void 0,function(){var r,o,s,a;return __generator(this,function(h){switch(h.label){case 0:e.version=i.version,e.tiledVersion=i.tiledversion,e.width=i.width,e.height=i.height,e.tileWidth=i.tilewidth,e.tileHeight=i.tileheight,e.hexSideLength=i.hexsidelength,e.orientation=this.parseOrientationType(i.orientation),e.staggerAxis=this.parseStaggerAxisType(i.staggeraxis),e.staggerIndex=this.parseStaggerIndexType(i.staggerindex),e.renderOrder=this.parseRenderOrderType(i.renderorder),e.nextObjectID=i.nextobjectid,e.backgroundColor=t.TmxUtils.color16ToUnit(i.color),e.properties=this.parsePropertyDict(i.properties),e.maxTileWidth=e.tileWidth,e.maxTileHeight=e.tileHeight,e.tmxDirectory=n.root+n.url.replace(".","_").replace(n.name,""),e.tilesets=[],r=0,o=i.tilesets,h.label=1;case 1:return rt.map.maxTileWidth&&(t.map.maxTileWidth=e.image.width),e.image.height>t.map.maxTileHeight&&(t.map.maxTileHeight=e.image.height))}),t.tileRegions.forEach(function(e){var i=e.width,n=e.height;i>t.map.maxTileWidth&&(t.map.maxTileWidth=i),i>t.map.maxTileHeight&&(t.map.maxTileHeight=n)})},e.parseOrientationType=function(e){return"unknown"==e?t.OrientationType.unknown:"orthogonal"==e?t.OrientationType.orthogonal:"isometric"==e?t.OrientationType.isometric:"staggered"==e?t.OrientationType.staggered:"hexagonal"==e?t.OrientationType.hexagonal:t.OrientationType.unknown},e.parseStaggerAxisType=function(e){return"y"==e?t.StaggerAxisType.y:t.StaggerAxisType.x},e.parseStaggerIndexType=function(e){return"even"==e?t.StaggerIndexType.even:t.StaggerIndexType.odd},e.parseRenderOrderType=function(e){return"right-up"==e?t.RenderOrderType.rightUp:"left-down"==e?t.RenderOrderType.leftDown:"left-up"==e?t.RenderOrderType.leftUp:t.RenderOrderType.rightDown},e.parsePropertyDict=function(e){if(!e)return null;for(var i=new Map,n=0,r=e;n=e.columns));m+=e.tileWidth+e.spacing);else e.tiles.forEach(function(i,n){e.tileRegions.set(n,new t.Rectangle(0,0,i.image.width,i.image.height))});return[2,e]}})})},e.loadTmxTilesetTile=function(e,i,n,r,o){return __awaiter(this,void 0,void 0,function(){var s,a,h,c,l,u,p,d,f,g,y,m,_;return __generator(this,function(v){switch(v.label){case 0:if(e.tileset=i,e.id=n.id,s=n.terrain)for(e.terrainEdges=new Array(4),a=0,h=0,c=s;h0){a.shape.x=h.x,a.shape.y=h.y,i.addChild(a.shape),a.shape.graphics.clear(),a.shape.graphics.lineStyle(1,10526884);for(u=0;u0&&(l=u.currentAnimationFrameGid);var p=i.tileset.tileRegions.get(l),d=Math.floor(i.x)*s,f=Math.floor(i.y)*a;i.horizontalFlip&&i.verticalFlip?(d+=a+(p.height*o.y-a),f-=p.width*o.x-s):i.horizontalFlip?d+=s+(p.height*o.y-a):i.verticalFlip?f+=s-p.width*o.x:f+=a-p.height*o.y;var g=new t.Vector2(d,f).add(r);if(i.tileset.image){if(n){var y=i.tileset.image.bitmap.getTexture(""+l);y||(y=i.tileset.image.bitmap.createTexture(""+l,p.x,p.y,p.width,p.height)),i.tileset.image.texture=new e(y),n.addChild(i.tileset.image.texture),i.tileset.image.texture.x!=g.x&&(i.tileset.image.texture.x=g.x),i.tileset.image.texture.y!=g.y&&(i.tileset.image.texture.y=g.y),i.verticalFlip&&i.horizontalFlip?(i.tileset.image.texture.scaleX=-1,i.tileset.image.texture.scaleY=-1):i.verticalFlip?(i.tileset.image.texture.scaleX=o.x,i.tileset.image.texture.scaleY=-1):i.horizontalFlip?(i.tileset.image.texture.scaleX=-1,i.tileset.image.texture.scaleY=o.y):(i.tileset.image.texture.scaleX=o.x,i.tileset.image.texture.scaleY=o.y),0!=i.tileset.image.texture.rotation&&(i.tileset.image.texture.rotation=0),0!=i.tileset.image.texture.anchorOffsetX&&(i.tileset.image.texture.anchorOffsetX=0),0!=i.tileset.image.texture.anchorOffsetY&&(i.tileset.image.texture.anchorOffsetY=0)}}else u.image.texture&&(u.image.bitmap.getTexture(l.toString())||(u.image.texture=new e(u.image.bitmap.createTexture(l.toString(),p.x,p.y,p.width,p.height)),n.addChild(u.image.texture)),u.image.texture.x=g.x,u.image.texture.y=g.y,u.image.texture.scaleX=o.x,u.image.texture.scaleY=o.y,u.image.texture.rotation=0,u.image.texture.anchorOffsetX=0,u.image.texture.anchorOffsetY=0,u.image.texture.filters=[h])},i}();t.TiledRendering=i}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.update=function(){this.tiles.forEach(function(t){t.updateAnimatedTiles()})},e}(t.TmxDocument);t.TmxTileset=e;var i=function(){return function(){}}();t.TmxTileOffset=i;var n=function(){return function(){}}();t.TmxTerrain=n}(es||(es={})),function(t){var e=function(){function e(){}return Object.defineProperty(e.prototype,"currentAnimationFrameGid",{get:function(){return this.animationFrames[this._animationCurrentFrame].gid+this.tileset.firstGid},enumerable:!0,configurable:!0}),e.prototype.processProperties=function(){var t;(t=this.properties.get("engine.isDestructable"))&&(this.isDestructable=Boolean(t)),(t=this.properties.get("engine:isSlope"))&&(this.isSlope=Boolean(t)),(t=this.properties.get("engine:isOneWayPlatform"))&&(this.isOneWayPlatform=Boolean(t)),(t=this.properties.get("engine:slopeTopLeft"))&&(this.slopeTopLeft=Number(t)),(t=this.properties.get("engine:slopeTopRight"))&&(this.slopeTopRight=Number(t))},e.prototype.updateAnimatedTiles=function(){0!=this.animationFrames.length&&(this._animationElapsedTime+=t.Time.deltaTime,this._animationElapsedTime>this.animationFrames[this._animationCurrentFrame].duration&&(this._animationCurrentFrame=t.MathHelper.incrementWithWrap(this._animationCurrentFrame,this.animationFrames.length),this._animationElapsedTime=0))},e}();t.TmxTilesetTile=e;var i=function(){return function(){}}();t.TmxAnimationFrame=i}(es||(es={})),function(t){var e=function(){function e(){}return e.decode=function(e,i,n){switch(n=n||"none",i=i||"none"){case"base64":var r=t.Base64Utils.decodeBase64AsArray(e,4);return"none"===n?r:t.Base64Utils.decompress(e,r,n);case"csv":return t.Base64Utils.decodeCSV(e);case"none":for(var o=[],s=0;si;n--)if(t[n]0&&t[r-1]>n;r--)t[r]=t[r-1];t[r]=n}},t.binarySearch=function(t,e){for(var i=0,n=t.length,r=i+n>>1;i=t[r]&&(i=r+1),r=i+n>>1;return t[i]==e?i:-1},t.findElementIndex=function(t,e){for(var i=t.length,n=0;nt[e]&&(e=n);return e},t.getMinElementIndex=function(t){for(var e=0,i=t.length,n=1;n=0;--r)i.unshift(e[r]);return i},t.getDifferAry=function(t,e){t=this.getUniqueAry(t),e=this.getUniqueAry(e);for(var i=t.concat(e),n={},r=[],o=i.length,s=0;s=0;e-=1)t.splice(e,1)},t.cloneList=function(t){return t?t.slice(0,t.length):null},t.equals=function(t,e){if(t==e)return!0;var i=t.length;if(i!=e.length)return!1;for(;i--;)if(t[i]!=e[i])return!1;return!0},t.insert=function(t,e,i){if(!t)return null;var n=t.length;if(e>n&&(e=n),e<0&&(e=0),e==n)t.push(i);else if(0==e)t.unshift(i);else{for(var r=n-1;r>=e;r-=1)t[r+1]=t[r];t[e]=i}return i},t}();!function(t){var e=function(){function t(){}return Object.defineProperty(t,"nativeBase64",{get:function(){return"function"==typeof window.atob},enumerable:!0,configurable:!0}),t.decode=function(t){if(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),this.nativeBase64)return window.atob(t);for(var e,i,n,r,o,s,a=[],h=0;h>4,i=(15&r)<<4|(o=this._keyStr.indexOf(t.charAt(h++)))>>2,n=(3&o)<<6|(s=this._keyStr.indexOf(t.charAt(h++))),a.push(String.fromCharCode(e)),64!==o&&a.push(String.fromCharCode(i)),64!==s&&a.push(String.fromCharCode(n));return a=a.join("")},t.encode=function(t){if(t=t.replace(/\r\n/g,"\n"),!this.nativeBase64){for(var e,i,n,r,o,s,a,h=[],c=0;c>2,o=(3&e)<<4|(i=t.charCodeAt(c++))>>4,s=(15&i)<<2|(n=t.charCodeAt(c++))>>6,a=63&n,isNaN(i)?s=a=64:isNaN(n)&&(a=64),h.push(this._keyStr.charAt(r)),h.push(this._keyStr.charAt(o)),h.push(this._keyStr.charAt(s)),h.push(this._keyStr.charAt(a));return h=h.join("")}window.btoa(t)},t.decodeBase64AsArray=function(e,i){i=i||1;var n,r,o,s=t.decode(e),a=new Uint32Array(s.length/i);for(n=0,o=s.length/i;n=0;--r)a[n]+=s.charCodeAt(n*i+r)<<(r<<3);return a},t.decompress=function(t,e,i){throw new Error("GZIP/ZLIB compressed TMX Tile Map not supported!")},t.decodeCSV=function(t){for(var e=t.replace("\n","").trim().split(","),i=[],n=0;n>16},set:function(t){this._packedValue=4278255615&this._packedValue|t<<16},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._packedValue>>8},set:function(t){this._packedValue=4294902015&this._packedValue|t<<8},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"r",{get:function(){return this._packedValue},set:function(t){this._packedValue=4294967040&this._packedValue|t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._packedValue>>24},set:function(t){this._packedValue=16777215&this._packedValue|t<<24},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"packedValue",{get:function(){return this._packedValue},set:function(t){this._packedValue=t},enumerable:!0,configurable:!0}),e.prototype.equals=function(t){return this._packedValue==t._packedValue},e}();t.Color=e}(es||(es={})),function(t){var e=function(){function t(){this.loadedAssets=new Map}return t.prototype.loadRes=function(t,e){var i=this;return void 0===e&&(e=!0),new Promise(function(n,r){var o=i.loadedAssets.get(t);o?n(o):e?RES.getResAsync(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)}):RES.getResByUrl(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)})})},t.prototype.dispose=function(){this.loadedAssets.forEach(function(t){var e=t;RES.destroyRes(e)&&e.dispose()}),this.loadedAssets.clear()},t}();t.ContentManager=e}(es||(es={})),function(t){var e=function(){function t(){}return t.getColorMatrix=function(t){var e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];return e[0]=Math.floor(t/256/256)/255,e[6]=Math.floor(t/256%256)/255,e[12]=t%256/255,new egret.ColorMatrixFilter(e)},t}();t.DrawUtils=e}(es||(es={})),function(t){var e=function(){function e(){}return e.oppositeEdge=function(e){switch(e){case t.Edge.bottom:return t.Edge.top;case t.Edge.top:return t.Edge.bottom;case t.Edge.left:return t.Edge.right;case t.Edge.right:return t.Edge.left}},e.isHorizontal=function(e){return e==t.Edge.right||e==t.Edge.left},e.isVertical=function(e){return e==t.Edge.top||e==t.Edge.bottom},e}();t.EdgeExt=e}(es||(es={})),function(t){var e=function(){return function(t,e){this.func=t,this.context=e}}();t.FuncPack=e;var i=function(){function t(){this._messageTable=new Map}return t.prototype.addObserver=function(t,i,n){var r=this._messageTable.get(t);r||(r=[],this._messageTable.set(t,r)),-1!=r.findIndex(function(t){return t.func==i})&&console.warn("您试图添加相同的观察者两次"),r.push(new e(i,n))},t.prototype.removeObserver=function(t,e){var i=this._messageTable.get(t),n=i.findIndex(function(t){return t.func==e});-1!=n&&i.removeAt(n)},t.prototype.emit=function(t,e){var i=this._messageTable.get(t);if(i)for(var n=i.length-1;n>=0;n--)i[n].func.call(i[n].context,e)},t}();t.Emitter=i}(es||(es={})),function(t){!function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.left=2]="left",t[t.right=3]="right"}(t.Edge||(t.Edge={}))}(es||(es={})),function(t){var e=function(){function t(){}return t.repeat=function(t,e){for(var i=[];e--;)i.push(t);return i},t}();t.Enumerable=e}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),t.prototype.setEnabled=function(t){this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled())},t.prototype.onEnabled=function(){},t.prototype.onDisabled=function(){},t.prototype.update=function(){},t}();t.GlobalManager=e}(es||(es={})),function(t){var e=function(){function e(){this.x=0,this.y=0,this.touchPoint=-1,this.touchDown=!1}return Object.defineProperty(e.prototype,"position",{get:function(){return new t.Vector2(this.x,this.y)},enumerable:!0,configurable:!0}),e.prototype.reset=function(){this.x=0,this.y=0,this.touchDown=!1,this.touchPoint=-1},e}();t.TouchState=e;var i=function(){function i(){}return Object.defineProperty(i,"gameTouchs",{get:function(){return this._gameTouchs},enumerable:!0,configurable:!0}),Object.defineProperty(i,"resolutionScale",{get:function(){return this._resolutionScale},enumerable:!0,configurable:!0}),Object.defineProperty(i,"totalTouchCount",{get:function(){return this._totalTouchCount},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPosition",{get:function(){return this._gameTouchs[0]?this._gameTouchs[0].position:t.Vector2.zero},enumerable:!0,configurable:!0}),Object.defineProperty(i,"maxSupportedTouch",{get:function(){return t.Core._instance.stage.maxTouches},set:function(e){t.Core._instance.stage.maxTouches=e,this.initTouchCache()},enumerable:!0,configurable:!0}),Object.defineProperty(i,"touchPositionDelta",{get:function(){var e=t.Vector2.subtract(this.touchPosition,this._previousTouchState.position);return e.length()>0&&this.setpreviousTouchState(this._gameTouchs[0]),e},enumerable:!0,configurable:!0}),i.initialize=function(){this._init||(this._init=!0,t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.touchBegin,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.touchMove,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.touchEnd,this),this.initTouchCache())},i.scaledPosition=function(e){var i=new t.Vector2(e.x-this._resolutionOffset.x,e.y-this._resolutionOffset.y);return t.Vector2.multiply(i,this.resolutionScale)},i.initTouchCache=function(){this._totalTouchCount=0,this._touchIndex=0,this._gameTouchs.length=0;for(var t=0;t0)for(var e=0;ethis._objectQueue.length;)this._objectQueue.shift()},t.clearCache=function(){this._objectQueue.length=0},t.obtain=function(){return this._objectQueue.length>0?this._objectQueue.shift():[]},t.free=function(t){this._objectQueue.unshift(t),t.length=0},t._objectQueue=[],t}();t.ListPool=e}(es||(es={})),function(t){var e=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.clear=function(){this.first=this.second=null},t.prototype.equals=function(t){return this.first==t.first&&this.second==t.second},t}();t.Pair=e}(es||(es={}));var RandomUtils=function(){function t(){}return t.randrange=function(t,e,i){if(void 0===i&&(i=1),0==i)throw new Error("step 不能为 0");var n=e-t;if(0==n)throw new Error("没有可用的范围("+t+","+e+")");n<0&&(n=t-e);var r=Math.floor((n+i-1)/i);return Math.floor(this.random()*r)*i+Math.min(t,e)},t.randint=function(t,e){return(t=Math.floor(t))>(e=Math.floor(e))?t++:e++,this.randrange(t,e)},t.randnum=function(t,e){return this.random()*(e-t)+t},t.shuffle=function(t){return t.sort(this._randomCompare),t},t.choice=function(t){if(!t.hasOwnProperty("length"))throw new Error("无法对此对象执行此操作");var e=Math.floor(this.random()*t.length);return t instanceof String?String(t).charAt(e):t[e]},t.sample=function(t,e){var i=t.length;if(e<=0||i=0;)s=Math.floor(this.random()*i);n.push(t[s]),r.push(s)}return n},t.random=function(){return Math.random()},t.boolean=function(t){return void 0===t&&(t=.5),this.random().5?1:-1},t}();!function(t){var e=function(){function e(){}return e.getSide=function(e,i){switch(i){case t.Edge.top:return e.top;case t.Edge.bottom:return e.bottom;case t.Edge.left:return e.left;case t.Edge.right:return e.right}},e.union=function(e,i){var n=new t.Rectangle(i.x,i.y,0,0),r=new t.Rectangle;return r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.width=Math.max(e.right,n.right)-r.x,r.height=Math.max(e.bottom,r.bottom)-r.y,r},e.getHalfRect=function(e,i){switch(i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,e.height/2);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height/2,e.width,e.height/2);case t.Edge.left:return new t.Rectangle(e.x,e.y,e.width/2,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width/2,e.y,e.width/2,e.height)}},e.getRectEdgePortion=function(e,i,n){switch(void 0===n&&(n=1),i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,n);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height-n,e.width,n);case t.Edge.left:return new t.Rectangle(e.x,e.y,n,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width-n,e.y,n,e.height)}},e.expandSide=function(e,i,n){switch(n=Math.abs(n),i){case t.Edge.top:e.y-=n,e.height+=n;break;case t.Edge.bottom:e.height+=n;break;case t.Edge.left:e.x-=n,e.width+=n;break;case t.Edge.right:e.width+=n}},e.contract=function(t,e,i){t.x+=e,t.y+=i,t.width-=2*e,t.height-=2*i},e}();t.RectangleExt=e}(es||(es={})),function(t){var e=function(){return function(t){this.value=t}}();t.Ref=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.update=function(t){this.remainder+=t;var e=Math.trunc(this.remainder);return this.remainder-=e,e},t.prototype.reset=function(){this.remainder=0},t}();t.SubpixelNumber=e}(es||(es={})),function(t){var e=function(){function e(){this.triangleIndices=[],this._triPrev=new Array(12),this._triNext=new Array(12)}return e.testPointTriangle=function(e,i,n,r){return!(t.Vector2Ext.cross(t.Vector2.subtract(e,i),t.Vector2.subtract(n,i))<0)&&(!(t.Vector2Ext.cross(t.Vector2.subtract(e,n),t.Vector2.subtract(r,n))<0)&&!(t.Vector2Ext.cross(t.Vector2.subtract(e,r),t.Vector2.subtract(i,r))<0))},e.prototype.triangulate=function(i,n){void 0===n&&(n=!0);var r=i.length;this.initialize(r);for(var o=0,s=0;r>3&&o<500;){o++;var a=!0,h=i[this._triPrev[s]],c=i[s],l=i[this._triNext[s]];if(t.Vector2Ext.isTriangleCCW(h,c,l)){var u=this._triNext[this._triNext[s]];do{if(e.testPointTriangle(i[u],h,c,l)){a=!1;break}u=this._triNext[u]}while(u!=this._triPrev[s])}else a=!1;a?(this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),this._triNext[this._triPrev[s]]=this._triNext[s],this._triPrev[this._triNext[s]]=this._triPrev[s],r--,s=this._triPrev[s]):s=this._triNext[s]}this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),n||this.triangleIndices.reverse()},e.prototype.initialize=function(t){this.triangleIndices.length=0,this._triNext.lengtht.MathHelper.Epsilon?e.divide(new t.Vector2(i)):e.x=e.y=0},e.transformA=function(t,e,i,n,r,o){for(var s=0;sthis.safeArea.right&&(s.x=this.safeArea.right-s.width),s.topthis.safeArea.bottom&&(s.y=this.safeArea.bottom-s.height),s},i}();t.Layout=i,function(t){t[t.none=0]="none",t[t.left=1]="left",t[t.right=2]="right",t[t.horizontalCenter=4]="horizontalCenter",t[t.top=8]="top",t[t.bottom=16]="bottom",t[t.verticalCenter=32]="verticalCenter",t[t.topLeft=9]="topLeft",t[t.topRight=10]="topRight",t[t.topCenter=12]="topCenter",t[t.bottomLeft=17]="bottomLeft",t[t.bottomRight=18]="bottomRight",t[t.bottomCenter=20]="bottomCenter",t[t.centerLeft=33]="centerLeft",t[t.centerRight=34]="centerRight",t[t.center=36]="center"}(e=t.Alignment||(t.Alignment={}))}(es||(es={})),function(t){var e,i=function(){function t(t){void 0===t&&(t=n),this.getSystemTime=t,this._stopDuration=0,this._completeSlices=[]}return t.prototype.getState=function(){return void 0===this._startSystemTime?e.IDLE:void 0===this._stopSystemTime?e.RUNNING:e.STOPPED},t.prototype.isIdle=function(){return this.getState()===e.IDLE},t.prototype.isRunning=function(){return this.getState()===e.RUNNING},t.prototype.isStopped=function(){return this.getState()===e.STOPPED},t.prototype.slice=function(){return this.recordPendingSlice()},t.prototype.getCompletedSlices=function(){return Array.from(this._completeSlices)},t.prototype.getCompletedAndPendingSlices=function(){return this._completeSlices.concat([this.getPendingSlice()])},t.prototype.getPendingSlice=function(){return this.calculatePendingSlice()},t.prototype.getTime=function(){return this.caculateStopwatchTime()},t.prototype.reset=function(){this._startSystemTime=this._pendingSliceStartStopwatchTime=this._stopSystemTime=void 0,this._stopDuration=0,this._completeSlices=[]},t.prototype.start=function(t){if(void 0===t&&(t=!1),t&&this.reset(),void 0!==this._stopSystemTime){var e=(i=this.getSystemTime())-this._stopSystemTime;this._stopDuration+=e,this._stopSystemTime=void 0}else if(void 0===this._startSystemTime){var i=this.getSystemTime();this._startSystemTime=i,this._pendingSliceStartStopwatchTime=0}},t.prototype.stop=function(t){if(void 0===t&&(t=!1),void 0===this._startSystemTime)return 0;var e=this.getSystemTimeOfCurrentStopwatchTime();return t&&this.recordPendingSlice(this.caculateStopwatchTime(e)),this._stopSystemTime=e,this.getTime()},t.prototype.calculatePendingSlice=function(t){return void 0===this._pendingSliceStartStopwatchTime?Object.freeze({startTime:0,endTime:0,duration:0}):(void 0===t&&(t=this.getTime()),Object.freeze({startTime:this._pendingSliceStartStopwatchTime,endTime:t,duration:t-this._pendingSliceStartStopwatchTime}))},t.prototype.caculateStopwatchTime=function(t){return void 0===this._startSystemTime?0:(void 0===t&&(t=this.getSystemTimeOfCurrentStopwatchTime()),t-this._startSystemTime-this._stopDuration)},t.prototype.getSystemTimeOfCurrentStopwatchTime=function(){return void 0===this._stopSystemTime?this.getSystemTime():this._stopSystemTime},t.prototype.recordPendingSlice=function(t){if(void 0!==this._pendingSliceStartStopwatchTime){void 0===t&&(t=this.getTime());var e=this.calculatePendingSlice(t);return this._pendingSliceStartStopwatchTime=e.endTime,this._completeSlices.push(e),e}return this.calculatePendingSlice()},t}();t.Stopwatch=i,function(t){t.IDLE="IDLE",t.RUNNING="RUNNING",t.STOPPED="STOPPED"}(e||(e={})),t.setDefaultSystemTimeGetter=function(t){void 0===t&&(t=Date.now),n=t};var n=Date.now}(stopwatch||(stopwatch={})),function(t){var e=function(){function e(){this.showLog=!1,this.markers=[],this.stopwacth=new stopwatch.Stopwatch,this._markerNameToIdMap=new Map,this._rectShape1=new egret.Shape,this._rectShape2=new egret.Shape,this._rectShape3=new egret.Shape,this._rectShape4=new egret.Shape,this._rectShape5=new egret.Shape,this._rectShape6=new egret.Shape,this._logs=new Array(2);for(var e=0;e=e.logSnapDuration&&(l.logs[n].snapMin=l.logs[n].min,l.logs[n].snapMax=l.logs[n].max,l.logs[n].snapAvg=l.logs[n].avg,l.logs[n].samples=0)):(l.logs[n].min=h,l.logs[n].max=h,l.logs[n].avg=h,l.logs[n].initialized=!0)}o.markCount=r.nestCount,o.nestCount=r.nestCount}this.stopwacth.reset(),this.stopwacth.start()}},e.prototype.beginMark=function(t,i,n){if(void 0===n&&(n=0),n<0||n>=e.maxBars)throw new Error("barIndex argument out of range");var r=this._curLog.bars[n];if(r.markCount>=e.maxSamples)throw new Error("exceeded sample count. either set larger number to timeruler.maxsaple or lower sample count");if(r.nestCount>=e.maxNestCall)throw new Error("exceeded nest count. either set larger number to timeruler.maxnestcall or lower nest calls");var o=this._markerNameToIdMap.get(t);isNaN(o)&&(o=this.markers.length,this._markerNameToIdMap.set(t,o)),r.markerNests[r.nestCount++]=r.markCount,r.markers[r.markCount].markerId=o,r.markers[r.markCount].color=i,r.markers[r.markCount].beginTime=this.stopwacth.getTime(),r.markers[r.markCount].endTime=-1},e.prototype.endMark=function(t,i){if(void 0===i&&(i=0),i<0||i>=e.maxBars)throw new Error("barIndex argument out of range");var n=this._curLog.bars[i];if(n.nestCount<=0)throw new Error("call beginMark method before calling endMark method");var r=this._markerNameToIdMap.get(t);if(isNaN(r))throw new Error("Marker "+t+" is not registered. Make sure you specifed same name as you used for beginMark method");var o=n.markerNests[--n.nestCount];if(n.markers[o].markerId!=r)throw new Error("Incorrect call order of beginMark/endMark method. beginMark(A), beginMark(B), endMark(B), endMark(A) But you can't called it like beginMark(A), beginMark(B), endMark(A), endMark(B).");n.markers[o].endTime=this.stopwacth.getTime()},e.prototype.getAverageTime=function(t,i){if(t<0||t>=e.maxBars)throw new Error("barIndex argument out of range");var n=0,r=this._markerNameToIdMap.get(i);return r&&(n=this.markers[r].logs[t].avg),n},e.prototype.resetLog=function(){this.markers.forEach(function(t){for(var e=0;e0&&(r+=e.barHeight+2*e.barPadding,o=Math.max(o,t.markers[t.markCount-1].endTime))});var s=this.sampleFrames*(1/60*1e3);this._frameAdjust=o>s?Math.max(0,this._frameAdjust)+1:Math.min(0,this._frameAdjust)-1,Math.max(this._frameAdjust)>e.autoAdjustDelay&&(this.sampleFrames=Math.min(e.maxSampleFrames,this.sampleFrames),this.sampleFrames=Math.max(this.targetSampleFrames,o/(1/60*1e3)+1),this._frameAdjust=0);var a=n/s,h=i.y-(r-e.barHeight),c=h,l=new t.Rectangle(i.x,c,n,r);this._rectShape1.graphics.clear(),this._rectShape1.graphics.beginFill(0,128/255),this._rectShape1.graphics.drawRect(l.x,l.y,l.width,l.height),this._rectShape1.graphics.endFill(),l.height=e.barHeight,this._rectShape2.graphics.clear();for(var u=0,p=this._prevLog.bars;u0)for(var f=0;fa||i[c].height>a)throw new Error("一个纹理的大小比图集的大小大");h.push(new t.Rectangle(0,0,i[c].width,i[c].height))}for(;h.length>0;){var l=new egret.RenderTexture,u=new t.RectanglePacker(a,a,1);for(c=0;c0){for(var p=new t.IntegerRectangle,d=[],f=[],g=[],y=[],m=0;m0;)this.freeRectangle(this._insertedRectangles.pop());for(;this._freeAreas.length>0;)this.freeRectangle(this._freeAreas.pop());for(this._width=t,this._height=e,this._packedWidth=0,this._packedHeight=0,this._freeAreas.push(this.allocateRectangle(0,0,this._width,this._height));this._insertedRectangles.length>0;)this.freeSize(this._insertList.pop());this._padding=i},e.prototype.insertRectangle=function(t,e,i){var n=this.allocateSize(t,e,i);this._insertList.push(n)},e.prototype.packRectangles=function(t){for(void 0===t&&(t=!0),t&&this._insertList.sort(function(t,e){return t.width-e.width});this._insertList.length>0;){var e=this._insertList.pop(),i=e.width,n=e.height,r=this.getFreeAreaIndex(i,n);if(r>=0){var o=this._freeAreas[r],s=this.allocateRectangle(o.x,o.y,i,n);for(s.id=e.id,this.generateNewFreeAreas(s,this._freeAreas,this._newFreeAreas);this._newFreeAreas.length>0;)this._freeAreas.push(this._newFreeAreas.pop());this._insertedRectangles.push(s),s.right>this._packedWidth&&(this._packedWidth=s.right),s.bottom>this._packedHeight&&(this._packedHeight=s.bottom)}this.freeSize(e)}return this.rectangleCount},e.prototype.getRectangle=function(t,e){var i=this._insertedRectangles[t];return e.x=i.x,e.y=i.y,e.width=i.width,e.height=i.height,e},e.prototype.getRectangleId=function(t){return this._insertedRectangles[t].id},e.prototype.generateNewFreeAreas=function(t,e,i){var n=t.x,r=t.y,o=t.right+1+this._padding,s=t.bottom+1+this._padding,a=null;0==this._padding&&(a=t);for(var h=e.length-1;h>=0;h--){var c=e[h];if(!(n>=c.right||o<=c.x||r>=c.bottom||s<=c.y)){null==a&&(a=this.allocateRectangle(t.x,t.y,t.width+this._padding,t.height+this._padding)),this.generateDividedAreas(a,c,i);var l=e.pop();h=0;e--)for(var i=t[e],n=t.length-1;n>=0;n--)if(e!=n){var r=t[n];if(i.x>=r.x&&i.y>=r.y&&i.right<=r.right&&i.bottom<=r.bottom){this.freeRectangle(i);var o=t.pop();e0&&(i.push(this.allocateRectangle(t.right,e.y,r,e.height)),n++);var o=t.x-e.x;o>0&&(i.push(this.allocateRectangle(e.x,e.y,o,e.height)),n++);var s=e.bottom-t.bottom;s>0&&(i.push(this.allocateRectangle(e.x,t.bottom,e.width,s)),n++);var a=t.y-e.y;a>0&&(i.push(this.allocateRectangle(e.x,e.y,e.width,a)),n++),0==n&&(t.width=0;s--){var a=this._freeAreas[s];if(a.x0){var r=this._sortableSizeStack.pop();return r.width=e,r.height=i,r.id=n,r}return new t.SortableSize(e,i,n)},e.prototype.freeSize=function(t){this._sortableSizeStack.push(t)},e.prototype.allocateRectangle=function(e,i,n,r){if(this._rectangleStack.length>0){var o=this._rectangleStack.pop();return o.x=e,o.y=i,o.width=n,o.height=r,o.right=e+n,o.bottom=i+r,o}return new t.IntegerRectangle(e,i,n,r)},e.prototype.freeRectangle=function(t){this._rectangleStack.push(t)},e}();t.RectanglePacker=e}(es||(es={})),function(t){var e=function(){return function(t,e,i){this.width=t,this.height=e,this.id=i}}();t.SortableSize=e}(es||(es={})),function(t){var e=function(){return function(t){this.assets=t}}();t.TextureAssets=e;var i=function(){return function(){}}();t.TextureAsset=i}(es||(es={})),function(t){var e=function(){return function(t,e){this.texture=t,this.id=e}}();t.TextureToPack=e}(es||(es={})),function(t){var e=function(){function e(){this._timeInSeconds=0,this._repeats=!1,this._isDone=!1,this._elapsedTime=0}return e.prototype.getContext=function(){return this.context},e.prototype.reset=function(){this._elapsedTime=0},e.prototype.stop=function(){this._isDone=!0},e.prototype.tick=function(){return!this._isDone&&this._elapsedTime>this._timeInSeconds&&(this._elapsedTime-=this._timeInSeconds,this._onTime(this),this._isDone||this._repeats||(this._isDone=!0)),this._elapsedTime+=t.Time.deltaTime,this._isDone},e.prototype.initialize=function(t,e,i,n){this._timeInSeconds=t,this._repeats=e,this.context=i,this._onTime=n},e.prototype.unload=function(){this.context=null,this._onTime=null},e}();t.Timer=e}(es||(es={})),function(t){var e=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._timers=[],t}return __extends(i,e),i.prototype.update=function(){for(var t=this._timers.length-1;t>=0;t--)this._timers[t].tick()&&(this._timers[t].unload(),this._timers.removeAt(t))},i.prototype.schedule=function(e,i,n,r){var o=new t.Timer;return o.initialize(e,i,n,r),this._timers.push(o),o},i}(t.GlobalManager);t.TimerManager=e}(es||(es={})); \ No newline at end of file +window.es={},window.__extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();var transform,__awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(r,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){t.done?r(t.value):new i(function(e){e(t.value)}).then(s,a)}h((n=n.apply(t,e||[])).next())})},__generator=this&&this.__generator||function(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(r=(r=s.trys).length>0&&r[r.length-1])&&(6===o[0]||2===o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]-1}(this,t)},Array.prototype.firstOrDefault=function(t){return function(t,e){var i=t.findIndex(e);return-1==i?null:t[i]}(this,t)},Array.prototype.find=function(t){return function(t,e){return t.firstOrDefault(e)}(this,t)},Array.prototype.where=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return e.call(arguments[2],n,r,t)&&i.push(n),i},[]);for(var i=[],n=0,r=t.length;n=0&&t.splice(i,1)}while(i>=0)}(this,t)},Array.prototype.remove=function(t){return function(t,e){var i=t.findIndex(function(t){return t===e});return i>=0&&(t.splice(i,1),!0)}(this,t)},Array.prototype.removeAt=function(t){return function(t,e){t.splice(e,1)}(this,t)},Array.prototype.removeRange=function(t,e){return function(t,e,i){t.splice(e,i)}(this,t,e)},Array.prototype.select=function(t){return function(t,e){if("function"==typeof t.reduce)return t.reduce(function(i,n,r){return i.push(e.call(arguments[2],n,r,t)),i},[]);for(var i=[],n=0,r=t.length;no?1:-1}),t}(this,t,e)},Array.prototype.orderByDescending=function(t,e){return function(t,e,i){return t.sort(function(t,n){var r=e(t),o=e(n);return i?-i(r,o):r0;){if("break"===l())break}return s?this.recontructPath(a,n,r):null},e.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},e}();t.AStarPathfinder=e;var i=function(t){function e(e){var i=t.call(this)||this;return i.data=e,i}return __extends(e,t),e}(t.PriorityQueueNode);t.AStarNode=i}(es||(es={})),function(t){var e=function(){function e(e,i){this.dirs=[new t.Vector2(1,0),new t.Vector2(0,-1),new t.Vector2(-1,0),new t.Vector2(0,1)],this.walls=[],this.weightedNodes=[],this.defaultWeight=1,this.weightedNodeWeight=5,this._neighbors=new Array(4),this._width=e,this._height=i}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x=this._nodes.length?(console.error("node.QueueIndex has been corrupted. Did you change it manually? Or add this node to another queue?"),!1):this._nodes[t.queueIndex]==t:(console.error("node cannot be null"),!1)},t.prototype.enqueue=function(t,e){t.priority=e,this._numNodes++,this._nodes[this._numNodes]=t,t.queueIndex=this._numNodes,t.insertionIndex=this._numNodesEverEnqueued++,this.cascadeUp(this._nodes[this._numNodes])},t.prototype.dequeue=function(){var t=this._nodes[1];return this.remove(t),t},t.prototype.remove=function(t){if(t.queueIndex==this._numNodes)return this._nodes[this._numNodes]=null,void this._numNodes--;var e=this._nodes[this._numNodes];this.swap(t,e),delete this._nodes[this._numNodes],this._numNodes--,this.onNodeUpdated(e)},t.prototype.isValidQueue=function(){for(var t=1;t0&&this.hasHigherPriority(t,i)?this.cascadeUp(t):this.cascadeDown(t)},t.prototype.cascadeDown=function(t){for(var e,i=t.queueIndex;;){e=t;var n=2*i;if(n>this._numNodes){t.queueIndex=i,this._nodes[i]=t;break}var r=this._nodes[n];this.hasHigherPriority(r,e)&&(e=r);var o=n+1;if(o<=this._numNodes){var s=this._nodes[o];this.hasHigherPriority(s,e)&&(e=s)}if(e==t){t.queueIndex=i,this._nodes[i]=t;break}this._nodes[i]=e;var a=e.queueIndex;e.queueIndex=i,i=a}},t.prototype.cascadeUp=function(t){for(var e=Math.floor(t.queueIndex/2);e>=1;){var i=this._nodes[e];if(this.hasHigherPriority(i,t))break;this.swap(t,i),e=Math.floor(t.queueIndex/2)}},t.prototype.swap=function(t,e){this._nodes[t.queueIndex]=e,this._nodes[e.queueIndex]=t;var i=t.queueIndex;t.queueIndex=e.queueIndex,e.queueIndex=i},t.prototype.hasHigherPriority=function(t,e){return t.priority0;){if("break"===h())break}return o?t.AStarPathfinder.recontructPath(a,i,n):null},e.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},e}();t.BreadthFirstPathfinder=e}(es||(es={})),function(t){var e=function(){function t(){this.edges=new Map}return t.prototype.addEdgesForNode=function(t,e){return this.edges.set(t,e),this},t.prototype.getNeighbors=function(t){return this.edges.get(t)},t}();t.UnweightedGraph=e}(es||(es={})),function(t){var e=function(){function e(t,e){this.x=0,this.y=0,this.x=t||0,this.y=null!=e?e:this.x}return Object.defineProperty(e,"zero",{get:function(){return new e(0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"one",{get:function(){return new e(1,1)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitX",{get:function(){return new e(1,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unitY",{get:function(){return new e(0,1)},enumerable:!0,configurable:!0}),e.add=function(t,i){var n=new e(0,0);return n.x=t.x+i.x,n.y=t.y+i.y,n},e.divide=function(t,i){var n=new e(0,0);return n.x=t.x/i.x,n.y=t.y/i.y,n},e.multiply=function(t,i){var n=new e(0,0);return n.x=t.x*i.x,n.y=t.y*i.y,n},e.subtract=function(t,i){var n=new e(0,0);return n.x=t.x-i.x,n.y=t.y-i.y,n},e.normalize=function(t){var i=new e(t.x,t.y),n=1/Math.sqrt(i.x*i.x+i.y*i.y);return i.x*=n,i.y*=n,i},e.dot=function(t,e){return t.x*e.x+t.y*e.y},e.distanceSquared=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},e.clamp=function(i,n,r){return new e(t.MathHelper.clamp(i.x,n.x,r.x),t.MathHelper.clamp(i.y,n.y,r.y))},e.lerp=function(i,n,r){return new e(t.MathHelper.lerp(i.x,n.x,r),t.MathHelper.lerp(i.y,n.y,r))},e.transform=function(t,i){return new e(t.x*i.m11+t.y*i.m21+i.m31,t.x*i.m12+t.y*i.m22+i.m32)},e.distance=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)},e.angle=function(i,n){return i=e.normalize(i),n=e.normalize(n),Math.acos(t.MathHelper.clamp(e.dot(i,n),-1,1))*t.MathHelper.Rad2Deg},e.negate=function(t){var i=new e;return i.x=-t.x,i.y=-t.y,i},e.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},e.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},e.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},e.prototype.subtract=function(t){return this.x-=t.x,this.y-=t.y,this},e.prototype.normalize=function(){var t=1/Math.sqrt(this.x*this.x+this.y*this.y);this.x*=t,this.y*=t},e.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lengthSquared=function(){return this.x*this.x+this.y*this.y},e.prototype.round=function(){return new e(Math.round(this.x),Math.round(this.y))},e.prototype.equals=function(t){return t.x==this.x&&t.y==this.y},e}();t.Vector2=e}(es||(es={})),function(t){var e=function(){function e(t,i,n){void 0===n&&(n=!1),this.walls=[],this._neighbors=new Array(4),this._width=t,this._hegiht=i,this._dirs=n?e.COMPASS_DIRS:e.CARDINAL_DIRS}return e.prototype.isNodeInBounds=function(t){return 0<=t.x&&t.x0;){if("break"===l())break}return s?this.recontructPath(a,n,r):null},i.recontructPath=function(t,e,i){var n=[],r=i;for(n.push(i);r!=e;)r=this.getKey(t,r),n.push(r);return n.reverse(),n},i.hasKey=function(t,e){for(var i,n=t.keys();!(i=n.next()).done;)if(JSON.stringify(i.value)==JSON.stringify(e))return!0;return!1},i.getKey=function(t,e){for(var i,n,r=t.keys(),o=t.values();i=r.next(),n=o.next(),!i.done;)if(JSON.stringify(i.value)==JSON.stringify(e))return n.value;return null},i}();t.WeightedPathfinder=i}(es||(es={})),function(t){var e=function(e){function i(){var n=e.call(this)||this;return n._globalManagers=[],n._timerManager=new t.TimerManager,i._instance=n,i.emitter=new t.Emitter,i.content=new t.ContentManager,n.addEventListener(egret.Event.ADDED_TO_STAGE,n.onAddToStage,n),i.registerGlobalManager(n._timerManager),n}return __extends(i,e),Object.defineProperty(i,"Instance",{get:function(){return this._instance},enumerable:!0,configurable:!0}),Object.defineProperty(i,"scene",{get:function(){return this._instance?this._instance._scene:null},set:function(t){t?null==this._instance._scene?(this._instance.addChild(t),this._instance._scene=t,this._instance._scene.begin(),i.Instance.onSceneChanged()):this._instance._nextScene=t:console.error("场景不能为空")},enumerable:!0,configurable:!0}),i.startSceneTransition=function(t){if(!this._instance._sceneTransition)return this._instance._sceneTransition=t,t;console.warn("在前一个场景完成之前,不能开始一个新的场景转换。")},i.registerGlobalManager=function(t){this._instance._globalManagers.push(t),t.enabled=!0},i.unregisterGlobalManager=function(t){this._instance._globalManagers.remove(t),t.enabled=!1},i.getGlobalManager=function(t){for(var e=0;e=0;e--)this._globalManagers[e].enabled&&this._globalManagers[e].update();return this._sceneTransition&&(!this._sceneTransition||this._sceneTransition.loadsNewScene&&!this._sceneTransition.isNewSceneLoaded)||this._scene.update(),this._nextScene?(this._scene.parent&&this._scene.parent.removeChild(this._scene),this._scene.end(),this._scene=this._nextScene,this._nextScene=null,this.onSceneChanged(),[4,this._scene.begin()]):[3,2];case 1:i.sent(),this.addChild(this._scene),i.label=2;case 2:return this.endDebugUpdate(),[4,this.draw()];case 3:return i.sent(),[2]}})})},i.prototype.onAddToStage=function(){i.graphicsDevice=new t.GraphicsDevice,this.addEventListener(egret.Event.RESIZE,this.onGraphicsDeviceReset,this),this.addEventListener(egret.StageOrientationEvent.ORIENTATION_CHANGE,this.onOrientationChanged,this),this.addEventListener(egret.Event.ENTER_FRAME,this.update,this),t.Input.initialize(),KeyboardUtils.init(),this.initialize()},i.debugRenderEndabled=!1,i}(egret.DisplayObjectContainer);t.Core=e}(es||(es={})),function(t){var e=function(){function t(){}return t.renderableBounds=16776960,t.renderableCenter=10040012,t.colliderBounds=5592405,t.colliderEdge=9109504,t.colliderPosition=16776960,t.colliderCenter=16711680,t}();t.Colors=e;var i=function(){function e(){}return Object.defineProperty(e,"lineSizeMultiplier",{get:function(){return Math.max(Math.ceil(t.Core.scene.x/t.Core.scene.width),1)},enumerable:!0,configurable:!0}),e}();t.Size=i;var n=function(){function e(){}return e.drawHollowRect=function(e,i,n){void 0===n&&(n=0),this._debugDrawItems.push(new t.DebugDrawItem(e,i,n))},e.render=function(){if(this._debugDrawItems.length>0){var e=new egret.Shape;t.Core.scene&&t.Core.scene.addChild(e);for(var i=this._debugDrawItems.length-1;i>=0;i--){this._debugDrawItems[i].draw(e)&&this._debugDrawItems.removeAt(i)}}},e._debugDrawItems=[],e}();t.Debug=n}(es||(es={})),function(t){var e=function(){function t(){}return t.verletParticle=14431326,t.verletConstraintEdge=4406838,t}();t.DebugDefaults=e}(es||(es={})),function(t){var e;!function(t){t[t.line=0]="line",t[t.hollowRectangle=1]="hollowRectangle",t[t.pixel=2]="pixel",t[t.text=3]="text"}(e=t.DebugDrawType||(t.DebugDrawType={}));var i=function(){function i(t,i,n){this.rectangle=t,this.color=i,this.duration=n,this.drawType=e.hollowRectangle}return i.prototype.draw=function(i){switch(this.drawType){case e.line:case e.hollowRectangle:case e.pixel:case e.text:}return this.duration-=t.Time.deltaTime,this.duration<0},i}();t.DebugDrawItem=i}(es||(es={})),function(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.updateInterval=1,e.debugDisplayObject=new egret.DisplayObjectContainer,e._enabled=!0,e._updateOrder=0,e}return __extends(e,t),Object.defineProperty(e.prototype,"transform",{get:function(){return this.entity.transform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this.entity?this.entity.enabled&&this._enabled:this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){},e.prototype.onAddedToEntity=function(){},e.prototype.onRemovedFromEntity=function(){},e.prototype.onEntityTransformChanged=function(t){},e.prototype.debugRender=function(){},e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled()),this},e.prototype.setUpdateOrder=function(t){return this._updateOrder!=t&&(this._updateOrder=t),this},e}(egret.HashObject);t.Component=e}(es||(es={})),function(t){!function(t){t[t.GraphicsDeviceReset=0]="GraphicsDeviceReset",t[t.SceneChanged=1]="SceneChanged",t[t.OrientationChanged=2]="OrientationChanged"}(t.CoreEvents||(t.CoreEvents={}))}(es||(es={})),function(t){var e=function(){function e(i){this.updateInterval=1,this._tag=0,this._enabled=!0,this._updateOrder=0,this.components=new t.ComponentList(this),this.transform=new t.Transform(this),this.name=i,this.id=e._idGenerator++,this.componentBits=new t.BitSet}return Object.defineProperty(e.prototype,"isDestroyed",{get:function(){return this._isDestroyed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tag",{get:function(){return this._tag},set:function(t){this.setTag(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"updateOrder",{get:function(){return this._updateOrder},set:function(t){this.setUpdateOrder(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this.transform.parent},set:function(t){this.transform.setParent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"childCount",{get:function(){return this.transform.childCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"position",{get:function(){return this.transform.position},set:function(t){this.transform.setPosition(t.x,t.y)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localPosition",{get:function(){return this.transform.localPosition},set:function(t){this.transform.setLocalPosition(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotation",{get:function(){return this.transform.rotation},set:function(t){this.transform.setRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotationDegrees",{get:function(){return this.transform.rotationDegrees},set:function(t){this.transform.setRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotation",{get:function(){return this.transform.localRotation},set:function(t){this.transform.setLocalRotation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localRotationDegrees",{get:function(){return this.transform.localRotationDegrees},set:function(t){this.transform.setLocalRotationDegrees(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scale",{get:function(){return this.transform.scale},set:function(t){this.transform.setScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localScale",{get:function(){return this.transform.localScale},set:function(t){this.transform.setLocalScale(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldInverseTransform",{get:function(){return this.transform.worldInverseTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"localToWorldTransform",{get:function(){return this.transform.localToWorldTransform},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"worldToLocalTransform",{get:function(){return this.transform.worldToLocalTransform},enumerable:!0,configurable:!0}),e.prototype.onTransformChanged=function(t){this.components.onEntityTransformChanged(t)},e.prototype.setTag=function(t){return this._tag!=t&&(this.scene&&this.scene.entities.removeFromTagList(this),this._tag=t,this.scene&&this.scene.entities.addToTagList(this)),this},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled?this.components.onEntityEnabled():this.components.onEntityDisabled()),this},e.prototype.setUpdateOrder=function(t){if(this._updateOrder!=t)return this._updateOrder=t,this.scene&&(this.scene.entities.markEntityListUnsorted(),this.scene.entities.markTagUnsorted(this.tag)),this},e.prototype.destroy=function(){this._isDestroyed=!0,this.scene.entities.remove(this),this.transform.parent=null;for(var t=this.transform.childCount-1;t>=0;t--){this.transform.getChild(t).entity.destroy()}},e.prototype.detachFromScene=function(){this.scene.entities.remove(this),this.components.deregisterAllComponents();for(var t=0;t=0;t--)this._sceneComponents[t].enabled&&this._sceneComponents[t].update();this.entityProcessors&&this.entityProcessors.update(),this.entities.update(),this.entityProcessors&&this.entityProcessors.lateUpdate(),this.renderableComponents.updateList()},i.prototype.render=function(){if(0!=this._renderers.length)for(var t=0;te.x?-1:1,n=t.Vector2.normalize(t.Vector2.subtract(this.position,e));this.rotation=i*Math.acos(t.Vector2.dot(n,t.Vector2.unitY))},n.prototype.setLocalRotation=function(t){return this._localRotation=t,this._localDirty=this._positionDirty=this._localPositionDirty=this._localRotationDirty=this._localScaleDirty=!0,this.setDirty(e.rotationDirty),this},n.prototype.setLocalRotationDegrees=function(e){return this.setLocalRotation(t.MathHelper.toRadians(e))},n.prototype.setScale=function(e){return this._scale=e,this.parent?this.localScale=t.Vector2.divide(e,this.parent._scale):this.localScale=e,this},n.prototype.setLocalScale=function(t){return this._localScale=t,this._localDirty=this._positionDirty=this._localScaleDirty=!0,this.setDirty(e.scaleDirty),this},n.prototype.roundPosition=function(){this.position=this._position.round()},n.prototype.updateTransform=function(){this.hierarchyDirty!=e.clean&&(this.parent&&this.parent.updateTransform(),this._localDirty&&(this._localPositionDirty&&(this._translationMatrix=t.Matrix2D.create().translate(this._localPosition.x,this._localPosition.y),this._localPositionDirty=!1),this._localRotationDirty&&(this._rotationMatrix=t.Matrix2D.create().rotate(this._localRotation),this._localRotationDirty=!1),this._localScaleDirty&&(this._scaleMatrix=t.Matrix2D.create().scale(this._localScale.x,this._localScale.y),this._localScaleDirty=!1),this._localTransform=this._scaleMatrix.multiply(this._rotationMatrix),this._localTransform=this._localTransform.multiply(this._translationMatrix),this.parent||(this._worldTransform=this._localTransform,this._rotation=this._localRotation,this._scale=this._localScale,this._worldInverseDirty=!0),this._localDirty=!1),this.parent&&(this._worldTransform=this._localTransform.multiply(this.parent._worldTransform),this._rotation=this._localRotation+this.parent._rotation,this._scale=t.Vector2.multiply(this.parent._scale,this._localScale),this._worldInverseDirty=!0),this._worldToLocalDirty=!0,this._positionDirty=!0,this.hierarchyDirty=e.clean)},n.prototype.setDirty=function(e){if(0==(this.hierarchyDirty&e)){switch(this.hierarchyDirty|=e,e){case t.DirtyType.positionDirty:this.entity.onTransformChanged(transform.Component.position);break;case t.DirtyType.rotationDirty:this.entity.onTransformChanged(transform.Component.rotation);break;case t.DirtyType.scaleDirty:this.entity.onTransformChanged(transform.Component.scale)}this._children||(this._children=[]);for(var i=0;it&&(this._zoom=t),this._maximumZoom=t,this;console.error("maximumZoom must be greater than zero")},n.prototype.forceMatrixUpdate=function(){this._areMatrixedDirty=!0},n.prototype.onEntityTransformChanged=function(t){this._areMatrixedDirty=!0},n.prototype.zoomIn=function(t){this.zoom+=t},n.prototype.zoomOut=function(t){this.zoom-=t},n.prototype.worldToScreenPoint=function(e){return this.updateMatrixes(),e=t.Vector2Ext.transformR(e,this._transformMatrix)},n.prototype.screenToWorldPoint=function(e){return this.updateMatrixes(),e=t.Vector2Ext.transformR(e,this._inverseTransformMatrix)},n.prototype.onSceneRenderTargetSizeChanged=function(e,i){this._isProjectionMatrixDirty=!0;var n=this._origin;this.origin=new t.Vector2(e/2,i/2),this.entity.transform.position.add(t.Vector2.subtract(this._origin,n))},n.prototype.mouseToWorldPoint=function(){return this.screenToWorldPoint(t.Input.touchPosition)},n.prototype.updateMatrixes=function(){var e;this._areMatrixedDirty&&(this._transformMatrix=t.Matrix2D.create().translate(-this.entity.transform.position.x,-this.entity.transform.position.y),1!=this._zoom&&(e=t.Matrix2D.create().scale(this._zoom,this._zoom),this._transformMatrix=this._transformMatrix.multiply(e)),0!=this.entity.transform.rotation&&(e=t.Matrix2D.create().rotate(this.entity.transform.rotation),this._transformMatrix=this._transformMatrix.multiply(e)),e=t.Matrix2D.create().translate(this._origin.x,this._origin.y),this._transformMatrix=this._transformMatrix.multiply(e),this._inverseTransformMatrix=this._transformMatrix.invert(),this._areBoundsDirty=!0,this._areMatrixedDirty=!1)},n}(t.Component);t.Camera=i}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i._shakeDirection=t.Vector2.zero,i._shakeOffset=t.Vector2.zero,i._shakeIntensity=0,i._shakeDegredation=.95,i}return __extends(i,e),i.prototype.shake=function(e,i,n){void 0===e&&(e=15),void 0===i&&(i=.9),void 0===n&&(n=t.Vector2.zero),this.enabled=!0,this._shakeIntensity=1)&&(i=.95),this._shakeDegredation=i)},i.prototype.update=function(){Math.abs(this._shakeIntensity)>0&&(this._shakeOffset=this._shakeDirection,0!=this._shakeOffset.x||0!=this._shakeOffset.y?this._shakeOffset.normalize():(this._shakeOffset.x=this._shakeOffset.x+Math.random()-.5,this._shakeOffset.y=this._shakeOffset.y+Math.random()-.5),this._shakeOffset.multiply(new t.Vector2(this._shakeIntensity)),this._shakeIntensity*=-this._shakeDegredation,Math.abs(this._shakeIntensity)<=.01&&(this._shakeIntensity=0,this.enabled=!1)),this.entity.scene.camera.position.add(this._shakeOffset)},i}(t.Component);t.CameraShake=e}(es||(es={})),function(t){var e=function(){function t(t){this._type=t,this._cache=[]}return t.prototype.obtain=function(){try{return this._cache.length>0?this._cache.shift():new this._type}catch(t){throw new Error(this._type+t)}},t.prototype.free=function(t){t.reset(),this._cache.push(t)},t}();t.ComponentPool=e}(es||(es={})),function(t){var e;!function(t){t[t.lockOn=0]="lockOn",t[t.cameraWindow=1]="cameraWindow"}(e=t.CameraStyle||(t.CameraStyle={}));var i=function(i){function n(n,r,o){void 0===n&&(n=null),void 0===r&&(r=null),void 0===o&&(o=e.lockOn);var s=i.call(this)||this;return s.followLerp=.1,s.deadzone=new t.Rectangle,s.focusOffset=t.Vector2.zero,s.mapLockEnabled=!1,s.mapSize=new t.Rectangle,s._desiredPositionDelta=new t.Vector2,s._worldSpaceDeadZone=new t.Rectangle,s.rectShape=new egret.Shape,s._targetEntity=n,s._cameraStyle=o,s.camera=r,s}return __extends(n,i),n.prototype.onAddedToEntity=function(){this.camera||(this.camera=this.entity.scene.camera),this.follow(this._targetEntity,this._cameraStyle),t.Core.emitter.addObserver(t.CoreEvents.GraphicsDeviceReset,this.onGraphicsDeviceReset,this)},n.prototype.onGraphicsDeviceReset=function(){t.Core.schedule(0,!1,this,function(t){var e=t.context;e.follow(e._targetEntity,e._cameraStyle)})},n.prototype.update=function(){var e=t.Vector2.multiply(this.camera.bounds.size,new t.Vector2(.5));this._worldSpaceDeadZone.x=this.camera.position.x-e.x*t.Core.scene.scaleX+this.deadzone.x+this.focusOffset.x,this._worldSpaceDeadZone.y=this.camera.position.y-e.y*t.Core.scene.scaleY+this.deadzone.y+this.focusOffset.y,this._worldSpaceDeadZone.width=this.deadzone.width,this._worldSpaceDeadZone.height=this.deadzone.height,this._targetEntity&&this.updateFollow(),this.camera.position=t.Vector2.lerp(this.camera.position,t.Vector2.add(this.camera.position,this._desiredPositionDelta),this.followLerp),this.entity.transform.roundPosition(),this.mapLockEnabled&&(this.camera.position=this.clampToMapSize(this.camera.position),this.entity.transform.roundPosition())},n.prototype.debugRender=function(){this.rectShape||this.debugDisplayObject.addChild(this.rectShape),this.rectShape.graphics.clear(),this._cameraStyle==e.lockOn?(this.rectShape.graphics.beginFill(9109504,0),this.rectShape.graphics.lineStyle(1,9109504),this.rectShape.graphics.drawRect(this._worldSpaceDeadZone.x-5,this._worldSpaceDeadZone.y-5,this._worldSpaceDeadZone.width,this._worldSpaceDeadZone.height),this.rectShape.graphics.endFill()):(this.rectShape.graphics.beginFill(9109504,0),this.rectShape.graphics.lineStyle(1,9109504),this.rectShape.graphics.drawRect(this._worldSpaceDeadZone.x,this._worldSpaceDeadZone.y,this._worldSpaceDeadZone.width,this._worldSpaceDeadZone.height),this.rectShape.graphics.endFill())},n.prototype.clampToMapSize=function(e){var i=t.Vector2.multiply(this.camera.bounds.size,new t.Vector2(.5)).add(new t.Vector2(this.mapSize.x,this.mapSize.y)),n=new t.Vector2(this.mapSize.width-i.x,this.mapSize.height-i.y);return t.Vector2.clamp(e,i,n)},n.prototype.follow=function(i,n){void 0===n&&(n=e.cameraWindow),this._targetEntity=i,this._cameraStyle=n;var r=this.camera.bounds;switch(this._cameraStyle){case e.cameraWindow:var o=r.width/6,s=r.height/3;this.deadzone=new t.Rectangle((r.width-o)/2,(r.height-s)/2,o,s);break;case e.lockOn:this.deadzone=new t.Rectangle(r.width/2,r.height/2,10,10)}},n.prototype.updateFollow=function(){if(this._desiredPositionDelta.x=this._desiredPositionDelta.y=0,this._cameraStyle==e.lockOn){var i=this._targetEntity.transform.position.x,n=this._targetEntity.transform.position.y;this._worldSpaceDeadZone.x>i?this._desiredPositionDelta.x=i-this._worldSpaceDeadZone.x:this._worldSpaceDeadZone.xn&&(this._desiredPositionDelta.y=n-this._worldSpaceDeadZone.y)}else{if(!this._targetCollider&&(this._targetCollider=this._targetEntity.getComponent(t.Collider),!this._targetCollider))return;var r=this._targetEntity.getComponent(t.Collider).bounds;this._worldSpaceDeadZone.containsRect(r)||(this._worldSpaceDeadZone.left>r.left?this._desiredPositionDelta.x=r.left-this._worldSpaceDeadZone.left:this._worldSpaceDeadZone.rightr.top&&(this._desiredPositionDelta.y=r.top-this._worldSpaceDeadZone.top))}},n.prototype.setCenteredDeadzone=function(e,i){if(this.camera){var n=this.camera.bounds;this.deadzone=new t.Rectangle((n.width-e)/2,(n.height-i)/2,e,i)}else console.error("相机是null。我们不能得到它的边界。请等到该组件添加到实体之后")},n}(t.Component);t.FollowCamera=i}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.compare=function(t,e){return t.updateOrder-e.updateOrder},t}();t.IUpdatableComparer=e}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e}(t.Component);t.PooledComponent=e}(es||(es={})),function(t){var e=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.displayObject=new egret.DisplayObject,i.hollowShape=new egret.Shape,i.pixelShape=new egret.Shape,i.color=0,i._areBoundsDirty=!0,i.debugRenderEnabled=!0,i._localOffset=t.Vector2.zero,i._renderLayer=0,i._bounds=new t.Rectangle,i}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.bounds.width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.bounds.height},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"localOffset",{get:function(){return this._localOffset},set:function(t){this.setLocalOffset(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renderLayer",{get:function(){return this._renderLayer},set:function(t){this.setRenderLayer(t)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"bounds",{get:function(){return this._areBoundsDirty&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,t.Vector2.zero,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){this._isVisible!=t&&(this._isVisible=t,this._isVisible?this.onBecameVisible():this.onBecameInvisible())},enumerable:!0,configurable:!0}),i.prototype.onEntityTransformChanged=function(t){this._areBoundsDirty=!0},i.prototype.debugRender=function(){if(this.debugRenderEnabled){this.hollowShape.parent||this.debugDisplayObject.addChild(this.hollowShape),this.pixelShape.parent||this.debugDisplayObject.addChild(this.pixelShape);var e=t.Vector2.add(this.entity.transform.position,this._localOffset);this.pixelShape.graphics.clear(),this.pixelShape.graphics.beginFill(t.Colors.renderableCenter,0),this.pixelShape.graphics.lineStyle(4,t.Colors.renderableCenter),this.pixelShape.graphics.lineTo(e.x,e.y),this.pixelShape.graphics.moveTo(e.x,e.y),this.pixelShape.graphics.endFill()}},i.prototype.isVisibleFromCamera=function(t){return!!t&&(this.isVisible=t.bounds.intersects(this.bounds),this.isVisible)},i.prototype.setRenderLayer=function(t){if(t!=this._renderLayer){var e=this._renderLayer;this._renderLayer=t,this.entity&&this.entity.scene&&this.entity.scene.renderableComponents.updateRenderableRenderLayer(this,e,this._renderLayer)}return this},i.prototype.setColor=function(t){return this.color=t,this},i.prototype.setLocalOffset=function(t){return this._localOffset!=t&&(this._localOffset=t),this},i.prototype.sync=function(e){var i=new t.Vector2(this.entity.position.x+this.localOffset.x-e.position.x+e.origin.x,this.entity.position.y+this.localOffset.y-e.position.y+e.origin.y);this.displayObject.x!=i.x&&(this.displayObject.x=i.x),this.displayObject.y!=i.y&&(this.displayObject.y=i.y),this.displayObject.scaleX!=this.entity.scale.x&&(this.displayObject.scaleX=this.entity.scale.x),this.displayObject.scaleY!=this.entity.scale.y&&(this.displayObject.scaleY=this.entity.scale.y),this.displayObject.rotation!=this.entity.rotation&&(this.displayObject.rotation=this.entity.rotation)},i.prototype.toString=function(){return"[RenderableComponent] renderLayer: "+this.renderLayer},i.prototype.onBecameVisible=function(){this.displayObject.visible=this.isVisible,this.debugDisplayObject.visible=this.isVisible},i.prototype.onBecameInvisible=function(){this.displayObject.visible=this.isVisible,this.debugDisplayObject.visible=this.isVisible},i}(t.Component);t.RenderableComponent=e}(es||(es={})),function(t){var e=function(){function e(){this.updateOrder=0,this._enabled=!0}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),e.prototype.onEnabled=function(){},e.prototype.onDisabled=function(){},e.prototype.onRemovedFromScene=function(){},e.prototype.update=function(){},e.prototype.setEnabled=function(t){return this._enabled!=t&&(this._enabled=t,this._enabled),this},e.prototype.setUpdateOrder=function(e){return this.updateOrder!=e&&(this.updateOrder=e,t.Core.scene._sceneComponents.sort(this.compareTo)),this},e.prototype.compareTo=function(t){return this.updateOrder-t.updateOrder},e}();t.SceneComponent=e}(es||(es={})),function(t){var e=egret.Bitmap,i=function(i){function n(e){void 0===e&&(e=null);var n=i.call(this)||this;return e instanceof t.Sprite?n.setSprite(e):e instanceof egret.Texture&&n.setSprite(new t.Sprite(e)),n}return __extends(n,i),Object.defineProperty(n.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this._sprite.sourceRect.width,this._sprite.sourceRect.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"originNormalized",{get:function(){return new t.Vector2(this._origin.x/this.width*this.entity.transform.scale.x,this._origin.y/this.height*this.entity.transform.scale.y)},set:function(e){this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"origin",{get:function(){return this._origin},set:function(t){this.setOrigin(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"sprite",{get:function(){return this._sprite},set:function(t){this.setSprite(t)},enumerable:!0,configurable:!0}),n.prototype.setSprite=function(t){return this._sprite=t,this._sprite&&(this._origin=this._sprite.origin,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y),this.displayObject=new e(t.texture2D),this},n.prototype.setOrigin=function(t){return this._origin!=t&&(this._origin=t,this.displayObject.anchorOffsetX=this._origin.x,this.displayObject.anchorOffsetY=this._origin.y,this._areBoundsDirty=!0),this},n.prototype.setOriginNormalized=function(e){return this.setOrigin(new t.Vector2(e.x*this.width/this.entity.transform.scale.x,e.y*this.height/this.entity.transform.scale.y)),this},n.prototype.render=function(e){this.sync(e);var i=new t.Vector2(this.entity.position.x+this.localOffset.x-this.origin.x-e.position.x+e.origin.x,this.entity.position.y+this.localOffset.y-this.origin.y-e.position.y+e.origin.y);this.displayObject.x!=i.x&&(this.displayObject.x=i.x),this.displayObject.y!=i.y&&(this.displayObject.y=i.y)},n}(t.RenderableComponent);t.SpriteRenderer=i}(es||(es={})),function(t){var e=egret.Bitmap,i=egret.RenderTexture,n=function(n){function r(e){var i=n.call(this,e)||this;return i._textureScale=t.Vector2.one,i._inverseTexScale=t.Vector2.one,i._gapX=0,i._gapY=0,i._sourceRect=e.sourceRect,i.displayObject.$fillMode=egret.BitmapFillMode.REPEAT,i}return __extends(r,n),Object.defineProperty(r.prototype,"bounds",{get:function(){return this._areBoundsDirty&&this._sprite&&(this._bounds.calculateBounds(this.entity.transform.position,this._localOffset,this._origin,this.entity.transform.scale,this.entity.transform.rotation,this.width,this.height),this._areBoundsDirty=!1),this._bounds},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollX",{get:function(){return this._sourceRect.x},set:function(t){this._sourceRect.x=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"scrollY",{get:function(){return this._sourceRect.y},set:function(t){this._sourceRect.y=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y),this._sourceRect.width=this._sprite.sourceRect.width*this._inverseTexScale.x,this._sourceRect.height=this._sprite.sourceRect.height*this._inverseTexScale.y},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"width",{get:function(){return this._sourceRect.width},set:function(t){this._areBoundsDirty=!0,this._sourceRect.width=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"height",{get:function(){return this._sourceRect.height},set:function(t){this._areBoundsDirty=!0,this._sourceRect.height=t},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"gapXY",{get:function(){return new t.Vector2(this._gapX,this._gapY)},set:function(t){this._gapX=t.x,this._gapY=t.y;var n=new i,r=this.sprite.sourceRect;r.x=0,r.y=0,r.width+=this._gapX,r.height+=this._gapY,n.drawToTexture(this.displayObject,r),this.displayObject?this.displayObject.texture=n:this.displayObject=new e(n)},enumerable:!0,configurable:!0}),r.prototype.setGapXY=function(t){return this.gapXY=t,this},r.prototype.render=function(t){n.prototype.render.call(this,t);var e=this.displayObject;e.width=this.width,e.height=this.height,e.scrollRect=this._sourceRect},r}(t.SpriteRenderer);t.TiledSpriteRenderer=n}(es||(es={})),function(t){var e=function(e){function i(t){var i=e.call(this,t)||this;return i.scrollSpeedX=15,i.scroolSpeedY=0,i._scrollX=0,i._scrollY=0,i._scrollWidth=0,i._scrollHeight=0,i._scrollWidth=i.width,i._scrollHeight=i.height,i}return __extends(i,e),Object.defineProperty(i.prototype,"textureScale",{get:function(){return this._textureScale},set:function(e){this._textureScale=e,this._inverseTexScale=new t.Vector2(1/this._textureScale.x,1/this._textureScale.y)},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollWidth",{get:function(){return this._scrollWidth},set:function(t){this._scrollWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"scrollHeight",{get:function(){return this._scrollHeight},set:function(t){this._scrollHeight=t},enumerable:!0,configurable:!0}),i.prototype.update=function(){this.sprite&&(this._scrollX+=this.scrollSpeedX*t.Time.deltaTime,this._scrollY+=this.scroolSpeedY*t.Time.deltaTime,this._sourceRect.x=this._scrollX,this._sourceRect.y=this._scrollY,this._sourceRect.width=this._scrollWidth+Math.abs(this._scrollX),this._sourceRect.height=this._scrollHeight+Math.abs(this._scrollY))},i}(t.TiledSpriteRenderer);t.ScrollingSpriteRenderer=e}(es||(es={})),function(t){var e=egret.SpriteSheet,i=function(){function i(e,i,n){void 0===i&&(i=new t.Rectangle(0,0,e.textureWidth,e.textureHeight)),void 0===n&&(n=i.getHalfSize()),this.uvs=new t.Rectangle,this.texture2D=e,this.sourceRect=i,this.center=new t.Vector2(.5*i.width,.5*i.height),this.origin=n;var r=1/e.textureWidth,o=1/e.textureHeight;this.uvs.x=i.x*r,this.uvs.y=i.y*o,this.uvs.width=i.width*r,this.uvs.height=i.height*o}return i.spritesFromAtlas=function(t,n,r,o,s){void 0===o&&(o=0),void 0===s&&(s=Number.MAX_VALUE);for(var a=[],h=t.textureWidth/n,c=t.textureHeight/r,l=0,u=new e(t),p=0;po||this._loopMode==e.pingPongOnce&&s>2*o)return this.animationState=i.completed,this._elapsedTime=0,this.currentFrame=0,void(this.displayObject.texture=n.sprites[this.currentFrame].texture2D);var a=Math.floor(s/r),h=n.sprites.length;if(h>2&&(this._loopMode==e.pingPong||this._loopMode==e.pingPongOnce)){var c=h-1;this.currentFrame=c-Math.abs(c-a%(2*c))}else this.currentFrame=a%h;this.displayObject.texture=n.sprites[this.currentFrame].texture2D}},r.prototype.addAnimation=function(t,e){return!this.sprite&&e.sprites.length>0&&this.setSprite(e.sprites[0]),this._animations[t]=e,this},r.prototype.play=function(t,n){void 0===n&&(n=null),this.currentAnimation=this._animations[t],this.currentAnimationName=t,this.currentFrame=0,this.animationState=i.running,this.displayObject.texture=this.currentAnimation.sprites[0].texture2D,this._elapsedTime=0,this._loopMode=n||e.loop},r.prototype.isAnimationActive=function(t){return this.currentAnimation&&this.currentAnimationName==t},r.prototype.pause=function(){this.animationState=i.paused},r.prototype.unPause=function(){this.animationState=i.running},r.prototype.stop=function(){this.currentAnimation=null,this.currentAnimationName=null,this.currentFrame=0,this.animationState=i.none},r}(t.SpriteRenderer);t.SpriteAnimator=n}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"hasCollision",{get:function(){return this.below||this.right||this.left||this.above},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.becameGroundedThisFrame=this.isGroundedOnOnewayPlatform=this.right=this.left=this.above=this.below=!1,this.slopAngle=0},t.prototype.toString=function(){return"[CollisionState] r: "+this.right+", l: "+this.left+", a: "+this.above+", b: "+this.below+", angle: "+this.slopAngle+", wasGroundedLastFrame: "+this.wasGroundedLastFrame+", becameGroundedThisFrame: "+this.becameGroundedThisFrame},t}();t.CollisionState=e;var i=function(e){function i(){var t=e.call(this)||this;return t.colliderHorizontalInset=2,t.colliderVerticalInset=6,t}return __extends(i,e),i.prototype.testCollisions=function(e,i,n){this._boxColliderBounds=i,n.wasGroundedLastFrame=n.below,n.reset();var r=e.x;e.y;if(0!=r){var o=r>0?t.Edge.right:t.Edge.left,s=this.collisionRectForSide(o,r);this.testMapCollision(s,o,n,0)?(e.x=0-t.RectangleExt.getSide(i,o),n.left=o==t.Edge.left,n.right=o==t.Edge.right,n._movementRemainderX.reset()):(n.left=!1,n.right=!1)}},i.prototype.testMapCollision=function(e,i,n,r){var o=t.EdgeExt.oppositeEdge(i);t.EdgeExt.isVertical(o)?e.center.x:e.center.y,t.RectangleExt.getSide(e,i),t.EdgeExt.isVertical(o)},i.prototype.collisionRectForSide=function(e,i){var n;return n=t.EdgeExt.isHorizontal(e)?t.RectangleExt.getRectEdgePortion(this._boxColliderBounds,e):t.RectangleExt.getHalfRect(this._boxColliderBounds,e),t.EdgeExt.isVertical(e)?t.RectangleExt.contract(n,this.colliderHorizontalInset,0):t.RectangleExt.contract(n,0,this.colliderVerticalInset),t.RectangleExt.expandSide(n,e,i),n},i}(t.Component);t.TiledMapMover=i}(es||(es={})),function(t){var e=function(e){function i(i,n,r){void 0===n&&(n=null),void 0===r&&(r=!0);var o=e.call(this)||this;return o.physicsLayer=new t.Ref(1),o.toContainer=!1,o.tiledMap=i,o._shouldCreateColliders=r,o.displayObject=new egret.DisplayObjectContainer,n&&(o.collisionLayer=i.tileLayers.find(function(t){return t.name==n})),o}return __extends(i,e),Object.defineProperty(i.prototype,"width",{get:function(){return this.tiledMap.width*this.tiledMap.tileWidth},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.tiledMap.height*this.tiledMap.tileHeight},enumerable:!0,configurable:!0}),i.prototype.setLayerToRender=function(t){this.layerIndicesToRender=[],this.layerIndicesToRender[0]=this.getLayerIndex(t)},i.prototype.setLayersToRender=function(){for(var t=[],e=0;e=2){this.polygonShape.graphics.beginFill(t.Colors.colliderEdge,0),this.polygonShape.graphics.lineStyle(t.Size.lineSizeMultiplier,t.Colors.colliderEdge);for(var i=0;i>6;0!=(e&t.LONG_MASK)&&i++,this._bits=new Array(i)}return t.prototype.and=function(t){for(var e,i=Math.min(this._bits.length,t._bits.length),n=0;n=0;)this._bits[e]&=~t._bits[e]},t.prototype.cardinality=function(){for(var t=0,e=this._bits.length-1;e>=0;e--){var i=this._bits[e];if(0!=i)if(-1!=i){var n=((i=((i=(i>>1&0x5555555555555400)+(0x5555555555555400&i))>>2&0x3333333333333400)+(0x3333333333333400&i))>>32)+i;t+=((n=((n=(n>>4&252645135)+(252645135&n))>>8&16711935)+(16711935&n))>>16&65535)+(65535&n)}else t+=64}return t},t.prototype.clear=function(t){if(null!=t){var e=t>>6;this.ensure(e),this._bits[e]&=~(1<>6;return!(e>=this._bits.length)&&0!=(this._bits[e]&1<=0;)if(0!=(this._bits[e]&t._bits[e]))return!0;return!1},t.prototype.isEmpty=function(){for(var t=this._bits.length-1;t>=0;t--)if(this._bits[t])return!1;return!0},t.prototype.nextSetBit=function(t){for(var e=t>>6,i=1<>6;this.ensure(i),this._bits[i]|=1<=this._bits.length){var e=new Number[t+1];e=this._bits.copyWithin(0,0,this._bits.length),this._bits=e}},t.LONG_MASK=63,t}();t.BitSet=e}(es||(es={})),function(t){var e=function(){function e(t){this._components=[],this._componentsToAdd=[],this._componentsToRemove=[],this._tempBufferList=[],this._entity=t}return Object.defineProperty(e.prototype,"count",{get:function(){return this._components.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._components},enumerable:!0,configurable:!0}),e.prototype.markEntityListUnsorted=function(){this._isComponentListUnsorted=!0},e.prototype.add=function(t){this._componentsToAdd.push(t)},e.prototype.remove=function(t){this._componentsToRemove.contains(t)&&console.warn("You are trying to remove a Component ("+t+") that you already removed"),this._componentsToAdd.contains(t)?this._componentsToAdd.remove(t):this._componentsToRemove.push(t)},e.prototype.removeAllComponents=function(){for(var t=0;t0){for(var i=0;i0){i=0;for(var n=this._componentsToAdd.length;i0){var e=this._entitiesToRemove;this._entitiesToRemove=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t.removeFromTagList(e),t._entities.remove(e),e.onRemovedFromScene(),e.scene=null,t.scene.entityProcessors.onEntityRemoved(e)}),this._tempEntityList.length=0}if(this._entitiesToAdded.length>0){e=this._entitiesToAdded;this._entitiesToAdded=this._tempEntityList,this._tempEntityList=e,this._tempEntityList.forEach(function(e){t._entities.contains(e)||(t._entities.push(e),e.scene=t.scene,t.addToTagList(e),t.scene.entityProcessors.onEntityAdded(e))}),this._tempEntityList.forEach(function(t){return t.onAddedToScene()}),this._tempEntityList.length=0,this._isEntityListUnsorted=!0}this._isEntityListUnsorted&&(this._entities.sort(),this._isEntityListUnsorted=!1),this._unsortedTags.length>0&&(this._unsortedTags.forEach(function(e){t._entityDict.get(e).sort()}),this._unsortedTags.length=0)},e.prototype.findEntity=function(t){for(var e=0;e=0;e=this.allSet.nextSetBit(e+1))if(!t.componentBits.get(e))return!1;return!(!this.exclusionSet.isEmpty()&&this.exclusionSet.intersects(t.componentBits))&&!(!this.oneSet.isEmpty()&&!this.oneSet.intersects(t.componentBits))},e.prototype.all=function(){for(var e=this,i=[],n=0;n0){for(var t=0,i=this._unsortedRenderLayers.length;t=e)return t;var n=!1;"-"==t.substr(0,1)&&(n=!0,t=t.substr(1));for(var r=e-i,o=0;o1?this.reverse(t.substring(1))+t.substring(0,1):t},t.cutOff=function(t,e,i,n){void 0===n&&(n=!0),e=Math.floor(e),i=Math.floor(i);var r=t.length;e>r&&(e=r);var o,s=e,a=e+i;return n?o=t.substring(0,s)+t.substr(a,r):(a=(s=r-1-e-i)+i,o=t.substring(0,s+1)+t.substr(a+1,r)),o},t.strReplace=function(t,e){for(var i=0,n=e.length;i",">",'"',""","'","'","®","®","©","©","™","™"],t}();!function(t){var e=function(){function e(){}return e.convertImageToCanvas=function(e,i){this.sharedCanvas||(this.sharedCanvas=egret.sys.createCanvas(),this.sharedContext=this.sharedCanvas.getContext("2d"));var n=e.$getTextureWidth(),r=e.$getTextureHeight();i||((i=egret.$TempRectangle).x=0,i.y=0,i.width=n,i.height=r),i.x=Math.min(i.x,n-1),i.y=Math.min(i.y,r-1),i.width=Math.min(i.width,n-i.x),i.height=Math.min(i.height,r-i.y);var o=Math.floor(i.width),s=Math.floor(i.height),a=this.sharedCanvas;if(a.style.width=o+"px",a.style.height=s+"px",this.sharedCanvas.width=o,this.sharedCanvas.height=s,"webgl"==egret.Capabilities.renderMode){var h=void 0;e.$renderBuffer?h=e:(egret.sys.systemRenderer.renderClear&&egret.sys.systemRenderer.renderClear(),(h=new egret.RenderTexture).drawToTexture(new egret.Bitmap(e)));for(var c=h.$renderBuffer.getPixels(i.x,i.y,o,s),l=0,u=0,p=0;p=0?"png":"jpg"});return wx.getFileSystemManager().saveFile({tempFilePath:o,filePath:wx.env.USER_DATA_PATH+"/"+i,success:function(t){}}),o},e.getPixel32=function(t,e,i){return egret.$warn(1041,"getPixel32","getPixels"),t.getPixels(e,i)},e.getPixels=function(t,e,i,n,r){if(void 0===n&&(n=1),void 0===r&&(r=1),"webgl"==egret.Capabilities.renderMode){var o=void 0;return t.$renderBuffer?o=t:(o=new egret.RenderTexture).drawToTexture(new egret.Bitmap(t)),o.$renderBuffer.getPixels(e,i,n,r)}try{this.convertImageToCanvas(t);return this.sharedContext.getImageData(e,i,n,r).data}catch(t){egret.$error(1039)}},e}();t.TextureUtils=e}(es||(es={})),function(t){var e=function(){function t(){}return t.update=function(t){var e=(t-this._lastTime)/1e3;this.deltaTime=e*this.timeScale,this.unscaledDeltaTime=e,this._timeSinceSceneLoad+=e,this.frameCount++,this._lastTime=t},t.sceneChanged=function(){this._timeSinceSceneLoad=0},t.checkEvery=function(t){return this._timeSinceSceneLoad/t>(this._timeSinceSceneLoad-this.deltaTime)/t},t.deltaTime=0,t.timeScale=1,t.frameCount=0,t._lastTime=0,t}();t.Time=e}(es||(es={}));var TimeUtils=function(){function t(){}return t.monthId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getFullYear(),i=t.getMonth()+1;return parseInt(e+(i<10?"0":"")+i)},t.dateId=function(t){void 0===t&&(t=null);var e=(t=t||new Date).getMonth()+1,i=e<10?"0":"",n=t.getDate(),r=n<10?"0":"";return parseInt(t.getFullYear()+i+e+r+n)},t.weekId=function(t,e){void 0===t&&(t=null),void 0===e&&(e=!0),t=t||new Date;var i=new Date;i.setTime(t.getTime()),i.setDate(1),i.setMonth(0);var n=i.getFullYear(),r=i.getDay();0==r&&(r=7);var o=!1;r<=4?(o=r>1,i.setDate(i.getDate()-(r-1))):i.setDate(i.getDate()+7-r+1);var s=this.diffDay(t,i,!1);if(s<0)return i.setDate(1),i.setMonth(0),i.setDate(i.getDate()-1),this.weekId(i,!1);var a=s/7,h=Math.floor(a)+1;if(53==h){i.setTime(t.getTime()),i.setDate(i.getDate()-1);var c=i.getDay();if(0==c&&(c=7),e&&(!o||c<4))return i.setFullYear(i.getFullYear()+1),i.setDate(1),i.setMonth(0),this.weekId(i,!1)}return parseInt(n+"00"+(h>9?"":"0")+h)},t.diffDay=function(t,e,i){void 0===i&&(i=!1);var n=(t.getTime()-e.getTime())/864e5;return i?Math.ceil(n):Math.floor(n)},t.getFirstDayOfWeek=function(t){var e=(t=t||new Date).getDay()||7;return new Date(t.getFullYear(),t.getMonth(),t.getDate()+1-e,0,0,0,0)},t.getFirstOfDay=function(t){return(t=t||new Date).setHours(0,0,0,0),t},t.getNextFirstOfDay=function(t){return new Date(this.getFirstOfDay(t).getTime()+864e5)},t.formatDate=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();return e+"-"+i+"-"+(n=n<10?"0"+n:n)},t.formatDateTime=function(t){var e=t.getFullYear(),i=t.getMonth()+1;i=i<10?"0"+i:i;var n=t.getDate();n=n<10?"0"+n:n;var r=t.getHours(),o=t.getMinutes();o=o<10?"0"+o:o;var s=t.getSeconds();return e+"-"+i+"-"+n+" "+r+":"+o+":"+(s=s<10?"0"+s:s)},t.parseDate=function(t){var e=Date.parse(t);return isNaN(e)?new Date:new Date(Date.parse(t.replace(/-/g,"/")))},t.secondToTime=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=":"),void 0===i&&(i=!0);var n=Math.floor(t/3600),r=Math.floor(t%3600/60),o=Math.floor(t%3600%60),s=n.toString(),a=r.toString(),h=o.toString();return n<10&&(s="0"+s),r<10&&(a="0"+a),o<10&&(h="0"+h),i?s+e+a+e+h:a+e+h},t.timeToMillisecond=function(t,e){void 0===e&&(e=":");for(var i=t.split(e),n=0,r=i.length,o=0;o-1?this.os="iOS":n.indexOf("android")>-1&&(this.os="Android");var r=i.language;r=r.indexOf("zh")>-1?"zh-CN":"en-US",this.language=r}},e}(egret.Capabilities);t.GraphicsCapabilities=e}(es||(es={})),function(t){var e=function(){function e(){this.setup(),this.graphicsCapabilities=new t.GraphicsCapabilities,this.graphicsCapabilities.initialize(this)}return Object.defineProperty(e.prototype,"viewport",{get:function(){return this._viewport},enumerable:!0,configurable:!0}),e.prototype.setup=function(){this._viewport=new t.Viewport(0,0,t.Core._instance.stage.stageWidth,t.Core._instance.stage.stageHeight)},e}();t.GraphicsDevice=e}(es||(es={})),function(t){var e=function(){function e(t,e,i,n){this._x=t,this._y=e,this._width=i,this._height=n,this._minDepth=0,this._maxDepth=1}return Object.defineProperty(e.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"aspectRatio",{get:function(){return 0!=this._height&&0!=this._width?this._width/this._height:0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bounds",{get:function(){return new t.Rectangle(this._x,this._y,this._width,this._height)},set:function(t){this._x=t.x,this._y=t.y,this._width=t.width,this._height=t.height},enumerable:!0,configurable:!0}),e}();t.Viewport=e}(es||(es={})),function(t){var e=function(e){function i(){return e.call(this,t.PostProcessor.default_vert,i.blur_frag,{screenWidth:t.Core.graphicsDevice.viewport.width,screenHeight:t.Core.graphicsDevice.viewport.height})||this}return __extends(i,e),i.blur_frag="precision mediump float;\nuniform sampler2D uSampler;\nuniform float screenWidth;\nuniform float screenHeight;\nfloat normpdf(in float x, in float sigma)\n{\nreturn 0.39894*exp(-0.5*x*x/(sigma*sigma))/sigma;\n}\nvoid main()\n{\nvec3 c = texture2D(uSampler, gl_FragCoord.xy / vec2(screenWidth, screenHeight).xy).rgb;\nconst int mSize = 11;\nconst int kSize = (mSize - 1)/2;\nfloat kernel[mSize];\nvec3 final_colour = vec3(0.0);\nfloat sigma = 7.0;\nfloat z = 0.0;\nfor (int j = 0; j <= kSize; ++j)\n{\nkernel[kSize+j] = kernel[kSize-j] = normpdf(float(j),sigma);\n}\nfor (int j = 0; j < mSize; ++j)\n{\nz += kernel[j];\n}\nfor (int i = -kSize; i <= kSize; ++i)\n{\nfor (int j = -kSize; j <= kSize; ++j)\n{\nfinal_colour += kernel[kSize+j]*kernel[kSize+i]*texture2D(uSampler, (gl_FragCoord.xy+vec2(float(i),float(j))) / vec2(screenWidth, screenHeight).xy).rgb;\n}\n}\ngl_FragColor = vec4(final_colour/(z*z), 1.0);\n}",i}(egret.CustomFilter);t.GaussianBlurEffect=e}(es||(es={})),function(t){var e=function(t){function e(){return t.call(this,e.vertSrc,e.fragmentSrc)||this}return __extends(e,t),e.vertSrc="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",e.fragmentSrc="precision lowp float;\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n#define SAMPLE_COUNT 15\nuniform vec2 _sampleOffsets[SAMPLE_COUNT];\nuniform float _sampleWeights[SAMPLE_COUNT];\nvoid main(void) {\nvec4 c = vec4(0, 0, 0, 0);\nfor( int i = 0; i < SAMPLE_COUNT; i++ )\n c += texture2D( uSampler, vTextureCoord + _sampleOffsets[i] ) * _sampleWeights[i];\ngl_FragColor = c;\n}",e}(egret.CustomFilter);t.PolygonLightEffect=e}(es||(es={})),function(t){var e=function(){function e(t){void 0===t&&(t=null),this.enabled=!0,this.effect=t}return e.prototype.onAddedToScene=function(e){this.scene=e,this.shape=new egret.Shape,this.shape.graphics.beginFill(16777215,1),this.shape.graphics.drawRect(0,0,t.Core.graphicsDevice.viewport.width,t.Core.graphicsDevice.viewport.height),this.shape.graphics.endFill(),e.addChild(this.shape)},e.prototype.process=function(){this.drawFullscreenQuad()},e.prototype.onSceneBackBufferSizeChanged=function(t,e){},e.prototype.unload=function(){this.effect&&(this.effect=null),this.scene.removeChild(this.shape),this.scene=null},e.prototype.drawFullscreenQuad=function(){this.scene.filters=[this.effect]},e.default_vert="attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\ngl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\nvTextureCoord = aTextureCoord;\nvColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}",e}();t.PostProcessor=e}(es||(es={})),function(t){var e=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return __extends(i,e),i.prototype.onAddedToScene=function(i){e.prototype.onAddedToScene.call(this,i),this.effect=new t.GaussianBlurEffect},i}(t.PostProcessor);t.GaussianBlurPostProcessor=e}(es||(es={})),function(t){var e=function(){function t(t,e){void 0===e&&(e=null),this.renderOrder=0,this.shouldDebugRender=!0,this.camera=e,this.renderOrder=t}return Object.defineProperty(t.prototype,"wantsToRenderToSceneRenderTarget",{get:function(){return!!this.renderTexture},enumerable:!0,configurable:!0}),t.prototype.onAddedToScene=function(t){},t.prototype.unload=function(){},t.prototype.onSceneBackBufferSizeChanged=function(t,e){},t.prototype.compareTo=function(t){return this.renderOrder-t.renderOrder},t.prototype.beginRender=function(t){},t.prototype.renderAfterStateCheck=function(t,e){t.render(e)},t.prototype.debugRender=function(t,e){for(var i=0;ii?i:t},e.pointOnCirlce=function(i,n,r){var o=e.toRadians(r);return new t.Vector2(Math.cos(o)*o+i.x,Math.sin(o)*o+i.y)},e.isEven=function(t){return t%2==0},e.clamp01=function(t){return t<0?0:t>1?1:t},e.angleBetweenVectors=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},e.incrementWithWrap=function(t,e){return++t==e?0:t},e.approach=function(t,e,i){return tn&&(n=s.x),s.yr&&(r=s.y)}return this.fromMinMax(e,i,n,r)},i.prototype.intersects=function(t){return t.leftthis.x+this.width)return!1}else{var n=1/t.direction.x,r=(this.x-t.start.x)*n,o=(this.x+this.width-t.start.x)*n;if(r>o){var s=r;r=o,o=s}if(e.value=Math.max(r,e.value),i=Math.min(o,i),e.value>i)return!1}if(Math.abs(t.direction.y)<1e-6){if(t.start.ythis.y+this.height)return!1}else{var a=1/t.direction.y,h=(this.y-t.start.y)*a,c=(this.y+this.height-t.start.y)*a;if(h>c){var l=h;h=c,c=l}if(e.value=Math.max(h,e.value),i=Math.max(c,i),e.value>i)return!1}return!0},i.prototype.containsRect=function(t){return this.x<=t.x&&t.x1)return!1;var l=(h.x*o.y-h.y*o.x)/a;return!(l<0||l>1)},i.lineToLineIntersection=function(e,i,n,r){var o=new t.Vector2(0,0),s=t.Vector2.subtract(i,e),a=t.Vector2.subtract(r,n),h=s.x*a.y-s.y*a.x;if(0==h)return o;var c=t.Vector2.subtract(n,e),l=(c.x*a.y-c.y*a.x)/h;if(l<0||l>1)return o;var u=(c.x*s.y-c.y*s.x)/h;return u<0||u>1?o:o=t.Vector2.add(e,new t.Vector2(l*s.x,l*s.y))},i.closestPointOnLine=function(e,i,n){var r=t.Vector2.subtract(i,e),o=t.Vector2.subtract(n,e),s=t.Vector2.dot(o,r)/t.Vector2.dot(r,r);return s=t.MathHelper.clamp(s,0,1),t.Vector2.add(e,new t.Vector2(r.x*s,r.y*s))},i.circleToCircle=function(e,i,n,r){return t.Vector2.distanceSquared(e,n)<(i+r)*(i+r)},i.circleToLine=function(e,i,n,r){return t.Vector2.distanceSquared(e,this.closestPointOnLine(n,r,e))=t&&r.y>=e&&r.x=t+n&&(s|=e.right),o.y=i+r&&(s|=e.bottom),s},i}();t.Collisions=i}(es||(es={})),function(t){var e=function(){function e(e,i,n,r,o){this.fraction=0,this.distance=0,this.point=t.Vector2.zero,this.normal=t.Vector2.zero,this.collider=e,this.fraction=i,this.distance=n,this.point=r,this.centroid=t.Vector2.zero}return e.prototype.setValues=function(t,e,i,n){this.collider=t,this.fraction=e,this.distance=i,this.point=n},e.prototype.setValuesNonCollider=function(t,e,i,n){this.fraction=t,this.distance=e,this.point=i,this.normal=n},e.prototype.reset=function(){this.collider=null,this.fraction=this.distance=0},e.prototype.toString=function(){return"[RaycastHit] fraction: "+this.fraction+", distance: "+this.distance+", normal: "+this.normal+", centroid: "+this.centroid+", point: "+this.point},e}();t.RaycastHit=e}(es||(es={})),function(t){var e=function(){function e(){}return e.reset=function(){this._spatialHash=new t.SpatialHash(this.spatialHashCellSize)},e.clear=function(){this._spatialHash.clear()},e.overlapCircleAll=function(t,e,i,n){if(void 0===n&&(n=-1),0!=i.length)return this._spatialHash.overlapCircle(t,e,i,n);console.error("An empty results array was passed in. No results will ever be returned.")},e.boxcastBroadphase=function(t,e){return void 0===e&&(e=this.allLayers),this._spatialHash.aabbBroadphase(t,null,e)},e.boxcastBroadphaseExcludingSelf=function(t,e,i){return void 0===i&&(i=this.allLayers),this._spatialHash.aabbBroadphase(e,t,i)},e.addCollider=function(t){e._spatialHash.register(t)},e.removeCollider=function(t){e._spatialHash.remove(t)},e.updateCollider=function(t){this._spatialHash.remove(t),this._spatialHash.register(t)},e.linecast=function(t,i,n){return void 0===n&&(n=e.allLayers),this._hitArray[0].reset(),this.linecastAll(t,i,this._hitArray,n),this._hitArray[0]},e.linecastAll=function(t,i,n,r){return void 0===r&&(r=e.allLayers),0==n.length?(console.warn("传入了一个空的hits数组。没有点击会被返回"),0):this._spatialHash.linecast(t,i,n,r)},e.debugDraw=function(t){this._spatialHash.debugDraw(t,2)},e.spatialHashCellSize=100,e.allLayers=-1,e.raycastsHitTriggers=!1,e.raycastsStartInColliders=!1,e._hitArray=[new t.RaycastHit],e}();t.Physics=e}(es||(es={})),function(t){var e=function(){return function(e,i){this.start=e,this.end=i,this.direction=t.Vector2.subtract(this.end,this.start)}}();t.Ray2D=e}(es||(es={})),function(t){var e=function(){return function(){}}();t.Shape=e}(es||(es={})),function(t){var e=function(e){function i(t,i){var n=e.call(this)||this;return n._areEdgeNormalsDirty=!0,n.isUnrotated=!0,n.setPoints(t),n.isBox=i,n}return __extends(i,e),Object.defineProperty(i.prototype,"edgeNormals",{get:function(){return this._areEdgeNormalsDirty&&this.buildEdgeNormals(),this._edgeNormals},enumerable:!0,configurable:!0}),i.prototype.setPoints=function(t){this.points=t,this.recalculateCenterAndEdgeNormals(),this._originalPoints=[];for(var e=0;e=this.points.length?this.points[0]:this.points[n+1];var o=t.Vector2Ext.perpendicular(r,e);t.Vector2Ext.normalize(o),this._edgeNormals[n]=o}},i.buildSymmetricalPolygon=function(e,i){for(var n=new Array(e),r=0;rr&&(r=s,n=o)}return e[n]},i.getClosestPointOnPolygonToPoint=function(e,i,n,r){n.value=Number.MAX_VALUE,r.x=0,r.y=0;for(var o=new t.Vector2(0,0),s=0,a=0;at.y!=this.points[n].y>t.y&&t.x<(this.points[n].x-this.points[i].x)*(t.y-this.points[i].y)/(this.points[n].y-this.points[i].y)+this.points[i].x&&(e=!e);return e},i.prototype.pointCollidesWithShape=function(e,i){return t.ShapeCollisions.pointToPoly(e,this,i)},i}(t.Shape);t.Polygon=e}(es||(es={})),function(t){var e=function(e){function i(t,n){var r=e.call(this,i.buildBox(t,n),!0)||this;return r.width=t,r.height=n,r}return __extends(i,e),i.buildBox=function(e,i){var n=e/2,r=i/2,o=new Array(4);return o[0]=new t.Vector2(-n,-r),o[1]=new t.Vector2(n,-r),o[2]=new t.Vector2(n,r),o[3]=new t.Vector2(-n,r),o},i.prototype.updateBox=function(e,i){this.width=e,this.height=i;var n=e/2,r=i/2;this.points[0]=new t.Vector2(-n,-r),this.points[1]=new t.Vector2(n,-r),this.points[2]=new t.Vector2(n,r),this.points[3]=new t.Vector2(-n,r);for(var o=0;o1)return!1;var a,h=t.Vector2.add(s.start,t.Vector2.add(s.direction,new t.Vector2(r.value))),c=0;h.xi.bounds.right&&(c|=1),h.yi.bounds.bottom&&(c|=2);var l=a+c;return 3==l&&console.log("m == 3. corner "+t.Time.frameCount),!0},e}();t.RealtimeCollisions=e}(es||(es={})),function(t){var e=function(){function e(){}return e.polygonToPolygon=function(e,i,n){for(var r,o=!0,s=e.edgeNormals,a=i.edgeNormals,h=Number.POSITIVE_INFINITY,c=new t.Vector2,l=t.Vector2.subtract(e.position,i.position),u=0;u0&&(o=!1),!o)return!1;(y=Math.abs(y))r&&(r=o);return{min:n,max:r}},e.circleToPolygon=function(e,i,n){var r,o=t.Vector2.subtract(e.position,i.position),s=new t.Ref(0),a=t.Polygon.getClosestPointOnPolygonToPoint(i.points,o,s,n.normal),h=i.containsPoint(e.position);if(s.value>e.radius*e.radius&&!h)return!1;if(h)r=t.Vector2.multiply(n.normal,new t.Vector2(Math.sqrt(s.value)-e.radius));else if(0==s.value)r=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else{var c=Math.sqrt(s.value);r=t.Vector2.multiply(new t.Vector2(-t.Vector2.subtract(o,a)),new t.Vector2((e.radius-s.value)/c))}return n.minimumTranslationVector=r,n.point=t.Vector2.add(a,i.position),!0},e.circleToBox=function(e,i,n){var r=i.bounds.getClosestPointOnRectangleBorderToPoint(e.position,n.normal);if(i.containsPoint(e.position)){n.point=r;var o=t.Vector2.add(r,t.Vector2.multiply(n.normal,new t.Vector2(e.radius)));return n.minimumTranslationVector=t.Vector2.subtract(e.position,o),!0}var s=t.Vector2.distanceSquared(r,e.position);if(0==s)n.minimumTranslationVector=t.Vector2.multiply(n.normal,new t.Vector2(e.radius));else if(s<=e.radius*e.radius){n.normal=t.Vector2.subtract(e.position,r);var a=n.normal.length()-e.radius;return n.point=r,t.Vector2Ext.normalize(n.normal),n.minimumTranslationVector=t.Vector2.multiply(new t.Vector2(a),n.normal),!0}return!1},e.pointToCircle=function(e,i,n){var r=t.Vector2.distanceSquared(e,i.position),o=1+i.radius;if(r1)return!1;var u=(c.x*s.y-c.y*s.x)/h;return!(u<0||u>1)&&(o=o.add(e).add(t.Vector2.multiply(new t.Vector2(l),s)),!0)},e.lineToCircle=function(e,i,n,r){var o=t.Vector2.distance(e,i),s=t.Vector2.divide(t.Vector2.subtract(i,e),new t.Vector2(o)),a=t.Vector2.subtract(e,n.position),h=t.Vector2.dot(a,s),c=t.Vector2.dot(a,a)-n.radius*n.radius;if(c>0&&h>0)return!1;var l=h*h-c;return!(l<0)&&(r.fraction=-h-Math.sqrt(l),r.fraction<0&&(r.fraction=0),r.point=t.Vector2.add(e,t.Vector2.multiply(new t.Vector2(r.fraction),s)),r.distance=t.Vector2.distance(e,r.point),r.normal=t.Vector2.normalize(t.Vector2.subtract(r.point,n.position)),r.fraction=r.distance/o,!0)},e.boxToBoxCast=function(e,i,n,r){var o=this.minkowskiDifference(e,i);if(o.contains(0,0)){var s=o.getClosestPointOnBoundsToOrigin();return!s.equals(t.Vector2.zero)&&(r.normal=new t.Vector2(-s.x),r.normal.normalize(),r.distance=0,r.fraction=0,!0)}var a=new t.Ray2D(t.Vector2.zero,new t.Vector2(-n.x)),h=new t.Ref(0);return!!(o.rayIntersects(a,h)&&h.value<=1)&&(r.fraction=h.value,r.distance=n.length()*h.value,r.normal=new t.Vector2(-n.x,-n.y),r.normal.normalize(),r.centroid=t.Vector2.add(e.bounds.center,t.Vector2.multiply(n,new t.Vector2(h.value))),!0)},e}();t.ShapeCollisions=e}(es||(es={})),function(t){var e=function(){function e(e){void 0===e&&(e=100),this.gridBounds=new t.Rectangle,this._overlapTestCircle=new t.Circle(0),this._cellDict=new i,this._tempHashSet=[],this._cellSize=e,this._inverseCellSize=1/this._cellSize,this._raycastParser=new n}return e.prototype.register=function(e){var i=e.bounds;e.registeredPhysicsBounds=i;var n=this.cellCoords(i.x,i.y),r=this.cellCoords(i.right,i.bottom);this.gridBounds.contains(n.x,n.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,n)),this.gridBounds.contains(r.x,r.y)||(this.gridBounds=t.RectangleExt.union(this.gridBounds,r));for(var o=n.x;o<=r.x;o++)for(var s=n.y;s<=r.y;s++){var a=this.cellAtPosition(o,s,!0);a.firstOrDefault(function(t){return t.hashCode==e.hashCode})||a.push(e)}},e.prototype.remove=function(t){for(var e=t.registeredPhysicsBounds,i=this.cellCoords(e.x,e.y),n=this.cellCoords(e.right,e.bottom),r=i.x;r<=n.x;r++)for(var o=i.y;o<=n.y;o++){var s=this.cellAtPosition(r,o);s?s.remove(t):console.log("从不存在碰撞器的单元格中移除碰撞器: ["+t+"]")}},e.prototype.removeWithBruteForce=function(t){this._cellDict.remove(t)},e.prototype.clear=function(){this._cellDict.clear()},e.prototype.debugDraw=function(t,e){void 0===e&&(e=1);for(var i=this.gridBounds.x;i<=this.gridBounds.right;i++)for(var n=this.gridBounds.y;n<=this.gridBounds.bottom;n++){var r=this.cellAtPosition(i,n);r&&r.length>0&&this.debugDrawCellDetails(i,n,r.length,t,e)}},e.prototype.aabbBroadphase=function(e,i,n){this._tempHashSet.length=0;for(var r=this.cellCoords(e.x,e.y),o=this.cellCoords(e.right,e.bottom),s=r.x;s<=o.x;s++)for(var a=r.y;a<=o.y;a++){var h=this.cellAtPosition(s,a);if(h)for(var c=function(r){var o=h[r];if(o==i||!t.Flags.isFlagSet(n,o.physicsLayer.value))return"continue";e.intersects(o.bounds)&&(l._tempHashSet.firstOrDefault(function(t){return t.hashCode==o.hashCode})||l._tempHashSet.push(o))},l=this,u=0;u=0&&(e.push(this.findBoundsRect(i,o,r,t)),i=-1)}i>=0&&(e.push(this.findBoundsRect(i,this.map.width,r,t)),i=-1)}return e},e.prototype.findBoundsRect=function(e,i,n,r){for(var o=-1,s=n+1;sthis.tileHeight||this.maxTileWidth>this.tileWidth},enumerable:!0,configurable:!0}),i.prototype.getTilesetForTileGid=function(t){if(0==t)return null;for(var e=this.tilesets.length-1;e>=0;e--)if(this.tilesets[e].firstGid<=t)return this.tilesets[e];console.error("tile gid"+t+"未在任何tileset中找到")},i.prototype.worldToTilePositionX=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileWidth);return i?t.MathHelper.clamp(n,0,this.width-1):n},i.prototype.worldToTilePositionY=function(e,i){void 0===i&&(i=!0);var n=Math.floor(e/this.tileHeight);return i?t.MathHelper.clamp(n,0,this.height-1):n},i.prototype.getLayer=function(t){return this.layers[t]},i.prototype.update=function(){this.tilesets.forEach(function(t){t.update()})},i.prototype.dispose=function(t){void 0===t&&(t=!0),this._isDisposed||(t&&(this.tilesets.forEach(function(t){t.image&&t.image.dispose()}),this.imageLayers.forEach(function(t){t.image&&t.image.dispose()})),this._isDisposed=!0)},i}(t.TmxDocument);t.TmxMap=e,function(t){t[t.unknown=0]="unknown",t[t.orthogonal=1]="orthogonal",t[t.isometric=2]="isometric",t[t.staggered=3]="staggered",t[t.hexagonal=4]="hexagonal"}(t.OrientationType||(t.OrientationType={})),function(t){t[t.x=0]="x",t[t.y=1]="y"}(t.StaggerAxisType||(t.StaggerAxisType={})),function(t){t[t.odd=0]="odd",t[t.even=1]="even"}(t.StaggerIndexType||(t.StaggerIndexType={})),function(t){t[t.rightDown=0]="rightDown",t[t.rightUp=1]="rightUp",t[t.leftDown=2]="leftDown",t[t.leftUp=3]="leftUp"}(t.RenderOrderType||(t.RenderOrderType={}))}(es||(es={})),function(t){var e=function(){return function(){}}();t.TmxObjectGroup=e;var i=function(){return function(){this.shape=new egret.Shape,this.textField=new egret.TextField}}();t.TmxObject=i;var n=function(){return function(){}}();t.TmxText=n;var r=function(){return function(){}}();t.TmxAlignment=r,function(t){t[t.basic=0]="basic",t[t.point=1]="point",t[t.tile=2]="tile",t[t.ellipse=3]="ellipse",t[t.polygon=4]="polygon",t[t.polyline=5]="polyline",t[t.text=6]="text"}(t.TmxObjectType||(t.TmxObjectType={})),function(t){t[t.unkownOrder=-1]="unkownOrder",t[t.TopDown=0]="TopDown",t[t.IndexOrder=1]="IndexOrder"}(t.DrawOrderType||(t.DrawOrderType={})),function(t){t[t.left=0]="left",t[t.center=1]="center",t[t.right=2]="right",t[t.justify=3]="justify"}(t.TmxHorizontalAlignment||(t.TmxHorizontalAlignment={})),function(t){t[t.top=0]="top",t[t.center=1]="center",t[t.bottom=2]="bottom"}(t.TmxVerticalAlignment||(t.TmxVerticalAlignment={}))}(es||(es={})),function(t){var e=function(){function e(){}return e.loadTmxMap=function(t,e){var i=RES.getRes(e);return this.loadTmxMapData(t,i,RES.getResourceInfo(e))},e.loadTmxMapData=function(e,i,n){return __awaiter(this,void 0,void 0,function(){var r,o,s,a;return __generator(this,function(h){switch(h.label){case 0:e.version=i.version,e.tiledVersion=i.tiledversion,e.width=i.width,e.height=i.height,e.tileWidth=i.tilewidth,e.tileHeight=i.tileheight,e.hexSideLength=i.hexsidelength,e.orientation=this.parseOrientationType(i.orientation),e.staggerAxis=this.parseStaggerAxisType(i.staggeraxis),e.staggerIndex=this.parseStaggerIndexType(i.staggerindex),e.renderOrder=this.parseRenderOrderType(i.renderorder),e.nextObjectID=i.nextobjectid,e.backgroundColor=t.TmxUtils.color16ToUnit(i.color),e.properties=this.parsePropertyDict(i.properties),e.maxTileWidth=e.tileWidth,e.maxTileHeight=e.tileHeight,e.tmxDirectory=n.root+n.url.replace(".","_").replace(n.name,""),e.tilesets=[],r=0,o=i.tilesets,h.label=1;case 1:return rt.map.maxTileWidth&&(t.map.maxTileWidth=e.image.width),e.image.height>t.map.maxTileHeight&&(t.map.maxTileHeight=e.image.height))}),t.tileRegions.forEach(function(e){var i=e.width,n=e.height;i>t.map.maxTileWidth&&(t.map.maxTileWidth=i),i>t.map.maxTileHeight&&(t.map.maxTileHeight=n)})},e.parseOrientationType=function(e){return"unknown"==e?t.OrientationType.unknown:"orthogonal"==e?t.OrientationType.orthogonal:"isometric"==e?t.OrientationType.isometric:"staggered"==e?t.OrientationType.staggered:"hexagonal"==e?t.OrientationType.hexagonal:t.OrientationType.unknown},e.parseStaggerAxisType=function(e){return"y"==e?t.StaggerAxisType.y:t.StaggerAxisType.x},e.parseStaggerIndexType=function(e){return"even"==e?t.StaggerIndexType.even:t.StaggerIndexType.odd},e.parseRenderOrderType=function(e){return"right-up"==e?t.RenderOrderType.rightUp:"left-down"==e?t.RenderOrderType.leftDown:"left-up"==e?t.RenderOrderType.leftUp:t.RenderOrderType.rightDown},e.parsePropertyDict=function(e){if(!e)return null;for(var i=new Map,n=0,r=e;n=e.columns));m+=e.tileWidth+e.spacing);else e.tiles.forEach(function(i,n){e.tileRegions.set(n,new t.Rectangle(0,0,i.image.width,i.image.height))});return[2,e]}})})},e.loadTmxTilesetTile=function(e,i,n,r,o){return __awaiter(this,void 0,void 0,function(){var s,a,h,c,l,u,p,d,f,g,y,m,_;return __generator(this,function(v){switch(v.label){case 0:if(e.tileset=i,e.id=n.id,s=n.terrain)for(e.terrainEdges=new Array(4),a=0,h=0,c=s;h0){a.shape.x=h.x,a.shape.y=h.y,i.addChild(a.shape),a.shape.graphics.clear(),a.shape.graphics.lineStyle(1,10526884);for(u=0;u0&&(l=u.currentAnimationFrameGid);var p=i.tileset.tileRegions.get(l),d=Math.floor(i.x)*s,f=Math.floor(i.y)*a;i.horizontalFlip&&i.verticalFlip?(d+=a+(p.height*o.y-a),f-=p.width*o.x-s):i.horizontalFlip?d+=s+(p.height*o.y-a):i.verticalFlip?f+=s-p.width*o.x:f+=a-p.height*o.y;var g=new t.Vector2(d,f).add(r);if(i.tileset.image){if(n){var y=i.tileset.image.bitmap.getTexture(""+l);y||(y=i.tileset.image.bitmap.createTexture(""+l,p.x,p.y,p.width,p.height)),i.tileset.image.texture=new e(y),n.addChild(i.tileset.image.texture),i.tileset.image.texture.x!=g.x&&(i.tileset.image.texture.x=g.x),i.tileset.image.texture.y!=g.y&&(i.tileset.image.texture.y=g.y),i.verticalFlip&&i.horizontalFlip?(i.tileset.image.texture.scaleX=-1,i.tileset.image.texture.scaleY=-1):i.verticalFlip?(i.tileset.image.texture.scaleX=o.x,i.tileset.image.texture.scaleY=-1):i.horizontalFlip?(i.tileset.image.texture.scaleX=-1,i.tileset.image.texture.scaleY=o.y):(i.tileset.image.texture.scaleX=o.x,i.tileset.image.texture.scaleY=o.y),0!=i.tileset.image.texture.rotation&&(i.tileset.image.texture.rotation=0),0!=i.tileset.image.texture.anchorOffsetX&&(i.tileset.image.texture.anchorOffsetX=0),0!=i.tileset.image.texture.anchorOffsetY&&(i.tileset.image.texture.anchorOffsetY=0)}}else u.image.texture&&(u.image.bitmap.getTexture(l.toString())||(u.image.texture=new e(u.image.bitmap.createTexture(l.toString(),p.x,p.y,p.width,p.height)),n.addChild(u.image.texture)),u.image.texture.x=g.x,u.image.texture.y=g.y,u.image.texture.scaleX=o.x,u.image.texture.scaleY=o.y,u.image.texture.rotation=0,u.image.texture.anchorOffsetX=0,u.image.texture.anchorOffsetY=0,u.image.texture.filters=[h])},i}();t.TiledRendering=i}(es||(es={})),function(t){var e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.update=function(){this.tiles.forEach(function(t){t.updateAnimatedTiles()})},e}(t.TmxDocument);t.TmxTileset=e;var i=function(){return function(){}}();t.TmxTileOffset=i;var n=function(){return function(){}}();t.TmxTerrain=n}(es||(es={})),function(t){var e=function(){function e(){}return Object.defineProperty(e.prototype,"currentAnimationFrameGid",{get:function(){return this.animationFrames[this._animationCurrentFrame].gid+this.tileset.firstGid},enumerable:!0,configurable:!0}),e.prototype.processProperties=function(){var t;(t=this.properties.get("engine.isDestructable"))&&(this.isDestructable=Boolean(t)),(t=this.properties.get("engine:isSlope"))&&(this.isSlope=Boolean(t)),(t=this.properties.get("engine:isOneWayPlatform"))&&(this.isOneWayPlatform=Boolean(t)),(t=this.properties.get("engine:slopeTopLeft"))&&(this.slopeTopLeft=Number(t)),(t=this.properties.get("engine:slopeTopRight"))&&(this.slopeTopRight=Number(t))},e.prototype.updateAnimatedTiles=function(){0!=this.animationFrames.length&&(this._animationElapsedTime+=t.Time.deltaTime,this._animationElapsedTime>this.animationFrames[this._animationCurrentFrame].duration&&(this._animationCurrentFrame=t.MathHelper.incrementWithWrap(this._animationCurrentFrame,this.animationFrames.length),this._animationElapsedTime=0))},e}();t.TmxTilesetTile=e;var i=function(){return function(){}}();t.TmxAnimationFrame=i}(es||(es={})),function(t){var e=function(){function e(){}return e.decode=function(e,i,n){switch(n=n||"none",i=i||"none"){case"base64":var r=t.Base64Utils.decodeBase64AsArray(e,4);return"none"===n?r:t.Base64Utils.decompress(e,r,n);case"csv":return t.Base64Utils.decodeCSV(e);case"none":for(var o=[],s=0;si;n--)if(t[n]0&&t[r-1]>n;r--)t[r]=t[r-1];t[r]=n}},t.binarySearch=function(t,e){for(var i=0,n=t.length,r=i+n>>1;i=t[r]&&(i=r+1),r=i+n>>1;return t[i]==e?i:-1},t.findElementIndex=function(t,e){for(var i=t.length,n=0;nt[e]&&(e=n);return e},t.getMinElementIndex=function(t){for(var e=0,i=t.length,n=1;n=0;--r)i.unshift(e[r]);return i},t.getDifferAry=function(t,e){t=this.getUniqueAry(t),e=this.getUniqueAry(e);for(var i=t.concat(e),n={},r=[],o=i.length,s=0;s=0;e-=1)t.splice(e,1)},t.cloneList=function(t){return t?t.slice(0,t.length):null},t.equals=function(t,e){if(t==e)return!0;var i=t.length;if(i!=e.length)return!1;for(;i--;)if(t[i]!=e[i])return!1;return!0},t.insert=function(t,e,i){if(!t)return null;var n=t.length;if(e>n&&(e=n),e<0&&(e=0),e==n)t.push(i);else if(0==e)t.unshift(i);else{for(var r=n-1;r>=e;r-=1)t[r+1]=t[r];t[e]=i}return i},t}();!function(t){var e=function(){function t(){}return Object.defineProperty(t,"nativeBase64",{get:function(){return"function"==typeof window.atob},enumerable:!0,configurable:!0}),t.decode=function(t){if(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,""),this.nativeBase64)return window.atob(t);for(var e,i,n,r,o,s,a=[],h=0;h>4,i=(15&r)<<4|(o=this._keyStr.indexOf(t.charAt(h++)))>>2,n=(3&o)<<6|(s=this._keyStr.indexOf(t.charAt(h++))),a.push(String.fromCharCode(e)),64!==o&&a.push(String.fromCharCode(i)),64!==s&&a.push(String.fromCharCode(n));return a=a.join("")},t.encode=function(t){if(t=t.replace(/\r\n/g,"\n"),!this.nativeBase64){for(var e,i,n,r,o,s,a,h=[],c=0;c>2,o=(3&e)<<4|(i=t.charCodeAt(c++))>>4,s=(15&i)<<2|(n=t.charCodeAt(c++))>>6,a=63&n,isNaN(i)?s=a=64:isNaN(n)&&(a=64),h.push(this._keyStr.charAt(r)),h.push(this._keyStr.charAt(o)),h.push(this._keyStr.charAt(s)),h.push(this._keyStr.charAt(a));return h=h.join("")}window.btoa(t)},t.decodeBase64AsArray=function(e,i){i=i||1;var n,r,o,s=t.decode(e),a=new Uint32Array(s.length/i);for(n=0,o=s.length/i;n=0;--r)a[n]+=s.charCodeAt(n*i+r)<<(r<<3);return a},t.decompress=function(t,e,i){throw new Error("GZIP/ZLIB compressed TMX Tile Map not supported!")},t.decodeCSV=function(t){for(var e=t.replace("\n","").trim().split(","),i=[],n=0;n>16},set:function(t){this._packedValue=4278255615&this._packedValue|t<<16},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"g",{get:function(){return this._packedValue>>8},set:function(t){this._packedValue=4294902015&this._packedValue|t<<8},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"r",{get:function(){return this._packedValue},set:function(t){this._packedValue=4294967040&this._packedValue|t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"a",{get:function(){return this._packedValue>>24},set:function(t){this._packedValue=16777215&this._packedValue|t<<24},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"packedValue",{get:function(){return this._packedValue},set:function(t){this._packedValue=t},enumerable:!0,configurable:!0}),e.prototype.equals=function(t){return this._packedValue==t._packedValue},e}();t.Color=e}(es||(es={})),function(t){var e=function(){function t(){this.loadedAssets=new Map}return t.prototype.loadRes=function(t,e){var i=this;return void 0===e&&(e=!0),new Promise(function(n,r){var o=i.loadedAssets.get(t);o?n(o):e?RES.getResAsync(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)}):RES.getResByUrl(t).then(function(e){i.loadedAssets.set(t,e),n(e)}).catch(function(e){console.error("资源加载错误:",t,e),r(e)})})},t.prototype.dispose=function(){this.loadedAssets.forEach(function(t){var e=t;RES.destroyRes(e)&&e.dispose()}),this.loadedAssets.clear()},t}();t.ContentManager=e}(es||(es={})),function(t){var e=function(){function t(){}return t.getColorMatrix=function(t){var e=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];return e[0]=Math.floor(t/256/256)/255,e[6]=Math.floor(t/256%256)/255,e[12]=t%256/255,new egret.ColorMatrixFilter(e)},t}();t.DrawUtils=e}(es||(es={})),function(t){var e=function(){function e(){}return e.oppositeEdge=function(e){switch(e){case t.Edge.bottom:return t.Edge.top;case t.Edge.top:return t.Edge.bottom;case t.Edge.left:return t.Edge.right;case t.Edge.right:return t.Edge.left}},e.isHorizontal=function(e){return e==t.Edge.right||e==t.Edge.left},e.isVertical=function(e){return e==t.Edge.top||e==t.Edge.bottom},e}();t.EdgeExt=e}(es||(es={})),function(t){var e=function(){return function(t,e){this.func=t,this.context=e}}();t.FuncPack=e;var i=function(){function t(){this._messageTable=new Map}return t.prototype.addObserver=function(t,i,n){var r=this._messageTable.get(t);r||(r=[],this._messageTable.set(t,r)),-1!=r.findIndex(function(t){return t.func==i})&&console.warn("您试图添加相同的观察者两次"),r.push(new e(i,n))},t.prototype.removeObserver=function(t,e){var i=this._messageTable.get(t),n=i.findIndex(function(t){return t.func==e});-1!=n&&i.removeAt(n)},t.prototype.emit=function(t,e){var i=this._messageTable.get(t);if(i)for(var n=i.length-1;n>=0;n--)i[n].func.call(i[n].context,e)},t}();t.Emitter=i}(es||(es={})),function(t){!function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.left=2]="left",t[t.right=3]="right"}(t.Edge||(t.Edge={}))}(es||(es={})),function(t){var e=function(){function t(){}return t.repeat=function(t,e){for(var i=[];e--;)i.push(t);return i},t}();t.Enumerable=e}(es||(es={})),function(t){var e=function(){function t(){}return Object.defineProperty(t.prototype,"enabled",{get:function(){return this._enabled},set:function(t){this.setEnabled(t)},enumerable:!0,configurable:!0}),t.prototype.setEnabled=function(t){this._enabled!=t&&(this._enabled=t,this._enabled?this.onEnabled():this.onDisabled())},t.prototype.onEnabled=function(){},t.prototype.onDisabled=function(){},t.prototype.update=function(){},t}();t.GlobalManager=e}(es||(es={})),function(t){var e=function(){function t(){}return t.warmCache=function(t){if((t-=this._objectQueue.length)>0)for(var e=0;ethis._objectQueue.length;)this._objectQueue.shift()},t.clearCache=function(){this._objectQueue.length=0},t.obtain=function(){return this._objectQueue.length>0?this._objectQueue.shift():[]},t.free=function(t){this._objectQueue.unshift(t),t.length=0},t._objectQueue=[],t}();t.ListPool=e}(es||(es={})),function(t){var e=function(){function t(t,e){this.first=t,this.second=e}return t.prototype.clear=function(){this.first=this.second=null},t.prototype.equals=function(t){return this.first==t.first&&this.second==t.second},t}();t.Pair=e}(es||(es={}));var RandomUtils=function(){function t(){}return t.randrange=function(t,e,i){if(void 0===i&&(i=1),0==i)throw new Error("step 不能为 0");var n=e-t;if(0==n)throw new Error("没有可用的范围("+t+","+e+")");n<0&&(n=t-e);var r=Math.floor((n+i-1)/i);return Math.floor(this.random()*r)*i+Math.min(t,e)},t.randint=function(t,e){return(t=Math.floor(t))>(e=Math.floor(e))?t++:e++,this.randrange(t,e)},t.randnum=function(t,e){return this.random()*(e-t)+t},t.shuffle=function(t){return t.sort(this._randomCompare),t},t.choice=function(t){if(!t.hasOwnProperty("length"))throw new Error("无法对此对象执行此操作");var e=Math.floor(this.random()*t.length);return t instanceof String?String(t).charAt(e):t[e]},t.sample=function(t,e){var i=t.length;if(e<=0||i=0;)s=Math.floor(this.random()*i);n.push(t[s]),r.push(s)}return n},t.random=function(){return Math.random()},t.boolean=function(t){return void 0===t&&(t=.5),this.random().5?1:-1},t}();!function(t){var e=function(){function e(){}return e.getSide=function(e,i){switch(i){case t.Edge.top:return e.top;case t.Edge.bottom:return e.bottom;case t.Edge.left:return e.left;case t.Edge.right:return e.right}},e.union=function(e,i){var n=new t.Rectangle(i.x,i.y,0,0),r=new t.Rectangle;return r.x=Math.min(e.x,n.x),r.y=Math.min(e.y,n.y),r.width=Math.max(e.right,n.right)-r.x,r.height=Math.max(e.bottom,r.bottom)-r.y,r},e.getHalfRect=function(e,i){switch(i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,e.height/2);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height/2,e.width,e.height/2);case t.Edge.left:return new t.Rectangle(e.x,e.y,e.width/2,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width/2,e.y,e.width/2,e.height)}},e.getRectEdgePortion=function(e,i,n){switch(void 0===n&&(n=1),i){case t.Edge.top:return new t.Rectangle(e.x,e.y,e.width,n);case t.Edge.bottom:return new t.Rectangle(e.x,e.y+e.height-n,e.width,n);case t.Edge.left:return new t.Rectangle(e.x,e.y,n,e.height);case t.Edge.right:return new t.Rectangle(e.x+e.width-n,e.y,n,e.height)}},e.expandSide=function(e,i,n){switch(n=Math.abs(n),i){case t.Edge.top:e.y-=n,e.height+=n;break;case t.Edge.bottom:e.height+=n;break;case t.Edge.left:e.x-=n,e.width+=n;break;case t.Edge.right:e.width+=n}},e.contract=function(t,e,i){t.x+=e,t.y+=i,t.width-=2*e,t.height-=2*i},e}();t.RectangleExt=e}(es||(es={})),function(t){var e=function(){return function(t){this.value=t}}();t.Ref=e}(es||(es={})),function(t){var e=function(){function t(){}return t.prototype.update=function(t){this.remainder+=t;var e=Math.trunc(this.remainder);return this.remainder-=e,e},t.prototype.reset=function(){this.remainder=0},t}();t.SubpixelNumber=e}(es||(es={})),function(t){var e=function(){function e(){this.triangleIndices=[],this._triPrev=new Array(12),this._triNext=new Array(12)}return e.testPointTriangle=function(e,i,n,r){return!(t.Vector2Ext.cross(t.Vector2.subtract(e,i),t.Vector2.subtract(n,i))<0)&&(!(t.Vector2Ext.cross(t.Vector2.subtract(e,n),t.Vector2.subtract(r,n))<0)&&!(t.Vector2Ext.cross(t.Vector2.subtract(e,r),t.Vector2.subtract(i,r))<0))},e.prototype.triangulate=function(i,n){void 0===n&&(n=!0);var r=i.length;this.initialize(r);for(var o=0,s=0;r>3&&o<500;){o++;var a=!0,h=i[this._triPrev[s]],c=i[s],l=i[this._triNext[s]];if(t.Vector2Ext.isTriangleCCW(h,c,l)){var u=this._triNext[this._triNext[s]];do{if(e.testPointTriangle(i[u],h,c,l)){a=!1;break}u=this._triNext[u]}while(u!=this._triPrev[s])}else a=!1;a?(this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),this._triNext[this._triPrev[s]]=this._triNext[s],this._triPrev[this._triNext[s]]=this._triPrev[s],r--,s=this._triPrev[s]):s=this._triNext[s]}this.triangleIndices.push(this._triPrev[s]),this.triangleIndices.push(s),this.triangleIndices.push(this._triNext[s]),n||this.triangleIndices.reverse()},e.prototype.initialize=function(t){this.triangleIndices.length=0,this._triNext.lengtht.MathHelper.Epsilon?e.divide(new t.Vector2(i)):e.x=e.y=0},e.transformA=function(t,e,i,n,r,o){for(var s=0;sthis.safeArea.right&&(s.x=this.safeArea.right-s.width),s.topthis.safeArea.bottom&&(s.y=this.safeArea.bottom-s.height),s},i}();t.Layout=i,function(t){t[t.none=0]="none",t[t.left=1]="left",t[t.right=2]="right",t[t.horizontalCenter=4]="horizontalCenter",t[t.top=8]="top",t[t.bottom=16]="bottom",t[t.verticalCenter=32]="verticalCenter",t[t.topLeft=9]="topLeft",t[t.topRight=10]="topRight",t[t.topCenter=12]="topCenter",t[t.bottomLeft=17]="bottomLeft",t[t.bottomRight=18]="bottomRight",t[t.bottomCenter=20]="bottomCenter",t[t.centerLeft=33]="centerLeft",t[t.centerRight=34]="centerRight",t[t.center=36]="center"}(e=t.Alignment||(t.Alignment={}))}(es||(es={})),function(t){var e,i=function(){function t(t){void 0===t&&(t=n),this.getSystemTime=t,this._stopDuration=0,this._completeSlices=[]}return t.prototype.getState=function(){return void 0===this._startSystemTime?e.IDLE:void 0===this._stopSystemTime?e.RUNNING:e.STOPPED},t.prototype.isIdle=function(){return this.getState()===e.IDLE},t.prototype.isRunning=function(){return this.getState()===e.RUNNING},t.prototype.isStopped=function(){return this.getState()===e.STOPPED},t.prototype.slice=function(){return this.recordPendingSlice()},t.prototype.getCompletedSlices=function(){return Array.from(this._completeSlices)},t.prototype.getCompletedAndPendingSlices=function(){return this._completeSlices.concat([this.getPendingSlice()])},t.prototype.getPendingSlice=function(){return this.calculatePendingSlice()},t.prototype.getTime=function(){return this.caculateStopwatchTime()},t.prototype.reset=function(){this._startSystemTime=this._pendingSliceStartStopwatchTime=this._stopSystemTime=void 0,this._stopDuration=0,this._completeSlices=[]},t.prototype.start=function(t){if(void 0===t&&(t=!1),t&&this.reset(),void 0!==this._stopSystemTime){var e=(i=this.getSystemTime())-this._stopSystemTime;this._stopDuration+=e,this._stopSystemTime=void 0}else if(void 0===this._startSystemTime){var i=this.getSystemTime();this._startSystemTime=i,this._pendingSliceStartStopwatchTime=0}},t.prototype.stop=function(t){if(void 0===t&&(t=!1),void 0===this._startSystemTime)return 0;var e=this.getSystemTimeOfCurrentStopwatchTime();return t&&this.recordPendingSlice(this.caculateStopwatchTime(e)),this._stopSystemTime=e,this.getTime()},t.prototype.calculatePendingSlice=function(t){return void 0===this._pendingSliceStartStopwatchTime?Object.freeze({startTime:0,endTime:0,duration:0}):(void 0===t&&(t=this.getTime()),Object.freeze({startTime:this._pendingSliceStartStopwatchTime,endTime:t,duration:t-this._pendingSliceStartStopwatchTime}))},t.prototype.caculateStopwatchTime=function(t){return void 0===this._startSystemTime?0:(void 0===t&&(t=this.getSystemTimeOfCurrentStopwatchTime()),t-this._startSystemTime-this._stopDuration)},t.prototype.getSystemTimeOfCurrentStopwatchTime=function(){return void 0===this._stopSystemTime?this.getSystemTime():this._stopSystemTime},t.prototype.recordPendingSlice=function(t){if(void 0!==this._pendingSliceStartStopwatchTime){void 0===t&&(t=this.getTime());var e=this.calculatePendingSlice(t);return this._pendingSliceStartStopwatchTime=e.endTime,this._completeSlices.push(e),e}return this.calculatePendingSlice()},t}();t.Stopwatch=i,function(t){t.IDLE="IDLE",t.RUNNING="RUNNING",t.STOPPED="STOPPED"}(e||(e={})),t.setDefaultSystemTimeGetter=function(t){void 0===t&&(t=Date.now),n=t};var n=Date.now}(stopwatch||(stopwatch={})),function(t){var e=function(){function e(){this.showLog=!1,this.markers=[],this.stopwacth=new stopwatch.Stopwatch,this._markerNameToIdMap=new Map,this._rectShape1=new egret.Shape,this._rectShape2=new egret.Shape,this._rectShape3=new egret.Shape,this._rectShape4=new egret.Shape,this._rectShape5=new egret.Shape,this._rectShape6=new egret.Shape,this._logs=new Array(2);for(var e=0;e=e.logSnapDuration&&(l.logs[n].snapMin=l.logs[n].min,l.logs[n].snapMax=l.logs[n].max,l.logs[n].snapAvg=l.logs[n].avg,l.logs[n].samples=0)):(l.logs[n].min=h,l.logs[n].max=h,l.logs[n].avg=h,l.logs[n].initialized=!0)}o.markCount=r.nestCount,o.nestCount=r.nestCount}this.stopwacth.reset(),this.stopwacth.start()}},e.prototype.beginMark=function(t,i,n){if(void 0===n&&(n=0),n<0||n>=e.maxBars)throw new Error("barIndex argument out of range");var r=this._curLog.bars[n];if(r.markCount>=e.maxSamples)throw new Error("exceeded sample count. either set larger number to timeruler.maxsaple or lower sample count");if(r.nestCount>=e.maxNestCall)throw new Error("exceeded nest count. either set larger number to timeruler.maxnestcall or lower nest calls");var o=this._markerNameToIdMap.get(t);isNaN(o)&&(o=this.markers.length,this._markerNameToIdMap.set(t,o)),r.markerNests[r.nestCount++]=r.markCount,r.markers[r.markCount].markerId=o,r.markers[r.markCount].color=i,r.markers[r.markCount].beginTime=this.stopwacth.getTime(),r.markers[r.markCount].endTime=-1},e.prototype.endMark=function(t,i){if(void 0===i&&(i=0),i<0||i>=e.maxBars)throw new Error("barIndex argument out of range");var n=this._curLog.bars[i];if(n.nestCount<=0)throw new Error("call beginMark method before calling endMark method");var r=this._markerNameToIdMap.get(t);if(isNaN(r))throw new Error("Marker "+t+" is not registered. Make sure you specifed same name as you used for beginMark method");var o=n.markerNests[--n.nestCount];if(n.markers[o].markerId!=r)throw new Error("Incorrect call order of beginMark/endMark method. beginMark(A), beginMark(B), endMark(B), endMark(A) But you can't called it like beginMark(A), beginMark(B), endMark(A), endMark(B).");n.markers[o].endTime=this.stopwacth.getTime()},e.prototype.getAverageTime=function(t,i){if(t<0||t>=e.maxBars)throw new Error("barIndex argument out of range");var n=0,r=this._markerNameToIdMap.get(i);return r&&(n=this.markers[r].logs[t].avg),n},e.prototype.resetLog=function(){this.markers.forEach(function(t){for(var e=0;e0&&(r+=e.barHeight+2*e.barPadding,o=Math.max(o,t.markers[t.markCount-1].endTime))});var s=this.sampleFrames*(1/60*1e3);this._frameAdjust=o>s?Math.max(0,this._frameAdjust)+1:Math.min(0,this._frameAdjust)-1,Math.max(this._frameAdjust)>e.autoAdjustDelay&&(this.sampleFrames=Math.min(e.maxSampleFrames,this.sampleFrames),this.sampleFrames=Math.max(this.targetSampleFrames,o/(1/60*1e3)+1),this._frameAdjust=0);var a=n/s,h=i.y-(r-e.barHeight),c=h,l=new t.Rectangle(i.x,c,n,r);this._rectShape1.graphics.clear(),this._rectShape1.graphics.beginFill(0,128/255),this._rectShape1.graphics.drawRect(l.x,l.y,l.width,l.height),this._rectShape1.graphics.endFill(),l.height=e.barHeight,this._rectShape2.graphics.clear();for(var u=0,p=this._prevLog.bars;u0)for(var f=0;f0&&this.setpreviousTouchState(this._gameTouchs[0]),e},enumerable:!0,configurable:!0}),i.initialize=function(){this._init||(this._init=!0,t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.touchBegin,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.touchMove,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_END,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_CANCEL,this.touchEnd,this),t.Core._instance.stage.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,this.touchEnd,this),this.initTouchCache())},i.update=function(){KeyboardUtils.update();for(var t=0;t0,this._willRepeat||(this.isRepeating=!1)},i.prototype.update=function(){this._bufferCounter-=t.Time.unscaledDeltaTime,this.isRepeating=!1;for(var e=!1,i=0;i0||this.isRepeating)return!0;for(var t=0,e=this.nodes;ta||i[c].height>a)throw new Error("一个纹理的大小比图集的大小大");h.push(new t.Rectangle(0,0,i[c].width,i[c].height))}for(;h.length>0;){var l=new egret.RenderTexture,u=new t.RectanglePacker(a,a,1);for(c=0;c0){for(var p=new t.IntegerRectangle,d=[],f=[],g=[],y=[],m=0;m0;)this.freeRectangle(this._insertedRectangles.pop());for(;this._freeAreas.length>0;)this.freeRectangle(this._freeAreas.pop());for(this._width=t,this._height=e,this._packedWidth=0,this._packedHeight=0,this._freeAreas.push(this.allocateRectangle(0,0,this._width,this._height));this._insertedRectangles.length>0;)this.freeSize(this._insertList.pop());this._padding=i},e.prototype.insertRectangle=function(t,e,i){var n=this.allocateSize(t,e,i);this._insertList.push(n)},e.prototype.packRectangles=function(t){for(void 0===t&&(t=!0),t&&this._insertList.sort(function(t,e){return t.width-e.width});this._insertList.length>0;){var e=this._insertList.pop(),i=e.width,n=e.height,r=this.getFreeAreaIndex(i,n);if(r>=0){var o=this._freeAreas[r],s=this.allocateRectangle(o.x,o.y,i,n);for(s.id=e.id,this.generateNewFreeAreas(s,this._freeAreas,this._newFreeAreas);this._newFreeAreas.length>0;)this._freeAreas.push(this._newFreeAreas.pop());this._insertedRectangles.push(s),s.right>this._packedWidth&&(this._packedWidth=s.right),s.bottom>this._packedHeight&&(this._packedHeight=s.bottom)}this.freeSize(e)}return this.rectangleCount},e.prototype.getRectangle=function(t,e){var i=this._insertedRectangles[t];return e.x=i.x,e.y=i.y,e.width=i.width,e.height=i.height,e},e.prototype.getRectangleId=function(t){return this._insertedRectangles[t].id},e.prototype.generateNewFreeAreas=function(t,e,i){var n=t.x,r=t.y,o=t.right+1+this._padding,s=t.bottom+1+this._padding,a=null;0==this._padding&&(a=t);for(var h=e.length-1;h>=0;h--){var c=e[h];if(!(n>=c.right||o<=c.x||r>=c.bottom||s<=c.y)){null==a&&(a=this.allocateRectangle(t.x,t.y,t.width+this._padding,t.height+this._padding)),this.generateDividedAreas(a,c,i);var l=e.pop();h=0;e--)for(var i=t[e],n=t.length-1;n>=0;n--)if(e!=n){var r=t[n];if(i.x>=r.x&&i.y>=r.y&&i.right<=r.right&&i.bottom<=r.bottom){this.freeRectangle(i);var o=t.pop();e0&&(i.push(this.allocateRectangle(t.right,e.y,r,e.height)),n++);var o=t.x-e.x;o>0&&(i.push(this.allocateRectangle(e.x,e.y,o,e.height)),n++);var s=e.bottom-t.bottom;s>0&&(i.push(this.allocateRectangle(e.x,t.bottom,e.width,s)),n++);var a=t.y-e.y;a>0&&(i.push(this.allocateRectangle(e.x,e.y,e.width,a)),n++),0==n&&(t.width=0;s--){var a=this._freeAreas[s];if(a.x0){var r=this._sortableSizeStack.pop();return r.width=e,r.height=i,r.id=n,r}return new t.SortableSize(e,i,n)},e.prototype.freeSize=function(t){this._sortableSizeStack.push(t)},e.prototype.allocateRectangle=function(e,i,n,r){if(this._rectangleStack.length>0){var o=this._rectangleStack.pop();return o.x=e,o.y=i,o.width=n,o.height=r,o.right=e+n,o.bottom=i+r,o}return new t.IntegerRectangle(e,i,n,r)},e.prototype.freeRectangle=function(t){this._rectangleStack.push(t)},e}();t.RectanglePacker=e}(es||(es={})),function(t){var e=function(){return function(t,e,i){this.width=t,this.height=e,this.id=i}}();t.SortableSize=e}(es||(es={})),function(t){var e=function(){return function(t){this.assets=t}}();t.TextureAssets=e;var i=function(){return function(){}}();t.TextureAsset=i}(es||(es={})),function(t){var e=function(){return function(t,e){this.texture=t,this.id=e}}();t.TextureToPack=e}(es||(es={})),function(t){var e=function(){function e(){this._timeInSeconds=0,this._repeats=!1,this._isDone=!1,this._elapsedTime=0}return e.prototype.getContext=function(){return this.context},e.prototype.reset=function(){this._elapsedTime=0},e.prototype.stop=function(){this._isDone=!0},e.prototype.tick=function(){return!this._isDone&&this._elapsedTime>this._timeInSeconds&&(this._elapsedTime-=this._timeInSeconds,this._onTime(this),this._isDone||this._repeats||(this._isDone=!0)),this._elapsedTime+=t.Time.deltaTime,this._isDone},e.prototype.initialize=function(t,e,i,n){this._timeInSeconds=t,this._repeats=e,this.context=i,this._onTime=n},e.prototype.unload=function(){this.context=null,this._onTime=null},e}();t.Timer=e}(es||(es={})),function(t){var e=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t._timers=[],t}return __extends(i,e),i.prototype.update=function(){for(var t=this._timers.length-1;t>=0;t--)this._timers[t].tick()&&(this._timers[t].unload(),this._timers.removeAt(t))},i.prototype.schedule=function(e,i,n,r){var o=new t.Timer;return o.initialize(e,i,n,r),this._timers.push(o),o},i}(t.GlobalManager);t.TimerManager=e}(es||(es={})); \ No newline at end of file diff --git a/source/src/ECS/Component.ts b/source/src/ECS/Component.ts index b51c82ec..c936f548 100644 --- a/source/src/ECS/Component.ts +++ b/source/src/ECS/Component.ts @@ -127,15 +127,5 @@ module es { return this; } - - /** - * 创建此组件的克隆 - */ - public clone(): Component { - let component = ObjectUtils.clone(this); - component.entity = null; - - return component; - } } } diff --git a/source/src/ECS/Components/Physics/Colliders/BoxCollider.ts b/source/src/ECS/Components/Physics/Colliders/BoxCollider.ts index a1ef4586..169bace5 100644 --- a/source/src/ECS/Components/Physics/Colliders/BoxCollider.ts +++ b/source/src/ECS/Components/Physics/Colliders/BoxCollider.ts @@ -8,12 +8,24 @@ module es { /** * 零参数构造函数要求RenderableComponent在实体上,这样碰撞器可以在实体被添加到场景时调整自身的大小。 */ - constructor() { + constructor(x?: number, y?: number, width?: number, height?: number) { super(); - // 我们在这里插入一个1x1框作为占位符,直到碰撞器在下一阵被添加到实体并可以获得更精确的自动调整大小数据 - this.shape = new Box(1, 1); - this._colliderRequiresAutoSizing = true; + if (x == undefined && y == undefined){ + if (width == undefined && height == undefined){ + // 我们在这里插入一个1x1框作为占位符,直到碰撞器在下一阵被添加到实体并可以获得更精确的自动调整大小数据 + this.shape = new Box(1, 1); + this._colliderRequiresAutoSizing = true; + }else if (width != undefined && height != undefined){ + x = -width / 2; + y = -height / 2; + this._localOffset = new Vector2(x + width / 2, y + height / 2); + this.shape = new Box(width, height); + } + }else if (x != undefined && y != undefined && width != undefined && height != undefined){ + this._localOffset = new Vector2(x + width / 2, y + height / 2); + this.shape = new Box(width, height); + } } public get width() { @@ -32,20 +44,6 @@ module es { this.setHeight(value); } - /** - * 创建一个BoxCollider并使用x/y组件作为localOffset - * @param x - * @param y - * @param width - * @param height - */ - public createBoxRect(x: number, y: number, width: number, height: number): BoxCollider{ - this._localOffset = new Vector2(x + width / 2, y + width / 2); - this.shape = new Box(width, height); - this._colliderRequiresAutoSizing = false; - return this; - } - /** * 设置BoxCollider的大小 * @param width @@ -110,11 +108,11 @@ module es { if (!this.pixelShape2.parent) this.debugDisplayObject.addChild(this.pixelShape2); - // this.hollowShape.graphics.clear(); - // this.hollowShape.graphics.beginFill(Colors.colliderBounds, 0); - // this.hollowShape.graphics.lineStyle(Size.lineSizeMultiplier, Colors.colliderBounds); - // this.hollowShape.graphics.drawRect(this.bounds.x, this.bounds.y, this.bounds.width, this.bounds.height); - // this.hollowShape.graphics.endFill(); + this.hollowShape.graphics.clear(); + this.hollowShape.graphics.beginFill(Colors.colliderBounds, 0); + this.hollowShape.graphics.lineStyle(Size.lineSizeMultiplier, Colors.colliderBounds); + this.hollowShape.graphics.drawRect(this.bounds.x, this.bounds.y, this.bounds.width, this.bounds.height); + this.hollowShape.graphics.endFill(); this.polygonShape.graphics.clear(); if (poly.points.length >= 2){ diff --git a/source/src/ECS/Components/Physics/Colliders/CircleCollider.ts b/source/src/ECS/Components/Physics/Colliders/CircleCollider.ts index e50c9a31..5f15a8c4 100644 --- a/source/src/ECS/Components/Physics/Colliders/CircleCollider.ts +++ b/source/src/ECS/Components/Physics/Colliders/CircleCollider.ts @@ -13,11 +13,14 @@ module es { constructor(radius?: number) { super(); - if (radius) + if (radius == undefined){ + // 我们在这里插入一个1px的圆圈作为占位符 + // 直到碰撞器被添加到实体并可以获得更精确的自动调整大小数据的下一帧 + this.shape = new Circle(1); this._colliderRequiresAutoSizing = true; - // 我们在这里插入一个1px的圆圈作为占位符 - // 直到碰撞器被添加到实体并可以获得更精确的自动调整大小数据的下一帧 - this.shape = new Circle(radius ? radius : 1); + }else{ + this.shape = new Circle(radius); + } } public get radius(): number { diff --git a/source/src/ECS/Components/Physics/Colliders/Collider.ts b/source/src/ECS/Components/Physics/Colliders/Collider.ts index ada2ce55..adfa3476 100644 --- a/source/src/ECS/Components/Physics/Colliders/Collider.ts +++ b/source/src/ECS/Components/Physics/Colliders/Collider.ts @@ -1,6 +1,5 @@ module es { export abstract class Collider extends Component { - public debug /** * 对撞机的基本形状 */ @@ -12,12 +11,12 @@ module es { /** * 在处理冲突时,physicsLayer可以用作过滤器。Flags类有帮助位掩码的方法 */ - public physicsLayer = 1 << 0; + public physicsLayer = new Ref(1 << 0); /** * 碰撞器在使用移动器移动时应该碰撞的层 * 默认为所有层 */ - public collidesWithLayers = Physics.allLayers; + public collidesWithLayers: Ref = new Ref(Physics.allLayers); /** * 如果为true,碰撞器将根据附加的变换缩放和旋转 */ @@ -124,8 +123,8 @@ module es { let renderableBounds = renderable.bounds; // 这里我们需要大小*反尺度,因为当我们自动调整碰撞器的大小时,它需要没有缩放的渲染 - let width = renderableBounds.width / this.entity.scale.x; - let height = renderableBounds.height / this.entity.scale.y; + let width = renderableBounds.width / this.entity.transform.scale.x; + let height = renderableBounds.height / this.entity.transform.scale.y; // 圆碰撞器需要特别注意原点 if (this instanceof CircleCollider) { this.radius = Math.max(width, height) * 0.5; @@ -214,7 +213,7 @@ module es { public collidesWith(collider: Collider, motion: Vector2, result: CollisionResult): boolean { // 改变形状的位置,使它在移动后的位置,这样我们可以检查重叠 let oldPosition = this.entity.position; - this.entity.position = this.entity.position.add(motion); + this.entity.position.add(motion); let didCollide = this.shape.collidesWithShape(collider.shape, result); if (didCollide) @@ -225,15 +224,5 @@ module es { return didCollide; } - - public clone(): Component { - let collider = ObjectUtils.clone(this); - collider.entity = null; - - if (this.shape) - collider.shape = this.shape.clone(); - - return collider; - } } } diff --git a/source/src/ECS/Components/Physics/Mover.ts b/source/src/ECS/Components/Physics/Mover.ts index a13c1132..3cec508d 100644 --- a/source/src/ECS/Components/Physics/Mover.ts +++ b/source/src/ECS/Components/Physics/Mover.ts @@ -36,7 +36,7 @@ module es { let bounds = collider.bounds; bounds.x += motion.x; bounds.y += motion.y; - let neighbors = Physics.boxcastBroadphaseExcludingSelf(collider, bounds, collider.collidesWithLayers); + let neighbors = Physics.boxcastBroadphaseExcludingSelf(collider, bounds, collider.collidesWithLayers.value); for (let j = 0; j < neighbors.length; j++) { let neighbor = neighbors[j]; diff --git a/source/src/ECS/Components/Physics/ProjectileMover.ts b/source/src/ECS/Components/Physics/ProjectileMover.ts index a12d4e87..32b79c20 100644 --- a/source/src/ECS/Components/Physics/ProjectileMover.ts +++ b/source/src/ECS/Components/Physics/ProjectileMover.ts @@ -24,13 +24,12 @@ module es { let didCollide = false; // 获取我们在新位置可能发生碰撞的任何东西 - this.entity.position = Vector2.add(this.entity.position, motion); + this.entity.position.add(motion); // 获取任何可能在新位置发生碰撞的东西 - let neighbors = Physics.boxcastBroadphase(this._collider.bounds, this._collider.collidesWithLayers); - for (let i = 0; i < neighbors.length; i++) { - let neighbor = neighbors[i]; - if (this._collider.overlaps(neighbor) && neighbor.enabled) { + let neighbors = Physics.boxcastBroadphase(this._collider.bounds, this._collider.collidesWithLayers.value); + for (let neighbor of neighbors){ + if (this._collider.overlaps(neighbor) && neighbor.enabled){ didCollide = true; this.notifyTriggerListeners(this._collider, neighbor); } diff --git a/source/src/ECS/Components/SpriteAnimation.ts b/source/src/ECS/Components/SpriteAnimation.ts index b5f81b75..179b485a 100644 --- a/source/src/ECS/Components/SpriteAnimation.ts +++ b/source/src/ECS/Components/SpriteAnimation.ts @@ -3,7 +3,7 @@ module es { public readonly sprites: Sprite[]; public readonly frameRate: number; - constructor(sprites: Sprite[], frameRate: number) { + constructor(sprites: Sprite[], frameRate: number = 10) { this.sprites = sprites; this.frameRate = frameRate; } diff --git a/source/src/ECS/Components/TiledMapRenderer.ts b/source/src/ECS/Components/TiledMapRenderer.ts index d4711fb1..09c6fa22 100644 --- a/source/src/ECS/Components/TiledMapRenderer.ts +++ b/source/src/ECS/Components/TiledMapRenderer.ts @@ -1,7 +1,7 @@ module es { export class TiledMapRenderer extends RenderableComponent { public tiledMap: TmxMap; - public physicsLayer: number = 1 << 0; + public physicsLayer: Ref = new Ref(1 << 0); /** * 如果空,所有层将被渲染 */ @@ -27,7 +27,7 @@ module es { this.displayObject = new egret.DisplayObjectContainer(); if (collisionLayerName) { - this.collisionLayer = tiledMap.tileLayers[collisionLayerName]; + this.collisionLayer = tiledMap.tileLayers.find(layer => layer.name == collisionLayerName); } } @@ -123,7 +123,7 @@ module es { // 为我们收到的矩形创建碰撞器 this._colliders = []; for (let i = 0; i < collisionRects.length; i++) { - let collider = new BoxCollider().createBoxRect(collisionRects[i].x + this._localOffset.x, + let collider = new BoxCollider(collisionRects[i].x + this._localOffset.x, collisionRects[i].y + this._localOffset.y, collisionRects[i].width, collisionRects[i].height); collider.physicsLayer = this.physicsLayer; collider.entity = this.entity; diff --git a/source/src/ECS/Core.ts b/source/src/ECS/Core.ts index af66a5bf..ea7a13e6 100644 --- a/source/src/ECS/Core.ts +++ b/source/src/ECS/Core.ts @@ -200,6 +200,7 @@ module es { // 更新我们所有的系统管理器 Time.update(egret.getTimer()); + Input.update(); if (this._scene) { for (let i = this._globalManagers.length - 1; i >= 0; i--) { diff --git a/source/src/ECS/Entity.ts b/source/src/ECS/Entity.ts index 81b9f35b..91e88d06 100644 --- a/source/src/ECS/Entity.ts +++ b/source/src/ECS/Entity.ts @@ -280,20 +280,6 @@ module es { } } - /** - * 创建此实体的深层克隆。子类可以重写此方法来复制任何自定义字段。 - * 当重写时,应该调用CopyFrom方法,它将为您克隆所有组件、碰撞器和转换子组件。 - * 注意克隆的实体不会被添加到任何场景中!你必须自己添加它们! - * @param position - */ - public clone(position: Vector2 = new Vector2()): Entity { - let entity = new Entity(this.name + "(clone)"); - entity.copyFrom(this); - entity.transform.position = position; - - return entity; - } - /** * 在提交了所有挂起的实体更改后,将此实体添加到场景时调用 */ @@ -413,31 +399,5 @@ module es { public toString(): string { return `[Entity: name: ${this.name}, tag: ${this.tag}, enabled: ${this.enabled}, depth: ${this.updateOrder}]`; } - - /** - * 将实体的属性、组件和碰撞器复制到此实例 - * @param entity - */ - protected copyFrom(entity: Entity) { - this.tag = entity.tag; - this.updateInterval = entity.updateInterval; - this.updateOrder = entity.updateOrder; - this.enabled = entity.enabled; - - this.transform.scale = entity.transform.scale; - this.transform.rotation = entity.transform.rotation; - - for (let i = 0; i < entity.components.count; i++) - this.addComponent(entity.components.buffer[i].clone()); - for (let i = 0; i < entity.components._componentsToAdd.length; i++) - this.addComponent(entity.components._componentsToAdd[i].clone()); - - for (let i = 0; i < entity.transform.childCount; i++) { - let child = entity.transform.getChild(i).entity; - let childClone = child.clone(); - childClone.transform.copyFrom(child.transform); - childClone.transform.parent = this.transform; - } - } } } diff --git a/source/src/Math/Flags.ts b/source/src/Math/Flags.ts index 55e473af..77c5d335 100644 --- a/source/src/Math/Flags.ts +++ b/source/src/Math/Flags.ts @@ -30,8 +30,8 @@ module es { * @param self * @param flag */ - public static setFlagExclusive(self: number, flag: number) { - return 1 << flag; + public static setFlagExclusive(self: Ref, flag: number) { + self.value = 1 << flag; } /** @@ -39,8 +39,8 @@ module es { * @param self * @param flag */ - public static setFlag(self: number, flag: number) { - return (self | 1 << flag); + public static setFlag(self: Ref, flag: number) { + self.value = (self.value | 1 << flag); } /** @@ -48,17 +48,17 @@ module es { * @param self * @param flag */ - public static unsetFlag(self: number, flag: number) { + public static unsetFlag(self: Ref, flag: number) { flag = 1 << flag; - return (self & (~flag)); + self.value = (self.value & (~flag)); } /** * 反转数值集合位 * @param self */ - public static invertFlags(self: number) { - return ~self; + public static invertFlags(self: Ref) { + self.value = ~self.value; } } } diff --git a/source/src/Physics/Collision.ts b/source/src/Physics/Collision.ts index dc82e398..874e5c8f 100644 --- a/source/src/Physics/Collision.ts +++ b/source/src/Physics/Collision.ts @@ -67,28 +67,51 @@ module es { return Vector2.add(lineA, new Vector2(v.x * t, v.y * t)); } - public static isCircleToCircle(circleCenter1: Vector2, circleRadius1: number, circleCenter2: Vector2, circleRadius2: number): boolean { + public static circleToCircle(circleCenter1: Vector2, circleRadius1: number, circleCenter2: Vector2, circleRadius2: number): boolean { return Vector2.distanceSquared(circleCenter1, circleCenter2) < (circleRadius1 + circleRadius2) * (circleRadius1 + circleRadius2); } - public static isCircleToLine(circleCenter: Vector2, radius: number, lineFrom: Vector2, lineTo: Vector2): boolean { + public static circleToLine(circleCenter: Vector2, radius: number, lineFrom: Vector2, lineTo: Vector2): boolean { return Vector2.distanceSquared(circleCenter, this.closestPointOnLine(lineFrom, lineTo, circleCenter)) < radius * radius; } - public static isCircleToPoint(circleCenter: Vector2, radius: number, point: Vector2): boolean { + public static circleToPoint(circleCenter: Vector2, radius: number, point: Vector2): boolean { return Vector2.distanceSquared(circleCenter, point) < radius * radius; } - public static isRectToCircle(rect: egret.Rectangle, cPosition: Vector2, cRadius: number): boolean { - let ew = rect.width * 0.5; - let eh = rect.height * 0.5; - let vx = Math.max(0, Math.max(cPosition.x - rect.x) - ew); - let vy = Math.max(0, Math.max(cPosition.y - rect.y) - eh); + public static rectToCircle(rect: egret.Rectangle, cPosition: Vector2, cRadius: number): boolean { + if (this.rectToPoint(rect.x, rect.y, rect.width, rect.height, cPosition)) + return true; - return vx * vx + vy * vy < cRadius * cRadius; + let edgeFrom: Vector2 = Vector2.zero; + let edgeTo: Vector2 = Vector2.zero; + let sector = this.getSector(rect.x, rect.y, rect.width, rect.height, cPosition); + + if ((sector & PointSectors.top) != 0){ + edgeFrom = new Vector2(rect.x, rect.y); + edgeTo = new Vector2(rect.x + rect.width, rect.y); + if (this.circleToLine(cPosition, cRadius, edgeFrom, edgeTo)) + return true; + } + + if ((sector & PointSectors.bottom) != 0){ + edgeFrom = new Vector2(rect.x, rect.y + rect.width); + edgeTo = new Vector2(rect.x + rect.width, rect.y + rect.height); + if (this.circleToLine(cPosition, cRadius, edgeFrom, edgeTo)) + return true; + } + + if ((sector & PointSectors.left) != 0){ + edgeFrom = new Vector2(rect.x + rect.width, rect.y); + edgeTo = new Vector2(rect.x + rect.width, rect.y + rect.height); + if (this.circleToLine(cPosition, cRadius, edgeFrom, edgeTo)) + return true; + } + + return false; } - public static isRectToLine(rect: Rectangle, lineFrom: Vector2, lineTo: Vector2) { + public static rectToLine(rect: Rectangle, lineFrom: Vector2, lineTo: Vector2) { let fromSector = this.getSector(rect.x, rect.y, rect.width, rect.height, lineFrom); let toSector = this.getSector(rect.x, rect.y, rect.width, rect.height, lineTo); @@ -134,7 +157,7 @@ module es { return false; } - public static isRectToPoint(rX: number, rY: number, rW: number, rH: number, point: Vector2) { + public static rectToPoint(rX: number, rY: number, rW: number, rH: number, point: Vector2) { return point.x >= rX && point.y >= rY && point.x < rX + rW && point.y < rY + rH; } diff --git a/source/src/Physics/Shapes/Box.ts b/source/src/Physics/Shapes/Box.ts index ea9ef7b2..0bfd88cc 100644 --- a/source/src/Physics/Shapes/Box.ts +++ b/source/src/Physics/Shapes/Box.ts @@ -60,7 +60,7 @@ module es { return this.bounds.intersects(other.bounds); if (other instanceof Circle) - return Collisions.isRectToCircle(this.bounds, other.position, other.radius); + return Collisions.rectToCircle(this.bounds, other.position, other.radius); } return super.overlaps(other); diff --git a/source/src/Physics/Shapes/Circle.ts b/source/src/Physics/Shapes/Circle.ts index e90182c3..b506eff5 100644 --- a/source/src/Physics/Shapes/Circle.ts +++ b/source/src/Physics/Shapes/Circle.ts @@ -25,21 +25,21 @@ module es { // 为了处理偏移原点的旋转,我们只需要将圆心围绕(0,0)在一个圆上移动,我们的偏移量就是0角 let offsetAngle = Math.atan2(collider.localOffset.y, collider.localOffset.x) * MathHelper.Rad2Deg; let offsetLength = hasUnitScale ? collider._localOffsetLength : Vector2.multiply(collider.localOffset, collider.entity.transform.scale).length(); - this.center = MathHelper.pointOnCirlce(Vector2.zero, offsetLength, collider.entity.transform.rotation + offsetAngle); + this.center = MathHelper.pointOnCirlce(Vector2.zero, offsetLength, collider.entity.transform.rotationDegrees + offsetAngle); } } - this.position = Vector2.add(collider.transform.position, this.center); + this.position = Vector2.add(collider.entity.transform.position, this.center); this.bounds = new Rectangle(this.position.x - this.radius, this.position.y - this.radius, this.radius * 2, this.radius * 2); } public overlaps(other: Shape) { let result: CollisionResult = new CollisionResult(); if (other instanceof Box && (other as Box).isUnrotated) - return Collisions.isRectToCircle(other.bounds, this.position, this.radius); + return Collisions.rectToCircle(other.bounds, this.position, this.radius); if (other instanceof Circle) - return Collisions.isCircleToCircle(this.position, this.radius, other.position, (other as Circle).radius); + return Collisions.circleToCircle(this.position, this.radius, other.position, (other as Circle).radius); if (other instanceof Polygon) return ShapeCollisions.circleToPolygon(this, other, result); diff --git a/source/src/Physics/Shapes/Polygon.ts b/source/src/Physics/Shapes/Polygon.ts index 72e6899e..20614b29 100644 --- a/source/src/Physics/Shapes/Polygon.ts +++ b/source/src/Physics/Shapes/Polygon.ts @@ -76,7 +76,7 @@ module es { public buildEdgeNormals() { // 对于box 我们只需要两条边,因为另外两条边是平行的 let totalEdges = this.isBox ? 2 : this.points.length; - if (this._edgeNormals == null || this._edgeNormals.length != totalEdges) + if (this._edgeNormals == undefined || this._edgeNormals.length != totalEdges) this._edgeNormals = new Array(totalEdges); let p2: Vector2; @@ -169,7 +169,7 @@ module es { edgeNormal.y = 0; let closestPoint = new Vector2(0, 0); - let tempDistanceSquared; + let tempDistanceSquared = 0; for (let i = 0; i < points.length; i++) { let j = i + 1; if (j == points.length) @@ -200,9 +200,9 @@ module es { * @param originalPoints * @param rotatedPoints */ - public static rotatePolygonVerts(radians: number, originalPoints: Vector2[], rotatedPoints){ + public static rotatePolygonVerts(radians: number, originalPoints: Vector2[], rotatedPoints: Vector2[]){ let cos = Math.cos(radians); - let sin = Math.sign(radians); + let sin = Math.sin(radians); for (let i = 0; i < originalPoints.length; i ++){ let position = originalPoints[i]; diff --git a/source/src/Physics/Shapes/Shape.ts b/source/src/Physics/Shapes/Shape.ts index b095c1cb..949d27b1 100644 --- a/source/src/Physics/Shapes/Shape.ts +++ b/source/src/Physics/Shapes/Shape.ts @@ -26,9 +26,5 @@ module es { public abstract containsPoint(point: Vector2); public abstract pointCollidesWithShape(point: Vector2, result: CollisionResult): boolean; - - public clone(): Shape { - return ObjectUtils.clone(this); - } } } diff --git a/source/src/Physics/Verlet/SpatialHash.ts b/source/src/Physics/Verlet/SpatialHash.ts index 1692e84c..ce6e90bb 100644 --- a/source/src/Physics/Verlet/SpatialHash.ts +++ b/source/src/Physics/Verlet/SpatialHash.ts @@ -130,7 +130,7 @@ module es { let collider = cell[i]; // 如果它是自身或者如果它不匹配我们的层掩码 跳过这个碰撞器 - if (collider == excludeCollider || !Flags.isFlagSet(layerMask, collider.physicsLayer)) + if (collider == excludeCollider || !Flags.isFlagSet(layerMask, collider.physicsLayer.value)) continue; if (bounds.intersects(collider.bounds)) { @@ -364,7 +364,7 @@ module es { continue; // 确保碰撞器在图层蒙版上 - if (!Flags.isFlagSet(this._layerMask, potential.physicsLayer)) + if (!Flags.isFlagSet(this._layerMask, potential.physicsLayer.value)) continue; // TODO: rayIntersects的性能够吗?需要测试它。Collisions.rectToLine可能更快 diff --git a/source/src/Tiled/Layer.ts b/source/src/Tiled/Layer.ts index e86f596d..13015ddc 100644 --- a/source/src/Tiled/Layer.ts +++ b/source/src/Tiled/Layer.ts @@ -47,7 +47,7 @@ module es { * 返回平铺空间中的矩形列表,其中任何非空平铺组合为边界区域 */ public getCollisionRectangles(): Rectangle[] { - let checkedIndexes = []; + let checkedIndexes: boolean[] = new Array(this.tiles.length); let rectangles = []; let startCol = -1; let index = -1; @@ -55,12 +55,12 @@ module es { for (let y = 0; y < this.map.height; y ++){ for (let x = 0; x< this.map.width; x ++){ index = y * this.map.width + x; - let tile = this.getTile(x, y); + let tile = this.getTile(x, y); if (tile && !checkedIndexes[index]){ if (startCol < 0) startCol = x; checkedIndexes[index] = true; - }else if(tile || checkedIndexes[index]){ + }else if(!tile || checkedIndexes[index] == true){ if (startCol >= 0){ rectangles.push(this.findBoundsRect(startCol, x, y, checkedIndexes)); startCol = -1; @@ -90,7 +90,7 @@ module es { for (let x = startX; x < endX; x ++){ index = y * this.map.width + x; let tile = this.getTile(x, y); - if (tile || checkedIndexes[index]){ + if (!tile || checkedIndexes[index]){ // 再次将我们到目前为止在这一行中访问过的所有内容设置为false,因为它不会包含在矩形中,应该再次进行检查 for (let _x = startX; _x < x; _x++){ index = y * this.map.width + _x; @@ -132,7 +132,7 @@ module es { * TmxTilesetTile只存在于动态的tiles和带有附加属性的tiles中。 */ public get tilesetTile(): TmxTilesetTile { - if (this._tilesetTileIndex == undefined){ + if (!this._tilesetTileIndex){ this._tilesetTileIndex = -1; if (this.tileset.firstGid <= this.gid){ let tilesetTile = this.tileset.tiles.get(this.gid - this.tileset.firstGid); diff --git a/source/src/Utils/Input.ts b/source/src/Utils/Input/Input.ts similarity index 82% rename from source/src/Utils/Input.ts rename to source/src/Utils/Input/Input.ts index 7dc5e8ee..fa3f3d9c 100644 --- a/source/src/Utils/Input.ts +++ b/source/src/Utils/Input/Input.ts @@ -55,6 +55,8 @@ module es { return this._gameTouchs[0].position; } + public static _virtualInputs: VirtualInput[] = []; + /** 获取最大触摸数 */ public static get maxSupportedTouch() { return Core._instance.stage.maxTouches; @@ -91,11 +93,45 @@ module es { this.initTouchCache(); } + public static update(){ + KeyboardUtils.update(); + for (let i = 0; i < this._virtualInputs.length; i ++) + this._virtualInputs[i].update(); + } + public static scaledPosition(position: Vector2) { let scaledPos = new Vector2(position.x - this._resolutionOffset.x, position.y - this._resolutionOffset.y); return Vector2.multiply(scaledPos, this.resolutionScale); } + /** + * 只有在当前帧按下并且在上一帧没有按下时才算press + * @param key + */ + public static isKeyPressed(key: Keys): boolean{ + return KeyboardUtils.currentKeys.contains(key) && !KeyboardUtils.previousKeys.contains(key); + } + + public static isKeyPressedBoth(keyA: Keys, keyB: Keys){ + return this.isKeyPressed(keyA) || this.isKeyPressed(keyB); + } + + public static isKeyDown(key: Keys): boolean { + return KeyboardUtils.currentKeys.contains(key); + } + + public static isKeyDownBoth(keyA: Keys, keyB: Keys){ + return this.isKeyDown(keyA) || this.isKeyDown(keyB); + } + + public static isKeyReleased(key: Keys){ + return !KeyboardUtils.currentKeys.contains(key) && KeyboardUtils.previousKeys.contains(key); + } + + public static isKeyReleasedBoth(keyA: Keys, keyB: Keys){ + return this.isKeyReleased(keyA) || this.isKeyReleased(keyB); + } + private static initTouchCache() { this._totalTouchCount = 0; this._touchIndex = 0; diff --git a/source/src/Utils/Input/KeyboardUtils.ts b/source/src/Utils/Input/KeyboardUtils.ts new file mode 100644 index 00000000..1b984afb --- /dev/null +++ b/source/src/Utils/Input/KeyboardUtils.ts @@ -0,0 +1,47 @@ +import Keys = es.Keys; + +class KeyboardUtils { + /** + * 当前帧按键状态 + */ + public static currentKeys: Keys[] = []; + /** + * 上一帧按键状态 + */ + public static previousKeys: Keys[] = []; + private static keyStatusKeys: Keys[] = []; + + public static init(): void { + document.addEventListener("keydown", KeyboardUtils.onKeyDownHandler); + document.addEventListener("keyup", KeyboardUtils.onKeyUpHandler); + } + + public static update(){ + KeyboardUtils.previousKeys.length = 0; + for (let key of KeyboardUtils.currentKeys){ + KeyboardUtils.previousKeys.push(key); + KeyboardUtils.currentKeys.remove(key); + } + KeyboardUtils.currentKeys.length = 0; + for (let key of KeyboardUtils.keyStatusKeys){ + KeyboardUtils.currentKeys.push(key); + } + } + + public static destroy(): void { + KeyboardUtils.currentKeys.length = 0; + + document.removeEventListener("keyup", KeyboardUtils.onKeyUpHandler); + document.removeEventListener("keypress", KeyboardUtils.onKeyDownHandler); + } + + private static onKeyDownHandler(event: KeyboardEvent): void { + if (!KeyboardUtils.keyStatusKeys.contains(event.keyCode)) + KeyboardUtils.keyStatusKeys.push(event.keyCode); + } + + private static onKeyUpHandler(event: KeyboardEvent): void { + if (KeyboardUtils.keyStatusKeys.contains(event.keyCode)) + KeyboardUtils.keyStatusKeys.remove(event.keyCode); + } +} \ No newline at end of file diff --git a/source/src/Utils/Input/Keys.ts b/source/src/Utils/Input/Keys.ts new file mode 100644 index 00000000..2e32a9a5 --- /dev/null +++ b/source/src/Utils/Input/Keys.ts @@ -0,0 +1,116 @@ +module es { + export enum Keys { + none, + back = 8, + tab = 9, + enter = 13, + capsLock = 20, + escape = 27, + space = 32, + pageUp = 33, + pageDown = 34, + end = 35, + home = 36, + left = 37, + up = 38, + right = 39, + down = 40, + select = 41, + print = 42, + execute = 43, + printScreen = 44, + insert = 45, + delete = 46, + help = 47, + d0 = 48, + d1 = 49, + d2 = 50, + d3 = 51, + d4 = 52, + d5 = 53, + d6 = 54, + d7 = 55, + d8 = 56, + d9 = 57, + 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, + leftWindows = 91, + rightWindows = 92, + apps = 93, + sleep = 95, + numPad0 = 96, + numPad1 = 97, + numPad2 = 98, + numPad3 = 99, + numPad4 = 100, + numPad5 = 101, + numPad6 = 102, + numPad7 = 103, + numPad8 = 104, + numPad9 = 105, + multiply = 106, + add = 107, + seperator = 108, + subtract = 109, + decimal = 110, + divide = 111, + f1 = 112, + f2 = 113, + f3 = 114, + f4 = 115, + f5 = 116, + f6 = 117, + f7 = 118, + f8 = 119, + f9 = 120, + f10 = 121, + f11 = 122, + f12 = 123, + f13 = 124, + f14 = 125, + f15 = 126, + f16 = 127, + f17 = 128, + f18 = 129, + f19 = 130, + f20 = 131, + f21 = 132, + f22 = 133, + f23 = 134, + f24 = 135, + numLock = 144, + scroll = 145, + leftShift = 160, + rightShift = 161, + leftControl = 162, + rightControl = 163, + leftAlt = 164, + rightAlt = 165, + browserBack = 166, + browserForward = 167 + } +} \ No newline at end of file diff --git a/source/src/Utils/Input/Virtual/VirtualAxis.ts b/source/src/Utils/Input/Virtual/VirtualAxis.ts new file mode 100644 index 00000000..aa0e7be6 --- /dev/null +++ b/source/src/Utils/Input/Virtual/VirtualAxis.ts @@ -0,0 +1,79 @@ +/// +/// +module es { + /** + * 用-1和1之间的浮点数表示的虚拟输入 + */ + export class VirtualAxis extends VirtualInput { + public nodes: VirtualAxisNode[] = []; + + public get value() { + for (let i = 0; i < this.nodes.length; i++) { + let val = this.nodes[i].value; + if (val != 0) + return val; + } + + return 0; + } + + constructor(...nodes: VirtualAxisNode[]) { + super(); + this.nodes.concat(nodes); + } + + public update() { + for (let i = 0; i < this.nodes.length; i++) + this.nodes[i].update(); + } + } + + export class KeyboardKeys extends VirtualAxisNode { + public overlapBehavior: OverlapBehavior; + public positive: Keys; + public negative: Keys; + public _value: number = 0; + public _turned: boolean; + + constructor(overlapBehavior: OverlapBehavior, negative: Keys, positive: Keys) { + super(); + this.overlapBehavior = overlapBehavior; + this.negative = negative; + this.positive = positive; + } + + public update() { + if (Input.isKeyDown(this.positive)) { + if (Input.isKeyDown(this.negative)) { + switch (this.overlapBehavior) { + default: + case es.OverlapBehavior.cancelOut: + this._value = 0; + break; + case es.OverlapBehavior.takeNewer: + if (!this._turned) { + this._value *= -1; + this._turned = true; + } + break; + case es.OverlapBehavior.takeOlder: + break; + } + } else { + this._turned = false; + this._value = 1; + } + } else if (Input.isKeyDown(this.negative)) { + this._turned = false; + this._value = -1; + } else { + this._turned = false; + this._value = 0; + } + } + + public get value(){ + return this._value; + } + } +} \ No newline at end of file diff --git a/source/src/Utils/Input/Virtual/VirtualButton.ts b/source/src/Utils/Input/Virtual/VirtualButton.ts new file mode 100644 index 00000000..3c2db342 --- /dev/null +++ b/source/src/Utils/Input/Virtual/VirtualButton.ts @@ -0,0 +1,134 @@ +/// +module es { + /** + * 用布尔值表示的虚拟输入。除了简单地检查当前按钮状态, + * 您还可以询问它是否刚刚被按下或释放了这个框架。 + * 您还可以将按下的按钮存储在缓冲区中一段有限的时间,或者直到调用consumeBuffer()将其使用为止。 + */ + export class VirtualButton extends VirtualInput{ + public nodes: Node[] = []; + public bufferTime: number = 0; + public firstRepeatTime: number = 0; + public mutiRepeatTime: number = 0; + public isRepeating: boolean; + + public _bufferCounter: number = 0; + public _repeatCounter: number = 0; + public _willRepeat: boolean; + + constructor(bufferTime: number = 0, ...nodes: Node[]){ + super(); + this.nodes = nodes; + this.bufferTime = bufferTime; + } + + public setRepeat(firstRepeatTime: number, mutiRepeatTime: number = firstRepeatTime){ + this.firstRepeatTime = firstRepeatTime; + this.mutiRepeatTime = mutiRepeatTime; + this._willRepeat = this.firstRepeatTime > 0; + if (!this._willRepeat) + this.isRepeating = false; + } + + public update() { + this._bufferCounter -= Time.unscaledDeltaTime; + this.isRepeating = false; + + let check = false; + for (let i = 0; i < this.nodes.length; i ++){ + this.nodes[i].update(); + if (this.nodes[i].isPressed){ + this._bufferCounter = this.bufferTime; + check = true; + }else if(this.nodes[i].isDown){ + check = true; + } + } + + if (!check){ + this._repeatCounter = 0; + this._bufferCounter = 0; + }else if(this._willRepeat){ + if (this._repeatCounter == 0){ + this._repeatCounter = this.firstRepeatTime; + }else{ + this._repeatCounter -= Time.unscaledDeltaTime; + if (this._repeatCounter <= 0){ + this.isRepeating = true; + this._repeatCounter = this.mutiRepeatTime; + } + } + } + } + + public get isDown(){ + for (let node of this.nodes){ + if (node.isDown) + return true; + } + + return false; + } + + public get isPressed(){ + if (this._bufferCounter > 0 || this.isRepeating) + return true; + + for (let node of this.nodes){ + if (node.isPressed) + return true; + } + + return false; + } + + public get isReleased(){ + for (let node of this.nodes){ + if (node.isReleased) + return true; + } + return false; + } + + public consumeBuffer(){ + this._bufferCounter = 0; + } + + /** + * 添加一个键盘键到这个虚拟按钮 + * @param key + */ + public addKeyboardKey(key: Keys): VirtualButton{ + this.nodes.push(new KeyboardKey(key)); + return this; + } + } + + export abstract class Node extends VirtualInputNode { + public abstract isDown: boolean; + public abstract isPressed: boolean; + public abstract isReleased: boolean; + } + + export class KeyboardKey extends Node { + public key: Keys; + + constructor(key: Keys){ + super(); + + this.key = key; + } + + public get isDown(){ + return Input.isKeyDown(this.key); + } + + public get isPressed(){ + return Input.isKeyPressed(this.key); + } + + public get isReleased(){ + return Input.isKeyReleased(this.key); + } + } +} \ No newline at end of file diff --git a/source/src/Utils/Input/Virtual/VirtualInput.ts b/source/src/Utils/Input/Virtual/VirtualInput.ts new file mode 100644 index 00000000..a4973873 --- /dev/null +++ b/source/src/Utils/Input/Virtual/VirtualInput.ts @@ -0,0 +1,43 @@ +module es { + export enum OverlapBehavior { + /** + * 重复的输入将导致相互抵消,并且不会记录任何输入。 + * 例如:按左箭头键,按住时按右箭头键。这将导致相互抵消。 + */ + cancelOut, + /** + * 将使用找到的第一个输入 + */ + takeOlder, + /** + * 将使用找到的最后一个输入 + */ + takeNewer, + } + + /** + * 虚拟按钮,其状态由其VirtualInputNodes的状态决定 + */ + export abstract class VirtualInput { + protected constructor() { + Input._virtualInputs.push(this); + } + + /** + * 从输入系统取消虚拟输入的注册。在轮询VirtualInput之后调用这个函数 + */ + public deregister(){ + Input._virtualInputs.remove(this); + } + + public abstract update(); + } + + /** + * 将它们添加到您的VirtualInput中,以定义它如何确定当前输入状态。 + * 例如,如果你想检查一个键盘键是否被按下,创建一个VirtualButton并添加一个VirtualButton.keyboardkey + */ + export abstract class VirtualInputNode { + public update() {} + } +} \ No newline at end of file diff --git a/source/src/Utils/Input/Virtual/VirtualIntegerAxis.ts b/source/src/Utils/Input/Virtual/VirtualIntegerAxis.ts new file mode 100644 index 00000000..a1bff4cb --- /dev/null +++ b/source/src/Utils/Input/Virtual/VirtualIntegerAxis.ts @@ -0,0 +1,44 @@ +module es { + /** + * 用int(-1、0或1)表示的虚拟输入。它对应的输入可以从上到下到下, + * 如使用两个键盘键作为正/负检查。 + */ + export class VirtualIntegerAxis extends VirtualInput { + public nodes: VirtualAxisNode[] = []; + + public get value(){ + for (let i = 0; i < this.nodes.length; i ++){ + let val = this.nodes[i].value; + if (val != 0) + return Math.sign(val); + } + + return 0; + } + + constructor(...nodes: VirtualAxisNode[]){ + super(); + this.nodes.concat(nodes); + } + + public update() { + for (let i = 0; i < this.nodes.length; i ++) + this.nodes[i].update(); + } + + /** + * 添加键盘键来模拟这个虚拟输入的左/右或上/下 + * @param overlapBehavior + * @param negative + * @param positive + */ + public addKeyboardKeys(overlapBehavior: OverlapBehavior, negative: Keys, positive: Keys){ + this.nodes.push(new KeyboardKeys(overlapBehavior, negative, positive)); + return this; + } + } + + export abstract class VirtualAxisNode extends VirtualInputNode { + public abstract value: number; + } +} \ No newline at end of file diff --git a/source/src/Utils/KeyboardUtils.ts b/source/src/Utils/KeyboardUtils.ts deleted file mode 100644 index 1785a6cf..00000000 --- a/source/src/Utils/KeyboardUtils.ts +++ /dev/null @@ -1,225 +0,0 @@ -class KeyboardUtils { - /** - * 键盘事件类型 - */ - public static TYPE_KEY_DOWN: number = 0; - public static TYPE_KEY_UP: number = 1; - /** - * 键值字符串枚举 - */ - public static A: string = "A"; - public static B: string = "B"; - public static C: string = "C"; - public static D: string = "D"; - public static E: string = "E"; - public static F: string = "F"; - public static G: string = "G"; - public static H: string = "H"; - public static I: string = "I"; - public static J: string = "J"; - public static K: string = "K"; - public static L: string = "L"; - public static M: string = "M"; - public static N: string = "N"; - public static O: string = "O"; - public static P: string = "P"; - public static Q: string = "Q"; - public static R: string = "R"; - public static S: string = "S"; - public static T: string = "T"; - public static U: string = "U"; - public static V: string = "V"; - public static W: string = "W"; - public static X: string = "X"; - public static Y: string = "Y"; - public static Z: string = "Z"; - public static ESC: string = "Esc"; - public static F1: string = "F1"; - public static F2: string = "F2"; - public static F3: string = "F3"; - public static F4: string = "F4"; - public static F5: string = "F5"; - public static F6: string = "F6"; - public static F7: string = "F7"; - public static F8: string = "F8"; - public static F9: string = "F9"; - public static F10: string = "F10"; - public static F11: string = "F11"; - public static F12: string = "F12"; - public static NUM_1: string = "1"; - public static NUM_2: string = "2"; - public static NUM_3: string = "3"; - public static NUM_4: string = "4"; - public static NUM_5: string = "5"; - public static NUM_6: string = "6"; - public static NUM_7: string = "7"; - public static NUM_8: string = "8"; - public static NUM_9: string = "9"; - public static NUM_0: string = "0"; - public static TAB: string = "Tab"; - public static CTRL: string = "Ctrl"; - public static ALT: string = "Alt"; - public static SHIFT: string = "Shift"; - public static CAPS_LOCK: string = "Caps Lock"; - public static ENTER: string = "Enter"; - public static SPACE: string = "Space"; - public static BACK_SPACE: string = "Back Space"; - public static INSERT: string = "Insert"; - public static DELETE: string = "Page Down"; - public static HOME: string = "Home"; - public static END: string = "Page Down"; - public static PAGE_UP: string = "Page Up"; - public static PAGE_DOWN: string = "Page Down"; - public static LEFT: string = "Left"; - public static RIGHT: string = "Right"; - public static UP: string = "Up"; - public static DOWN: string = "Down"; - public static PAUSE_BREAK: string = "Pause Break"; - public static NUM_LOCK: string = "Num Lock"; - public static SCROLL_LOCK: string = "Scroll Lock"; - public static WINDOWS: string = "Windows"; - //存放按下注册数据的字典 - private static keyDownDict: Object; - //存放按起注册数据的字典 - private static keyUpDict: Object; - - public static init(): void { - KeyboardUtils.keyDownDict = {}; - KeyboardUtils.keyUpDict = {}; - document.addEventListener("keydown", KeyboardUtils.onKeyDonwHander); - document.addEventListener("keyup", KeyboardUtils.onKeyUpHander); - } - - /** - * 注册按键 - * @param key 键值 - * @param fun 回调方法 - * @param type 按键类型 TYPE_KEY_DOWN、TYPE_KEY_UP - */ - public static registerKey(key: string, fun: Function, thisObj: any, type: number = 0, ...args): void { - var keyDict: Object = type ? this.keyUpDict : this.keyDownDict; - keyDict[key] = {"fun": fun, args: args, "thisObj": thisObj}; - } - - /** - * 注销按键 - * @param key 键值 - * @param type 注销的类型 - */ - public static unregisterKey(key: string, type: number = 0): void { - var keyDict: Object = type ? this.keyUpDict : this.keyDownDict; - delete keyDict[key]; - } - - /** - * 销毁方法 - */ - public static destroy(): void { - KeyboardUtils.keyDownDict = null; - KeyboardUtils.keyUpDict = null; - document.removeEventListener("keydown", this.onKeyDonwHander); - document.removeEventListener("keyup", this.onKeyUpHander); - } - - private static onKeyDonwHander(event: KeyboardEvent): void { - if (!KeyboardUtils.keyDownDict) return; - var key: string = KeyboardUtils.keyCodeToString(event.keyCode); - var o: Object = KeyboardUtils.keyDownDict[key]; - if (o) { - var fun: Function = o["fun"]; - var thisObj: any = o["thisObj"]; - var args: any = o["args"]; - fun.apply(thisObj, args); - } - } - - private static onKeyUpHander(event: KeyboardEvent): void { - if (!KeyboardUtils.keyUpDict) return; - var key: string = KeyboardUtils.keyCodeToString(event.keyCode); - var o: Object = KeyboardUtils.keyUpDict[key]; - if (o) { - var fun: Function = o["fun"]; - var thisObj: any = o["thisObj"]; - var args: any = o["args"]; - fun.apply(thisObj, args); - } - } - - /** - * 根据keyCode或charCode获取相应的字符串代号 - * @param keyCode - * @return 键盘所指字符串代号 - */ - private static keyCodeToString(keyCode: number): string { - switch (keyCode) { - case 8: - return this.BACK_SPACE; - case 9: - return this.TAB; - case 13: - return this.ENTER; - case 16: - return this.SHIFT; - case 17: - return this.CTRL; - case 19: - return this.PAUSE_BREAK; - case 20: - return this.CAPS_LOCK; - case 27: - return this.ESC; - case 32: - return this.SPACE; - case 33: - return this.PAGE_UP; - case 34: - return this.PAGE_DOWN; - case 35: - return this.END; - case 36: - return this.HOME; - case 37: - return this.LEFT; - case 38: - return this.UP; - case 39: - return this.RIGHT; - case 40: - return this.DOWN; - case 45: - return this.INSERT; - case 46: - return this.DELETE; - case 91: - return this.WINDOWS; - case 112: - return this.F1; - case 113: - return this.F2; - case 114: - return this.F3; - case 115: - return this.F4; - case 116: - return this.F5; - case 117: - return this.F6; - case 118: - return this.F7; - case 119: - return this.F8; - case 120: - return this.F9; - case 122: - return this.F11; - case 123: - return this.F12; - case 144: - return this.NUM_LOCK; - case 145: - return this.SCROLL_LOCK; - default: - return String.fromCharCode(keyCode); - } - } -} \ No newline at end of file