From 3489ceac59044fa7e90ed21e405d70ebb5d63c6d Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Sat, 5 Nov 2016 12:50:36 -0400 Subject: [PATCH 01/30] initial playground --- .editorconfig | 14 + .gitignore | 2 + package.json | 32 + src/assets/basics/bunny.png | Bin 0 -> 449 bytes src/game/main.ts | 33 + src/index.html | 12 + src/tsconfig.json | 26 + src/typings/pixi.js.d.ts | 2581 +++++++++++++++++++++++++++++++++++ tslint.json | 63 + yarn.lock | 896 ++++++++++++ 10 files changed, 3659 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitignore create mode 100644 package.json create mode 100644 src/assets/basics/bunny.png create mode 100644 src/game/main.ts create mode 100644 src/index.html create mode 100644 src/tsconfig.json create mode 100644 src/typings/pixi.js.d.ts create mode 100644 tslint.json create mode 100644 yarn.lock diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..f3526162d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = 0 +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..8225baa4a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/node_modules +/dist diff --git a/package.json b/package.json new file mode 100644 index 000000000..a7c11ef9a --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "game-off-2016", + "version": "1.0.0", + "description": "Game for Github Gameoff 2016", + "main": "dist/index.html", + "scripts": { + "deploy-libs": "cp node_modules/pixi.js/bin/pixi.min.* dist/", + "deploy-assets": "cp -r src/assets dist", + "deploy-static": "cp src/index.html dist/", + "deploy": "mkdir -p dist; npm run deploy-libs; npm run deploy-assets; npm run deploy-static", + "start": "cd dist; live-server" + }, + "repository": { + "url": "git+https://github.com/ropilz/game-off-2016.git", + "type": "git" + }, + "keyworkds": [ + "ggo16", + "game off" + ], + "author": "ropilz", + "license": "MIT", + "bugs": { + "url": "https://github.com/ropilz/game-off-2016/issues" + }, + "dependencies": { + "@types/pixi.js": "^3.0.30", + "live-server": "^1.1.0", + "pixi.js": "^4.1.1", + "typescript": "^2.0.7" + } +} diff --git a/src/assets/basics/bunny.png b/src/assets/basics/bunny.png new file mode 100644 index 0000000000000000000000000000000000000000..79c31675083b7ffc272a6370bc189360bde484d0 GIT binary patch literal 449 zcmV;y0Y3hTP)SOJFMz`0@qn1GK$9W|wOohG3Lai}FkWLtiT<2<{JbM8>W7|R$! zUuNqg#gmKmsTnILy&K;zJjd^_40xy)%EA1>FWWk~LFpr>Et|!Hv(V>Hs9!2xEQJ>~!qz76HLsxFXdG zs5~GjUDeD6dXvG$_#HtoUok|M-X@BSTy{VK4P?TJZcz}O&FVzD0fZu8Yajr@?2aYL r_Q@_>J=ju&>AqoA-=wzwF98MsNX4 + + + + Hacker vs Robot + + + + + + + \ No newline at end of file diff --git a/src/tsconfig.json b/src/tsconfig.json new file mode 100644 index 000000000..4411bd25b --- /dev/null +++ b/src/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compileOnSave": true, + "buildOnSave": true, + "compilerOptions": { + "declaration": false, + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "lib": ["es6", "dom"], + "mapRoot": "../../dist", + "module": "es6", + "moduleResolution": "node", + "outDir": "../dist", + "sourceMap": true, + "target": "es5", + "baseUrl": "", + "typeRoots": [ + "./typings" + ], + "types": [ + "pixi.js" + ] + }, + "exclude": [ + "node_modules" + ] +} diff --git a/src/typings/pixi.js.d.ts b/src/typings/pixi.js.d.ts new file mode 100644 index 000000000..5c920e780 --- /dev/null +++ b/src/typings/pixi.js.d.ts @@ -0,0 +1,2581 @@ +// type definitions for Pixi.js +// project: https://github.com/pixijs/pixi.js/tree/dev +// definitions by: clark-stevenson +// definitions: https://github.com/borisyankov/DefinitelyTyped + +declare namespace PIXI { + + // from CONST + export var VERSION: typeof CONST.VERSION; + export var PI_2: typeof CONST.PI_2; + export var RAD_TO_DEG: typeof CONST.RAD_TO_DEG; + export var DEG_TO_RAD: typeof CONST.DEG_TO_RAD; + export var TARGET_FPMS: typeof CONST.TARGET_FPMS; + export var RENDERER_TYPE: typeof CONST.RENDERER_TYPE; + export var BLEND_MODES: typeof CONST.BLEND_MODES; + export var DRAW_MODES: typeof CONST.DRAW_MODES; + export var SCALE_MODES: typeof CONST.SCALE_MODES; + export var WRAP_MODES: typeof CONST.WRAP_MODES; + export var TRANSFORM_MODE: typeof CONST.TRANSFORM_MODE; + export var SPRITE_MAX_TEXTURES: typeof CONST.SPRITE_MAX_TEXTURES; + export var PRECISION: typeof CONST.PRECISION; + export var TEXT_STYLE_CHANGED: typeof CONST.TEXT_STYLE_CHANGED; + export var GC_MODES: typeof CONST.GC_MODES; + export var MIPMAP_TEXTURES: typeof CONST.MIPMAP_TEXTURES; + export var RETINA_PREFIX: typeof CONST.RETINA_PREFIX; + export var RESOLUTION: typeof CONST.RESOLUTION; + export var FILTER_RESOLUTION: typeof CONST.FILTER_RESOLUTION; + export var DEFAULT_RENDER_OPTIONS: typeof CONST.DEFAULT_RENDER_OPTIONS; + export var SHAPES: typeof CONST.SHAPES; + export var SPRITE_BATCH_SIZE: typeof CONST.SPRITE_BATCH_SIZE; + export var TEXT_GRADIENT: typeof CONST.TEXT_GRADIENT; + + export function autoDetectRenderer(width: number, height: number, options?: PIXI.IRendererOptions, noWebGL?: boolean): PIXI.WebGLRenderer | PIXI.CanvasRenderer; + export var loader: PIXI.loaders.Loader; + + ////////////////////////////////////////////////////////////////////////////// + /////////////////////////////ACCESSIBILITY//////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + export namespace accessibility { + + // accessibility + export class AccessibilityManager { + + constructor(renderer: CanvasRenderer | WebGLRenderer); + + protected div: HTMLElement; + protected pool: HTMLElement[]; + protected renderId: number; + debug: boolean; + renderer: SystemRenderer; + protected children: IAccessibleTarget[]; + protected isActive: boolean; + + protected activate(): void; + protected deactivate(): void; + protected updateAccessibleObjects(displayObject: DisplayObject): void; + protected update(): void; + protected capHitArea(hitArea: IHitArea): void; + protected addChild(displayObject: DisplayObject): void; + protected _onClick(e: interaction.InteractionEvent): void; + protected _onFocus(e: interaction.InteractionEvent): void; + protected _onFocusOut(e: interaction.InteractionEvent): void; + protected _onKeyDown(e: interaction.InteractionEvent): void; + protected _onMouseMove(): void; + + destroy(): void; + + } + export interface IAccessibleTarget { + + accessible: boolean; + accessibleTitle: string; + accessibleHint: string; + tabIndex: number; + + } + + } + + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////////CORE////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + // const + + export namespace CONST { + export var VERSION: string; + export var PI_2: number; + export var RAD_TO_DEG: number; + export var DEG_TO_RAD: number; + export var TARGET_FPMS: number; + export var RENDERER_TYPE: { + UNKNOWN: number; + WEBGL: number; + CANVAS: number; + }; + export var BLEND_MODES: { + NORMAL: number; + ADD: number; + MULTIPLY: number; + SCREEN: number; + OVERLAY: number; + DARKEN: number; + LIGHTEN: number; + COLOR_DODGE: number; + COLOR_BURN: number; + HARD_LIGHT: number; + SOFT_LIGHT: number; + DIFFERENCE: number; + EXCLUSION: number; + HUE: number; + SATURATION: number; + COLOR: number; + LUMINOSITY: number; + }; + export var DRAW_MODES: { + POINTS: number; + LINES: number; + LINE_LOOP: number; + LINE_STRIP: number; + TRIANGLES: number; + TRIANGLE_STRIP: number; + TRIANGLE_FAN: number; + }; + export var SCALE_MODES: { + DEFAULT: number, + LINEAR: number, + NEAREST: number + }; + export var GC_MODES: { + DEFAULT: number; + AUTO: number; + MANUAL: number; + }; + export var WRAP_MODES: { + CLAMP: number; + DEFAULT: number; + MIRRORED_REPEAT: number; + REPEAT: number; + }; + export var TRANSFORM_MODE: { + DEFAULT: number; + DYNAMIC: number; + STATIC: number; + }; + export var MIPMAP_TEXTURES: boolean; + export var RETINA_PREFIX: RegExp; + export var RESOLUTION: number; + export var FILTER_RESOLUTION: number; + export var DEFAULT_RENDER_OPTIONS: { + view: HTMLCanvasElement; + antialias: boolean; + forceFXAA: boolean; + autoResize: boolean; + transparent: boolean; + backgroundColor: number; + clearBeforeRender: boolean; + preserveDrawingBuffer: boolean; + roundPixels: boolean; + }; + export var URL_FILE_EXTENSION: RegExp | string; + export var DATA_URI: RegExp | string; + export var SVG_SIZE: RegExp | string; + export var SHAPES: { + POLY: number; + RECT: number; + CIRC: number; + ELIP: number; + RREC: number; + }; + export var PRECISION: { + DEFAULT: string; + LOW: string; + MEDIUM: string; + HIGH: string; + }; + export var TEXT_GRADIENT: { + LINEAR_VERTICAL: number; + LINEAR_HORIZONTAL: number; + }; + export var SPRITE_BATCH_SIZE: number; + export var SPRITE_MAX_TEXTURES: number; + export var TEXT_STYLE_CHANGED: string; + + } + + // display + + export interface IDestroyOptions { + children?: boolean; + texture?: boolean; + baseTexture?: boolean; + } + export class Bounds { + + minX: number; + minY: number; + maxX: number; + maxY: number; + rect: Rectangle; + + isEmpty(): boolean; + clear(): void; + + getRectangle(rect?: Rectangle): Rectangle; + addPoint(point: Point): void; + addQuad(vertices: number[]): Bounds; + addFrame(transform: Transform, x0: number, y0: number, x1: number, y1: number): void; + addVertices(transform: Transform, vertices: number[], beginOffset: number, endOffset: number): void; + addBounds(bounds: Bounds): void; + addBoundsMask(bounds: Bounds, mask: Bounds): void; + addBoundsArea(bounds: Bounds, area: Rectangle): void; + + } + export class Container extends DisplayObject { + + // begin extras.getChildByName + getChildByName(name: string): DisplayObject; + // end extras.getChildByName + + children: DisplayObject[]; + width: number; + height: number; + + protected onChildrenChange: (...args: any[]) => void; + addChild(child: DisplayObject): DisplayObject; + addChild(...child: DisplayObject[]): DisplayObject; + addChildAt(child: DisplayObject, index: number): DisplayObject; + swapChildren(child: DisplayObject, child2: DisplayObject): void; + getChildIndex(child: DisplayObject): number; + setChildIndex(child: DisplayObject, index: number): void; + getChildAt(index: number): DisplayObject; + removeChild(child: DisplayObject): DisplayObject; + removeChildAt(index: number): DisplayObject; + removeChildren(beginIndex?: number, endIndex?: number): DisplayObject | DisplayObject[]; + updateTransform(): void; + calculateBounds(): void; + protected _calculateBounds(): void; + protected containerUpdateTransform(): void; + renderWebGL(renderer: WebGLRenderer): void; + renderAdvancedWebGL(renderer: WebGLRenderer): void; + protected _renderWebGL(renderer: WebGLRenderer): void; + protected _renderCanvas(renderer: CanvasRenderer): void; + renderCanvas(renderer: CanvasRenderer): void; + destroy(options?: IDestroyOptions | boolean): void; + + once(event: "added", fn: (displayObject: DisplayObject) => void, context?: any): utils.EventEmitter; + once(event: "removed", fn: (DisplayObject: DisplayObject) => void, context?: any): utils.EventEmitter; + once(event: string, fn: Function, context?: any): utils.EventEmitter; + on(event: "added", fn: (displayObject: DisplayObject) => void, context?: any): utils.EventEmitter; + on(event: "removed", fn: (DisplayObject: DisplayObject) => void, context?: any): utils.EventEmitter; + on(event: string, fn: Function, context?: any): utils.EventEmitter; + off(event: string, fn: Function, context?: any): utils.EventEmitter; + + } + export class DisplayObject extends utils.EventEmitter implements interaction.InteractiveTarget { + + // begin extras.cacheAsBitmap + protected _cacheAsBitmap: boolean; + protected _cacheData: boolean; + cacheAsBitmap: boolean; + protected _renderCachedWebGL(renderer: WebGLRenderer): void; + protected _initCachedDisplayObject(renderer: WebGLRenderer): void; + protected _renderCachedCanvas(renderer: CanvasRenderer): void; + protected _initCachedDisplayObjectCanvas(renderer: CanvasRenderer): void; + protected _calculateCachedBounds(): Rectangle; + protected _getCachedLocalBounds(): Rectangle; + protected _destroyCachedDisplayObject(): void; + protected _cacheAsBitmapDestroy(): void; + // end extras.cacheAsBitmap + + // begin extras.getChildByName + name: string; + // end extras.getChildByName + + // begin extras.getGlobalPosition + getGlobalPosition(point?: Point, skipUpdate?: boolean): Point; + // end extras.getGlobalPosition + + // begin accessible target + accessible: boolean; + accessibleTitle: string; + accessibleHint: string; + tabIndex: number; + // end accessible target + + // begin interactive target + interactive: boolean; + buttonMode: boolean; + hitArea: IHitArea; + interactiveChildren: boolean; + defaultCursor: string; + _isRightDown: boolean; + _isLeftDown: boolean; + // end interactive target + + transform: TransformBase; + alpha: number; + visible: boolean; + renderable: boolean; + parent: Container; + worldAlpha: number; + filterArea: Rectangle; + protected _filters: Filter[]; + protected _enabledFilters: Filter[]; + protected _bounds: Bounds; + protected _boundsID: number; + protected _lastBoundsID: number; + protected _boundsRect: Rectangle; + protected _localBoundsRect: Rectangle; + protected _mask: Rectangle; + x: number; + y: number; + worldTransform: Matrix; + localTransform: Matrix; + position: Point; + scale: Point; + pivot: Point; + skew: Point; + rotation: number; + worldVisible: boolean; + mask: PIXI.Graphics | PIXI.Sprite; + filters: Filter[]; + + updateTransform(): void; + protected displayObjectUpdateTransform(): void; + protected _recursivePostUpdateTransform(): void; + getBounds(skipUpdate?: boolean, rect?: Rectangle): Rectangle; + getLocalBounds(rect?: Rectangle): Rectangle; + toGlobal(position: Point, point?: Point, skipUpdate?: boolean): Point; + toLocal(position: Point, from?: DisplayObject, point?: Point, skipUpdate?: boolean): Point; + protected renderWebGL(renderer: WebGLRenderer): void; + protected renderCanvas(renderer: CanvasRenderer): void; + setParent(container: Container): Container; + setTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, pivotX?: number, pivotY?: number): DisplayObject; + destroy(): void; + + on(event: string, fn: Function, context?: any): utils.EventEmitter; + once(event: string, fn: Function, context?: any): utils.EventEmitter; + off(event: string, fn: Function, context?: any): utils.EventEmitter; + + /* + on(event: 'click', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'mousedown', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'mouseout', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'mouseover', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'mouseup', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'mouseclick', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'mouseupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'rightclick', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'rightdown', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'rightup', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'rightupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'tap', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'touchend', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'touchendoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'touchmove', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + on(event: 'touchstart', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + + once(event: 'click', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'mousedown', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'mouseout', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'mouseover', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'mouseup', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'mouseclick', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'mouseupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'rightclick', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'rightdown', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'rightup', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'rightupoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'tap', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'touchend', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'touchendoutside', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'touchmove', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + once(event: 'touchstart', fn: (event: interaction.InteractionEvent) => void, context?: any): utils.EventEmitter; + */ + + } + + export class TransformBase { + + static IDENTITY: TransformBase; + + worldTransform: Matrix; + localTransform: Matrix; + protected _worldID: number; + updateLocalTransform(): void; + updateTransform(parentTransform: TransformBase): void; + updateWorldTransform(parentTransform: TransformBase): void; + + } + export class TransformStatic extends TransformBase { + + position: ObservablePoint; + scale: ObservablePoint; + pivot: ObservablePoint; + skew: ObservablePoint; + + protected _rotation: number; + protected _sr: number; + protected _cr: number; + protected _cy: number; + protected _sy: number; + protected _nsx: number; + protected _cx: number; + protected _currentLocalID: number; + + protected onChange(): void; + updateSkew(): void; + updateLocalTransform(): void; + updateTransform(parentTransform: TransformBase): void; + setFromMatrix(matrix: Matrix): void; + + rotation: number; + + } + export class Transform extends TransformBase { + + constructor(); + + position: Point; + scale: Point; + skew: ObservablePoint; + pivot: Point; + + protected _rotation: number; + protected _sr: number; + protected _cr: number; + protected _cy: number; + protected _sy: number; + protected _nsx: number; + protected _cx: number; + + updateSkew(): void; + setFromMatrix(matrix: Matrix): void; + + rotation: number; + + } + + // graphics + + export class GraphicsData { + + constructor(lineWidth: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number, fill: boolean, shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon); + + lineWidth: number; + lineColor: number; + lineAlpha: number; + protected _lineTint: number; + fillColor: number; + fillAlpha: number; + protected _fillTint: number; + fill: boolean; + protected holes: IShape[]; + shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon; + type: number; + clone(): GraphicsData; + addHole(shape: IShape | Circle | Rectangle | RoundedRectangle | Ellipse | Polygon): void; + destroy(options?: IDestroyOptions | boolean): void; + + } + export class Graphics extends Container { + + fillAlpha: number; + lineWidth: number; + lineColor: number; + protected graphicsData: GraphicsData[]; + tint: number; + protected _prevTint: number; + blendMode: number; + currentPath: GraphicsData; + protected _webGL: any; + isMask: boolean; + boundsPadding: number; + protected _localBounds: Bounds; + dirty: boolean; + fastRectDirty: number; + clearDirty: number; + boundsDirty: number; + protected cachedSpriteDirty: boolean; + protected _spriteRect: Rectangle; + protected _fastRect: boolean; + + static _SPRITE_TEXTURE: Texture; + + clone(): Graphics; + lineStyle(lineWidth?: number, color?: number, alpha?: number): Graphics; + moveTo(x: number, y: number): Graphics; + lineTo(x: number, y: number): Graphics; + quadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): Graphics; + bezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): Graphics; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): Graphics; + arc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): Graphics; + beginFill(color: number, alpha?: number): Graphics; + endFill(): Graphics; + drawRect(x: number, y: number, width: number, height: number): Graphics; + drawRoundedRect(x: number, y: number, width: number, height: number, radius: number): Graphics; + drawCircle(x: number, y: number, radius: number): Graphics; + drawEllipse(x: number, y: number, width: number, height: number): Graphics; + drawPolygon(path: number[] | Point[]): Graphics; + clear(): Graphics; + isFastRect(): boolean; + protected _renderCanvas(renderer: CanvasRenderer): void; + protected _calculateBounds(): Rectangle; + protected _renderSpriteRect(renderer: PIXI.SystemRenderer): void; + containsPoint(point: Point): boolean; + updateLocalBounds(): void; + drawShape(shape: IShape | Circle | Rectangle | Ellipse | Polygon | RoundedRectangle): GraphicsData; + generateCanvasTexture(scaleMode?: number, resolution?: number): Texture; + protected closePath(): Graphics; + protected addHole(): Graphics; + destroy(options?: IDestroyOptions | boolean): void; + + } + export class CanvasGraphicsRenderer { + + constructor(renderer: SystemRenderer); + render(graphics: Graphics): void; + protected updateGraphicsTint(graphics: Graphics): void; + protected renderPolygon(points: Point[], close: boolean, context: CanvasRenderingContext2D): void; + destroy(): void; + + } + export class GraphicsRenderer extends ObjectRenderer { + + constructor(renderer: PIXI.CanvasRenderer); + + protected graphicsDataPool: GraphicsData[]; + protected primitiveShader: PrimitiveShader; + gl: WebGLRenderingContext; + + CONTEXT_UID: number; + + onContextChange(): void; + destroy(): void; + render(graphics: Graphics): void; + protected updateGraphics(graphics: PIXI.Graphics): void; + getWebGLData(webGL: WebGLRenderingContext, type: number): WebGLGraphicsData; + + } + export class WebGLGraphicsData { + + constructor(gl: WebGLRenderingContext, shader: glCore.GLShader, attribsState: glCore.IAttribState); + + gl: WebGLRenderingContext; + color: number[]; + points: Point[]; + indices: number[]; + buffer: WebGLBuffer; + indexBuffer: WebGLBuffer; + dirty: boolean; + glPoints: number[]; + glIndices: number[]; + shader: glCore.GLShader; + vao: glCore.VertexArrayObject; + + reset(): void; + upload(): void; + destroy(): void; + + } + export class PrimitiveShader extends glCore.GLShader { } + + // math + + export namespace GroupD8 { + + export var E: number; + export var SE: number; + export var S: number; + export var SW: number; + export var W: number; + export var NW: number; + export var N: number; + export var NE: number; + export var MIRROR_HORIZONTAL: number; + export var MIRROR_VERTICAL: number; + + export function uX(ind: number): number; + export function uY(ind: number): number; + export function vX(ind: number): number; + export function vY(ind: number): number; + export function inv(rotation: number): number; + export function add(rotationSecond: number, rotationFirst: number): number; + export function sub(rotationSecond: number, rotationFirst: number): number; + export function rotate180(rotation: number): number; + export function isSwapWidthHeight(rotation: number): boolean; + export function byDirection(dx: number, dy: number): number; + export function matrixAppendRotationInv(matrix: Matrix, rotation: number, tx: number, ty: number): void; + + } + export class Matrix { + + a: number; + b: number; + c: number; + d: number; + tx: number; + ty: number; + + fromArray(array: number[]): void; + set(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix; + toArray(transpose?: boolean, out?: number[]): number[]; + apply(pos: Point, newPos?: Point): Point; + applyInverse(pos: Point, newPos?: Point): Point; + translate(x: number, y: number): Matrix; + scale(x: number, y: number): Matrix; + rotate(angle: number): Matrix; + append(matrix: Matrix): Matrix; + setTransform(x: number, y: number, pivotX: number, pivotY: number, scaleX: number, scaleY: number, rotation: number, skewX: number, skewY: number): PIXI.Matrix; + prepend(matrix: Matrix): Matrix; + invert(): Matrix; + identity(): Matrix; + decompose(transform: TransformBase): TransformBase; + clone(): Matrix; + copy(matrix: Matrix): Matrix; + + static IDENTITY: Matrix; + static TEMP_MATRIX: Matrix; + + } + export class ObservablePoint { + + constructor(cb: Function, scope?: any, x?: number, y?: number); + + x: number; + y: number; + cb: () => void; + scope: any; + + set(x?: number, y?: number): void; + copy(point: Point | ObservablePoint): void; + + } + export class Point { + + constructor(x?: number, y?: number); + + x: number; + y: number; + + clone(): Point; + copy(p: Point): void; + equals(p: Point): boolean; + set(x?: number, y?: number): void; + + } + + export interface IShape { + } + export interface IHitArea extends IShape { + + contains(x: number, y: number): boolean; + + } + export class Circle { + + constructor(x?: number, y?: number, radius?: number); + + x: number; + y: number; + radius: number; + type: number; + + clone(): Circle; + contains(x: number, y: number): boolean; + getBounds(): Rectangle; + + } + export class Ellipse { + + constructor(x?: number, y?: number, width?: number, height?: number); + + x: number; + y: number; + width: number; + height: number; + type: number; + + clone(): Ellipse; + contains(x: number, y: number): boolean; + getBounds(): Rectangle; + + } + export class Polygon { + + constructor(points: Point[] | number[]); + constructor(...points: Point[]); + constructor(...points: number[]); + + closed: boolean; + points: number[]; + type: number; + + clone(): Polygon; + contains(x: number, y: number): boolean; + close(): void; + + } + export class Rectangle { + + constructor(x?: number, y?: number, width?: number, height?: number); + + x: number; + y: number; + width: number; + height: number; + type: number; + left: number; + right: number; + top: number; + bottom: number; + + static EMPTY: Rectangle; + + clone(): Rectangle; + copy(rectangle: Rectangle): Rectangle; + contains(x: number, y: number): boolean; + pad(paddingX: number, paddingY: number): void; + fit(rectangle: Rectangle): void; + enlarge(rect: Rectangle): void; + + } + export class RoundedRectangle { + + constructor(x?: number, y?: number, width?: number, height?: number, radius?: number); + + x: number; + y: number; + width: number; + height: number; + radius: number; + type: number; + + clone(): RoundedRectangle; + contains(x: number, y: number): boolean; + + } + + // renderers + + export interface IRendererOptions { + + view?: HTMLCanvasElement; + transparent?: boolean; + autoResize?: boolean; + antialias?: boolean; + resolution?: number; + clearBeforeRender?: boolean; + backgroundColor?: number; + roundPixels?: boolean; + context?: WebGLRenderingContext; + + } + export class SystemRenderer extends utils.EventEmitter { + + constructor(system: string, width?: number, height?: number, options?: IRendererOptions); + + type: number; + width: number; + height: number; + view: HTMLCanvasElement; + resolution: number; + transparent: boolean; + autoResize: boolean; + blendModes: any; // todo? + preserveDrawingBuffer: boolean; + clearBeforeRender: boolean; + roundPixels: boolean; + protected _backgroundColor: number; + protected _backgroundColorRgba: number[]; + protected _backgroundColorString: string; + protected _tempDisplayObjectParent: Container; + protected _lastObjectRendered: DisplayObject; + backgroundColor: number; + + resize(width: number, height: number): void; + generateTexture(displayObject: DisplayObject, scaleMode?: number, resolution?: number): RenderTexture; + render(...args: any[]): void; + destroy(removeView?: boolean): void; + + } + export class CanvasRenderer extends SystemRenderer { + + // plugintarget mixin start + protected __plugins: any[]; + plugins: any; + registerPlugin(pluginName: string, ctor: Function): void; + initPlugins(): void; + destroyPlugins(): void; + // plugintarget mixin end + + constructor(width?: number, height?: number, options?: IRendererOptions); + + rootContext: CanvasRenderingContext2D; + rootResolution: number; + refresh: boolean; + maskManager: CanvasMaskManager; + smoothProperty: string; + + render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Transform, skipUpdateTransform?: boolean): void + setBlendMode(blendMode: number): void; + destroy(removeView?: boolean): void; + resize(w: number, h: number): void; + + on(event: "prerender", fn: () => void, context?: any): utils.EventEmitter; + on(event: "postrender", fn: () => void, context?: any): utils.EventEmitter; + on(event: string, fn: Function, context?: any): utils.EventEmitter; + once(event: "prerender", fn: () => void, context?: any): utils.EventEmitter; + once(event: "postrender", fn: () => void, context?: any): utils.EventEmitter; + once(event: string, fn: Function, context?: any): utils.EventEmitter; + off(event: string, fn: Function, context?: any): utils.EventEmitter; + + } + export class CanvasMaskManager { + + constructor(renderer: CanvasRenderer); + + pushMask(maskData: any): void; + protected renderGraphicsShape(graphics: Graphics): void; + popMask(renderer: WebGLRenderer | CanvasRenderer): void; + destroy(): void; + + } + export class CanvasRenderTarget { + + constructor(width: number, height: number, resolution: number); + + canvas: HTMLCanvasElement; + context: CanvasRenderingContext2D; + resolution: number; + + width: number; + height: number; + + clear(): void; + resize(width: number, height: number): void; + destroy(): void; + + } + + export interface IWebGLRendererOptions { + + view?: HTMLCanvasElement; + transparent?: boolean; + autoResize?: boolean; + antialias?: boolean; + forceFXAA?: boolean; + resolution?: number; + clearBeforeRender?: boolean; + preserveDrawingBuffer?: boolean; + roundPixels?: boolean; + + } + export class WebGLRenderer extends SystemRenderer { + + // plugintarget mixin start + protected __plugins: any[]; + plugins: any; + registerPlugin(pluginName: string, ctor: Function): void; + initPlugins(): void; + destroyPlugins(): void; + // plugintarget mixin end + + constructor(width?: number, height?: number, options?: IWebGLRendererOptions); + + protected _contextOptions: { + alpha: boolean; + antiAlias: boolean; + premultipliedAlpha: boolean; + stencil: boolean; + preseveDrawingBuffer: boolean; + }; + protected _bakcgroundColorRgba: number[]; + maskManager: MaskManager; + stencilManager: StencilManager; + emptyRenderer: ObjectRenderer; + currentRenderer: ObjectRenderer; + gl: WebGLRenderingContext; + state: WebGLState; + renderingToScreen: boolean; + filterManager: FilterManager; + textureManager: TextureManager; + protected drawModes: any; + protected _activeShader: glCore.GLShader; + protected _activeRenderTarget: RenderTarget; + protected _activeTextureLocation: number; + protected _activeTexture: Texture; + protected _initContext(): void; + + render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Transform, skipUpdateTransform?: boolean): void + setObjectRenderer(objectRenderer: ObjectRenderer): void; + flush(): void; + resize(width: number, height: number): void; + setBlendMode(blendMode: number): void; + clear(clearColor?: number): void; + setTransform(matrix: Matrix): void; + bindRenderTexture(renderTexture: RenderTexture, transform: Transform): WebGLRenderer; + bindRenderTarget(renderTarget: RenderTarget): WebGLRenderer; + bindShader(shader: glCore.GLShader): WebGLRenderer; + bindTexture(texture: Texture, location: number): WebGLRenderer; + protected createVao(): glCore.VertexArrayObject; + reset(): WebGLRenderer; + handleContextLost(event: WebGLContextEvent): void; + handleContextRestored(): void; + destroy(removeView?: boolean): void; + + on(event: "context", fn: (gl: WebGLRenderingContext) => void, context?: any): utils.EventEmitter; + on(event: "prerender", fn: () => void, context?: any): utils.EventEmitter; + on(event: "postrender", fn: () => void, context?: any): utils.EventEmitter; + on(event: string, fn: Function, context?: any): utils.EventEmitter; + once(event: "context", fn: (gl: WebGLRenderingContext) => void, context?: any): utils.EventEmitter; + once(event: "prerender", fn: () => void, context?: any): utils.EventEmitter; + once(event: "postrender", fn: () => void, context?: any): utils.EventEmitter; + once(event: string, fn: Function, context?: any): utils.EventEmitter; + off(event: string, fn: Function, context?: any): utils.EventEmitter; + + } + export class WebGLState { + + constructor(gl: WebGLRenderingContext); + + activeState: number[]; + defaultState: number[]; + stackIndex: number; + stack: number[]; + gl: WebGLRenderingContext; + maxAttribs: number; + attribState: glCore.IAttribState; + nativeVaoExtension: any; + + push(): void; + pop(): void; + setState(state: number[]): void; + setBlend(value: number): void; + setBlendMode(value: number): void; + setDepthTest(value: number): void; + setCullFace(value: number): void; + setFrontFace(value: number): void; + resetAttributes(): void; + resetToDefault(): void; + + } + export class TextureManager { + + constructor(renderer: WebGLRenderer); + + renderer: WebGLRenderer; + gl: WebGLRenderingContext; + protected _managedTextures: WebGLTexture[]; + + bindTexture(): void; + getTexture(): WebGLTexture; + updateTexture(texture: BaseTexture | Texture): WebGLTexture; + destroyTexture(texture: BaseTexture, _skipRemove?: boolean): void; + removeAll(): void; + destroy(): void; + + } + export class TextureGarbageCollector { + + constructor(renderer: WebGLRenderer); + + renderer: WebGLRenderer; + count: number; + checkCount: number; + maxIdle: number; + checkCountMax: number; + mode: number; + + update(): void; + run(): void; + unload(): void; + + } + export abstract class ObjectRenderer extends WebGLManager { + + constructor(renderer: WebGLRenderer); + + start(): void; + stop(): void; + flush(): void; + + render(...args: any[]): void; + + } + export class Quad { + + constructor(gl: WebGLRenderingContext); + + gl: WebGLRenderingContext; + vertices: number[]; + uvs: number[]; + interleaved: number[]; + indices: number[]; + vertexBuffer: WebGLBuffer; + vao: glCore.VertexArrayObject; + initVao(shader: glCore.GLShader): void; + map(targetTextureFrame: Rectangle, destinationFrame: Rectangle): Quad; + draw(): Quad; + upload(): Quad; + destroy(): void; + + } + export class RenderTarget { + + constructor(gl: WebGLRenderingContext, width: number, height: number, scaleMode: number, resolution: number, root?: boolean); + + gl: WebGLRenderingContext; + frameBuffer: glCore.GLFramebuffer; + texture: Texture; + clearColor: number[]; + size: Rectangle; + resolution: number; + projectionMatrix: Matrix; + transform: Matrix; + frame: Rectangle; + defaultFrame: Rectangle; + destinationFrame: Rectangle; + sourceFrame: Rectangle; + stencilBuffer: glCore.GLFramebuffer; + stencilMaskStack: Graphics[]; + filterData: { + index: number, + stack: { + renderTarget: RenderTarget, + filter: any[]; + bounds: Rectangle + }[] + }; + scaleMode: number; + root: boolean; + + clear(clearColor?: number[]): void; + attachStencilBuffer(): void; + setFrame(destinationFrame: Rectangle, sourceFrame: Rectangle): void; + activate(): void; + calculateProjection(destinationFrame: Rectangle, sourceFrame: Rectangle): void; + resize(width: number, height: number): void; + destroy(): void; + + } + + export class BlendModeManager extends WebGLManager { + + constructor(renderer: WebGLRenderer); + + currentBlendMode: number; + + setBlendMode(blendMode: number): boolean; + + } + export class FilterManager extends WebGLManager { + + constructor(renderer: WebGLRenderer); + + gl: WebGLRenderingContext; + quad: Quad; + stack: { + renderTarget: RenderTarget; + sourceFrame: Rectangle; + destinationFrame: Rectangle; + filters: Filter[]; + target: any; + resolution: number; + }[]; + stackIndex: number; + shaderCache: any; + filterData: any; + + pushFilter(target: RenderTarget, filters: Filter[]): void; + popFilter(): void; + applyFilter(shader: glCore.GLShader | Filter, inputTarget: RenderTarget, outputTarget: RenderTarget, clear?: boolean): void; + syncUniforms(shader: glCore.GLShader, filter: Filter): void; + getRenderTarget(clear?: boolean, resolution?: number): RenderTarget; + returnRenderTarget(renderTarget: RenderTarget): RenderTarget; + calculateScreenSpaceMatrix(outputMatrix: Matrix): Matrix; + calculateNormalisedScreenSpaceMatrix(outputMatrix: Matrix): Matrix; + calculateSpriteMatrix(outputMatrix: Matrix, sprite: Sprite): Matrix; + destroy(): void; + emptyPool(): void; + getPotRenderTarget(gl: WebGLRenderingContext, minWidth: number, minHeight: number, resolution: number): RenderTarget; + freePotRenderTarget(renderTarget: RenderTarget): void; + + } + export class StencilMaskStack { + + stencilStack: any[]; + reverse: boolean; + count: number; + + } + export class MaskManager extends WebGLManager { + + scissor: boolean; + scissorData: any; + scissorRenderTarget: RenderTarget; + enableScissor: boolean; + alphaMaskPool: number[]; + alphaMaskIndex: number; + pushMask(target: RenderTarget, maskData: Sprite | Graphics): void; + popMask(target: RenderTarget, maskData: Sprite | Graphics): void; + pushSpriteMask(target: RenderTarget, maskData: Sprite | Graphics): void; + popSpriteMask(): void; + pushStencilMask(maskData: Sprite | Graphics): void; + popStencilMask(): void; + pushScissorMask(target: RenderTarget, maskData: Sprite | Graphics): void; + popScissorMask(): void; + + } + export class StencilManager extends WebGLManager { + + constructor(renderer: WebGLRenderer); + + stencilMaskStack: Graphics[]; + + setMaskStack(stencilMasStack: Graphics[]): void; + pushStencil(graphics: Graphics): void; + popStencil(): void; + destroy(): void; + + } + export class WebGLManager { + + constructor(renderer: WebGLRenderer); + + renderer: WebGLRenderer; + onContextChange(): void; + destroy(): void; + + } + export interface IUniformData { + + type: string; + value: any; + + // name is set by pixi if uniforms were automatically extracted from shader code, but not used anywhere + name?: string; + + } + export class Filter { + + // param uniforms should be an object matching type {[name: string]: IUniformData}; + // left untyped as there's no way to define the type without requiring an index signature or making this class generic + constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: any); + + vertextSrc: string; + fragmentSrc: string; + protected uniformData: {[name: string]: IUniformData}; + uniforms: {[name: string]: any}; + glShaders: any; + glShaderKey: string; + padding: number; + resolution: number; + blendMode: number; + enabled: boolean; + apply(filterManager: FilterManager, input: RenderTarget, output: RenderTarget, clear?: boolean): void; + + static defaultVertexSrc: string; + static defaultFragmentSrc: string; + + } + export class SpriteMaskFilter extends Filter { + + constructor(sprite: Sprite); + + maskSprite: Sprite; + maskMatrix: Matrix; + apply(filterManager: FilterManager, input: RenderTarget, output: RenderTarget): void; + + } + + // sprites + + export class Sprite extends Container { + + constructor(texture?: Texture); + + protected _anchor: ObservablePoint; + anchor: ObservablePoint; + protected _texture: Texture; + protected _width: number; + protected _height: number; + tint: number; + protected _tint: number; + protected _tintRGB: number; + blendMode: number; + shader: glCore.GLShader | Filter; + protected cachedTint: number; + texture: Texture; + protected textureDirty: boolean; + protected _textureID: number; + protected _transformID: number; + protected vertexTrimmedData: Float32Array; + vertexData: Float32Array; + width: number; + height: number; + + protected _onTextureUpdate(): void; + calculateVertices(): void; + protected _calculateBounds(): void; + protected calculateTrimmedVertices(): void; + protected onAnchorUpdate(): void; + protected _renderWebGL(renderer: WebGLRenderer): void; + protected _renderCanvas(renderer: CanvasRenderer): void; + getLocalBounds(): Rectangle; + containsPoint(point: Point): boolean; + destroy(options?: IDestroyOptions | boolean): void; + + static from(source: number | string | BaseTexture | HTMLCanvasElement | HTMLVideoElement): Sprite; + static fromFrame(frameId: string): Sprite; + static fromImage(imageId: string, crossorigin?: boolean, scaleMode?: number): Sprite; + + } + export class BatchBuffer { + + vertices: ArrayBuffer; + float32View: number[]; + uint32View: number[]; + + destroy(): void; + + } + export class SpriteRenderer extends ObjectRenderer { + + constructor(renderer: PIXI.WebGLRenderer); + + vertSize: number; + vertByteSize: number; + size: number; + buffers: BatchBuffer[]; + indices: number[]; + shaders: glCore.GLShader[]; + textureCount: number; + currentIndex: number; + tick: number; + groups: any[]; + sprites: Sprite[]; + vertexBuffers: number[]; + vaos: glCore.VertexArrayObject[]; + vaoMax: number; + vertexCount: number; + + protected onContextChanged(): void; + protected onPrerender(): void; + render(sprite: Sprite): void; + flush(): void; + start(): void; + stop(): void; + destroy(): void; + + } + export class CanvasSpriteRenderer extends ObjectRenderer { + + constructor(renderer: WebGLRenderer); + + render(sprite: Sprite): void; + destroy(): void; + + } + export namespace CanvasTinter { + + export function getTintedTexture(sprite: Sprite, color: number): HTMLCanvasElement; + export function tintWithMultiply(texture: Texture, color: number, canvas: HTMLCanvasElement): void; + export function tintWithOverlay(texture: Texture, color: number, canvas: HTMLCanvasElement): void; + export function tintWithPerPixel(texture: Texture, color: number, canvas: HTMLCanvasElement): void; + export function roundColor(color: number): number; + + export var cacheStepsPerColorChannel: number; + export var convertTintToImage: boolean; + export var canUseMultiply: boolean; + export var tintMethod: Function; + + } + + // text + + // todo: This is actually a class, but as of TypeScript 1, classes cannot have optional properties, which are needed here. + // however, in TypeScript 2, optional class properties are supported (https://github.com/Microsoft/TypeScript/pull/8625). + // so when TypeScript 2 becomes the norm, change this to a class + export interface ITextStyle { + + align?: string; + breakWords?: boolean; + dropShadow?: boolean; + dropShadowAngle?: number; + dropShadowBlur?: number; + dropShadowColor?: string | number; + dropShadowDistance?: number; + fill?: string | string[] | number | number[] | CanvasGradient | CanvasPattern; + fillGradientType?: number; + fontFamily?: string; + fontSize?: number | string; + fontStyle?: string; + fontVariant?: string; + fontWeight?: string; + letterSpacing?: number; + lineHeight?: number; + lineJoin?: string; + miterLimit?: number; + padding?: number; + stroke?: string | number; + strokeThickness?: number; + styleID?: number; + textBaseline?: string; + wordWrap?: boolean; + wordWrapWidth?: number; + + } + export class Text extends Sprite { + + constructor(text?: string, style?: ITextStyle); + + canvas: HTMLCanvasElement; + context: CanvasRenderingContext2D; + resolution: number; + protected _text: string; + protected _style: ITextStyle; + protected _styleListener: Function; + protected _font: string; + protected localStyleID: number; + + static fontPropertiesCache: any; + static fontPropertiesCanvas: HTMLCanvasElement; + static fontPropertiesContext: CanvasRenderingContext2D; + + width: number; + height: number; + style: ITextStyle; + text: string; + + protected updateText(respectDirty?: boolean): void; + protected drawLetterSpacing(text: string, x: number, y: number, isStroke?: boolean): void; + protected updateTexture(): void; + protected _renderWebGL(renderer: WebGLRenderer): void; + protected _renderCanvas(renderer: CanvasRenderer): void; + protected determineFontProperties(fontStyle: ITextStyle): ITextStyle; + protected wordWrap(text: string): string; + protected _calculateBounds(): void; + protected _onStyleChange: () => void; + protected _generateFillStyle(style: string | number | CanvasGradient, lines: number): string | number | CanvasGradient; + destroy(options?: IDestroyOptions | boolean): void; + dirty: boolean; + + } + + // textures + + export class BaseRenderTexture extends BaseTexture { + + constructor(width?: number, height?: number, scaleMode?: number, resolution?: number); + + height: number; + width: number; + realHeight: number; + realWidth: number; + resolution: number; + scaleMode: number; + hasLoaded: boolean; + protected _glRenderTargets: { [n: number]: WebGLTexture; }; + protected _canvasRenderTarget: { [n: number]: WebGLTexture; }; + valid: boolean; + + resize(width: number, height: number): void; + destroy(): void; + + once(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): utils.EventEmitter; + once(event: string, fn: Function, context?: any): utils.EventEmitter; + on(event: "update", fn: (baseRenderTexture: BaseRenderTexture) => void, context?: any): utils.EventEmitter; + on(event: string, fn: Function, context?: any): utils.EventEmitter; + off(event: string, fn: Function, context?: any): utils.EventEmitter; + + } + export class BaseTexture extends utils.EventEmitter { + + constructor(source?: HTMLImageElement | HTMLCanvasElement, scaleMode?: number, resolution?: number); + + protected uuid: number; + protected touched: number; + resolution: number; + width: number; + height: number; + realWidth: number; + realHeight: number; + scaleMode: number; + hasLoaded: boolean; + isLoading: boolean; + wrapMode: number; + source: HTMLImageElement | HTMLCanvasElement; + origSource: HTMLImageElement; + imageType: string; + sourceScale: number; + premultipliedAlpha: boolean; + imageUrl: string; + protected isPowerOfTwo: boolean; + mipmap: boolean; + wrap: boolean; + protected _glTextures: any; + protected _enabled: number; + protected _id: number; + + update(): void; + protected _updateImageType(): void; + protected _loadSvgSource(): void; + protected _loadSvgSourceUsingDataUri(dataUri: string): void; + protected _loadSvgSourceUsingXhr(): void; + protected _loadSvgSourceUsingString(svgString: string): void; + loadSource(source: HTMLImageElement | HTMLCanvasElement): void; + protected _sourceLoaded(): void; + destroy(): void; + dispose(): void; + updateSourceImage(newSrc: string): void; + + static fromImage(imageUrl: string, crossorigin?: boolean, scaleMode?: number, sourceScale?: number): BaseTexture; + static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): BaseTexture; + + on(event: "update", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; + on(event: "loaded", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; + on(event: "error", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; + on(event: "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; + on(event: string, fn: Function, context?: any): utils.EventEmitter; + once(event: "update", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; + once(event: "loaded", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; + once(event: "error", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; + once(event: "dispose", fn: (baseTexture: BaseTexture) => void, context?: any): utils.EventEmitter; + once(event: string, fn: Function, context?: any): utils.EventEmitter; + off(event: string, fn: Function, context?: any): utils.EventEmitter; + + } + export class RenderTexture extends Texture { + + constructor(baseRenderTexture: BaseRenderTexture, frame?: Rectangle); + + protected legacyRenderer: any; + valid: boolean; + + resize(width: number, height: number, doNotResizeBaseTexture?: boolean): void; + + static create(width?: number, height?: number, scaleMode?: number, resolution?: number): RenderTexture; + + } + export class Texture extends utils.EventEmitter { + + constructor(baseTexture: BaseTexture, frame?: Rectangle, orig?: Rectangle, trim?: Rectangle, rotate?: number); + + noFrame: boolean; + baseTexture: BaseTexture; + protected _frame: Rectangle; + trim: Rectangle; + valid: boolean; + requiresUpdate: boolean; + protected _uvs: TextureUvs; + orig: Rectangle; + protected _updateID: number; + transform: any; + + update(): void; + protected onBaseTextureLoaded(baseTexture: BaseTexture): void; + protected onBaseTextureUpdated(baseTexture: BaseTexture): void; + destroy(destroyBase?: boolean): void; + clone(): Texture; + protected _updateUvs(): void; + + static fromImage(imageUrl: string, crossOrigin?: boolean, scaleMode?: number, sourceScale?: number): Texture; + static fromFrame(frameId: string): Texture; + static fromCanvas(canvas: HTMLCanvasElement, scaleMode?: number): Texture; + static fromVideo(video: HTMLVideoElement | string, scaleMode?: number): Texture; + static fromVideoUrl(videoUrl: string, scaleMode?: number): Texture; + static from(source: number | string | BaseTexture | HTMLCanvasElement | HTMLVideoElement): Texture; + static addTextureToCache(texture: Texture, id: string): void; + static removeTextureFromCache(id: string): Texture; + + frame: Rectangle; + protected _rotate: boolean; + rotate: number; + width: number; + height: number; + + static EMPTY: Texture; + + on(event: "update", fn: (texture: Texture) => void, context?: any): utils.EventEmitter; + on(event: string, fn: Function, context?: any): utils.EventEmitter; + once(event: "update", fn: (texture: Texture) => void, context?: any): utils.EventEmitter; + once(event: string, fn: Function, context?: any): utils.EventEmitter; + off(event: string, fn: Function, context?: any): utils.EventEmitter; + + } + export class TextureUvs { + + x0: number; + y0: number; + x1: number; + y1: number; + x2: number; + y2: number; + x3: number; + y3: number; + + uvsUint32: Uint32Array; + + protected set(frame: Rectangle, baseFrame: Rectangle, rotate: number): void; + + } + export class VideoBaseTexture extends BaseTexture { + + constructor(source: HTMLVideoElement, scaleMode?: number); + + autoUpdate: boolean; + autoPlay: boolean; + protected _isAutoUpdating: boolean; + + update(): void; + protected _onCanPlay(): void; + protected _onPlayStart(): void; + protected _onPlayStop(): void; + destroy(): void; + protected _isSourcePlaying(): boolean; + protected _isSourceReady(): boolean; + + static fromVideo(video: HTMLVideoElement, scaleMode?: number): VideoBaseTexture; + static fromUrl(videoSrc: string | any | string[] | any[]): VideoBaseTexture; + static fromUrls(videoSrc: string | any | string[] | any[]): VideoBaseTexture; + + } + + // ticker + + namespace ticker { + + export var shared: Ticker; + + export class Ticker { + + protected _tick(time: number): void; + protected _emitter: utils.EventEmitter; + protected _requestId: number; + protected _maxElapsedMS: number; + + protected _requestIfNeeded(): void; + protected _cancelIfNeeded(): void; + protected _startIfPossible(): void; + + autoStart: boolean; + deltaTime: number; + elapsedMS: number; + lastTime: number; + speed: number; + started: boolean; + + FPS: number; + minFPS: number; + + add(fn: (deltaTime: number) => void, context?: any): Ticker; + addOnce(fn: (deltaTime: number) => void, context?: any): Ticker; + remove(fn: (deltaTime: number) => void, context?: any): Ticker; + start(): void; + stop(): void; + update(): void; + + } + + } + + // shader + + export class Shader extends glCore.GLShader { } + + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////EXTRACT/////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + export namespace extract { + + export class CanvasExtract { + + protected renderer: CanvasRenderer; + + constructor(renderer: CanvasRenderer); + + image(target?: DisplayObject | RenderTexture): HTMLImageElement; + base64(target?: DisplayObject | RenderTexture): string; + canvas(target?: DisplayObject | RenderTexture): HTMLCanvasElement; + pixels(renderTexture?: DisplayObject | RenderTexture): number[]; + + destroy(): void; + + } + export class WebGLExtract { + protected renderer: CanvasRenderer; + + constructor(renderer: CanvasRenderer); + + image(target?: DisplayObject | RenderTexture): HTMLImageElement; + base64(target?: DisplayObject | RenderTexture): string; + canvas(target?: DisplayObject | RenderTexture): HTMLCanvasElement; + pixels(renderTexture?: DisplayObject | RenderTexture): number[]; + + destroy(): void; + } + + } + + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////EXTRAS//////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + export namespace extras { + + export interface IBitmapTextStyle { + + font?: string | { + + name?: string; + size?: number; + + }; + align?: string; + tint?: number; + + } + export class BitmapText extends Container { + + constructor(text: string, style?: IBitmapTextStyle); + + textWidth: number; + textHeight: number; + protected _glyphs: Sprite[]; + protected _font: string | { + name?: string; + size?: number; + }; + font: string | { + name?: string; + size?: number; + }; + protected _text: string; + maxWidth: number; + maxLineHeight: number; + dirty: boolean; + tint: number; + align: string; + text: string; + + protected updateText(): void; + updateTransform(): void; + getLocalBounds(): Rectangle; + validate(): void; + + static fonts: any; + + } + export class MovieClip extends Sprite { + + constructor(textures: Texture[] | { texture: Texture, time?: number }[]); + + protected _textures: Texture[]; + protected _durations: number[]; + textures: Texture[] | { texture: Texture, time?: number }[]; + animationSpeed: number; + loop: boolean; + onComplete: () => void; + onFrameChange: (currentFrame: number) => void; + protected _currentTime: number; + playing: boolean; + totalFrames: number; + currentFrame: number; + stop(): void; + play(): void; + gotoAndStop(frameNumber: number): void; + gotoAndPlay(frameNumber: number): void; + protected update(deltaTime: number): void; + destroy(): void; + + static fromFrames(frame: string[]): MovieClip; + static fromImages(images: string[]): MovieClip; + + } + export class TextureTransform { + + constructor(texture: Texture, clampMargin?: number); + + protected _texture: Texture; + protected mapCoord: Matrix; + protected uClampFrame: Float32Array; + protected uClampOffset: Float32Array; + protected _lastTextureID: number; + + clampOffset: number; + clampMargin: number; + + texture: Texture; + + update(forceUpdate?: boolean): void; + + } + export class TilingSprite extends Sprite { + + constructor(texture: Texture, width?: number, height?: number); + + tileTransform: TransformStatic; + protected _width: number; + protected _height: number; + protected _canvasPattern: CanvasPattern; + uvTransform: TextureTransform; + + clampMargin: number; + tileScale: Point | ObservablePoint; + tilePosition: Point | ObservablePoint; + + protected _onTextureUpdate(): void; + protected _renderWebGL(renderer: WebGLRenderer): void; + protected _renderCanvas(renderer: CanvasRenderer): void; + protected _calculateBounds(): void; + getLocalBounds(rect?: Rectangle): Rectangle; + containsPoint(point: Point): boolean; + destroy(): void; + + static from(source: number | string | BaseTexture | HTMLCanvasElement | HTMLVideoElement, width?: number, height?: number): TilingSprite; + static fromFrame(frameId: string, width?: number, height?: number): TilingSprite; + // if you remove the next line, the class will break. https://github.com/pixijs/pixi-typescript/issues/96 + static fromImage(imageId: string, crossorigin?: boolean, scaleMode?: number): Sprite; + static fromImage(imageId: string, width?: number, height?: number, crossorigin?: boolean, scaleMode?: number): TilingSprite; + + width: number; + height: number; + + } + export class TilingSpriteRenderer extends ObjectRenderer { + + constructor(renderer: WebGLRenderer); + + render(ts: TilingSprite): void; + + } + + } + + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////FILTERS/////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + export namespace filters { + + export class FXAAFilter extends Filter { } + export class BlurFilter extends Filter { + + constructor(strength?: number, quality?: number, resolution?: number); + + blurXFilter: BlurXFilter; + blurYFilter: BlurYFilter; + resolution: number; + padding: number; + passes: number; + blur: number; + blurX: number; + blurY: number; + quality: number; + + } + export class BlurXFilter extends Filter { + + constructor(strength?: number, quality?: number, resolution?: number); + + protected _quality: number; + + quality: number; + passes: number; + resolution: number; + strength: number; + firstRun: boolean; + blur: number; + + } + export class BlurYFilter extends Filter { + + constructor(strength?: number, quality?: number, resolution?: number); + + protected _quality: number; + + quality: number; + passes: number; + resolution: number; + strength: number; + firstRun: boolean; + blur: number; + + } + export class ColorMatrixFilter extends Filter { + + constructor(); + + protected _loadMatrix(matrix: number[], multiply?: boolean): void; + protected _multiply(out: number[], a: number[], b: number[]): void; + protected _colorMatrix(matrix: number[]): void; + + matrix: number[]; + + brightness(b: number, multiply?: boolean): void; + greyscale(scale: number, multiply?: boolean): void; + blackAndWhite(multiply?: boolean): void; + hue(rotation: number, multiply?: boolean): void; + contrast(amount: number, multiply?: boolean): void; + saturate(amount: number, multiply?: boolean): void; + desaturate(multiply?: boolean): void; + negative(multiply?: boolean): void; + sepia(multiply?: boolean): void; + technicolor(multiply?: boolean): void; + polaroid(multiply?: boolean): void; + toBGR(multiply?: boolean): void; + kodachrome(multiply?: boolean): void; + browni(multiply?: boolean): void; + vintage(multiply?: boolean): void; + colorTone(desaturation: number, toned: number, lightColor: string, darkColor: string, multiply?: boolean): void; + night(intensity: number, multiply?: boolean): void; + predator(amount: number, multiply?: boolean): void; + lsd(multiply?: boolean): void; + reset(): void; + + } + export class DisplacementFilter extends Filter { + + constructor(sprite: Sprite, scale?: number); + + scale: Point; + map: Texture; + + } + export class VoidFilter extends Filter { + glShaderKey: string; + } + + // pixi-filters.d.ts todo + // https://github.com/pixijs/pixi-filters/ + export class NoiseFilter extends Filter { + + noise: number; + + } + + } + + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////INTERACTION/////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + export namespace interaction { + + export interface InteractionEvent { + + stopped: boolean; + target: DisplayObject; + currentTarget: DisplayObject; + type: string; + data: InteractionData; + stopPropagation(): void; + + } + export class InteractionData { + + global: Point; + + protected _target: DisplayObject; + target: DisplayObject; + targetProxy: DisplayObject; + originalEvent: Event; + + getLocalPosition(displayObject: DisplayObject, point?: Point, globalPos?: Point): Point; + + } + export class InteractionManager extends utils.EventEmitter { + + constructor(renderer: SystemRenderer, options?: { autoPreventDefault?: boolean; interactionFrequency?: number; }); + + renderer: SystemRenderer; + autoPreventDefault: boolean; + interactionFrequency: number; + mouse: InteractionData; + pointer: InteractionData; + eventData: { + stopped: boolean; + target: any; + type: any; + data: InteractionData; + stopPropagination(): void; + }; + interactiveDataPool: InteractionData[]; + protected interactionDOMElement: HTMLElement; + protected moveWhenInside: boolean; + protected eventsAdded: boolean; + mouseOverRenderer: boolean; + supportsTouchEvents: boolean; + supportsPointerEvents: boolean; + normalizeTouchEvents: boolean; + normalizeMouseEvents: boolean; + + protected onMouseUp: (event: MouseEvent) => void; + protected processMouseUp: (displayObject: DisplayObject, hit: boolean) => void; + protected onMouseDown: (event: MouseEvent) => void; + protected processMouseDown: (displayObject: DisplayObject, hit: boolean) => void; + protected onMouseMove: (event: MouseEvent) => void; + protected processMouseMove: (displayObject: DisplayObject, hit: boolean) => void; + protected onMouseOut: (event: MouseEvent) => void; + protected processMouseOverOut: (displayObject: DisplayObject, hit: boolean) => void; + protected onMouseOver: (event: MouseEvent) => void; + + protected onPointerUp: (event: PointerEvent) => void; + protected processPointerUp: (displayObject: DisplayObject, hit: boolean) => void; + protected onPointerDown: (event: PointerEvent) => void; + protected processPointerDown: (displayObject: DisplayObject, hit: boolean) => void; + protected onPointerMove: (event: PointerEvent) => void; + protected processPointerMove: (displayObject: DisplayObject, hit: boolean) => void; + protected onPointerOut: (event: PointerEvent) => void; + protected processPointerOut: (displayObject: DisplayObject, hit: boolean) => void; + protected onPointerOver: (event: PointerEvent) => void; + + protected onTouchStart: (event: TouchEvent) => void; + protected processTouchStart: (DisplayObject: DisplayObject, hit: boolean) => void; + protected onTouchEnd: (event: TouchEvent) => void; + protected processTouchEnd: (displayObject: DisplayObject, hit: boolean) => void; + protected onTouchMove: (event: TouchEvent) => void; + protected processTouchMove: (displayObject: DisplayObject, hit: boolean) => void; + defaultCursorStyle: string; + currentCursorStyle: string; + protected _tempPoint: Point; + resolution: number; + protected setTargetElement(element: HTMLElement, resolution: number): void; + protected addEvents(): void; + protected removeEvents(): void; + update(deltaTime: number): void; + protected dispatchEvent(displayObject: DisplayObject, eventString: string, eventData: any): void; + mapPositionToPoint(point: Point, x: number, y: number): void; + protected processInteractive(point: Point, displayObject: DisplayObject, func: (displayObject: DisplayObject, hit: boolean) => void, hitTest: boolean, interactive: boolean): boolean; + protected _startInteractionProcess(): void; + protected _queueAdd(displayObject: DisplayObject, order: number): void; + protected _finishInteractionProcess(func: Function): void; + protected getTouchData(touchEvent: InteractionData): InteractionData; + protected returnTouchData(touchData: InteractionData): void; + protected normalizeToPointerData(Event: Event): void; + + destroy(): void; + + } + export interface InteractiveTarget { + + interactive: boolean; + interactiveChildren: boolean; + hitArea: IHitArea; + buttonMode: boolean; + defaultCursor: string; + + } + export interface InteractiveTargetProxy extends InteractiveTarget { + } + + } + + ////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////LOADER///////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // extends + // https://github.com/englercj/resource-loader/ + // 1.6.4 + + export namespace loaders { + + export interface ILoaderOptions { + + crossOrigin?: boolean | string; + loadType?: number; + xhrType?: string; + metaData?: any; + + } + export interface IResourceDictionary { + + [index: string]: PIXI.loaders.Resource; + + } + export class Loader extends utils.EventEmitter { + + protected static _pixiMiddleware: Function[]; + static addPixiMiddleware(fn: Function): void; + + constructor(baseUrl?: string, concurrency?: number); + + baseUrl: string; + progress: number; + loading: boolean; + resources: IResourceDictionary; + + add(name: string, url: string, options?: ILoaderOptions, cb?: () => void): Loader; + add(url: string, options?: ILoaderOptions, cb?: () => void): Loader; + // todo I am not sure of object literal notional (or its options) so just allowing any but would love to improve this + add(obj: any, options?: ILoaderOptions, cb?: () => void): Loader; + + on(event: "complete", fn: (loader: loaders.Loader, object: any) => void, context?: any): utils.EventEmitter; + on(event: "error", fn: (error: Error, loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; + on(event: "load", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; + on(event: "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; + on(event: "start", fn: (loader: loaders.Loader) => void, context?: any): utils.EventEmitter; + on(event: string, fn: Function, context?: any): utils.EventEmitter; + + once(event: "complete", fn: (loader: loaders.Loader, object: any) => void, context?: any): utils.EventEmitter; + once(event: "error", fn: (error: Error, loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; + once(event: "load", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; + once(event: "progress", fn: (loader: loaders.Loader, resource: Resource) => void, context?: any): utils.EventEmitter; + once(event: "start", fn: (loader: loaders.Loader) => void, context?: any): utils.EventEmitter; + once(event: string, fn: Function, context?: any): utils.EventEmitter; + + before(fn: Function): Loader; + pre(fn: Function): Loader; + + after(fn: Function): Loader; + use(fn: Function): Loader; + + reset(): void; + + load(cb?: (loader: loaders.Loader, object: any) => void): Loader; + + } + export interface ITextureDictionary { + [index: string]: PIXI.Texture; + } + + export class Resource extends utils.EventEmitter { + + static LOAD_TYPE: { + XHR: number; + IMAGE: number; + AUDIO: number; + VIDEO: number; + }; + + static XHR_READ_STATE: { + UNSENT: number; + OPENED: number; + HEADERS_RECIEVED: number; + LOADING: number; + DONE: number; + }; + + static XHR_RESPONSE_TYPE: { + DEFAULT: number; + BUFFER: number; + BLOB: number; + DOCUMENT: number; + JSON: number; + TEXT: number; + }; + + constructor(name?: string, url?: string | string[], options?: ILoaderOptions); + + protected _loadSourceElement(type: string): void; + isLoading: boolean; + isComplete: boolean; + + name: string; + texture: Texture; + textures: ITextureDictionary; + url: string; + data: any; + crossOrigin: boolean | string; + loadType: number; + xhrType: string; + error: Error; + xhr: XMLHttpRequest; + SVGMetadataElement: any; + + complete(): void; + load(cb?: () => void): void; + abort(message: string): void; + + } + } + + ////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////MESH/////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + export namespace mesh { + + export class Mesh extends Container { + + constructor(texture: Texture, vertices?: Float32Array, uvs?: Float32Array, indices?: Uint16Array, drawMode?: number); + + protected _texture: Texture; + uvs: Float32Array; + vertices: Float32Array; + indices: Uint16Array; + dirty: boolean; + indexDirty: boolean; + dirtyVertex: boolean; + protected _geometryVersion: number; + blendMode: number; + canvasPadding: number; + drawMode: number; + texture: Texture; + shader: glCore.GLShader; + tintRgb: Float32Array; + protected _glDatas: { [n: number]: any; }; + protected _renderWebGL(renderer: WebGLRenderer): void; + protected _renderCanvas(renderer: CanvasRenderer): void; + protected _onTextureUpdate(): void; + protected _calculateBounds(): void; + containsPoint(point: Point): boolean; + tint: number; + + static DRAW_MODES: { + TRIANGLE_MESH: number; + TRIANGLES: number; + }; + + } + + export class CanvasMeshRenderer { + + constructor(renderer: CanvasRenderer); + + renderer: CanvasRenderer; + + render(mesh: Mesh): void; + protected _renderTriangleMesh(mesh: Mesh): void; + protected _renderTriangles(mesh: Mesh): void; + protected _renderDrawTriangle(mesh: Mesh, index0: number, index1: number, index2: number): void; + protected renderMeshFlat(mesh: Mesh): void; + + destroy(): void; + + } + + export class MeshRenderer extends ObjectRenderer { + + constructor(renderer: WebGLRenderer); + + shader: Shader; + onContextChange(): void; + render(mesh: Mesh): void; + + } + + export class Plane extends Mesh { + + constructor(texture: Texture, verticesX?: number, verticesY?: number); + protected _ready: boolean; + verticesX: number; + verticesY: number; + drawMode: number; + + refresh(): void; + + protected _onTexureUpdate(): void; + + } + + export class NineSlicePlane extends Plane { + + constructor(texture: Texture, leftWidth?: number, topHeight?: number, rightWidth?: number, bottomHeight?: number); + + width: number; + height: number; + leftWidth: number; + rightWidth: number; + topHeight: number; + bottomHeight: number; + + protected _leftWidth: number; + protected _rightWidth: number; + protected _topHeight: number; + protected _bottomHeight: number; + protected _height: number; + protected _width: number; + protected _origHeight: number; + protected _origWidth: number; + protected _uvh: number; + protected _uvw: number; + + updateHorizontalVertices(): void; + updateVerticalVertices(): void; + protected drawSegment(context: CanvasRenderingContext2D | WebGLRenderingContext, textureSource: any, w: number, h: number, x1: number, y1: number, x2: number, y2: number): void; + + } + + export class Rope extends Mesh { + + constructor(texture: Texture, points: Point[]); + + points: Point[]; + colors: number[]; + protected _ready: boolean; + refresh(): void; + + protected _onTextureUpdate(): void; + updateTransform(): void; + + } + } + + ////////////////////////////////////////////////////////////////////////////// + /////////////////////////////PARTICLES//////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + export namespace particles { + + export interface IParticleContainerProperties { + + scale?: boolean; + position?: boolean; + rotation?: boolean; + uvs?: boolean; + alpha?: boolean; + + } + export class ParticleContainer extends Container { + + constructor(size?: number, properties?: IParticleContainerProperties, batchSize?: number); + + protected _properties: boolean[]; + protected _maxSize: number; + protected _batchSize: number; + protected _glBuffers: { [n: number]: WebGLBuffer; }; + protected _bufferToUpdate: number; + interactiveChildren: boolean; + blendMode: number; + roundPixels: boolean; + baseTexture: BaseTexture; + + setProperties(properties: IParticleContainerProperties): void; + protected onChildrenChange: (smallestChildIndex?: number) => void; + + destroy(options?: IDestroyOptions | boolean): void; + + } + export class ParticleBuffer { + + constructor(gl: WebGLRenderingContext, properties: any, dynamicPropertyFlags: any[], size: number); + + gl: WebGLRenderingContext; + vertSize: number; + vertByteSize: number; + size: number; + dynamicProperties: any[]; + staticProperties: any[]; + staticStride: number; + staticBuffer: any; + staticData: any; + dynamicStride: number; + dynamicBuffer: any; + dynamicData: any; + + bind(): void; + destroy(): void; + + } + export interface IParticleRendererProperty { + attribute: number; + size: number; + uploadFunction: (children: PIXI.DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number) => void; + offset: number; + } + export class ParticleRenderer extends ObjectRenderer { + + constructor(renderer: WebGLRenderer); + + shader: glCore.GLShader; + indexBuffer: WebGLBuffer; + properties: IParticleRendererProperty[]; + protected tempMatrix: Matrix; + + start(): void; + generateBuffers(container: ParticleContainer): ParticleBuffer[]; + uploadVertices(children: DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; + uploadPosition(children: DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; + uploadRotation(children: DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; + uploadUvs(children: DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; + uploadAlpha(children: DisplayObject[], startIndex: number, amount: number, array: number[], stride: number, offset: number): void; + destroy(): void; + + indices: Uint16Array; + + } + export interface IParticleShader extends glCore.GLShader { } + + } + + ////////////////////////////////////////////////////////////////////////////// + ////////////////////////////PREPARE/////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + export namespace prepare { + + export class CanvasPrepare { + + static UPLOADS_PER_FRAME: number; + + constructor(renderer: CanvasRenderer); + + protected renderer: CanvasRenderer; + protected canvas: HTMLCanvasElement; + protected ctx: CanvasRenderingContext2D; + protected queue: any[]; + protected addHooks: Function[]; + protected uploadHooks: Function[]; + protected completes: Function[]; + protected ticking: boolean; + + upload(item: Function | DisplayObject | Container, done?: Function): void; + protected tick(): void; + register(addHook?: (item: any, queue: any[]) => boolean, uploadHook?: (prepare: CanvasPrepare, item: any) => boolean): CanvasPrepare; + add(item: DisplayObject | Container | any): CanvasPrepare; + destroy(): void; + protected uploadBaseTextures(prepare: CanvasPrepare | any, item: any): boolean; + protected findBaseTextures(item: DisplayObject, queue: any[]): boolean; + } + + export class WebGLPrepare { + + static UPLOADS_PER_FRAME: number; + + constructor(renderer: WebGLRenderer); + + protected renderer: WebGLRenderer; + protected queue: any[]; + protected addHooks: Function[]; + protected uploadHooks: Function[]; + protected completes: Function[]; + protected ticking: boolean; + upload(item: Function | DisplayObject | Container, done?: Function): void; + protected tick(): void; + register(addHook?: (item: any, queue: any[]) => boolean, uploadHook?: (renderer: WebGLRenderer, item: any) => boolean): WebGLPrepare; + add(item: PIXI.DisplayObject | PIXI.Container | any): WebGLPrepare; + destroy(): void; + protected uploadBaseTextures(prepare: WebGLPrepare | any, item: any): boolean; + protected uploadGraphics(renderer: WebGLRenderer, item: DisplayObject): boolean; + protected findBaseTextures(item: DisplayObject, queue: any[]): boolean; + protected findGraphics(item: DisplayObject, queue: any[]): boolean; + + } + } + + ////////////////////////////////////////////////////////////////////////////// + /////////////////////////////pixi-gl-core///////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + // pixi-gl-core https://github.com/pixijs/pixi-gl-core + // sharedArrayBuffer as a type is not available yet. + // need to fully define what an `Attrib` is. + export namespace glCore { + + export interface IContextOptions { + /** + * Boolean that indicates if the canvas contains an alpha buffer. + */ + alpha?: boolean; + /** + * Boolean that indicates that the drawing buffer has a depth buffer of at least 16 bits. + */ + depth?: boolean; + /** + * Boolean that indicates that the drawing buffer has a stencil buffer of at least 8 bits. + */ + stencil?: boolean; + /** + * Boolean that indicates whether or not to perform anti-aliasing. + */ + antialias?: boolean; + /** + * Boolean that indicates that the page compositor will assume the drawing buffer contains colors with pre-multiplied alpha. + */ + premultipliedAlpha?: boolean; + /** + * If the value is true the buffers will not be cleared and will preserve their values until cleared or overwritten by the author. + */ + preserveDrawingBuffer?: boolean; + /** + * Boolean that indicates if a context will be created if the system performance is low. + */ + failIfMajorPerformanceCaveat?: boolean; + } + export function createContext(view: HTMLCanvasElement, options?: IContextOptions): WebGLRenderingContext; + export function setVertexAttribArrays(gl: WebGLRenderingContext, attribs: IAttrib[], state?: WebGLState): WebGLRenderingContext; + export class GLBuffer { + + static EMPTY_ARRAY_BUFFER: ArrayBuffer; + + constructor(gl: WebGLRenderingContext, type: number, data: ArrayBuffer | ArrayBufferView | any, drawType: number); + + protected _updateID: number; + gl: WebGLRenderingContext; + buffer: WebGLBuffer; + type: number; + drawType: number; + data: ArrayBuffer | ArrayBufferView | any; + + upload(data: ArrayBuffer | ArrayBufferView | any, offset: number, dontBind: boolean): void; + bind(): void; + + static createVertexBuffer(gl: WebGLRenderingContext, data: ArrayBuffer | ArrayBufferView | any, drawType: number): WebGLBuffer; + static createIndexBuffer(gl: WebGLRenderingContext, data: ArrayBuffer | ArrayBufferView | any, drawType: number): WebGLBuffer; + static create(gl: WebGLRenderingContext, type: number, data: ArrayBuffer | ArrayBufferView | any, drawType: number): WebGLBuffer; + + destroy(): void; + + } + export class GLFramebuffer { + + constructor(gl: WebGLRenderingContext, width: number, height: number); + + gl: WebGLRenderingContext; + frameBuffer: WebGLFramebuffer; + stencil: WebGLRenderbuffer; + texture: GLTexture; + width: number; + height: number; + + enableTexture(texture: GLTexture): void; + enableStencil(): void; + clear(r: number, g: number, b: number, a: number): void; + bind(): void; + unbind(): void; + resize(width: number, height: number): void; + destroy(): void; + + static createRGBA(gl: WebGLRenderingContext, width: number, height: number, data: ArrayBuffer | ArrayBufferView | any): GLFramebuffer; + static createFloat32(gl: WebGLRenderingContext, width: number, height: number, data: ArrayBuffer | ArrayBufferView | any): GLFramebuffer; + + } + export class GLShader { + + constructor(gl: WebGLRenderingContext, vertexSrc: string | string[], fragmentSrc: string | string[], attributeLocations: string | string[] | any); + + gl: WebGLRenderingContext; + program: WebGLProgram; + uniforms: any; + + bind(): void; + destroy(): void; + + } + export class GLTexture { + + constructor(gl: WebGLRenderingContext, width: number, height: number, format: number, type: number); + + gl: WebGLRenderingContext; + texture: WebGLTexture; + mipmap: boolean; + premultiplyAlpha: boolean; + width: number; + height: number; + format: number; + type: number; + + upload(source: HTMLImageElement | ImageData | HTMLVideoElement): void; + uploadData(data: number, width: number, height: number): void; + bind(): void; + unbind(): void; + minFilter(linear: boolean): void; + magFilter(linear: boolean): void; + enableMipmap(): void; + enableLinearScaling(): void; + enableNearestScaling(): void; + enableWrapClamp(): void; + enableWrapRepeat(): void; + enableWrapMirrorRepeat(): void; + destroy(): void; + + static fromSource(gl: WebGLRenderingContext, source: HTMLImageElement | ImageData | HTMLVideoElement, premultipleAlpha?: boolean): GLTexture; + static fromData(gl: WebGLRenderingContext, data: number[], width: number, height: number): GLTexture; + + } + export interface IAttrib { + + attribute: { + location: boolean; + size: number; + }; + normalized: boolean; + stride: number; + start: number; + buffer: ArrayBuffer; + + } + export interface IWebGLRenderingContextAttribute { + + buffer: WebGLBuffer; + attribute: any; + type: number; + normalized: boolean; + stride: number; + start: number; + + } + export interface IAttribState { + tempAttribState: IAttrib[]; + attribState: IAttrib[]; + } + + export class VertexArrayObject { + + static FORCE_NATIVE: boolean; + + constructor(gl: WebGLRenderingContext, state: WebGLState); + + protected nativeVaoExtension: any; + protected nativeState: IAttribState; + protected nativeVao: VertexArrayObject; + gl: WebGLRenderingContext; + attributes: IAttrib[]; + indexBuffer: GLBuffer; + dirty: boolean; + + bind(): VertexArrayObject; + unbind(): VertexArrayObject; + activate(): VertexArrayObject; + addAttribute(buffer: GLBuffer, attribute: IAttrib, type: number, normalized: boolean, stride: number, start: number): VertexArrayObject; + addIndex(buffer: GLBuffer, options?: any): VertexArrayObject; + clear(): VertexArrayObject; + draw(type: number, size: number, start: number): VertexArrayObject; + destroy(): void; + + } + + } + + ////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////UTILS////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////////////// + + export interface IDecomposedDataUri { + mediaType: string; + subType: string; + encoding: string; + data: any; + } + + export namespace utils { + + export function uid(): number; + export function hex2rgb(hex: number, out?: number[]): number[]; + export function hex2string(hex: number): string; + export function rgb2hex(rgb: Number[]): number; + export function canUseNewCanvasBlendModes(): boolean; + export function getResolutionOfUrl(url: string): number; + export function getSvgSize(svgString: string): any; + export function decomposeDataUri(dataUri: string): IDecomposedDataUri; + export function getUrlFileExtension(url: string): string; + export function sayHello(type: string): void; + export function skipHello(): void; + export function isWebGLSupported(): boolean; + export function sign(n: number): number; + export function removeItems(arr: T[], startIdx: number, removeCount: number): void; + export var TextureCache: any; + export var BaseTextureCache: any; + + // https://github.com/primus/eventemitter3 + export class EventEmitter { + + listeners(event: string): Function[]; + emit(event: string, ...args: any[]): boolean; + on(event: string, fn: Function, context?: any): EventEmitter; + once(event: string, fn: Function, context?: any): EventEmitter; + removeListener(event: string, fn: Function, context?: any, once?: boolean): EventEmitter; + removeAllListeners(event: string): EventEmitter; + eventNames(): string[]; + + off(event: string, fn: Function, context?: any, once?: boolean): EventEmitter; + addListener(event: string, fn: Function, context?: any): EventEmitter; + + } + + } + +} + +declare namespace pixi { + export var gl: typeof PIXI.glCore; +} + +declare module "pixi.js" { + export = PIXI; +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 000000000..7f1cde2c6 --- /dev/null +++ b/tslint.json @@ -0,0 +1,63 @@ +{ + "rules": { + "max-line-length": [true, 120], + "no-inferrable-types": true, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "indent": [ + true, + "spaces" + ], + "eofline": true, + "no-duplicate-variable": true, + "no-eval": true, + "no-arg": true, + "no-internal-module": true, + "no-trailing-whitespace": true, + "no-bitwise": true, + "no-shadowed-variable": true, + "no-unused-expression": true, + "no-unused-variable": [true, {"ignore-pattern": "^(_.*)$"}], + "one-line": [ + true, + "check-catch", + "check-else", + "check-open-brace", + "check-whitespace" + ], + "quotemark": [ + true, + "single", + "avoid-escape" + ], + "semicolon": true, + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "curly": true, + "variable-name": [ + true, + "ban-keywords", + "check-format", + "allow-leading-underscore" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ] + } +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 000000000..d6adab503 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,896 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 +"@types/pixi.js": + version "3.0.30" + resolved "https://registry.yarnpkg.com/@types/pixi.js/-/pixi.js-3.0.30.tgz#5ef5d4b4cab3d356b0417f959fb09ffe78a7aa50" + +accepts@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.3.tgz#c3ca7434938648c3e0d9c1e328dd68b622c284ca" + dependencies: + mime-types "~2.1.11" + negotiator "0.6.1" + +acorn@^1.0.3: + version "1.2.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-1.2.2.tgz#c8ce27de0acc76d896d2b1fad3df588d9e82f014" + +ambi@^2.2.0, ambi@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/ambi/-/ambi-2.5.0.tgz#7c8e372be48891157e7cea01cb6f9143d1f74220" + dependencies: + editions "^1.1.1" + typechecker "^4.3.0" + +amdefine@>=0.0.4: + version "1.0.1" + resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" + +apache-crypt@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/apache-crypt/-/apache-crypt-1.1.2.tgz#820782a33bb6a5fd2712082f0ed3a24e3c9b0214" + dependencies: + unix-crypt-td-js "^1.0.0" + +apache-md5@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/apache-md5/-/apache-md5-1.0.6.tgz#470239d40c54e7c32dd9d6eb11bc3578ecc903c2" + +basic-auth@~1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-1.0.4.tgz#030935b01de7c9b94a824b29f3fccb750d3a5290" + +batch@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/batch/-/batch-0.5.3.tgz#3f3414f380321743bfc1042f9a83ff1d5824d464" + +bit-twiddle@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bit-twiddle/-/bit-twiddle-1.0.2.tgz#0c6c1fabe2b23d17173d9a61b7b7093eb9e1769e" + +bl@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" + dependencies: + readable-stream "~2.0.5" + +browserify-versionify@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/browserify-versionify/-/browserify-versionify-1.0.6.tgz#ab2dc61d6a119e627bec487598d1983b7fdb275e" + dependencies: + find-root "^0.1.1" + through2 "0.6.3" + +colors@~0.6.0-1: + version "0.6.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" + +colors@latest: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + +commander@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.1.0.tgz#d121bbae860d9992a3d517ba96f56588e47c6781" + +concat-stream@~1.4.5: + version "1.4.10" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.4.10.tgz#acc3bbf5602cb8cc980c6ac840fa7d8603e3ef36" + dependencies: + inherits "~2.0.1" + readable-stream "~1.1.9" + typedarray "~0.0.5" + +connect@3.4.x: + version "3.4.1" + resolved "https://registry.yarnpkg.com/connect/-/connect-3.4.1.tgz#a21361d3f4099ef761cda6dc4a973bb1ebb0a34d" + dependencies: + debug "~2.2.0" + finalhandler "0.4.1" + parseurl "~1.3.1" + utils-merge "1.0.0" + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + +cors@latest: + version "2.8.1" + resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.1.tgz#6181aa56abb45a2825be3304703747ae4e9d2383" + dependencies: + vary "^1" + +csextends@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/csextends/-/csextends-1.0.3.tgz#df41407bfddb1837ecc2dd28587725d6af9550f8" + +debug@~2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" + dependencies: + ms "0.7.1" + +depd@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3" + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + +duplexer@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" + +duplexer2@~0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" + dependencies: + readable-stream "~1.1.9" + +eachr@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/eachr/-/eachr-3.2.0.tgz#2c35e43ea086516f7997cf80b7aa64d55a4a4484" + dependencies: + editions "^1.1.1" + typechecker "^4.3.0" + +earcut@^2.0.7: + version "2.1.1" + resolved "https://registry.yarnpkg.com/earcut/-/earcut-2.1.1.tgz#157634e5f3ebb42224e475016e86a5b6ce556b45" + +editions@^1.1.0, editions@^1.1.1, editions@^1.1.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/editions/-/editions-1.3.3.tgz#0907101bdda20fac3cbe334c27cbd0688dc99a5b" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + +encodeurl@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + +escodegen@~0.0.24: + version "0.0.28" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-0.0.28.tgz#0e4ff1715f328775d6cab51ac44a406cd7abffd3" + dependencies: + esprima "~1.0.2" + estraverse "~1.3.0" + optionalDependencies: + source-map ">= 0.1.2" + +escodegen@~1.3.2: + version "1.3.3" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.3.3.tgz#f024016f5a88e046fd12005055e939802e6c5f23" + dependencies: + esprima "~1.1.1" + estraverse "~1.5.0" + esutils "~1.0.0" + optionalDependencies: + source-map "~0.1.33" + +esprima@~1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad" + +esprima@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.1.1.tgz#5b6f1547f4d102e670e140c509be6771d6aeb549" + +estraverse@~1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.3.2.tgz#37c2b893ef13d723f276d878d60d8535152a6c42" + +estraverse@~1.5.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.5.1.tgz#867a3e8e58a9f84618afb6c2ddbcd916b7cbaf71" + +esutils@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-1.0.0.tgz#8151d358e20c8acc7fb745e7472c0025fe496570" + +etag@~1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.7.0.tgz#03d30b5f67dd6e632d2945d30d6652731a34d5d8" + +event-stream@latest: + version "3.3.4" + resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" + dependencies: + duplexer "~0.1.1" + from "~0" + map-stream "~0.1.0" + pause-stream "0.0.11" + split "0.3" + stream-combiner "~0.0.4" + through "~2.3.1" + +eventemitter3@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-2.0.2.tgz#20ce4891909ce9f35b088c94fab40e2c96f473ac" + +events@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" + +extendr@^3.2.0, extendr@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/extendr/-/extendr-3.2.2.tgz#c6e46fe6d90b2e3e8812a6654bd6182cbf91cd06" + dependencies: + editions "^1.1.2" + typechecker "^4.3.0" + +extract-opts@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/extract-opts/-/extract-opts-3.3.1.tgz#5abbedc98c0d5202e3278727f9192d7e086c6be1" + dependencies: + eachr "^3.2.0" + editions "^1.1.1" + typechecker "^4.3.0" + +falafel@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/falafel/-/falafel-1.2.0.tgz#c18d24ef5091174a497f318cd24b026a25cddab4" + dependencies: + acorn "^1.0.3" + foreach "^2.0.5" + isarray "0.0.1" + object-keys "^1.0.6" + +faye-websocket@0.11.x: + version "0.11.0" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.0.tgz#d9ccf0e789e7db725d74bc4877d23aa42972ac50" + dependencies: + websocket-driver ">=0.5.1" + +finalhandler@0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-0.4.1.tgz#85a17c6c59a94717d262d61230d4b0ebe3d4a14d" + dependencies: + debug "~2.2.0" + escape-html "~1.0.3" + on-finished "~2.3.0" + unpipe "~1.0.0" + +find-root@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/find-root/-/find-root-0.1.2.tgz#98d2267cff1916ccaf2743b3a0eea81d79d7dcd1" + +findup@^0.1.5: + version "0.1.5" + resolved "https://registry.yarnpkg.com/findup/-/findup-0.1.5.tgz#8ad929a3393bac627957a7e5de4623b06b0e2ceb" + dependencies: + colors "~0.6.0-1" + commander "~2.1.0" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +fresh@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.3.0.tgz#651f838e22424e7566de161d8358caa199f83d4f" + +from@~0: + version "0.1.3" + resolved "https://registry.yarnpkg.com/from/-/from-0.1.3.tgz#ef63ac2062ac32acf7862e0d40b44b896f22f3bc" + +function-bind@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" + +glsl-inject-defines@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/glsl-inject-defines/-/glsl-inject-defines-1.0.3.tgz#dd1aacc2c17fcb2bd3fc32411c6633d0d7b60fd4" + dependencies: + glsl-token-inject-block "^1.0.0" + glsl-token-string "^1.0.1" + glsl-tokenizer "^2.0.2" + +glsl-resolve@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/glsl-resolve/-/glsl-resolve-0.0.1.tgz#894bef73910d792c81b5143180035d0a78af76d3" + dependencies: + resolve "^0.6.1" + xtend "^2.1.2" + +glsl-token-assignments@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/glsl-token-assignments/-/glsl-token-assignments-2.0.2.tgz#a5d82ab78499c2e8a6b83cb69495e6e665ce019f" + +glsl-token-defines@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/glsl-token-defines/-/glsl-token-defines-1.0.0.tgz#cb892aa959936231728470d4f74032489697fa9d" + dependencies: + glsl-tokenizer "^2.0.0" + +glsl-token-depth@^1.1.0, glsl-token-depth@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/glsl-token-depth/-/glsl-token-depth-1.1.2.tgz#23c5e30ee2bd255884b4a28bc850b8f791e95d84" + +glsl-token-descope@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/glsl-token-descope/-/glsl-token-descope-1.0.2.tgz#0fc90ab326186b82f597b2e77dc9e21efcd32076" + dependencies: + glsl-token-assignments "^2.0.0" + glsl-token-depth "^1.1.0" + glsl-token-properties "^1.0.0" + glsl-token-scope "^1.1.0" + +glsl-token-inject-block@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/glsl-token-inject-block/-/glsl-token-inject-block-1.1.0.tgz#e1015f5980c1091824adaa2625f1dfde8bd00034" + +glsl-token-properties@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/glsl-token-properties/-/glsl-token-properties-1.0.1.tgz#483dc3d839f0d4b5c6171d1591f249be53c28a9e" + +glsl-token-scope@^1.1.0, glsl-token-scope@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/glsl-token-scope/-/glsl-token-scope-1.1.2.tgz#a1728e78df24444f9cb93fd18ef0f75503a643b1" + +glsl-token-string@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/glsl-token-string/-/glsl-token-string-1.0.1.tgz#59441d2f857de7c3449c945666021ece358e48ec" + +glsl-token-whitespace-trim@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/glsl-token-whitespace-trim/-/glsl-token-whitespace-trim-1.0.0.tgz#46d1dfe98c75bd7d504c05d7d11b1b3e9cc93b10" + +glsl-tokenizer@^2.0.0, glsl-tokenizer@^2.0.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/glsl-tokenizer/-/glsl-tokenizer-2.1.2.tgz#720307522e03c57af35c00551950c4a70ef2dfb9" + dependencies: + through2 "^0.6.3" + +glslify-bundle@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/glslify-bundle/-/glslify-bundle-5.0.0.tgz#0252ada1ef9df30b660006e0bb21fd130b486e42" + dependencies: + glsl-inject-defines "^1.0.1" + glsl-token-defines "^1.0.0" + glsl-token-depth "^1.1.1" + glsl-token-descope "^1.0.2" + glsl-token-scope "^1.1.1" + glsl-token-string "^1.0.1" + glsl-token-whitespace-trim "^1.0.0" + glsl-tokenizer "^2.0.2" + murmurhash-js "^1.0.0" + shallow-copy "0.0.1" + +glslify-deps@^1.2.5: + version "1.3.0" + resolved "https://registry.yarnpkg.com/glslify-deps/-/glslify-deps-1.3.0.tgz#0b2234c8ea9e3d3fd7f6b3cb7f03ae59e6b51a59" + dependencies: + events "^1.0.2" + findup "^0.1.5" + glsl-resolve "0.0.1" + glsl-tokenizer "^2.0.0" + graceful-fs "^4.1.2" + inherits "^2.0.1" + map-limit "0.0.1" + resolve "^1.0.0" + +glslify@^5.0.2: + version "5.1.0" + resolved "https://registry.yarnpkg.com/glslify/-/glslify-5.1.0.tgz#1935bbb563215afd3e636b6e82f48bca1a6a022a" + dependencies: + bl "^1.0.0" + glsl-resolve "0.0.1" + glslify-bundle "^5.0.0" + glslify-deps "^1.2.5" + minimist "^1.2.0" + resolve "^1.1.5" + static-module "^1.1.2" + through2 "^0.6.3" + xtend "^4.0.0" + +graceful-fs@*, graceful-fs@^4.1.2, graceful-fs@^4.1.4: + version "4.1.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.10.tgz#f2d720c22092f743228775c75e3612632501f131" + +has@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +http-auth@2.4.x: + version "2.4.11" + resolved "https://registry.yarnpkg.com/http-auth/-/http-auth-2.4.11.tgz#61f024a6e0e7c48934944895c87a1395509c619b" + dependencies: + apache-crypt "1.1.2" + apache-md5 "1.0.6" + node-uuid "^1.4.7" + +http-errors@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.5.0.tgz#b1cb3d8260fd8e2386cad3189045943372d48211" + dependencies: + inherits "2.0.1" + setprototypeof "1.0.1" + statuses ">= 1.3.0 < 2" + +ignorefs@^1.0.0, ignorefs@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ignorefs/-/ignorefs-1.1.1.tgz#f97f8525a88e1ed101771e65d0438e060d9dd95d" + dependencies: + editions "^1.1.1" + ignorepatterns "^1.0.1" + +ignorepatterns@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ignorepatterns/-/ignorepatterns-1.1.0.tgz#ac8f436f2239b5dfb66d5f0d3a904a87ac67cc5e" + +inherits@^2.0.1, inherits@~2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +inherits@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" + +isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + +isarray@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" + +ismobilejs@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/ismobilejs/-/ismobilejs-0.4.0.tgz#7b986252118e552137f36e42c21794af6c91558f" + +live-server: + version "1.1.0" + resolved "https://registry.yarnpkg.com/live-server/-/live-server-1.1.0.tgz#a69f0e6ca581e0391aa57941970e17c308dd4869" + dependencies: + colors latest + connect "3.4.x" + cors latest + event-stream latest + faye-websocket "0.11.x" + http-auth "2.4.x" + morgan "^1.6.1" + object-assign latest + opn latest + proxy-middleware latest + send latest + serve-index "^1.7.2" + watchr "2.6.x" + +map-limit@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/map-limit/-/map-limit-0.0.1.tgz#eb7961031c0f0e8d001bf2d56fab685d58822f38" + dependencies: + once "~1.3.0" + +map-stream@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" + +mime-db@~1.24.0: + version "1.24.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.24.0.tgz#e2d13f939f0016c6e4e9ad25a8652f126c467f0c" + +mime-types@~2.1.11: + version "2.1.12" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.12.tgz#152ba256777020dd4663f54c2e7bc26381e71729" + dependencies: + mime-db "~1.24.0" + +mime@1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" + +minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + +morgan@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.7.0.tgz#eb10ca8e50d1abe0f8d3dad5c0201d052d981c62" + dependencies: + basic-auth "~1.0.3" + debug "~2.2.0" + depd "~1.1.0" + on-finished "~2.3.0" + on-headers "~1.0.1" + +ms@0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" + +murmurhash-js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/murmurhash-js/-/murmurhash-js-1.0.0.tgz#b06278e21fc6c37fa5313732b0412bcb6ae15f51" + +negotiator@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" + +node-uuid@^1.4.7: + version "1.4.7" + resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.7.tgz#6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f" + +object-assign@^4.0.1, object-assign@latest: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" + +object-inspect@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-0.4.0.tgz#f5157c116c1455b243b06ee97703392c5ad89fec" + +object-keys@^1.0.6: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + +object-keys@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" + +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + dependencies: + ee-first "1.1.1" + +on-headers@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" + +once@~1.3.0: + version "1.3.3" + resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" + dependencies: + wrappy "1" + +opn@latest: + version "4.0.2" + resolved "https://registry.yarnpkg.com/opn/-/opn-4.0.2.tgz#7abc22e644dff63b0a96d5ab7f2790c0f01abc95" + dependencies: + object-assign "^4.0.1" + pinkie-promise "^2.0.0" + +parse-uri@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-uri/-/parse-uri-1.0.0.tgz#2872dcc22f1a797acde1583d8a0ac29552ddac20" + +parseurl@~1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56" + +pause-stream@0.0.11: + version "0.0.11" + resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" + dependencies: + through "~2.3" + +pinkie-promise@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" + dependencies: + pinkie "^2.0.0" + +pinkie@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" + +pixi-gl-core@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pixi-gl-core/-/pixi-gl-core-1.0.3.tgz#3bd4fb3538a2ee601a048d8dc01f6df55e0b3550" + +pixi.js: + version "4.1.1" + resolved "https://registry.yarnpkg.com/pixi.js/-/pixi.js-4.1.1.tgz#d62657d90ef3d290d8dfda6e5cf82cc87a2a0f3e" + dependencies: + bit-twiddle "^1.0.2" + browserify-versionify "^1.0.6" + earcut "^2.0.7" + eventemitter3 "^2.0.0" + glslify "^5.0.2" + ismobilejs "^0.4.0" + object-assign "^4.0.1" + pixi-gl-core "^1.0.2" + resource-loader "^1.8.0" + +process-nextick-args@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" + +proxy-middleware@latest: + version "0.15.0" + resolved "https://registry.yarnpkg.com/proxy-middleware/-/proxy-middleware-0.15.0.tgz#a3fdf1befb730f951965872ac2f6074c61477a56" + +quote-stream@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/quote-stream/-/quote-stream-0.0.0.tgz#cde29e94c409b16e19dc7098b89b6658f9721d3b" + dependencies: + minimist "0.0.8" + through2 "~0.4.1" + +range-parser@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" + +"readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@~1.0.17, readable-stream@~1.0.27-1: + version "1.0.34" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@~1.1.9: + version "1.1.14" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.1.14.tgz#7cf4c54ef648e3813084c636dd2079e166c081d9" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "0.0.1" + string_decoder "~0.10.x" + +readable-stream@~2.0.5: + version "2.0.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + +resolve@^0.6.1: + version "0.6.3" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-0.6.3.tgz#dd957982e7e736debdf53b58a4dd91754575dd46" + +resolve@^1.0.0, resolve@^1.1.5: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resource-loader@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/resource-loader/-/resource-loader-1.8.0.tgz#7ac61d6947ee99678d60b970ed1467af995fb3dd" + dependencies: + eventemitter3 "^2.0.0" + parse-uri "^1.0.0" + +safefs@^3.1.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/safefs/-/safefs-3.2.2.tgz#8170c1444d7038e08caea05a374fae2fa349e15c" + dependencies: + graceful-fs "*" + +safefs@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/safefs/-/safefs-4.1.0.tgz#f82aeb4bdd7ae51f653eb20f6728b3058c8d6445" + dependencies: + editions "^1.1.1" + graceful-fs "^4.1.4" + +scandirectory@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/scandirectory/-/scandirectory-2.5.0.tgz#6ce03f54a090b668e3cbedbf20edf9e310593e72" + dependencies: + ignorefs "^1.0.0" + safefs "^3.1.2" + taskgroup "^4.0.5" + +send@latest: + version "0.14.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.14.1.tgz#a954984325392f51532a7760760e459598c89f7a" + dependencies: + debug "~2.2.0" + depd "~1.1.0" + destroy "~1.0.4" + encodeurl "~1.0.1" + escape-html "~1.0.3" + etag "~1.7.0" + fresh "0.3.0" + http-errors "~1.5.0" + mime "1.3.4" + ms "0.7.1" + on-finished "~2.3.0" + range-parser "~1.2.0" + statuses "~1.3.0" + +serve-index@^1.7.2: + version "1.8.0" + resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.8.0.tgz#7c5d96c13fb131101f93c1c5774f8516a1e78d3b" + dependencies: + accepts "~1.3.3" + batch "0.5.3" + debug "~2.2.0" + escape-html "~1.0.3" + http-errors "~1.5.0" + mime-types "~2.1.11" + parseurl "~1.3.1" + +setprototypeof@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.1.tgz#52009b27888c4dc48f591949c0a8275834c1ca7e" + +shallow-copy@~0.0.1, shallow-copy@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/shallow-copy/-/shallow-copy-0.0.1.tgz#415f42702d73d810330292cc5ee86eae1a11a170" + +"source-map@>= 0.1.2": + version "0.5.6" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" + +source-map@~0.1.33: + version "0.1.43" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.1.43.tgz#c24bc146ca517c1471f5dacbe2571b2b7f9e3346" + dependencies: + amdefine ">=0.0.4" + +split@0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" + dependencies: + through "2" + +static-eval@~0.2.0: + version "0.2.4" + resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-0.2.4.tgz#b7d34d838937b969f9641ca07d48f8ede263ea7b" + dependencies: + escodegen "~0.0.24" + +static-module@^1.1.2: + version "1.3.1" + resolved "https://registry.yarnpkg.com/static-module/-/static-module-1.3.1.tgz#79071d340e4419e4ab5ce87976a9eb67250c8493" + dependencies: + concat-stream "~1.4.5" + duplexer2 "~0.0.2" + escodegen "~1.3.2" + falafel "^1.0.0" + has "^1.0.0" + object-inspect "~0.4.0" + quote-stream "~0.0.0" + readable-stream "~1.0.27-1" + shallow-copy "~0.0.1" + static-eval "~0.2.0" + through2 "~0.4.1" + +"statuses@>= 1.3.0 < 2", statuses@~1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.0.tgz#8e55758cb20e7682c1f4fce8dcab30bf01d1e07a" + +stream-combiner@~0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" + dependencies: + duplexer "~0.1.1" + +string_decoder@~0.10.x: + version "0.10.31" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" + +taskgroup@^4.0.5: + version "4.3.1" + resolved "https://registry.yarnpkg.com/taskgroup/-/taskgroup-4.3.1.tgz#7de193febd768273c457730497024d512c27915a" + dependencies: + ambi "^2.2.0" + csextends "^1.0.3" + +taskgroup@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/taskgroup/-/taskgroup-5.0.1.tgz#08736c9b24683b1434774231eb4b73aa7c3f79b5" + dependencies: + ambi "^2.5.0" + eachr "^3.2.0" + editions "^1.1.1" + extendr "^3.2.0" + +through@~2.3, through@~2.3.1, through@2: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +through2@^0.6.3: + version "0.6.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" + dependencies: + readable-stream ">=1.0.33-1 <1.1.0-0" + xtend ">=4.0.0 <4.1.0-0" + +through2@~0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.4.2.tgz#dbf5866031151ec8352bb6c4db64a2292a840b9b" + dependencies: + readable-stream "~1.0.17" + xtend "~2.1.1" + +through2@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.3.tgz#795292fde9f254c2a368b38f9cc5d1bd4663afb6" + dependencies: + readable-stream ">=1.0.33-1 <1.1.0-0" + xtend ">=4.0.0 <4.1.0-0" + +typechecker@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-4.3.0.tgz#6f6d6815753e88d6812aa80de4a3fd18948e6e62" + dependencies: + editions "^1.1.0" + +typedarray@~0.0.5: + version "0.0.6" + resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" + +typescript: + version "2.0.7" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.0.7.tgz#efc39e8822e240d0b741d06ff86708137bcdb5e4" + +unix-crypt-td-js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unix-crypt-td-js/-/unix-crypt-td-js-1.0.0.tgz#1c0824150481bc7a01d49e98f1ec668d82412f3b" + +unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + +utils-merge@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" + +vary@^1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.0.tgz#e1e5affbbd16ae768dd2674394b9ad3022653140" + +watchr@2.6.x: + version "2.6.0" + resolved "https://registry.yarnpkg.com/watchr/-/watchr-2.6.0.tgz#e75c423b10be79267a0c3ef76e2ea104fe0267a5" + dependencies: + eachr "^3.2.0" + extendr "^3.2.2" + extract-opts "^3.3.1" + ignorefs "^1.1.1" + safefs "^4.1.0" + scandirectory "^2.5.0" + taskgroup "^5.0.1" + typechecker "^4.3.0" + +websocket-driver@>=0.5.1: + version "0.6.5" + resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.6.5.tgz#5cb2556ceb85f4373c6d8238aa691c8454e13a36" + dependencies: + websocket-extensions ">=0.1.1" + +websocket-extensions@>=0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +xtend@^2.1.2: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.2.0.tgz#eef6b1f198c1c8deafad8b1765a04dad4a01c5a9" + +xtend@^4.0.0, "xtend@>=4.0.0 <4.1.0-0": + version "4.0.1" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" + +xtend@~2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.1.2.tgz#6efecc2a4dad8e6962c4901b337ce7ba87b5d28b" + dependencies: + object-keys "~0.4.0" + From a4e92fd344595be892b21b2008b5f34cb1d4c349 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Sat, 5 Nov 2016 20:56:32 -0400 Subject: [PATCH 02/30] Set project structure --- package.json | 22 +- src/assets/basics/bunny.png | Bin 449 -> 0 bytes src/assets/basics/nin.png | Bin 0 -> 462 bytes src/css/style.css | 3 + src/game/main.ts | 17 +- src/index.html | 5 +- src/tsconfig.json | 5 +- yarn.lock | 1135 ++++++++++++++++++++++++++++++++++- 8 files changed, 1150 insertions(+), 37 deletions(-) delete mode 100644 src/assets/basics/bunny.png create mode 100644 src/assets/basics/nin.png create mode 100644 src/css/style.css diff --git a/package.json b/package.json index a7c11ef9a..a83ad2d82 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,21 @@ "description": "Game for Github Gameoff 2016", "main": "dist/index.html", "scripts": { - "deploy-libs": "cp node_modules/pixi.js/bin/pixi.min.* dist/", - "deploy-assets": "cp -r src/assets dist", - "deploy-static": "cp src/index.html dist/", - "deploy": "mkdir -p dist; npm run deploy-libs; npm run deploy-assets; npm run deploy-static", - "start": "cd dist; live-server" + "deploy-libs": "mkdir -p dist; cp node_modules/pixi.js/bin/pixi.min.* dist/", + "deploy-watch-assets": "sync-files -w src/assets dist/assets", + "deploy-watch-styles": "sync-files -w src/css dist/css", + "deploy-watch-html": "sync-files -w src/index.html dist/index.html", + "deploy-assets": "sync-files src/assets dist/assets", + "deploy-styles": "sync-files src/css dist/css", + "deploy-html": "sync-files src/index.html dist/index.html", + + "deploy-watch": "npm run deploy-watch-assets & npm run deploy-watch-styles & npm run deploy-watch-html", + "build-tsc": "tsc --p src/tsconfig.json", + "build-tsc-watch": "tsc -w --p src/tsconfig.json", + "watch": "npm run deploy-watch & npm run build-tsc-watch & npm run deploy-libs", + "build": "npm run deploy & npm run build-tsc & npm run deploy-libs", + "serve": "cd dist; live-server", + "start": "npm run watch & npm run serve" }, "repository": { "url": "git+https://github.com/ropilz/game-off-2016.git", @@ -24,9 +34,9 @@ "url": "https://github.com/ropilz/game-off-2016/issues" }, "dependencies": { - "@types/pixi.js": "^3.0.30", "live-server": "^1.1.0", "pixi.js": "^4.1.1", + "sync-files": "^1.0.3", "typescript": "^2.0.7" } } diff --git a/src/assets/basics/bunny.png b/src/assets/basics/bunny.png deleted file mode 100644 index 79c31675083b7ffc272a6370bc189360bde484d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 449 zcmV;y0Y3hTP)SOJFMz`0@qn1GK$9W|wOohG3Lai}FkWLtiT<2<{JbM8>W7|R$! zUuNqg#gmKmsTnILy&K;zJjd^_40xy)%EA1>FWWk~LFpr>Et|!Hv(V>Hs9!2xEQJ>~!qz76HLsxFXdG zs5~GjUDeD6dXvG$_#HtoUok|M-X@BSTy{VK4P?TJZcz}O&FVzD0fZu8Yajr@?2aYL r_Q@_>J=ju&>AqoA-=wzwF98MsNX4cdx@v7EBk#eUU6yd?p9|`ppa~4NJNQqer|4RUI~!Pz~Eeznpl#W zqEMb$lA+-4=^K!um&(q-z-Z*@;uzv_d~N9N+`|R}woyfsje4hlU~&}msCF^(O_0zt z^0I2o+Uziab&JcaDVaJCcN*w;h`d);$x)H>fB*5FZIH_^hljFW=aN`9vGgde-2dR+zfP9g>pDqa|3x0<6)WJpqQH5HCA-m9rBux2U*O)mah&I$ zPc+H*zHb^5D$09!K~_M{#p~bo1qE&2yo)J3z0ll$@p~zs=i6t9oKFhLni!qnJb%I5 z=7byPl{ef{f0C4ai0fTr3EvTB^{pvPa{p>(KU0w_@P0B=I*#vsSX@Lf Hacker vs Robot + - + - \ No newline at end of file + diff --git a/src/tsconfig.json b/src/tsconfig.json index 4411bd25b..d51f87aef 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -1,12 +1,11 @@ { - "compileOnSave": true, - "buildOnSave": true, + "compileOnSave": false, + "buildOnSave": false, "compilerOptions": { "declaration": false, "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": ["es6", "dom"], - "mapRoot": "../../dist", "module": "es6", "moduleResolution": "node", "outDir": "../dist", diff --git a/yarn.lock b/yarn.lock index d6adab503..3e67952c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,8 +1,8 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 -"@types/pixi.js": - version "3.0.30" - resolved "https://registry.yarnpkg.com/@types/pixi.js/-/pixi.js-3.0.30.tgz#5ef5d4b4cab3d356b0417f959fb09ffe78a7aa50" +abbrev@1: + version "1.0.9" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" accepts@~1.3.3: version "1.3.3" @@ -26,6 +26,29 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" +ansi-regex@^0.2.0, ansi-regex@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9" + +ansi-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107" + +ansi-styles@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de" + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + +anymatch@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" + dependencies: + arrify "^1.0.0" + micromatch "^2.1.5" + apache-crypt@1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/apache-crypt/-/apache-crypt-1.1.2.tgz#820782a33bb6a5fd2712082f0ed3a24e3c9b0214" @@ -36,6 +59,73 @@ apache-md5@1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/apache-md5/-/apache-md5-1.0.6.tgz#470239d40c54e7c32dd9d6eb11bc3578ecc903c2" +aproba@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0" + +are-we-there-yet@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz#80e470e95a084794fe1899262c5667c6e88de1b3" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.0 || ^1.1.13" + +argparse@^1.0.7: + version "1.0.9" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + dependencies: + arr-flatten "^1.0.1" + +arr-flatten@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.1.tgz#e5ffe54d45e19f32f216e91eb99c8ce892bb604b" + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + +arrify@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" + +asn1@~0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" + +assert-plus@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" + +assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + +aws-sign2@~0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" + +aws4@^1.2.1: + version "1.5.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.5.0.tgz#0a29ffb79c31c9e712eeb087e8e7a64b4a56d755" + +balanced-match@^0.4.1: + version "0.4.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" + basic-auth@~1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-1.0.4.tgz#030935b01de7c9b94a824b29f3fccb750d3a5290" @@ -44,6 +134,16 @@ batch@0.5.3: version "0.5.3" resolved "https://registry.yarnpkg.com/batch/-/batch-0.5.3.tgz#3f3414f380321743bfc1042f9a83ff1d5824d464" +bcrypt-pbkdf@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.0.tgz#3ca76b85241c7170bf7d9703e7b9aa74630040d4" + dependencies: + tweetnacl "^0.14.3" + +binary-extensions@^1.0.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.7.0.tgz#6c1610db163abfb34edfe42fa423343a1e01185d" + bit-twiddle@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/bit-twiddle/-/bit-twiddle-1.0.2.tgz#0c6c1fabe2b23d17173d9a61b7b7093eb9e1769e" @@ -54,6 +154,33 @@ bl@^1.0.0: dependencies: readable-stream "~2.0.5" +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + +boom@2.x.x: + version "2.10.1" + resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" + dependencies: + hoek "2.x.x" + +brace-expansion@^1.0.0: + version "1.1.6" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.6.tgz#7197d7eaa9b87e648390ea61fc66c84427420df9" + dependencies: + balanced-match "^0.4.1" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + browserify-versionify@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/browserify-versionify/-/browserify-versionify-1.0.6.tgz#ab2dc61d6a119e627bec487598d1983b7fdb275e" @@ -61,6 +188,53 @@ browserify-versionify@^1.0.6: find-root "^0.1.1" through2 "0.6.3" +buffer-shims@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" + +caseless@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" + +chalk@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" + dependencies: + ansi-styles "^1.1.0" + escape-string-regexp "^1.0.0" + has-ansi "^0.1.0" + strip-ansi "^0.3.0" + supports-color "^0.2.0" + +chalk@^1.0.0, chalk@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chokidar@^1.0.0-rc3: + version "1.6.1" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + colors@~0.6.0-1: version "0.6.2" resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" @@ -69,10 +243,26 @@ colors@latest: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" +combined-stream@^1.0.5, combined-stream@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" + dependencies: + delayed-stream "~1.0.0" + +commander@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" + dependencies: + graceful-readlink ">= 1.0.0" + commander@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.1.0.tgz#d121bbae860d9992a3d517ba96f56588e47c6781" +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + concat-stream@~1.4.5: version "1.4.10" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.4.10.tgz#acc3bbf5602cb8cc980c6ac840fa7d8603e3ef36" @@ -81,6 +271,19 @@ concat-stream@~1.4.5: readable-stream "~1.1.9" typedarray "~0.0.5" +configstore@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-0.3.2.tgz#25e4c16c3768abf75c5a65bc61761f495055b459" + dependencies: + graceful-fs "^3.0.1" + js-yaml "^3.1.0" + mkdirp "^0.5.0" + object-assign "^2.0.0" + osenv "^0.1.0" + user-home "^1.0.0" + uuid "^2.0.1" + xdg-basedir "^1.0.0" + connect@3.4.x: version "3.4.1" resolved "https://registry.yarnpkg.com/connect/-/connect-3.4.1.tgz#a21361d3f4099ef761cda6dc4a973bb1ebb0a34d" @@ -90,6 +293,10 @@ connect@3.4.x: parseurl "~1.3.1" utils-merge "1.0.0" +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -100,16 +307,40 @@ cors@latest: dependencies: vary "^1" +cryptiles@2.x.x: + version "2.0.5" + resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8" + dependencies: + boom "2.x.x" + csextends@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/csextends/-/csextends-1.0.3.tgz#df41407bfddb1837ecc2dd28587725d6af9550f8" +dashdash@^1.12.0: + version "1.14.0" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.0.tgz#29e486c5418bf0f356034a993d51686a33e84141" + dependencies: + assert-plus "^1.0.0" + debug@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" dependencies: ms "0.7.1" +deep-extend@~0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + depd@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3" @@ -128,6 +359,15 @@ duplexer2@~0.0.2: dependencies: readable-stream "~1.1.9" +duplexify@^3.2.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.0.tgz#1aa773002e1578457e9d9d4a50b0ccaaebcbd604" + dependencies: + end-of-stream "1.0.0" + inherits "^2.0.1" + readable-stream "^2.0.0" + stream-shift "^1.0.0" + eachr@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/eachr/-/eachr-3.2.0.tgz#2c35e43ea086516f7997cf80b7aa64d55a4a4484" @@ -139,7 +379,13 @@ earcut@^2.0.7: version "2.1.1" resolved "https://registry.yarnpkg.com/earcut/-/earcut-2.1.1.tgz#157634e5f3ebb42224e475016e86a5b6ce556b45" -editions@^1.1.0, editions@^1.1.1, editions@^1.1.2: +ecc-jsbn@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" + dependencies: + jsbn "~0.1.0" + +editions@^1.1.0, editions@^1.1.1, editions@^1.1.2, editions@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/editions/-/editions-1.3.3.tgz#0907101bdda20fac3cbe334c27cbd0688dc99a5b" @@ -151,10 +397,20 @@ encodeurl@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" +end-of-stream@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.0.0.tgz#d4596e702734a93e40e9af864319eabd99ff2f0e" + dependencies: + once "~1.3.0" + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" +escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + escodegen@~0.0.24: version "0.0.28" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-0.0.28.tgz#0e4ff1715f328775d6cab51ac44a406cd7abffd3" @@ -174,6 +430,10 @@ escodegen@~1.3.2: optionalDependencies: source-map "~0.1.33" +esprima@^2.6.0: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + esprima@~1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad" @@ -218,6 +478,22 @@ events@^1.0.2: version "1.1.1" resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + dependencies: + is-posix-bracket "^0.1.0" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + dependencies: + fill-range "^2.1.0" + +extend@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" + extendr@^3.2.0, extendr@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/extendr/-/extendr-3.2.2.tgz#c6e46fe6d90b2e3e8812a6654bd6182cbf91cd06" @@ -225,6 +501,12 @@ extendr@^3.2.0, extendr@^3.2.2: editions "^1.1.2" typechecker "^4.3.0" +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + dependencies: + is-extglob "^1.0.0" + extract-opts@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/extract-opts/-/extract-opts-3.3.1.tgz#5abbedc98c0d5202e3278727f9192d7e086c6be1" @@ -233,6 +515,10 @@ extract-opts@^3.3.1: editions "^1.1.1" typechecker "^4.3.0" +extsprintf@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" + falafel@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/falafel/-/falafel-1.2.0.tgz#c18d24ef5091174a497f318cd24b026a25cddab4" @@ -248,6 +534,20 @@ faye-websocket@0.11.x: dependencies: websocket-driver ">=0.5.1" +filename-regex@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" + +fill-range@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^1.1.3" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + finalhandler@0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-0.4.1.tgz#85a17c6c59a94717d262d61230d4b0ebe3d4a14d" @@ -268,10 +568,32 @@ findup@^0.1.5: colors "~0.6.0-1" commander "~2.1.0" +for-in@^0.1.5: + version "0.1.6" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-0.1.6.tgz#c9f96e89bfad18a545af5ec3ed352a1d9e5b4dc8" + +for-own@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.4.tgz#0149b41a39088c7515f51ebe1c1386d45f935072" + dependencies: + for-in "^0.1.5" + foreach@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + +form-data@~2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.1.tgz#4adf0342e1a79afa1e84c8c320a9ffc82392a1f3" + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.5" + mime-types "^2.1.12" + fresh@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.3.0.tgz#651f838e22424e7566de161d8358caa199f83d4f" @@ -280,10 +602,100 @@ from@~0: version "0.1.3" resolved "https://registry.yarnpkg.com/from/-/from-0.1.3.tgz#ef63ac2062ac32acf7862e0d40b44b896f22f3bc" +fs-extra@^0.16.3: + version "0.16.5" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.16.5.tgz#1ad661fa6c86c9608cd1b49efc6fce834939a750" + dependencies: + graceful-fs "^3.0.5" + jsonfile "^2.0.0" + rimraf "^2.2.8" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +fsevents@^1.0.0: + version "1.0.15" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.0.15.tgz#fa63f590f3c2ad91275e4972a6cea545fb0aae44" + dependencies: + nan "^2.3.0" + node-pre-gyp "^0.6.29" + +fstream-ignore@~1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream@^1.0.0, fstream@^1.0.2, fstream@~1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.10.tgz#604e8a92fe26ffd9f6fae30399d4984e1ab22822" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + function-bind@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" +gauge@~2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.6.0.tgz#d35301ad18e96902b4751dcbbe40f4218b942a46" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-color "^0.1.7" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +generate-function@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74" + +generate-object-property@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" + dependencies: + is-property "^1.0.0" + +getpass@^0.1.1: + version "0.1.6" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" + dependencies: + assert-plus "^1.0.0" + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + dependencies: + is-glob "^2.0.0" + +glob@^7.0.5: + version "7.1.1" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.2" + once "^1.3.0" + path-is-absolute "^1.0.0" + glsl-inject-defines@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/glsl-inject-defines/-/glsl-inject-defines-1.0.3.tgz#dd1aacc2c17fcb2bd3fc32411c6633d0d7b60fd4" @@ -390,16 +802,83 @@ glslify@^5.0.2: through2 "^0.6.3" xtend "^4.0.0" -graceful-fs@*, graceful-fs@^4.1.2, graceful-fs@^4.1.4: +got@^3.2.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/got/-/got-3.3.1.tgz#e5d0ed4af55fc3eef4d56007769d98192bcb2eca" + dependencies: + duplexify "^3.2.0" + infinity-agent "^2.0.0" + is-redirect "^1.0.0" + is-stream "^1.0.0" + lowercase-keys "^1.0.0" + nested-error-stacks "^1.0.0" + object-assign "^3.0.0" + prepend-http "^1.0.0" + read-all-stream "^3.0.0" + timed-out "^2.0.0" + +graceful-fs@*, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: version "4.1.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.10.tgz#f2d720c22092f743228775c75e3612632501f131" +graceful-fs@^3.0.1, graceful-fs@^3.0.5: + version "3.0.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" + dependencies: + natives "^1.1.0" + +"graceful-readlink@>= 1.0.0": + version "1.0.1" + resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" + +har-validator@~2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" + dependencies: + chalk "^1.1.1" + commander "^2.9.0" + is-my-json-valid "^2.12.4" + pinkie-promise "^2.0.0" + +has-ansi@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e" + dependencies: + ansi-regex "^0.2.0" + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + dependencies: + ansi-regex "^2.0.0" + +has-color@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + has@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" dependencies: function-bind "^1.0.2" +hawk@~3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" + dependencies: + boom "2.x.x" + cryptiles "2.x.x" + hoek "2.x.x" + sntp "1.x.x" + +hoek@2.x.x: + version "2.16.3" + resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" + http-auth@2.4.x: version "2.4.11" resolved "https://registry.yarnpkg.com/http-auth/-/http-auth-2.4.11.tgz#61f024a6e0e7c48934944895c87a1395509c619b" @@ -416,18 +895,37 @@ http-errors@~1.5.0: setprototypeof "1.0.1" statuses ">= 1.3.0 < 2" -ignorefs@^1.0.0, ignorefs@^1.1.1: +http-signature@~1.1.0: version "1.1.1" - resolved "https://registry.yarnpkg.com/ignorefs/-/ignorefs-1.1.1.tgz#f97f8525a88e1ed101771e65d0438e060d9dd95d" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" dependencies: - editions "^1.1.1" - ignorepatterns "^1.0.1" + assert-plus "^0.2.0" + jsprim "^1.2.2" + sshpk "^1.7.0" -ignorepatterns@^1.0.1: +ignorefs@^1.0.0, ignorefs@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ignorefs/-/ignorefs-1.2.0.tgz#da59fb858976e4a5e43702ccd1f282fdbc9e5756" + dependencies: + editions "^1.3.3" + ignorepatterns "^1.1.0" + +ignorepatterns@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ignorepatterns/-/ignorepatterns-1.1.0.tgz#ac8f436f2239b5dfb66d5f0d3a904a87ac67cc5e" -inherits@^2.0.1, inherits@~2.0.1: +infinity-agent@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/infinity-agent/-/infinity-agent-2.0.3.tgz#45e0e2ff7a9eb030b27d62b74b3744b7a7ac4216" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@^2.0.1, inherits@~2.0.0, inherits@~2.0.1, inherits@2: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -435,7 +933,94 @@ inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" -isarray@~1.0.0: +ini@~1.3.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + +is-buffer@^1.0.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" + +is-dotfile@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + dependencies: + number-is-nan "^1.0.0" + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + dependencies: + is-extglob "^1.0.0" + +is-my-json-valid@^2.12.4: + version "2.15.0" + resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" + dependencies: + generate-function "^2.0.0" + generate-object-property "^1.1.0" + jsonpointer "^4.0.0" + xtend "^4.0.0" + +is-npm@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" + +is-number@^2.0.2, is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + dependencies: + kind-of "^3.0.2" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + +is-property@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" + +is-redirect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" + +is-stream@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + +isarray@~1.0.0, isarray@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -447,7 +1032,72 @@ ismobilejs@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/ismobilejs/-/ismobilejs-0.4.0.tgz#7b986252118e552137f36e42c21794af6c91558f" -live-server: +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + dependencies: + isarray "1.0.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + +jodid25519@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" + dependencies: + jsbn "~0.1.0" + +js-yaml@^3.1.0: + version "3.6.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" + dependencies: + argparse "^1.0.7" + esprima "^2.6.0" + +jsbn@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + +jsonfile@^2.0.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + optionalDependencies: + graceful-fs "^4.1.6" + +jsonpointer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.0.tgz#6661e161d2fc445f19f98430231343722e1fcbd5" + +jsprim@^1.2.2: + version "1.3.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.3.1.tgz#2a7256f70412a29ee3670aaca625994c4dcff252" + dependencies: + extsprintf "1.0.2" + json-schema "0.2.3" + verror "1.3.6" + +kind-of@^3.0.2: + version "3.0.4" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.0.4.tgz#7b8ecf18a4e17f8269d73b501c9f232c96887a74" + dependencies: + is-buffer "^1.0.2" + +latest-version@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-1.0.1.tgz#72cfc46e3e8d1be651e1ebb54ea9f6ea96f374bb" + dependencies: + package-json "^1.0.0" + +live-server@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/live-server/-/live-server-1.1.0.tgz#a69f0e6ca581e0391aa57941970e17c308dd4869" dependencies: @@ -465,6 +1115,14 @@ live-server: serve-index "^1.7.2" watchr "2.6.x" +lodash@^3.1.0: + version "3.10.1" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" + +lowercase-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" + map-limit@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/map-limit/-/map-limit-0.0.1.tgz#eb7961031c0f0e8d001bf2d56fab685d58822f38" @@ -475,11 +1133,29 @@ map-stream@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" +micromatch@^2.1.5: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + mime-db@~1.24.0: version "1.24.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.24.0.tgz#e2d13f939f0016c6e4e9ad25a8652f126c467f0c" -mime-types@~2.1.11: +mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.7: version "2.1.12" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.12.tgz#152ba256777020dd4663f54c2e7bc26381e71729" dependencies: @@ -489,7 +1165,13 @@ mime@1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" -minimist@^1.2.0: +minimatch@^3.0.0, minimatch@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" + dependencies: + brace-expansion "^1.0.0" + +minimist@^1.1.0, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -497,6 +1179,12 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" +mkdirp@^0.5.0, "mkdirp@>=0.5 0", mkdirp@~0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + dependencies: + minimist "0.0.8" + morgan@^1.6.1: version "1.7.0" resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.7.0.tgz#eb10ca8e50d1abe0f8d3dad5c0201d052d981c62" @@ -515,15 +1203,78 @@ murmurhash-js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/murmurhash-js/-/murmurhash-js-1.0.0.tgz#b06278e21fc6c37fa5313732b0412bcb6ae15f51" +nan@^2.3.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.4.0.tgz#fb3c59d45fe4effe215f0b890f8adf6eb32d2232" + +natives@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.0.tgz#e9ff841418a6b2ec7a495e939984f78f163e6e31" + negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" -node-uuid@^1.4.7: +nested-error-stacks@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz#19f619591519f096769a5ba9a86e6eeec823c3cf" + dependencies: + inherits "~2.0.1" + +node-pre-gyp@^0.6.29: + version "0.6.31" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.31.tgz#d8a00ddaa301a940615dbcc8caad4024d58f6017" + dependencies: + mkdirp "~0.5.1" + nopt "~3.0.6" + npmlog "^4.0.0" + rc "~1.1.6" + request "^2.75.0" + rimraf "~2.5.4" + semver "~5.3.0" + tar "~2.2.1" + tar-pack "~3.3.0" + +node-uuid@^1.4.7, node-uuid@~1.4.7: version "1.4.7" resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.7.tgz#6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f" -object-assign@^4.0.1, object-assign@latest: +nopt@~3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" + dependencies: + abbrev "1" + +normalize-path@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" + +npmlog@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.0.tgz#e094503961c70c1774eb76692080e8d578a9f88f" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.6.0" + set-blocking "~2.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + +oauth-sign@~0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" + +object-assign@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-2.1.1.tgz#43c36e5d569ff8e4816c4efa8be02d26967c18aa" + +object-assign@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" + +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@latest: version "4.1.0" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" @@ -539,6 +1290,13 @@ object-keys@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-0.4.0.tgz#28a6aae7428dd2c3a92f3d95f21335dd204e0336" +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -549,7 +1307,13 @@ on-headers@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.1.tgz#928f5d0f470d49342651ea6794b0857c100693f7" -once@~1.3.0: +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +once@~1.3.0, once@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" dependencies: @@ -562,6 +1326,37 @@ opn@latest: object-assign "^4.0.1" pinkie-promise "^2.0.0" +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + +os-tmpdir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + +osenv@^0.1.0: + version "0.1.3" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.3.tgz#83cf05c6d6458fc4d5ac6362ea325d92f2754217" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +package-json@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/package-json/-/package-json-1.2.0.tgz#c8ecac094227cdf76a316874ed05e27cc939a0e0" + dependencies: + got "^3.2.0" + registry-url "^3.0.0" + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + parse-uri@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-uri/-/parse-uri-1.0.0.tgz#2872dcc22f1a797acde1583d8a0ac29552ddac20" @@ -570,6 +1365,10 @@ parseurl@~1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56" +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + pause-stream@0.0.11: version "0.0.11" resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" @@ -590,7 +1389,7 @@ pixi-gl-core@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/pixi-gl-core/-/pixi-gl-core-1.0.3.tgz#3bd4fb3538a2ee601a048d8dc01f6df55e0b3550" -pixi.js: +pixi.js@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/pixi.js/-/pixi.js-4.1.1.tgz#d62657d90ef3d290d8dfda6e5cf82cc87a2a0f3e" dependencies: @@ -604,6 +1403,14 @@ pixi.js: pixi-gl-core "^1.0.2" resource-loader "^1.8.0" +prepend-http@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" @@ -612,6 +1419,14 @@ proxy-middleware@latest: version "0.15.0" resolved "https://registry.yarnpkg.com/proxy-middleware/-/proxy-middleware-0.15.0.tgz#a3fdf1befb730f951965872ac2f6074c61477a56" +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + +qs@~6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" + quote-stream@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/quote-stream/-/quote-stream-0.0.0.tgz#cde29e94c409b16e19dc7098b89b6658f9721d3b" @@ -619,10 +1434,45 @@ quote-stream@~0.0.0: minimist "0.0.8" through2 "~0.4.1" +randomatic@^1.1.3: + version "1.1.5" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.5.tgz#5e9ef5f2d573c67bd2b8124ae90b5156e457840b" + dependencies: + is-number "^2.0.2" + kind-of "^3.0.2" + range-parser@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" +rc@^1.0.1, rc@~1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" + dependencies: + deep-extend "~0.4.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~1.0.4" + +read-all-stream@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa" + dependencies: + pinkie-promise "^2.0.0" + readable-stream "^2.0.0" + +readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@~2.1.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" + dependencies: + buffer-shims "^1.0.0" + core-util-is "~1.0.0" + inherits "~2.0.1" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + string_decoder "~0.10.x" + util-deprecate "~1.0.1" + "readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@~1.0.17, readable-stream@~1.0.27-1: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" @@ -652,6 +1502,61 @@ readable-stream@~2.0.5: string_decoder "~0.10.x" util-deprecate "~1.0.1" +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + +regex-cache@^0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" + dependencies: + is-equal-shallow "^0.1.3" + is-primitive "^2.0.0" + +registry-url@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" + dependencies: + rc "^1.0.1" + +repeat-element@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" + +repeat-string@^1.5.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + +request@^2.75.0: + version "2.78.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.78.0.tgz#e1c8dec346e1c81923b24acdb337f11decabe9cc" + dependencies: + aws-sign2 "~0.6.0" + aws4 "^1.2.1" + caseless "~0.11.0" + combined-stream "~1.0.5" + extend "~3.0.0" + forever-agent "~0.6.1" + form-data "~2.1.1" + har-validator "~2.0.6" + hawk "~3.1.3" + http-signature "~1.1.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.7" + node-uuid "~1.4.7" + oauth-sign "~0.8.1" + qs "~6.3.0" + stringstream "~0.0.4" + tough-cookie "~2.3.0" + tunnel-agent "~0.4.1" + resolve@^0.6.1: version "0.6.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-0.6.3.tgz#dd957982e7e736debdf53b58a4dd91754575dd46" @@ -667,6 +1572,12 @@ resource-loader@^1.8.0: eventemitter3 "^2.0.0" parse-uri "^1.0.0" +rimraf@^2.2.8, rimraf@~2.5.1, rimraf@~2.5.4, rimraf@2: + version "2.5.4" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" + dependencies: + glob "^7.0.5" + safefs@^3.1.2: version "3.2.2" resolved "https://registry.yarnpkg.com/safefs/-/safefs-3.2.2.tgz#8170c1444d7038e08caea05a374fae2fa349e15c" @@ -688,6 +1599,16 @@ scandirectory@^2.5.0: safefs "^3.1.2" taskgroup "^4.0.5" +semver-diff@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" + dependencies: + semver "^5.0.3" + +semver@^5.0.3, semver@~5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" + send@latest: version "0.14.1" resolved "https://registry.yarnpkg.com/send/-/send-0.14.1.tgz#a954984325392f51532a7760760e459598c89f7a" @@ -718,6 +1639,14 @@ serve-index@^1.7.2: mime-types "~2.1.11" parseurl "~1.3.1" +set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + setprototypeof@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.1.tgz#52009b27888c4dc48f591949c0a8275834c1ca7e" @@ -726,6 +1655,16 @@ shallow-copy@~0.0.1, shallow-copy@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/shallow-copy/-/shallow-copy-0.0.1.tgz#415f42702d73d810330292cc5ee86eae1a11a170" +signal-exit@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.1.tgz#5a4c884992b63a7acd9badb7894c3ee9cfccad81" + +sntp@1.x.x: + version "1.0.9" + resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" + dependencies: + hoek "2.x.x" + "source-map@>= 0.1.2": version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -742,6 +1681,25 @@ split@0.3: dependencies: through "2" +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + +sshpk@^1.7.0: + version "1.10.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.10.1.tgz#30e1a5d329244974a1af61511339d595af6638b0" + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + dashdash "^1.12.0" + getpass "^0.1.1" + optionalDependencies: + bcrypt-pbkdf "^1.0.0" + ecc-jsbn "~0.1.1" + jodid25519 "^1.0.0" + jsbn "~0.1.0" + tweetnacl "~0.14.0" + static-eval@~0.2.0: version "0.2.4" resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-0.2.4.tgz#b7d34d838937b969f9641ca07d48f8ede263ea7b" @@ -774,10 +1732,88 @@ stream-combiner@~0.0.4: dependencies: duplexer "~0.1.1" +stream-shift@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" +string-length@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" + dependencies: + strip-ansi "^3.0.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +stringstream@~0.0.4: + version "0.0.5" + resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" + +strip-ansi@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.3.0.tgz#25f48ea22ca79187f3174a4db8759347bb126220" + dependencies: + ansi-regex "^0.2.1" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + dependencies: + ansi-regex "^2.0.0" + +strip-json-comments@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" + +supports-color@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + +sync-files@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sync-files/-/sync-files-1.0.3.tgz#92e610cffb350d177bdf96bd0a5a505bcdcd9306" + dependencies: + chalk "^0.5.1" + chokidar "^1.0.0-rc3" + fs-extra "^0.16.3" + lodash "^3.1.0" + minimist "^1.1.0" + update-notifier "^0.3.0" + +tar-pack@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" + dependencies: + debug "~2.2.0" + fstream "~1.0.10" + fstream-ignore "~1.0.5" + once "~1.3.3" + readable-stream "~2.1.4" + rimraf "~2.5.1" + tar "~2.2.1" + uid-number "~0.0.6" + +tar@~2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + taskgroup@^4.0.5: version "4.3.1" resolved "https://registry.yarnpkg.com/taskgroup/-/taskgroup-4.3.1.tgz#7de193febd768273c457730497024d512c27915a" @@ -819,6 +1855,24 @@ through2@0.6.3: readable-stream ">=1.0.33-1 <1.1.0-0" xtend ">=4.0.0 <4.1.0-0" +timed-out@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-2.0.0.tgz#f38b0ae81d3747d628001f41dafc652ace671c0a" + +tough-cookie@~2.3.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" + dependencies: + punycode "^1.4.1" + +tunnel-agent@~0.4.1: + version "0.4.3" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.3" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.3.tgz#3da382f670f25ded78d7b3d1792119bca0b7132d" + typechecker@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-4.3.0.tgz#6f6d6815753e88d6812aa80de4a3fd18948e6e62" @@ -829,10 +1883,14 @@ typedarray@~0.0.5: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript: +typescript@^2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.0.7.tgz#efc39e8822e240d0b741d06ff86708137bcdb5e4" +uid-number@~0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + unix-crypt-td-js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unix-crypt-td-js/-/unix-crypt-td-js-1.0.0.tgz#1c0824150481bc7a01d49e98f1ec668d82412f3b" @@ -841,6 +1899,21 @@ unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" +update-notifier@^0.3.0: + version "0.3.2" + resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-0.3.2.tgz#22a8735baadef3320e2db928f693da898dc87777" + dependencies: + chalk "^1.0.0" + configstore "^0.3.1" + is-npm "^1.0.0" + latest-version "^1.0.0" + semver-diff "^2.0.0" + string-length "^1.0.0" + +user-home@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -849,10 +1922,20 @@ utils-merge@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" +uuid@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" + vary@^1: version "1.1.0" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.0.tgz#e1e5affbbd16ae768dd2674394b9ad3022653140" +verror@1.3.6: + version "1.3.6" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.3.6.tgz#cff5df12946d297d2baaefaa2689e25be01c005c" + dependencies: + extsprintf "1.0.2" + watchr@2.6.x: version "2.6.0" resolved "https://registry.yarnpkg.com/watchr/-/watchr-2.6.0.tgz#e75c423b10be79267a0c3ef76e2ea104fe0267a5" @@ -876,10 +1959,22 @@ websocket-extensions@>=0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7" +wide-align@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad" + dependencies: + string-width "^1.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" +xdg-basedir@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-1.0.1.tgz#14ff8f63a4fdbcb05d5b6eea22b36f3033b9f04e" + dependencies: + user-home "^1.0.0" + xtend@^2.1.2: version "2.2.0" resolved "https://registry.yarnpkg.com/xtend/-/xtend-2.2.0.tgz#eef6b1f198c1c8deafad8b1765a04dad4a01c5a9" From 848ef94e60e4c3ba68bd7a86fd0e66e762be895e Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Sat, 5 Nov 2016 21:46:51 -0400 Subject: [PATCH 03/30] Update tooling --- package.json | 9 +++++---- src/index.html | 11 ++++++++++- src/tsconfig.json | 8 ++++---- src/typings/{pixi.js.d.ts => pixi/index.d.ts} | 0 yarn.lock | 10 ++++++++++ 5 files changed, 29 insertions(+), 9 deletions(-) rename src/typings/{pixi.js.d.ts => pixi/index.d.ts} (100%) diff --git a/package.json b/package.json index a83ad2d82..1ca6c498a 100644 --- a/package.json +++ b/package.json @@ -4,21 +4,21 @@ "description": "Game for Github Gameoff 2016", "main": "dist/index.html", "scripts": { - "deploy-libs": "mkdir -p dist; cp node_modules/pixi.js/bin/pixi.min.* dist/", + "deploy-libs": "cp node_modules/pixi.js/bin/pixi.min.* node_modules/systemjs/dist/system.js* dist/", "deploy-watch-assets": "sync-files -w src/assets dist/assets", "deploy-watch-styles": "sync-files -w src/css dist/css", "deploy-watch-html": "sync-files -w src/index.html dist/index.html", "deploy-assets": "sync-files src/assets dist/assets", "deploy-styles": "sync-files src/css dist/css", "deploy-html": "sync-files src/index.html dist/index.html", - + "deploy": "npm run deploy-assets; npm run deploy-styles; npm run deploy-html", "deploy-watch": "npm run deploy-watch-assets & npm run deploy-watch-styles & npm run deploy-watch-html", "build-tsc": "tsc --p src/tsconfig.json", "build-tsc-watch": "tsc -w --p src/tsconfig.json", "watch": "npm run deploy-watch & npm run build-tsc-watch & npm run deploy-libs", - "build": "npm run deploy & npm run build-tsc & npm run deploy-libs", + "build": "npm run deploy; npm run build-tsc; npm run deploy-libs", "serve": "cd dist; live-server", - "start": "npm run watch & npm run serve" + "start": "npm run build; npm run watch & npm run serve" }, "repository": { "url": "git+https://github.com/ropilz/game-off-2016.git", @@ -37,6 +37,7 @@ "live-server": "^1.1.0", "pixi.js": "^4.1.1", "sync-files": "^1.0.3", + "systemjs": "^0.19.40", "typescript": "^2.0.7" } } diff --git a/src/index.html b/src/index.html index 0aa57f5d5..de09c5579 100644 --- a/src/index.html +++ b/src/index.html @@ -7,7 +7,16 @@ - + + diff --git a/src/tsconfig.json b/src/tsconfig.json index d51f87aef..dc1e51e99 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -6,17 +6,17 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": ["es6", "dom"], - "module": "es6", + "module": "system", "moduleResolution": "node", - "outDir": "../dist", + "outFile": "../dist/main.js", "sourceMap": true, - "target": "es5", + "target": "es6", "baseUrl": "", "typeRoots": [ "./typings" ], "types": [ - "pixi.js" + "PIXI" ] }, "exclude": [ diff --git a/src/typings/pixi.js.d.ts b/src/typings/pixi/index.d.ts similarity index 100% rename from src/typings/pixi.js.d.ts rename to src/typings/pixi/index.d.ts diff --git a/yarn.lock b/yarn.lock index 3e67952c3..397dbdbb3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1793,6 +1793,12 @@ sync-files@^1.0.3: minimist "^1.1.0" update-notifier "^0.3.0" +systemjs: + version "0.19.40" + resolved "https://registry.yarnpkg.com/systemjs/-/systemjs-0.19.40.tgz#158f64a9f4ef541a7fda6b40e527ee46b6c54cd0" + dependencies: + when "^3.7.5" + tar-pack@~3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.3.0.tgz#30931816418f55afc4d21775afdd6720cee45dae" @@ -1959,6 +1965,10 @@ websocket-extensions@>=0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7" +when@^3.7.5: + version "3.7.7" + resolved "https://registry.yarnpkg.com/when/-/when-3.7.7.tgz#aba03fc3bb736d6c88b091d013d8a8e590d84718" + wide-align@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad" From cfb471f5502894a04396dad939352599758ca003 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Sat, 5 Nov 2016 22:06:57 -0400 Subject: [PATCH 04/30] Fix github pages System base URL --- src/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.html b/src/index.html index de09c5579..7e8d7d5c8 100644 --- a/src/index.html +++ b/src/index.html @@ -11,7 +11,7 @@ - - - - diff --git a/src/tsconfig.json b/src/tsconfig.json index dc1e51e99..d8fca0e57 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -6,11 +6,10 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "lib": ["es6", "dom"], - "module": "system", + "module": "es6", "moduleResolution": "node", - "outFile": "../dist/main.js", "sourceMap": true, - "target": "es6", + "target": "es5", "baseUrl": "", "typeRoots": [ "./typings" diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 000000000..65ecf1c8d --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,44 @@ +'use strict'; + +const webpack = require("webpack"); +const HtmlWebpackPlugin = require('html-webpack-plugin'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); +const CleanWebpackPlugin = require('clean-webpack-plugin'); + +module.exports = { + context: __dirname + "/src", + entry: { + app: "./game/main.ts" + }, + devtool: 'source-map', + resolve: { + extensions: ['.ts', '.js'] + }, + output: { + path: __dirname + "/dist", + filename: "[name].bundle.js", + }, + module: { + rules: [ + { + test: /\.ts$/, + use: [{ + loader: "ts-loader" + }] + } + ], + }, + plugins: [ + new CleanWebpackPlugin(['assets', 'css'], {}), + new HtmlWebpackPlugin ({ + inject: true, + template: './index.html' + }), + new CopyWebpackPlugin([ + {from: '../node_modules/pixi.js/bin/pixi.min.js'}, + {from: '../node_modules/pixi.js/bin/pixi.min.js.map'}, + {from: './assets', to: './assets'}, + {from: './css', to: './css'} + ]) + ] +}; diff --git a/yarn.lock b/yarn.lock index 397dbdbb3..d036c7c39 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15,29 +15,33 @@ acorn@^1.0.3: version "1.2.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-1.2.2.tgz#c8ce27de0acc76d896d2b1fad3df588d9e82f014" -ambi@^2.2.0, ambi@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/ambi/-/ambi-2.5.0.tgz#7c8e372be48891157e7cea01cb6f9143d1f74220" +acorn@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + +ajv@^4.7.0: + version "4.8.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.8.2.tgz#65486936ca36fea39a1504332a78bebd5d447bdc" dependencies: - editions "^1.1.1" - typechecker "^4.3.0" + co "^4.6.0" + json-stable-stringify "^1.0.1" + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-regex@^0.2.0, ansi-regex@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9" - ansi-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.0.0.tgz#c5061b6e0ef8a81775e50f5d66151bf6bf371107" -ansi-styles@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de" - ansi-styles@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" @@ -49,16 +53,6 @@ anymatch@^1.3.0: arrify "^1.0.0" micromatch "^2.1.5" -apache-crypt@1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/apache-crypt/-/apache-crypt-1.1.2.tgz#820782a33bb6a5fd2712082f0ed3a24e3c9b0214" - dependencies: - unix-crypt-td-js "^1.0.0" - -apache-md5@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/apache-md5/-/apache-md5-1.0.6.tgz#470239d40c54e7c32dd9d6eb11bc3578ecc903c2" - aproba@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.0.4.tgz#2713680775e7614c8ba186c065d4e2e52d1072c0" @@ -70,12 +64,6 @@ are-we-there-yet@~1.1.2: delegates "^1.0.0" readable-stream "^2.0.0 || ^1.1.13" -argparse@^1.0.7: - version "1.0.9" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" - dependencies: - sprintf-js "~1.0.2" - arr-diff@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" @@ -86,6 +74,10 @@ arr-flatten@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.1.tgz#e5ffe54d45e19f32f216e91eb99c8ce892bb604b" +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + array-unique@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" @@ -94,6 +86,14 @@ arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" +asn1.js@^4.0.0: + version "4.9.0" + resolved "https://registry.yarnpkg.com/asn1.js/-/asn1.js-4.9.0.tgz#f71a1243f3e79d46d7b07d7fbf4824ee73af054a" + dependencies: + bn.js "^4.0.0" + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + asn1@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86" @@ -106,10 +106,30 @@ assert-plus@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" +assert@^1.1.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/assert/-/assert-1.4.1.tgz#99912d591836b5a6f5b345c0f07eefc08fc65d91" + dependencies: + util "0.10.3" + async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" +async@^1.3.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" + +async@~0.2.6: + version "0.2.10" + resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" + +async@2.0.0-rc.4: + version "2.0.0-rc.4" + resolved "https://registry.yarnpkg.com/async/-/async-2.0.0-rc.4.tgz#9b7f60724c17962a973f787419e0ebc5571dbad8" + dependencies: + lodash "^4.3.0" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -126,9 +146,13 @@ balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" -basic-auth@~1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-1.0.4.tgz#030935b01de7c9b94a824b29f3fccb750d3a5290" +base64-js@^1.0.2: + version "1.2.0" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.2.0.tgz#a39992d723584811982be5e290bb6a53d86700f1" + +Base64@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/Base64/-/Base64-0.2.1.tgz#ba3a4230708e186705065e66babdd4c35cf60028" batch@0.5.3: version "0.5.3" @@ -140,6 +164,10 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" +big.js@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/big.js/-/big.js-3.1.3.tgz#4cada2193652eb3ca9ec8e55c9015669c9806978" + binary-extensions@^1.0.0: version "1.7.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.7.0.tgz#6c1610db163abfb34edfe42fa423343a1e01185d" @@ -160,6 +188,22 @@ block-stream@*: dependencies: inherits "~2.0.0" +bluebird@^2.10.2: + version "2.11.0" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1" + +bluebird@^3.4.6: + version "3.4.6" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.6.tgz#01da8d821d87813d158967e743d5fe6c62cf8c0f" + +bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: + version "4.11.6" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" + +boolbase@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + boom@2.x.x: version "2.10.1" resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" @@ -181,6 +225,55 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" +brorand@^1.0.1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.0.6.tgz#4028706b915f91f7b349a2e0bf3c376039d216e5" + +browserify-aes@^1.0.0, browserify-aes@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.0.6.tgz#5e7725dbdef1fd5930d4ebab48567ce451c48a0a" + dependencies: + buffer-xor "^1.0.2" + cipher-base "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + inherits "^2.0.1" + +browserify-cipher@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-cipher/-/browserify-cipher-1.0.0.tgz#9988244874bf5ed4e28da95666dcd66ac8fc363a" + dependencies: + browserify-aes "^1.0.4" + browserify-des "^1.0.0" + evp_bytestokey "^1.0.0" + +browserify-des@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/browserify-des/-/browserify-des-1.0.0.tgz#daa277717470922ed2fe18594118a175439721dd" + dependencies: + cipher-base "^1.0.1" + des.js "^1.0.0" + inherits "^2.0.1" + +browserify-rsa@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/browserify-rsa/-/browserify-rsa-4.0.1.tgz#21e0abfaf6f2029cf2fafb133567a701d4135524" + dependencies: + bn.js "^4.1.0" + randombytes "^2.0.1" + +browserify-sign@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/browserify-sign/-/browserify-sign-4.0.0.tgz#10773910c3c206d5420a46aad8694f820b85968f" + dependencies: + bn.js "^4.1.1" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.2" + elliptic "^6.0.0" + inherits "^2.0.1" + parse-asn1 "^5.0.0" + browserify-versionify@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/browserify-versionify/-/browserify-versionify-1.0.6.tgz#ab2dc61d6a119e627bec487598d1983b7fdb275e" @@ -188,25 +281,63 @@ browserify-versionify@^1.0.6: find-root "^0.1.1" through2 "0.6.3" +browserify-zlib@~0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/browserify-zlib/-/browserify-zlib-0.1.4.tgz#bb35f8a519f600e0fa6b8485241c979d0141fb2d" + dependencies: + pako "~0.2.0" + buffer-shims@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" +buffer-xor@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + +buffer@^4.3.0: + version "4.9.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-4.9.1.tgz#6d1bb601b07a4efced97094132093027c95bc298" + dependencies: + base64-js "^1.0.2" + ieee754 "^1.1.4" + isarray "^1.0.0" + +builtin-modules@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +bytes@2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-2.3.0.tgz#d5b680a165b6201739acb611542aabc2d8ceb070" + +camel-case@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camel-case/-/camel-case-3.0.0.tgz#ca3c3688a4e9cf3a4cda777dc4dcbc713249cf73" + dependencies: + no-case "^2.2.0" + upper-case "^1.1.1" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + caseless@~0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7" -chalk@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" dependencies: - ansi-styles "^1.1.0" - escape-string-regexp "^1.0.0" - has-ansi "^0.1.0" - strip-ansi "^0.3.0" - supports-color "^0.2.0" + align-text "^0.1.3" + lazy-cache "^1.0.3" -chalk@^1.0.0, chalk@^1.1.1: +chalk@^1.1.1: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -216,7 +347,30 @@ chalk@^1.0.0, chalk@^1.1.1: strip-ansi "^3.0.0" supports-color "^2.0.0" -chokidar@^1.0.0-rc3: +change-case@3.0.x: + version "3.0.0" + resolved "https://registry.yarnpkg.com/change-case/-/change-case-3.0.0.tgz#6c9c8e35f8790870a82b6b0745be8c3cbef9b081" + dependencies: + camel-case "^3.0.0" + constant-case "^2.0.0" + dot-case "^2.1.0" + header-case "^1.0.0" + is-lower-case "^1.1.0" + is-upper-case "^1.1.0" + lower-case "^1.1.1" + lower-case-first "^1.0.0" + no-case "^2.2.0" + param-case "^2.1.0" + pascal-case "^2.0.0" + path-case "^2.1.0" + sentence-case "^2.1.0" + snake-case "^2.1.0" + swap-case "^1.1.0" + title-case "^2.1.0" + upper-case "^1.1.1" + upper-case-first "^1.1.0" + +chokidar@^1.4.3, chokidar@^1.6.0: version "1.6.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" dependencies: @@ -231,25 +385,68 @@ chokidar@^1.0.0-rc3: optionalDependencies: fsevents "^1.0.0" +cipher-base@^1.0.0, cipher-base@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.3.tgz#eeabf194419ce900da3018c207d212f2a6df0a07" + dependencies: + inherits "^2.0.1" + +clean-css@3.4.x: + version "3.4.20" + resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-3.4.20.tgz#c0d8963b5448e030f0bcd3ddd0dac4dfe3dea501" + dependencies: + commander "2.8.x" + source-map "0.4.x" + +clean-webpack-plugin@^0.1.14: + version "0.1.14" + resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-0.1.14.tgz#72e577e90d38a5b8a42a2d3a9c055c45b84e2194" + dependencies: + rimraf "~2.5.1" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + +clone@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" +colors@^1.0.3: + version "1.1.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" + colors@~0.6.0-1: version "0.6.2" resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" -colors@latest: - version "1.1.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" - combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" dependencies: delayed-stream "~1.0.0" -commander@^2.9.0: +commander@^2.9.0, commander@2.9.x: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: @@ -259,6 +456,29 @@ commander@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.1.0.tgz#d121bbae860d9992a3d517ba96f56588e47c6781" +commander@2.8.x: + version "2.8.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.8.1.tgz#06be367febfda0c330aa1e2a072d3dc9762425d4" + dependencies: + graceful-readlink ">= 1.0.0" + +compressible@~2.0.8: + version "2.0.9" + resolved "https://registry.yarnpkg.com/compressible/-/compressible-2.0.9.tgz#6daab4e2b599c2770dd9e21e7a891b1c5a755425" + dependencies: + mime-db ">= 1.24.0 < 2" + +compression@^1.5.2: + version "1.6.2" + resolved "https://registry.yarnpkg.com/compression/-/compression-1.6.2.tgz#cceb121ecc9d09c52d7ad0c3350ea93ddd402bc3" + dependencies: + accepts "~1.3.3" + bytes "2.3.0" + compressible "~2.0.8" + debug "~2.2.0" + on-headers "~1.0.1" + vary "~1.1.0" + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -271,41 +491,85 @@ concat-stream@~1.4.5: readable-stream "~1.1.9" typedarray "~0.0.5" -configstore@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/configstore/-/configstore-0.3.2.tgz#25e4c16c3768abf75c5a65bc61761f495055b459" - dependencies: - graceful-fs "^3.0.1" - js-yaml "^3.1.0" - mkdirp "^0.5.0" - object-assign "^2.0.0" - osenv "^0.1.0" - user-home "^1.0.0" - uuid "^2.0.1" - xdg-basedir "^1.0.0" +connect-history-api-fallback@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.3.0.tgz#e51d17f8f0ef0db90a64fdb47de3051556e9f169" -connect@3.4.x: - version "3.4.1" - resolved "https://registry.yarnpkg.com/connect/-/connect-3.4.1.tgz#a21361d3f4099ef761cda6dc4a973bb1ebb0a34d" +console-browserify@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10" dependencies: - debug "~2.2.0" - finalhandler "0.4.1" - parseurl "~1.3.1" - utils-merge "1.0.0" + date-now "^0.1.4" console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" +constant-case@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-2.0.0.tgz#4175764d389d3fa9c8ecd29186ed6005243b6a46" + dependencies: + snake-case "^2.1.0" + upper-case "^1.1.1" + +constants-browserify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75" + +content-disposition@0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.1.tgz#87476c6a67c8daa87e32e87616df883ba7fb071b" + +content-type@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.2.tgz#b7d113aee7a8dd27bd21133c4dc2529df1721eed" + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + +cookie@0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" + +copy-webpack-plugin@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.0.0.tgz#385e7f8deeb993f6d48b9f9854d50391912633ae" + dependencies: + bluebird "^2.10.2" + fs-extra "^0.26.4" + glob "^6.0.4" + loader-utils "^0.2.15" + lodash "^4.3.0" + minimatch "^3.0.0" + node-dir "^0.1.10" + core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" -cors@latest: - version "2.8.1" - resolved "https://registry.yarnpkg.com/cors/-/cors-2.8.1.tgz#6181aa56abb45a2825be3304703747ae4e9d2383" +create-ecdh@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d" + dependencies: + bn.js "^4.1.0" + elliptic "^6.0.0" + +create-hash@^1.1.0, create-hash@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.1.2.tgz#51210062d7bb7479f6c65bb41a92208b1d61abad" + dependencies: + cipher-base "^1.0.1" + inherits "^2.0.1" + ripemd160 "^1.0.0" + sha.js "^2.3.6" + +create-hmac@^1.1.0, create-hmac@^1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.4.tgz#d3fb4ba253eb8b3f56e39ea2fbcb8af747bd3170" dependencies: - vary "^1" + create-hash "^1.1.0" + inherits "^2.0.1" cryptiles@2.x.x: version "2.0.5" @@ -313,9 +577,33 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" -csextends@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/csextends/-/csextends-1.0.3.tgz#df41407bfddb1837ecc2dd28587725d6af9550f8" +crypto-browserify@^3.11.0: + version "3.11.0" + resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.11.0.tgz#3652a0906ab9b2a7e0c3ce66a408e957a2485522" + dependencies: + browserify-cipher "^1.0.0" + browserify-sign "^4.0.0" + create-ecdh "^4.0.0" + create-hash "^1.1.0" + create-hmac "^1.1.0" + diffie-hellman "^5.0.0" + inherits "^2.0.1" + pbkdf2 "^3.0.3" + public-encrypt "^4.0.0" + randombytes "^2.0.0" + +css-select@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" + dependencies: + boolbase "~1.0.0" + css-what "2.1" + domutils "1.5.1" + nth-check "~1.0.1" + +css-what@2.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.0.tgz#9467d032c38cfaefb9f2d79501253062f87fa1bd" dashdash@^1.12.0: version "1.14.0" @@ -323,12 +611,20 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" -debug@~2.2.0: +date-now@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" + +debug@^2.2.0, debug@~2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.2.0.tgz#f87057e995b1a1f6ae6a4960664137bc56f039da" dependencies: ms "0.7.1" +decamelize@^1.0.0, decamelize@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + deep-extend@~0.4.0: version "0.4.1" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.1.tgz#efe4113d08085f4e6f9687759810f807469e2253" @@ -345,35 +641,80 @@ depd@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.0.tgz#e1bd82c6aab6ced965b97b88b17ed3e528ca18c3" +des.js@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" + dependencies: + inherits "^2.0.1" + minimalistic-assert "^1.0.0" + destroy@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" -duplexer@~0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" +diffie-hellman@^5.0.0: + version "5.0.2" + resolved "https://registry.yarnpkg.com/diffie-hellman/-/diffie-hellman-5.0.2.tgz#b5835739270cfe26acf632099fded2a07f209e5e" + dependencies: + bn.js "^4.1.0" + miller-rabin "^4.0.0" + randombytes "^2.0.0" -duplexer2@~0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" +dom-converter@~0.1: + version "0.1.4" + resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.1.4.tgz#a45ef5727b890c9bffe6d7c876e7b19cb0e17f3b" dependencies: - readable-stream "~1.1.9" + utila "~0.3" -duplexify@^3.2.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/duplexify/-/duplexify-3.5.0.tgz#1aa773002e1578457e9d9d4a50b0ccaaebcbd604" +dom-serializer@0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.0.tgz#073c697546ce0780ce23be4a28e293e40bc30c82" dependencies: - end-of-stream "1.0.0" - inherits "^2.0.1" - readable-stream "^2.0.0" - stream-shift "^1.0.0" + domelementtype "~1.1.1" + entities "~1.1.1" -eachr@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/eachr/-/eachr-3.2.0.tgz#2c35e43ea086516f7997cf80b7aa64d55a4a4484" +domain-browser@^1.1.1: + version "1.1.7" + resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-1.1.7.tgz#867aa4b093faa05f1de08c06f4d7b21fdf8698bc" + +domelementtype@~1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" + +domelementtype@1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.0.tgz#b17aed82e8ab59e52dd9c19b1756e0fc187204c2" + +domhandler@2.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.1.0.tgz#d2646f5e57f6c3bab11cf6cb05d3c0acf7412594" + dependencies: + domelementtype "1" + +domutils@1.1: + version "1.1.6" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.1.6.tgz#bddc3de099b9a2efacc51c623f28f416ecc57485" dependencies: - editions "^1.1.1" - typechecker "^4.3.0" + domelementtype "1" + +domutils@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + dependencies: + dom-serializer "0" + domelementtype "1" + +dot-case@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-2.1.0.tgz#4b43dd0d7403c34cb645424add397e80bfe85ca6" + dependencies: + no-case "^2.2.0" + +duplexer2@~0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" + dependencies: + readable-stream "~1.1.9" earcut@^2.0.7: version "2.1.1" @@ -385,29 +726,65 @@ ecc-jsbn@~0.1.1: dependencies: jsbn "~0.1.0" -editions@^1.1.0, editions@^1.1.1, editions@^1.1.2, editions@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/editions/-/editions-1.3.3.tgz#0907101bdda20fac3cbe334c27cbd0688dc99a5b" - ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" +elliptic@^6.0.0: + version "6.3.2" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.3.2.tgz#e4c81e0829cf0a65ab70e998b8232723b5c1bc48" + dependencies: + bn.js "^4.4.0" + brorand "^1.0.1" + hash.js "^1.0.0" + inherits "^2.0.1" + +emojis-list@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" + encodeurl@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20" -end-of-stream@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.0.0.tgz#d4596e702734a93e40e9af864319eabd99ff2f0e" +enhanced-resolve@^0.9.0: + version "0.9.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-0.9.1.tgz#4d6e689b3725f86090927ccc86cd9f1635b89e2e" dependencies: - once "~1.3.0" + graceful-fs "^4.1.2" + memory-fs "^0.2.0" + tapable "^0.1.8" + +enhanced-resolve@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-2.3.0.tgz#a115c32504b6302e85a76269d7a57ccdd962e359" + dependencies: + graceful-fs "^4.1.2" + memory-fs "^0.3.0" + object-assign "^4.0.1" + tapable "^0.2.3" + +entities@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" + +errno@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" + dependencies: + prr "~0.0.0" + +error-ex@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.0.tgz#e67b43f3e82c96ea3a584ffee0b9fc3325d802d9" + dependencies: + is-arrayish "^0.2.1" escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" -escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2: +escape-string-regexp@^1.0.2: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -430,10 +807,6 @@ escodegen@~1.3.2: optionalDependencies: source-map "~0.1.33" -esprima@^2.6.0: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - esprima@~1.0.2: version "1.0.4" resolved "https://registry.yarnpkg.com/esprima/-/esprima-1.0.4.tgz#9f557e08fc3b4d26ece9dd34f8fbf476b62585ad" @@ -458,26 +831,30 @@ etag@~1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/etag/-/etag-1.7.0.tgz#03d30b5f67dd6e632d2945d30d6652731a34d5d8" -event-stream@latest: - version "3.3.4" - resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" - dependencies: - duplexer "~0.1.1" - from "~0" - map-stream "~0.1.0" - pause-stream "0.0.11" - split "0.3" - stream-combiner "~0.0.4" - through "~2.3.1" - eventemitter3@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-2.0.2.tgz#20ce4891909ce9f35b088c94fab40e2c96f473ac" -events@^1.0.2: +eventemitter3@1.x.x: + version "1.2.0" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.2.0.tgz#1c86991d816ad1e504750e73874224ecf3bec508" + +events@^1.0.0, events@^1.0.2: version "1.1.1" resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" +eventsource@~0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-0.1.6.tgz#0acede849ed7dd1ccc32c811bb11b944d4f29232" + dependencies: + original ">=0.0.5" + +evp_bytestokey@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz#497b66ad9fef65cd7c08a6180824ba1476b66e53" + dependencies: + create-hash "^1.1.1" + expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -490,31 +867,47 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" +express@^4.13.3: + version "4.14.0" + resolved "https://registry.yarnpkg.com/express/-/express-4.14.0.tgz#c1ee3f42cdc891fb3dc650a8922d51ec847d0d66" + dependencies: + accepts "~1.3.3" + array-flatten "1.1.1" + content-disposition "0.5.1" + content-type "~1.0.2" + cookie "0.3.1" + cookie-signature "1.0.6" + debug "~2.2.0" + depd "~1.1.0" + encodeurl "~1.0.1" + escape-html "~1.0.3" + etag "~1.7.0" + finalhandler "0.5.0" + fresh "0.3.0" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.1" + path-to-regexp "0.1.7" + proxy-addr "~1.1.2" + qs "6.2.0" + range-parser "~1.2.0" + send "0.14.1" + serve-static "~1.11.1" + type-is "~1.6.13" + utils-merge "1.0.0" + vary "~1.1.0" + extend@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.0.tgz#5a474353b9f3353ddd8176dfd37b91c83a46f1d4" -extendr@^3.2.0, extendr@^3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/extendr/-/extendr-3.2.2.tgz#c6e46fe6d90b2e3e8812a6654bd6182cbf91cd06" - dependencies: - editions "^1.1.2" - typechecker "^4.3.0" - extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" dependencies: is-extglob "^1.0.0" -extract-opts@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/extract-opts/-/extract-opts-3.3.1.tgz#5abbedc98c0d5202e3278727f9192d7e086c6be1" - dependencies: - eachr "^3.2.0" - editions "^1.1.1" - typechecker "^4.3.0" - extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" @@ -528,7 +921,13 @@ falafel@^1.0.0: isarray "0.0.1" object-keys "^1.0.6" -faye-websocket@0.11.x: +faye-websocket@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" + dependencies: + websocket-driver ">=0.5.1" + +faye-websocket@~0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.0.tgz#d9ccf0e789e7db725d74bc4877d23aa42972ac50" dependencies: @@ -548,19 +947,27 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -finalhandler@0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-0.4.1.tgz#85a17c6c59a94717d262d61230d4b0ebe3d4a14d" +finalhandler@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-0.5.0.tgz#e9508abece9b6dba871a6942a1d7911b91911ac7" dependencies: debug "~2.2.0" escape-html "~1.0.3" on-finished "~2.3.0" + statuses "~1.3.0" unpipe "~1.0.0" find-root@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/find-root/-/find-root-0.1.2.tgz#98d2267cff1916ccaf2743b3a0eea81d79d7dcd1" +find-up@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" + dependencies: + path-exists "^2.0.0" + pinkie-promise "^2.0.0" + findup@^0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/findup/-/findup-0.1.5.tgz#8ad929a3393bac627957a7e5de4623b06b0e2ceb" @@ -594,20 +1001,22 @@ form-data@~2.1.1: combined-stream "^1.0.5" mime-types "^2.1.12" +forwarded@~0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.0.tgz#19ef9874c4ae1c297bcf078fde63a09b66a84363" + fresh@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.3.0.tgz#651f838e22424e7566de161d8358caa199f83d4f" -from@~0: - version "0.1.3" - resolved "https://registry.yarnpkg.com/from/-/from-0.1.3.tgz#ef63ac2062ac32acf7862e0d40b44b896f22f3bc" - -fs-extra@^0.16.3: - version "0.16.5" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.16.5.tgz#1ad661fa6c86c9608cd1b49efc6fce834939a750" +fs-extra@^0.26.4: + version "0.26.7" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.26.7.tgz#9ae1fdd94897798edab76d0918cf42d0c3184fa9" dependencies: - graceful-fs "^3.0.5" - jsonfile "^2.0.0" + graceful-fs "^4.1.2" + jsonfile "^2.1.0" + klaw "^1.0.0" + path-is-absolute "^1.0.0" rimraf "^2.2.8" fs.realpath@^1.0.0: @@ -666,6 +1075,10 @@ generate-object-property@^1.1.0: dependencies: is-property "^1.0.0" +get-caller-file@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" + getpass@^0.1.1: version "0.1.6" resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.6.tgz#283ffd9fc1256840875311c1b60e8c40187110e6" @@ -685,6 +1098,16 @@ glob-parent@^2.0.0: dependencies: is-glob "^2.0.0" +glob@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" + dependencies: + inflight "^1.0.4" + inherits "2" + minimatch "2 || 3" + once "^1.3.0" + path-is-absolute "^1.0.0" + glob@^7.0.5: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" @@ -802,35 +1225,18 @@ glslify@^5.0.2: through2 "^0.6.3" xtend "^4.0.0" -got@^3.2.0: - version "3.3.1" - resolved "https://registry.yarnpkg.com/got/-/got-3.3.1.tgz#e5d0ed4af55fc3eef4d56007769d98192bcb2eca" - dependencies: - duplexify "^3.2.0" - infinity-agent "^2.0.0" - is-redirect "^1.0.0" - is-stream "^1.0.0" - lowercase-keys "^1.0.0" - nested-error-stacks "^1.0.0" - object-assign "^3.0.0" - prepend-http "^1.0.0" - read-all-stream "^3.0.0" - timed-out "^2.0.0" - -graceful-fs@*, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9: version "4.1.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.10.tgz#f2d720c22092f743228775c75e3612632501f131" -graceful-fs@^3.0.1, graceful-fs@^3.0.5: - version "3.0.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" - dependencies: - natives "^1.1.0" - "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" +handle-thing@^1.2.4: + version "1.2.5" + resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-1.2.5.tgz#fd7aad726bf1a5fd16dfc29b2f7a6601d27139c4" + har-validator@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d" @@ -840,12 +1246,6 @@ har-validator@~2.0.6: is-my-json-valid "^2.12.4" pinkie-promise "^2.0.0" -has-ansi@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e" - dependencies: - ansi-regex "^0.2.0" - has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -856,6 +1256,10 @@ has-color@^0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/has-color/-/has-color-0.1.7.tgz#67144a5260c34fc3cca677d041daf52fe7b78b2f" +has-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" + has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -866,6 +1270,12 @@ has@^1.0.0: dependencies: function-bind "^1.0.2" +hash.js@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.0.3.tgz#1332ff00156c0a0ffdd8236013d07b77a0451573" + dependencies: + inherits "^2.0.1" + hawk@~3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/hawk/-/hawk-3.1.3.tgz#078444bd7c1640b0fe540d2c9b73d59678e8e1c4" @@ -875,17 +1285,76 @@ hawk@~3.1.3: hoek "2.x.x" sntp "1.x.x" +he@1.1.x: + version "1.1.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.1.0.tgz#29319d49beec13a9b1f3c4f9b2a6dde4859bb2a7" + +header-case@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/header-case/-/header-case-1.0.0.tgz#d9e335909505d56051ec16a0106821889e910781" + dependencies: + no-case "^2.2.0" + upper-case "^1.1.3" + hoek@2.x.x: version "2.16.3" resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" -http-auth@2.4.x: - version "2.4.11" - resolved "https://registry.yarnpkg.com/http-auth/-/http-auth-2.4.11.tgz#61f024a6e0e7c48934944895c87a1395509c619b" +hosted-git-info@^2.1.4: + version "2.1.5" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.1.5.tgz#0ba81d90da2e25ab34a332e6ec77936e1598118b" + +hpack.js@^2.1.6: + version "2.1.6" + resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2" + dependencies: + inherits "^2.0.1" + obuf "^1.0.0" + readable-stream "^2.0.1" + wbuf "^1.1.0" + +html-minifier@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.1.1.tgz#73bd0600fc9d68f536b13a788360245b6d76eb9c" + dependencies: + change-case "3.0.x" + clean-css "3.4.x" + commander "2.9.x" + he "1.1.x" + ncname "1.0.x" + relateurl "0.2.x" + uglify-js "2.7.x" + +html-webpack-plugin@^2.24.1: + version "2.24.1" + resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-2.24.1.tgz#7f45fc678f66eac2d433f22336b4399da023b57e" + dependencies: + bluebird "^3.4.6" + html-minifier "^3.1.0" + loader-utils "^0.2.16" + lodash "^4.16.4" + pretty-error "^2.0.2" + toposort "^1.0.0" + +htmlparser2@~3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.3.0.tgz#cc70d05a59f6542e43f0e685c982e14c924a9efe" + dependencies: + domelementtype "1" + domhandler "2.1" + domutils "1.1" + readable-stream "1.0" + +http-browserify@^1.3.2: + version "1.7.0" + resolved "https://registry.yarnpkg.com/http-browserify/-/http-browserify-1.7.0.tgz#33795ade72df88acfbfd36773cefeda764735b20" dependencies: - apache-crypt "1.1.2" - apache-md5 "1.0.6" - node-uuid "^1.4.7" + Base64 "~0.2.0" + inherits "~2.0.1" + +http-deceiver@^1.2.4: + version "1.2.7" + resolved "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87" http-errors@~1.5.0: version "1.5.0" @@ -895,6 +1364,22 @@ http-errors@~1.5.0: setprototypeof "1.0.1" statuses ">= 1.3.0 < 2" +http-proxy-middleware@~0.17.1: + version "0.17.2" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.17.2.tgz#572d517a6d2fb1063a469de294eed96066352007" + dependencies: + http-proxy "^1.15.1" + is-glob "^3.0.0" + lodash "^4.16.2" + micromatch "^2.3.11" + +http-proxy@^1.15.1: + version "1.15.2" + resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.15.2.tgz#642fdcaffe52d3448d2bda3b0079e9409064da31" + dependencies: + eventemitter3 "1.x.x" + requires-port "1.x.x" + http-signature@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf" @@ -903,20 +1388,17 @@ http-signature@~1.1.0: jsprim "^1.2.2" sshpk "^1.7.0" -ignorefs@^1.0.0, ignorefs@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/ignorefs/-/ignorefs-1.2.0.tgz#da59fb858976e4a5e43702ccd1f282fdbc9e5756" - dependencies: - editions "^1.3.3" - ignorepatterns "^1.1.0" +https-browserify@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-0.0.1.tgz#3f91365cabe60b77ed0ebba24b454e3e09d95a82" -ignorepatterns@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ignorepatterns/-/ignorepatterns-1.1.0.tgz#ac8f436f2239b5dfb66d5f0d3a904a87ac67cc5e" +ieee754@^1.1.4: + version "1.1.8" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.8.tgz#be33d40ac10ef1926701f6f08a2d86fbfd1ad3e4" -infinity-agent@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/infinity-agent/-/infinity-agent-2.0.3.tgz#45e0e2ff7a9eb030b27d62b74b3744b7a7ac4216" +indexof@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/indexof/-/indexof-0.0.1.tgz#82dc336d232b9062179d05ab3293a66059fd435d" inflight@^1.0.4: version "1.0.6" @@ -937,6 +1419,22 @@ ini@~1.3.0: version "1.3.4" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" +interpret@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.0.1.tgz#d579fb7f693b858004947af39fa0db49f795602c" + +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + +ipaddr.js@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.1.1.tgz#c791d95f52b29c1247d5df80ada39b8a73647230" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + is-binary-path@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" @@ -947,6 +1445,12 @@ is-buffer@^1.0.2: version "1.1.4" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b" +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + is-dotfile@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.2.tgz#2c132383f39199f8edc268ca01b9b007d205cc4d" @@ -965,6 +1469,10 @@ is-extglob@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" +is-extglob@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.0.tgz#33411a482b046bf95e6b0cb27ee2711af4cf15ad" + is-fullwidth-code-point@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" @@ -977,6 +1485,18 @@ is-glob@^2.0.0, is-glob@^2.0.1: dependencies: is-extglob "^1.0.0" +is-glob@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a" + dependencies: + is-extglob "^2.1.0" + +is-lower-case@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-lower-case/-/is-lower-case-1.1.3.tgz#7e147be4768dc466db3bfb21cc60b31e6ad69393" + dependencies: + lower-case "^1.1.0" + is-my-json-valid@^2.12.4: version "2.15.0" resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.15.0.tgz#936edda3ca3c211fd98f3b2d3e08da43f7b2915b" @@ -986,10 +1506,6 @@ is-my-json-valid@^2.12.4: jsonpointer "^4.0.0" xtend "^4.0.0" -is-npm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" - is-number@^2.0.2, is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -1008,19 +1524,21 @@ is-property@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" -is-redirect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-redirect/-/is-redirect-1.0.0.tgz#1d03dded53bd8db0f30c26e4f95d36fc7c87dc24" - -is-stream@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" -isarray@~1.0.0, isarray@1.0.0: +is-upper-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-upper-case/-/is-upper-case-1.1.2.tgz#8d0b1fa7e7933a1e58483600ec7d9661cbaf756f" + dependencies: + upper-case "^1.1.0" + +is-utf8@^0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" + +isarray@^1.0.0, isarray@~1.0.0, isarray@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -1048,13 +1566,6 @@ jodid25519@^1.0.0: dependencies: jsbn "~0.1.0" -js-yaml@^3.1.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" - dependencies: - argparse "^1.0.7" - esprima "^2.6.0" - jsbn@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.0.tgz#650987da0dd74f4ebf5a11377a2aa2d273e97dfd" @@ -1063,16 +1574,34 @@ json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" +json-stable-stringify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" + dependencies: + jsonify "~0.0.0" + json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -jsonfile@^2.0.0: +json3@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" + +json5@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.0.tgz#9b20715b026cbe3778fd769edccd822d8332a5b2" + +jsonfile@^2.1.0: version "2.4.0" resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" optionalDependencies: graceful-fs "^4.1.6" +jsonify@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" + jsonpointer@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.0.tgz#6661e161d2fc445f19f98430231343722e1fcbd5" @@ -1091,37 +1620,66 @@ kind-of@^3.0.2: dependencies: is-buffer "^1.0.2" -latest-version@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-1.0.1.tgz#72cfc46e3e8d1be651e1ebb54ea9f6ea96f374bb" +klaw@^1.0.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + optionalDependencies: + graceful-fs "^4.1.9" + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" dependencies: - package-json "^1.0.0" + invert-kv "^1.0.0" -live-server@^1.1.0: +load-json-file@^1.0.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/live-server/-/live-server-1.1.0.tgz#a69f0e6ca581e0391aa57941970e17c308dd4869" - dependencies: - colors latest - connect "3.4.x" - cors latest - event-stream latest - faye-websocket "0.11.x" - http-auth "2.4.x" - morgan "^1.6.1" - object-assign latest - opn latest - proxy-middleware latest - send latest - serve-index "^1.7.2" - watchr "2.6.x" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + pinkie-promise "^2.0.0" + strip-bom "^2.0.0" -lodash@^3.1.0: - version "3.10.1" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" +loader-runner@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.2.0.tgz#824c1b699c4e7a2b6501b85902d5b862bf45b3fa" -lowercase-keys@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306" +loader-utils@^0.2.11, loader-utils@^0.2.15, loader-utils@^0.2.16, loader-utils@^0.2.6: + version "0.2.16" + resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.16.tgz#f08632066ed8282835dff88dfb52704765adee6d" + dependencies: + big.js "^3.1.3" + emojis-list "^2.0.0" + json5 "^0.5.0" + object-assign "^4.0.1" + +lodash.assign@^4.0.3, lodash.assign@^4.0.6: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" + +lodash@^4.16.2, lodash@^4.16.4, lodash@^4.3.0: + version "4.16.6" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.6.tgz#d22c9ac660288f3843e16ba7d2b5d06cca27d777" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +lower-case-first@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/lower-case-first/-/lower-case-first-1.0.2.tgz#e5da7c26f29a7073be02d52bac9980e5922adfa1" + dependencies: + lower-case "^1.1.2" + +lower-case@^1.1.0, lower-case@^1.1.1, lower-case@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-1.1.3.tgz#c92393d976793eee5ba4edb583cf8eae35bd9bfb" map-limit@0.0.1: version "0.0.1" @@ -1129,11 +1687,30 @@ map-limit@0.0.1: dependencies: once "~1.3.0" -map-stream@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + +memory-fs@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.2.0.tgz#f2bb25368bc121e391c2520de92969caee0a0290" + +memory-fs@^0.3.0, memory-fs@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.3.0.tgz#7bcc6b629e3a43e871d7e29aca6ae8a7f15cbb20" + dependencies: + errno "^0.1.3" + readable-stream "^2.0.1" -micromatch@^2.1.5: +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + +micromatch@^2.1.5, micromatch@^2.3.11: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" dependencies: @@ -1151,7 +1728,14 @@ micromatch@^2.1.5: parse-glob "^3.0.4" regex-cache "^0.4.2" -mime-db@~1.24.0: +miller-rabin@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.0.tgz#4a62fb1d42933c05583982f4c716f6fb9e6c6d3d" + dependencies: + bn.js "^4.0.0" + brorand "^1.0.1" + +"mime-db@>= 1.24.0 < 2", mime-db@~1.24.0: version "1.24.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.24.0.tgz#e2d13f939f0016c6e4e9ad25a8652f126c467f0c" @@ -1161,17 +1745,21 @@ mime-types@^2.1.12, mime-types@~2.1.11, mime-types@~2.1.7: dependencies: mime-db "~1.24.0" -mime@1.3.4: +mime@^1.3.4, mime@1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" -minimatch@^3.0.0, minimatch@^3.0.2: +minimalistic-assert@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz#702be2dda6b37f4836bcb3f5db56641b64a1d3d3" + +minimatch@^3.0.0, minimatch@^3.0.2, "minimatch@2 || 3": version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: brace-expansion "^1.0.0" -minimist@^1.1.0, minimist@^1.2.0: +minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -1179,22 +1767,12 @@ minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -mkdirp@^0.5.0, "mkdirp@>=0.5 0", mkdirp@~0.5.1: +"mkdirp@>=0.5 0", mkdirp@~0.5.0, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" -morgan@^1.6.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.7.0.tgz#eb10ca8e50d1abe0f8d3dad5c0201d052d981c62" - dependencies: - basic-auth "~1.0.3" - debug "~2.2.0" - depd "~1.1.0" - on-finished "~2.3.0" - on-headers "~1.0.1" - ms@0.7.1: version "0.7.1" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.1.tgz#9cd13c03adbff25b65effde7ce864ee952017098" @@ -1207,19 +1785,55 @@ nan@^2.3.0: version "2.4.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.4.0.tgz#fb3c59d45fe4effe215f0b890f8adf6eb32d2232" -natives@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.0.tgz#e9ff841418a6b2ec7a495e939984f78f163e6e31" +ncname@1.0.x: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ncname/-/ncname-1.0.0.tgz#5b57ad18b1ca092864ef62b0b1ed8194f383b71c" + dependencies: + xml-char-classes "^1.0.0" negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" -nested-error-stacks@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz#19f619591519f096769a5ba9a86e6eeec823c3cf" +no-case@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.0.tgz#ca2825ccb76b18e6f79d573dcfbf1eace33dd164" dependencies: - inherits "~2.0.1" + lower-case "^1.1.1" + +node-dir@^0.1.10: + version "0.1.16" + resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.16.tgz#d2ef583aa50b90d93db8cdd26fcea58353957fe4" + dependencies: + minimatch "^3.0.2" + +node-libs-browser@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-libs-browser/-/node-libs-browser-1.0.0.tgz#ff8ad6c2cfa78043bdd0091ec07f0aaa581620fc" + dependencies: + assert "^1.1.1" + browserify-zlib "~0.1.4" + buffer "^4.3.0" + console-browserify "^1.1.0" + constants-browserify "^1.0.0" + crypto-browserify "^3.11.0" + domain-browser "^1.1.1" + events "^1.0.0" + http-browserify "^1.3.2" + https-browserify "0.0.1" + os-browserify "~0.2.0" + path-browserify "0.0.0" + process "~0.11.0" + punycode "^1.2.4" + querystring-es3 "~0.2.0" + readable-stream "^2.0.5" + stream-browserify "^2.0.1" + string_decoder "~0.10.25" + timers-browserify "^1.0.1" + tty-browserify "0.0.0" + url "~0.11.0" + util "~0.10.3" + vm-browserify "0.0.4" node-pre-gyp@^0.6.29: version "0.6.31" @@ -1235,7 +1849,7 @@ node-pre-gyp@^0.6.29: tar "~2.2.1" tar-pack "~3.3.0" -node-uuid@^1.4.7, node-uuid@~1.4.7: +node-uuid@~1.4.7: version "1.4.7" resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.7.tgz#6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f" @@ -1245,6 +1859,15 @@ nopt@~3.0.6: dependencies: abbrev "1" +normalize-package-data@^2.3.2: + version "2.3.5" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.5.tgz#8d924f142960e1777e7ffe170543631cc7cb02df" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + normalize-path@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" @@ -1258,6 +1881,12 @@ npmlog@^4.0.0: gauge "~2.6.0" set-blocking "~2.0.0" +nth-check@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" + dependencies: + boolbase "~1.0.0" + number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -1266,15 +1895,7 @@ oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" -object-assign@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-2.1.1.tgz#43c36e5d569ff8e4816c4efa8be02d26967c18aa" - -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" - -object-assign@^4.0.1, object-assign@^4.1.0, object-assign@latest: +object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" @@ -1297,6 +1918,10 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" +obuf@^1.0.0, obuf@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.1.tgz#104124b6c602c6796881a042541d36db43a5264e" + on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -1319,34 +1944,48 @@ once@~1.3.0, once@~1.3.3: dependencies: wrappy "1" -opn@latest: +opn@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/opn/-/opn-4.0.2.tgz#7abc22e644dff63b0a96d5ab7f2790c0f01abc95" dependencies: object-assign "^4.0.1" pinkie-promise "^2.0.0" -os-homedir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" +original@>=0.0.5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/original/-/original-1.0.0.tgz#9147f93fa1696d04be61e01bd50baeaca656bd3b" + dependencies: + url-parse "1.0.x" -os-tmpdir@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" +os-browserify@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/os-browserify/-/os-browserify-0.2.1.tgz#63fc4ccee5d2d7763d26bbf8601078e6c2e0044f" -osenv@^0.1.0: - version "0.1.3" - resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.3.tgz#83cf05c6d6458fc4d5ac6362ea325d92f2754217" +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" dependencies: - os-homedir "^1.0.0" - os-tmpdir "^1.0.0" + lcid "^1.0.0" -package-json@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/package-json/-/package-json-1.2.0.tgz#c8ecac094227cdf76a316874ed05e27cc939a0e0" +pako@~0.2.0: + version "0.2.9" + resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" + +param-case@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.0.tgz#2619f90fd6c829ed0b958f1c84ed03a745a6d70a" + dependencies: + no-case "^2.2.0" + +parse-asn1@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.0.0.tgz#35060f6d5015d37628c770f4e091a0b5a278bc23" dependencies: - got "^3.2.0" - registry-url "^3.0.0" + asn1.js "^4.0.0" + browserify-aes "^1.0.0" + create-hash "^1.1.0" + evp_bytestokey "^1.0.0" + pbkdf2 "^3.0.3" parse-glob@^3.0.4: version "3.0.4" @@ -1357,6 +1996,12 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + parse-uri@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-uri/-/parse-uri-1.0.0.tgz#2872dcc22f1a797acde1583d8a0ac29552ddac20" @@ -1365,15 +2010,54 @@ parseurl@~1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.1.tgz#c8ab8c9223ba34888aa64a297b28853bec18da56" +pascal-case@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/pascal-case/-/pascal-case-2.0.0.tgz#39c248bde5a8dc02d5160696bdb01e044d016ee1" + dependencies: + camel-case "^3.0.0" + upper-case-first "^1.1.0" + +path-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" + +path-case@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-case/-/path-case-2.1.0.tgz#5ac491de642936e5dfe0e18d16c461b8be8cf073" + dependencies: + no-case "^2.2.0" + +path-exists@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" + dependencies: + pinkie-promise "^2.0.0" + path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -pause-stream@0.0.11: - version "0.0.11" - resolved "https://registry.yarnpkg.com/pause-stream/-/pause-stream-0.0.11.tgz#fe5a34b0cbce12b5aa6a2b403ee2e73b602f1445" +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + +path-type@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" + dependencies: + graceful-fs "^4.1.2" + pify "^2.0.0" + pinkie-promise "^2.0.0" + +pbkdf2@^3.0.3: + version "3.0.9" + resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.9.tgz#f2c4b25a600058b3c3773c086c37dbbee1ffe693" dependencies: - through "~2.3" + create-hmac "^1.1.2" + +pify@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" pinkie-promise@^2.0.0: version "2.0.1" @@ -1403,30 +2087,74 @@ pixi.js@^4.1.1: pixi-gl-core "^1.0.2" resource-loader "^1.8.0" -prepend-http@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" +pretty-error@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.0.2.tgz#a7db19cbb529ca9f0af3d3a2f77d5caf8e5dec23" + dependencies: + renderkid "~2.0.0" + utila "~0.4" + process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" -proxy-middleware@latest: - version "0.15.0" - resolved "https://registry.yarnpkg.com/proxy-middleware/-/proxy-middleware-0.15.0.tgz#a3fdf1befb730f951965872ac2f6074c61477a56" +process@~0.11.0: + version "0.11.9" + resolved "https://registry.yarnpkg.com/process/-/process-0.11.9.tgz#7bd5ad21aa6253e7da8682264f1e11d11c0318c1" + +proxy-addr@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-1.1.2.tgz#b4cc5f22610d9535824c123aef9d3cf73c40ba37" + dependencies: + forwarded "~0.1.0" + ipaddr.js "1.1.1" + +prr@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" + +public-encrypt@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.0.tgz#39f699f3a46560dd5ebacbca693caf7c65c18cc6" + dependencies: + bn.js "^4.1.0" + browserify-rsa "^4.0.0" + create-hash "^1.1.0" + parse-asn1 "^5.0.0" + randombytes "^2.0.1" -punycode@^1.4.1: +punycode@^1.2.4, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" +punycode@1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" + qs@~6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.0.tgz#f403b264f23bc01228c74131b407f18d5ea5d442" +qs@6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.0.tgz#3b7848c03c2dece69a9522b0fae8c4126d745f3b" + +querystring-es3@~0.2.0: + version "0.2.1" + resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" + +querystring@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" + +querystringify@0.0.x: + version "0.0.4" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-0.0.4.tgz#0cf7f84f9463ff0ae51c4c4b142d95be37724d9c" + quote-stream@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/quote-stream/-/quote-stream-0.0.0.tgz#cde29e94c409b16e19dc7098b89b6658f9721d3b" @@ -1441,11 +2169,15 @@ randomatic@^1.1.3: is-number "^2.0.2" kind-of "^3.0.2" -range-parser@~1.2.0: +randombytes@^2.0.0, randombytes@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec" + +range-parser@^1.0.3, range-parser@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.0.tgz#f49be6b487894ddc40dcc94a322f611092e00d5e" -rc@^1.0.1, rc@~1.1.6: +rc@~1.1.6: version "1.1.6" resolved "https://registry.yarnpkg.com/rc/-/rc-1.1.6.tgz#43651b76b6ae53b5c802f1151fa3fc3b059969c9" dependencies: @@ -1454,14 +2186,22 @@ rc@^1.0.1, rc@~1.1.6: minimist "^1.2.0" strip-json-comments "~1.0.4" -read-all-stream@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/read-all-stream/-/read-all-stream-3.1.0.tgz#35c3e177f2078ef789ee4bfafa4373074eaef4fa" +read-pkg-up@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" dependencies: - pinkie-promise "^2.0.0" - readable-stream "^2.0.0" + find-up "^1.0.0" + read-pkg "^1.0.0" -readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.2, readable-stream@~2.1.4: +read-pkg@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" + dependencies: + load-json-file "^1.0.0" + normalize-package-data "^2.3.2" + path-type "^1.0.0" + +"readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@~2.1.4: version "2.1.5" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.1.5.tgz#66fa8b720e1438b364681f2ad1a63c618448c9d0" dependencies: @@ -1473,7 +2213,7 @@ readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2. string_decoder "~0.10.x" util-deprecate "~1.0.1" -"readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@~1.0.17, readable-stream@~1.0.27-1: +"readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@~1.0.17, readable-stream@~1.0.27-1, readable-stream@1.0: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" dependencies: @@ -1518,11 +2258,19 @@ regex-cache@^0.4.2: is-equal-shallow "^0.1.3" is-primitive "^2.0.0" -registry-url@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/registry-url/-/registry-url-3.1.0.tgz#3d4ef870f73dde1d77f0cf9a381432444e174942" +relateurl@0.2.x: + version "0.2.7" + resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" + +renderkid@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.0.tgz#1859753e7a5adbf35443aba0d4e4579e78abee85" dependencies: - rc "^1.0.1" + css-select "^1.1.0" + dom-converter "~0.1" + htmlparser2 "~3.3.0" + strip-ansi "^3.0.0" + utila "~0.3" repeat-element@^1.1.2: version "1.1.2" @@ -1557,6 +2305,18 @@ request@^2.75.0: tough-cookie "~2.3.0" tunnel-agent "~0.4.1" +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + +requires-port@1.0.x, requires-port@1.x.x: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + resolve@^0.6.1: version "0.6.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-0.6.3.tgz#dd957982e7e736debdf53b58a4dd91754575dd46" @@ -1572,44 +2332,37 @@ resource-loader@^1.8.0: eventemitter3 "^2.0.0" parse-uri "^1.0.0" +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + rimraf@^2.2.8, rimraf@~2.5.1, rimraf@~2.5.4, rimraf@2: version "2.5.4" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.5.4.tgz#96800093cbf1a0c86bd95b4625467535c29dfa04" dependencies: glob "^7.0.5" -safefs@^3.1.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/safefs/-/safefs-3.2.2.tgz#8170c1444d7038e08caea05a374fae2fa349e15c" - dependencies: - graceful-fs "*" - -safefs@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/safefs/-/safefs-4.1.0.tgz#f82aeb4bdd7ae51f653eb20f6728b3058c8d6445" - dependencies: - editions "^1.1.1" - graceful-fs "^4.1.4" +ripemd160@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-1.0.1.tgz#93a4bbd4942bc574b69a8fa57c71de10ecca7d6e" -scandirectory@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/scandirectory/-/scandirectory-2.5.0.tgz#6ce03f54a090b668e3cbedbf20edf9e310593e72" +rxjs@^5.0.0-rc.2: + version "5.0.0-rc.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.0.0-rc.2.tgz#d38206f50eeb1e77b0832a74c1c2adeeed5ec2b7" dependencies: - ignorefs "^1.0.0" - safefs "^3.1.2" - taskgroup "^4.0.5" + symbol-observable "^1.0.1" -semver-diff@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/semver-diff/-/semver-diff-2.1.0.tgz#4bbb8437c8d37e4b0cf1a68fd726ec6d645d6d36" - dependencies: - semver "^5.0.3" +select-hose@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" -semver@^5.0.3, semver@~5.3.0: +semver@^5.0.1, semver@~5.3.0, "semver@2 || 3 || 4 || 5": version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" -send@latest: +send@0.14.1: version "0.14.1" resolved "https://registry.yarnpkg.com/send/-/send-0.14.1.tgz#a954984325392f51532a7760760e459598c89f7a" dependencies: @@ -1627,6 +2380,13 @@ send@latest: range-parser "~1.2.0" statuses "~1.3.0" +sentence-case@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/sentence-case/-/sentence-case-2.1.0.tgz#d592fbed457fd1a59e3af0ee17e99f6fd70d7efd" + dependencies: + no-case "^2.2.0" + upper-case-first "^1.1.2" + serve-index@^1.7.2: version "1.8.0" resolved "https://registry.yarnpkg.com/serve-index/-/serve-index-1.8.0.tgz#7c5d96c13fb131101f93c1c5774f8516a1e78d3b" @@ -1639,7 +2399,16 @@ serve-index@^1.7.2: mime-types "~2.1.11" parseurl "~1.3.1" -set-blocking@~2.0.0: +serve-static@~1.11.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.11.1.tgz#d6cce7693505f733c759de57befc1af76c0f0805" + dependencies: + encodeurl "~1.0.1" + escape-html "~1.0.3" + parseurl "~1.3.1" + send "0.14.1" + +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -1651,6 +2420,12 @@ setprototypeof@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.0.1.tgz#52009b27888c4dc48f591949c0a8275834c1ca7e" +sha.js@^2.3.6: + version "2.4.5" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.5.tgz#27d171efcc82a118b99639ff581660242b506e7c" + dependencies: + inherits "^2.0.1" + shallow-copy@~0.0.1, shallow-copy@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/shallow-copy/-/shallow-copy-0.0.1.tgz#415f42702d73d810330292cc5ee86eae1a11a170" @@ -1659,13 +2434,41 @@ signal-exit@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.1.tgz#5a4c884992b63a7acd9badb7894c3ee9cfccad81" +snake-case@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-2.1.0.tgz#41bdb1b73f30ec66a04d4e2cad1b76387d4d6d9f" + dependencies: + no-case "^2.2.0" + sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" dependencies: hoek "2.x.x" -"source-map@>= 0.1.2": +sockjs-client@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.1.1.tgz#284843e9a9784d7c474b1571b3240fca9dda4bb0" + dependencies: + debug "^2.2.0" + eventsource "~0.1.6" + faye-websocket "~0.11.0" + inherits "^2.0.1" + json3 "^3.3.2" + url-parse "^1.1.1" + +sockjs@0.3.18: + version "0.3.18" + resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.18.tgz#d9b289316ca7df77595ef299e075f0f937eb4207" + dependencies: + faye-websocket "^0.10.0" + uuid "^2.0.2" + +source-list-map@~0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.6.tgz#e1e6f94f0b40c4d28dcf8f5b8766e0e45636877f" + +source-map@^0.5.3, "source-map@>= 0.1.2", source-map@~0.5.1, source-map@~0.5.3: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" @@ -1675,15 +2478,45 @@ source-map@~0.1.33: dependencies: amdefine ">=0.0.4" -split@0.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/split/-/split-0.3.3.tgz#cd0eea5e63a211dfff7eb0f091c4133e2d0dd28f" +source-map@0.4.x: + version "0.4.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" + dependencies: + amdefine ">=0.0.4" + +spdx-correct@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" dependencies: - through "2" + spdx-license-ids "^1.0.2" -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" +spdx-expression-parse@~1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" + +spdx-license-ids@^1.0.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" + +spdy-transport@^2.0.15: + version "2.0.17" + resolved "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-2.0.17.tgz#94376f85a7aaabf9e6edb6bd2f11ee26359be5b5" + dependencies: + debug "^2.2.0" + hpack.js "^2.1.6" + obuf "^1.1.0" + readable-stream "^2.0.1" + wbuf "^1.4.0" + +spdy@^3.4.1: + version "3.4.4" + resolved "https://registry.yarnpkg.com/spdy/-/spdy-3.4.4.tgz#e0406407ca90ff01b553eb013505442649f5a819" + dependencies: + debug "^2.2.0" + handle-thing "^1.2.4" + http-deceiver "^1.2.4" + select-hose "^2.0.0" + spdy-transport "^2.0.15" sshpk@^1.7.0: version "1.10.1" @@ -1726,27 +2559,18 @@ static-module@^1.1.2: version "1.3.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.0.tgz#8e55758cb20e7682c1f4fce8dcab30bf01d1e07a" -stream-combiner@~0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/stream-combiner/-/stream-combiner-0.0.4.tgz#4d5e433c185261dde623ca3f44c586bcf5c4ad14" +stream-browserify@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/stream-browserify/-/stream-browserify-2.0.1.tgz#66266ee5f9bdb9940a4e4514cafb43bb71e5c9db" dependencies: - duplexer "~0.1.1" - -stream-shift@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" + inherits "~2.0.1" + readable-stream "^2.0.2" -string_decoder@~0.10.x: +string_decoder@~0.10.25, string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" -string-length@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" - dependencies: - strip-ansi "^3.0.0" - -string-width@^1.0.1: +string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" dependencies: @@ -1758,46 +2582,50 @@ stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" -strip-ansi@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.3.0.tgz#25f48ea22ca79187f3174a4db8759347bb126220" - dependencies: - ansi-regex "^0.2.1" - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" dependencies: ansi-regex "^2.0.0" +strip-bom@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" + dependencies: + is-utf8 "^0.2.0" + strip-json-comments@~1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-1.0.4.tgz#1e15fbcac97d3ee99bf2d73b4c656b082bbafb91" -supports-color@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" -sync-files@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sync-files/-/sync-files-1.0.3.tgz#92e610cffb350d177bdf96bd0a5a505bcdcd9306" +supports-color@^3.1.0, supports-color@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" dependencies: - chalk "^0.5.1" - chokidar "^1.0.0-rc3" - fs-extra "^0.16.3" - lodash "^3.1.0" - minimist "^1.1.0" - update-notifier "^0.3.0" + has-flag "^1.0.0" -systemjs: - version "0.19.40" - resolved "https://registry.yarnpkg.com/systemjs/-/systemjs-0.19.40.tgz#158f64a9f4ef541a7fda6b40e527ee46b6c54cd0" +swap-case@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/swap-case/-/swap-case-1.1.2.tgz#c39203a4587385fad3c850a0bd1bcafa081974e3" dependencies: - when "^3.7.5" + lower-case "^1.1.1" + upper-case "^1.1.1" + +symbol-observable@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" + +tapable@^0.1.8: + version "0.1.10" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.1.10.tgz#29c35707c2b70e50d07482b5d202e8ed446dafd4" + +tapable@^0.2.3, tapable@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.4.tgz#a7814605089d4ba896c33c7e3566e13dcd194aa5" tar-pack@~3.3.0: version "3.3.0" @@ -1820,26 +2648,6 @@ tar@~2.2.1: fstream "^1.0.2" inherits "2" -taskgroup@^4.0.5: - version "4.3.1" - resolved "https://registry.yarnpkg.com/taskgroup/-/taskgroup-4.3.1.tgz#7de193febd768273c457730497024d512c27915a" - dependencies: - ambi "^2.2.0" - csextends "^1.0.3" - -taskgroup@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/taskgroup/-/taskgroup-5.0.1.tgz#08736c9b24683b1434774231eb4b73aa7c3f79b5" - dependencies: - ambi "^2.5.0" - eachr "^3.2.0" - editions "^1.1.1" - extendr "^3.2.0" - -through@~2.3, through@~2.3.1, through@2: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - through2@^0.6.3: version "0.6.5" resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" @@ -1861,9 +2669,22 @@ through2@0.6.3: readable-stream ">=1.0.33-1 <1.1.0-0" xtend ">=4.0.0 <4.1.0-0" -timed-out@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-2.0.0.tgz#f38b0ae81d3747d628001f41dafc652ace671c0a" +timers-browserify@^1.0.1: + version "1.4.2" + resolved "https://registry.yarnpkg.com/timers-browserify/-/timers-browserify-1.4.2.tgz#c9c58b575be8407375cb5e2462dacee74359f41d" + dependencies: + process "~0.11.0" + +title-case@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.0.tgz#c68ccb4232079ded64f94b91b4941ade91391979" + dependencies: + no-case "^2.2.0" + upper-case "^1.0.3" + +toposort@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.0.tgz#b66cf385a1a8a8e68e45b8259e7f55875e8b06ef" tough-cookie@~2.3.0: version "2.3.2" @@ -1871,6 +2692,21 @@ tough-cookie@~2.3.0: dependencies: punycode "^1.4.1" +ts-loader@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-1.0.0.tgz#0fbefb6ca9460e3d5398f7f9f96f4c67c3c7ce64" + dependencies: + arrify "^1.0.0" + colors "^1.0.3" + enhanced-resolve "^0.9.0" + loader-utils "^0.2.6" + object-assign "^4.1.0" + semver "^5.0.1" + +tty-browserify@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6" + tunnel-agent@~0.4.1: version "0.4.3" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb" @@ -1879,11 +2715,12 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: version "0.14.3" resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.3.tgz#3da382f670f25ded78d7b3d1792119bca0b7132d" -typechecker@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-4.3.0.tgz#6f6d6815753e88d6812aa80de4a3fd18948e6e62" +type-is@~1.6.13: + version "1.6.13" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.13.tgz#6e83ba7bc30cd33a7bb0b7fb00737a2085bf9d08" dependencies: - editions "^1.1.0" + media-typer "0.3.0" + mime-types "~2.1.11" typedarray@~0.0.5: version "0.0.6" @@ -1893,46 +2730,92 @@ typescript@^2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.0.7.tgz#efc39e8822e240d0b741d06ff86708137bcdb5e4" +uglify-js@~2.7.3, uglify-js@2.7.x: + version "2.7.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.4.tgz#a295a0de12b6a650c031c40deb0dc40b14568bd2" + dependencies: + async "~0.2.6" + source-map "~0.5.1" + uglify-to-browserify "~1.0.0" + yargs "~3.10.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + uid-number@~0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" -unix-crypt-td-js@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unix-crypt-td-js/-/unix-crypt-td-js-1.0.0.tgz#1c0824150481bc7a01d49e98f1ec668d82412f3b" - unpipe@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" -update-notifier@^0.3.0: - version "0.3.2" - resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-0.3.2.tgz#22a8735baadef3320e2db928f693da898dc87777" +upper-case-first@^1.1.0, upper-case-first@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/upper-case-first/-/upper-case-first-1.1.2.tgz#5d79bedcff14419518fd2edb0a0507c9b6859115" dependencies: - chalk "^1.0.0" - configstore "^0.3.1" - is-npm "^1.0.0" - latest-version "^1.0.0" - semver-diff "^2.0.0" - string-length "^1.0.0" + upper-case "^1.1.1" -user-home@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" +upper-case@^1.0.3, upper-case@^1.1.0, upper-case@^1.1.1, upper-case@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/upper-case/-/upper-case-1.1.3.tgz#f6b4501c2ec4cdd26ba78be7222961de77621598" + +url-parse@^1.1.1: + version "1.1.7" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.1.7.tgz#025cff999653a459ab34232147d89514cc87d74a" + dependencies: + querystringify "0.0.x" + requires-port "1.0.x" + +url-parse@1.0.x: + version "1.0.5" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.0.5.tgz#0854860422afdcfefeb6c965c662d4800169927b" + dependencies: + querystringify "0.0.x" + requires-port "1.0.x" + +url@~0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" + dependencies: + punycode "1.3.2" + querystring "0.2.0" util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +util@~0.10.3, util@0.10.3: + version "0.10.3" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.3.tgz#7afb1afe50805246489e3db7fe0ed379336ac0f9" + dependencies: + inherits "2.0.1" + +utila@~0.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/utila/-/utila-0.3.3.tgz#d7e8e7d7e309107092b05f8d9688824d633a4226" + +utila@~0.4: + version "0.4.0" + resolved "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c" + utils-merge@1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.0.tgz#0294fb922bb9375153541c4f7096231f287c8af8" -uuid@^2.0.1: +uuid@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.3.tgz#67e2e863797215530dff318e5bf9dcebfd47b21a" -vary@^1: +validate-npm-package-license@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" + dependencies: + spdx-correct "~1.0.0" + spdx-expression-parse "~1.0.0" + +vary@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.0.tgz#e1e5affbbd16ae768dd2674394b9ad3022653140" @@ -1942,18 +2825,84 @@ verror@1.3.6: dependencies: extsprintf "1.0.2" -watchr@2.6.x: - version "2.6.0" - resolved "https://registry.yarnpkg.com/watchr/-/watchr-2.6.0.tgz#e75c423b10be79267a0c3ef76e2ea104fe0267a5" +vm-browserify@0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-0.0.4.tgz#5d7ea45bbef9e4a6ff65f95438e0a87c357d5a73" + dependencies: + indexof "0.0.1" + +watchpack@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.1.0.tgz#42d44627464a2fadffc9308c0f7562cfde795f24" + dependencies: + async "2.0.0-rc.4" + chokidar "^1.4.3" + graceful-fs "^4.1.2" + +wbuf@^1.1.0, wbuf@^1.4.0: + version "1.7.2" + resolved "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.2.tgz#d697b99f1f59512df2751be42769c1580b5801fe" + dependencies: + minimalistic-assert "^1.0.0" + +webpack-dev-middleware@^1.4.0: + version "1.8.4" + resolved "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-1.8.4.tgz#e8765c9122887ce9e3abd4cc9c3eb31b61e0948d" dependencies: - eachr "^3.2.0" - extendr "^3.2.2" - extract-opts "^3.3.1" - ignorefs "^1.1.1" - safefs "^4.1.0" - scandirectory "^2.5.0" - taskgroup "^5.0.1" - typechecker "^4.3.0" + memory-fs "~0.3.0" + mime "^1.3.4" + path-is-absolute "^1.0.0" + range-parser "^1.0.3" + +webpack-dev-server@2.1.0-beta.10: + version "2.1.0-beta.10" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-2.1.0-beta.10.tgz#8ea8a1d7366e747c53423be77ecf49437f66cd7e" + dependencies: + chokidar "^1.6.0" + compression "^1.5.2" + connect-history-api-fallback "^1.3.0" + express "^4.13.3" + http-proxy-middleware "~0.17.1" + opn "4.0.2" + serve-index "^1.7.2" + sockjs "0.3.18" + sockjs-client "1.1.1" + spdy "^3.4.1" + strip-ansi "^3.0.0" + supports-color "^3.1.1" + webpack-dev-middleware "^1.4.0" + yargs "^6.0.0" + +webpack-sources@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.2.tgz#057a3f3255f8ba561b901d9150589aa103a57e65" + dependencies: + source-list-map "~0.1.0" + source-map "~0.5.3" + +webpack@2.1.0-beta.25: + version "2.1.0-beta.25" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.1.0-beta.25.tgz#c35ff4da4ee70344a2f14c35258d95412709e9ed" + dependencies: + acorn "^3.2.0" + ajv "^4.7.0" + async "^1.3.0" + clone "^1.0.2" + enhanced-resolve "^2.2.0" + interpret "^1.0.0" + loader-runner "^2.2.0" + loader-utils "^0.2.11" + memory-fs "~0.3.0" + mkdirp "~0.5.0" + node-libs-browser "^1.0.0" + object-assign "^4.0.1" + source-map "^0.5.3" + supports-color "^3.1.0" + tapable "~0.2.3" + uglify-js "~2.7.3" + watchpack "^1.0.0" + webpack-sources "^0.1.0" + yargs "^4.7.1" websocket-driver@>=0.5.1: version "0.6.5" @@ -1965,9 +2914,9 @@ websocket-extensions@>=0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7" -when@^3.7.5: - version "3.7.7" - resolved "https://registry.yarnpkg.com/when/-/when-3.7.7.tgz#aba03fc3bb736d6c88b091d013d8a8e590d84718" +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" wide-align@^1.1.0: version "1.1.0" @@ -1975,15 +2924,31 @@ wide-align@^1.1.0: dependencies: string-width "^1.0.1" +window-size@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.2.0.tgz#b4315bb4214a3d7058ebeee892e13fa24d98b075" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +wrap-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.0.0.tgz#7d30f8f873f9a5bbc3a64dabc8d177e071ae426f" + dependencies: + string-width "^1.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -xdg-basedir@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-1.0.1.tgz#14ff8f63a4fdbcb05d5b6eea22b36f3033b9f04e" - dependencies: - user-home "^1.0.0" +xml-char-classes@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/xml-char-classes/-/xml-char-classes-1.0.0.tgz#64657848a20ffc5df583a42ad8a277b4512bbc4d" xtend@^2.1.2: version "2.2.0" @@ -1999,3 +2964,67 @@ xtend@~2.1.1: dependencies: object-keys "~0.4.0" +y18n@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" + +yargs-parser@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-2.4.1.tgz#85568de3cf150ff49fa51825f03a8c880ddcc5c4" + dependencies: + camelcase "^3.0.0" + lodash.assign "^4.0.6" + +yargs-parser@^4.0.2: + version "4.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.1.0.tgz#313df030f20124124aeae8fbab2da53ec28c56d7" + dependencies: + camelcase "^3.0.0" + +yargs@^4.7.1: + version "4.8.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-4.8.1.tgz#c0c42924ca4aaa6b0e6da1739dfb216439f9ddc0" + dependencies: + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + lodash.assign "^4.0.3" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.1" + which-module "^1.0.0" + window-size "^0.2.0" + y18n "^3.2.1" + yargs-parser "^2.4.1" + +yargs@^6.0.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.3.0.tgz#19c6dbb768744d571eb6ebae0c174cf2f71b188d" + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + window-size "^0.2.0" + y18n "^3.2.1" + yargs-parser "^4.0.2" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" + From d5f9b667490947f80d657dd6d02dd66fbf731fca Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Mon, 7 Nov 2016 19:50:56 -0400 Subject: [PATCH 06/30] Add initial level loader --- src/game/config.ts | 4 +++- src/game/levels/level-01.ts | 19 ++++++++++++++++ src/game/main.ts | 43 ++++++++++++------------------------- src/game/map/loader.ts | 24 +++++++++++++++++++++ 4 files changed, 60 insertions(+), 30 deletions(-) create mode 100644 src/game/levels/level-01.ts create mode 100644 src/game/map/loader.ts diff --git a/src/game/config.ts b/src/game/config.ts index b5cee7f04..18afbe15a 100644 --- a/src/game/config.ts +++ b/src/game/config.ts @@ -1,3 +1,5 @@ export const config = { - canvasSize: [800, 600] + tileSize: 32, + gridWidth: 20, + gridHeight: 15 }; diff --git a/src/game/levels/level-01.ts b/src/game/levels/level-01.ts new file mode 100644 index 000000000..81408bb44 --- /dev/null +++ b/src/game/levels/level-01.ts @@ -0,0 +1,19 @@ +export default { + map: [ + 'XXXXXXXXXXXXXXXXXXXX', + 'XX X', + 'X X X', + 'XX X X', + 'X X PX X', + 'X X X X', + 'X X X', + 'X X', + 'X X', + 'X X', + 'X X', + 'X X', + 'X X', + 'X X', + 'XXXXXXXXXXXXXXXXXXXX', + ] +}; diff --git a/src/game/main.ts b/src/game/main.ts index 85a23668f..2a2b64030 100644 --- a/src/game/main.ts +++ b/src/game/main.ts @@ -1,43 +1,28 @@ -import {Subject} from 'rxjs/subject'; +import {load} from './map/loader'; +import level1 from './levels/level-01'; -let a = new Subject(); - -debugger; +// Config PIXI PIXI.SCALE_MODES.DEFAULT = PIXI.SCALE_MODES.NEAREST; PIXI.DEFAULT_RENDER_OPTIONS.antialias = false; PIXI.DEFAULT_RENDER_OPTIONS.roundPixels = true; -var renderer = PIXI.autoDetectRenderer(800, 600, {backgroundColor : 0x1099bb}); + +const scale = 1; + +var renderer = PIXI.autoDetectRenderer(32 * 20 * scale, 32 * 15 * scale, {backgroundColor : 0x1099bb}); document.body.appendChild(renderer.view); // create the root of the scene graph var stage = new PIXI.Container(); -// create a texture from an image path -var texture = PIXI.Texture.fromImage('assets/basics/nin.png'); -// create a new Sprite using the texture -var bunny = new PIXI.Sprite(texture); - -// center the sprite's anchor point -bunny.anchor.x = 0; -bunny.anchor.y = 0; +stage.addChild(load(level1.map)); -// move the sprite to the center of the screen -bunny.position.x = 200; -bunny.position.y = 150; -bunny.scale.x = 1; -bunny.scale.y = 1; - -stage.addChild(bunny); +stage.scale.x = scale; +stage.scale.y = scale; // start animating -animate(); -function animate() { - requestAnimationFrame(animate); - - // just for fun, let's rotate mr rabbit a little - // bunny.rotation += 0.1; - - // render the container - renderer.render(stage); +animate(0); +function animate(time?) { + requestAnimationFrame(animate); + renderer.render(stage); } diff --git a/src/game/map/loader.ts b/src/game/map/loader.ts new file mode 100644 index 000000000..2669338bc --- /dev/null +++ b/src/game/map/loader.ts @@ -0,0 +1,24 @@ +const {Graphics, Container, Texture, Sprite} = PIXI; + +export function load(map: string[]) { + const stage = new Container(); + const graphics = new Graphics(); + stage.addChild(graphics); + graphics.beginFill(0xFFFF00); + for (let row = 0; row < map.length; row += 1) { + for (let tile = 0; tile < map[row].length; tile += 1) { + if (map[row][tile] === 'X') { + graphics.drawRect(32 * tile, 32 * row, 32, 32); + } else if (map[row][tile] === 'P') { + var texture = Texture.fromImage('assets/basics/nin.png'); + var player = new Sprite(texture); + player.anchor.x = 0; + player.anchor.y = 0; + player.position.x = 32 * tile + (32 - 24) / 2; + player.position.y = 32 * row + (32 - 24); + stage.addChild(player); + } + } + } + return stage; +} From 5ce5706df8d26870cd9f19a9307e24e16603a751 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Mon, 7 Nov 2016 23:44:33 -0400 Subject: [PATCH 07/30] Add GameCanvas & GameLoop classes --- package.json | 1 + src/css/style.css | 4 ++ src/game/config.ts | 6 ++- src/game/main.ts | 27 +++----------- src/game/util/game-canvas.ts | 72 ++++++++++++++++++++++++++++++++++++ src/game/util/game-loop.ts | 31 ++++++++++++++++ yarn.lock | 4 ++ 7 files changed, 123 insertions(+), 22 deletions(-) create mode 100644 src/game/util/game-canvas.ts create mode 100644 src/game/util/game-loop.ts diff --git a/package.json b/package.json index 62747a7ce..09f5e5bc8 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "url": "https://github.com/ropilz/game-off-2016/issues" }, "dependencies": { + "@types/chai": "^3.4.34", "clean-webpack-plugin": "^0.1.14", "copy-webpack-plugin": "^4.0.0", "html-webpack-plugin": "^2.24.1", diff --git a/src/css/style.css b/src/css/style.css index d5b85901e..155aed278 100644 --- a/src/css/style.css +++ b/src/css/style.css @@ -1,3 +1,7 @@ +body { + margin: 0; + position: fixed; +} canvas { image-rendering: pixelated; } diff --git a/src/game/config.ts b/src/game/config.ts index 18afbe15a..92b886fa5 100644 --- a/src/game/config.ts +++ b/src/game/config.ts @@ -1,5 +1,9 @@ export const config = { tileSize: 32, gridWidth: 20, - gridHeight: 15 + gridHeight: 15, + roundScale: true, + keys: { + // 'up': + } }; diff --git a/src/game/main.ts b/src/game/main.ts index 2a2b64030..9d5545b0c 100644 --- a/src/game/main.ts +++ b/src/game/main.ts @@ -1,28 +1,13 @@ import {load} from './map/loader'; import level1 from './levels/level-01'; -// Config PIXI -PIXI.SCALE_MODES.DEFAULT = PIXI.SCALE_MODES.NEAREST; -PIXI.DEFAULT_RENDER_OPTIONS.antialias = false; -PIXI.DEFAULT_RENDER_OPTIONS.roundPixels = true; +import {GameLoop} from './util/game-loop'; +import {GameCanvas} from './util/game-canvas'; +let gameLoop = new GameLoop(); +let canvas = new GameCanvas(); -const scale = 1; -var renderer = PIXI.autoDetectRenderer(32 * 20 * scale, 32 * 15 * scale, {backgroundColor : 0x1099bb}); -document.body.appendChild(renderer.view); +canvas.stage.addChild(load(level1.map)); -// create the root of the scene graph -var stage = new PIXI.Container(); - -stage.addChild(load(level1.map)); - -stage.scale.x = scale; -stage.scale.y = scale; - -// start animating -animate(0); -function animate(time?) { - requestAnimationFrame(animate); - renderer.render(stage); -} +gameLoop.main$.subscribe(() => canvas.paint()); diff --git a/src/game/util/game-canvas.ts b/src/game/util/game-canvas.ts new file mode 100644 index 000000000..b38ad3da1 --- /dev/null +++ b/src/game/util/game-canvas.ts @@ -0,0 +1,72 @@ +import {config} from '../config'; + +PIXI.SCALE_MODES.DEFAULT = PIXI.SCALE_MODES.NEAREST; +PIXI.DEFAULT_RENDER_OPTIONS.antialias = false; +PIXI.DEFAULT_RENDER_OPTIONS.roundPixels = true; + + +export class GameCanvas { + scale: number; + renderer: PIXI.WebGLRenderer | PIXI.CanvasRenderer; + stage: PIXI.Container; + private _width: number; + private _height: number; + + get width() { + return this._width; + } + + get height() { + return this._height; + } + + resizeCanvas() { + var w = window, + d = document, + e = d.documentElement, + g = d.getElementsByTagName('body')[0], + x = w.innerWidth || e.clientWidth || g.clientWidth, + y = w.innerHeight || e.clientHeight || g.clientHeight; + this.renderer.resize(x, y); + this.scale = Math.min(x / this.width, y / this.height); + if (config.roundScale) { + let scale = Math.ceil(this.scale); + let spacing = config.tileSize * scale; + if (scale * this.width - spacing < x && scale * this.height - spacing < y) { + this.scale = scale; + } else { + this.scale = Math.floor(this.scale); + } + } + + this.stage.x = (this.renderer.width - this.width * this.scale) / 2; + this.stage.y = (this.renderer.height - this.height * this.scale) / 2; + this.stage.scale.x = this.scale; + this.stage.scale.y = this.scale; + } + + paint() { + this.renderer.render(this.stage); + } + + constructor() { + this.scale = 1; + this._width = config.tileSize * config.gridWidth; + this._height = config.tileSize * config.gridHeight; + + this.renderer = PIXI.autoDetectRenderer(0, 0, {backgroundColor : 0}); + + this.stage = new PIXI.Container(); + this.stage.scale.x = this.scale; + this.stage.scale.y = this.scale; + const graphics = new PIXI.Graphics(); + this.stage.addChild(graphics); + graphics.beginFill(0x1099bb); + graphics.drawRect(0, 0, this.width, this.height); + + this.resizeCanvas(); + document.body.appendChild(this.renderer.view); + + window.addEventListener('resize', () => this.resizeCanvas()); + } +} diff --git a/src/game/util/game-loop.ts b/src/game/util/game-loop.ts new file mode 100644 index 000000000..575b0cad7 --- /dev/null +++ b/src/game/util/game-loop.ts @@ -0,0 +1,31 @@ +import { Observable } from 'rxjs/Rx'; + +interface ITimeEvent { + timestamp: number; + delta: number; +}; + +export class GameLoop { + main$: Observable; + game$: Observable; + private _paused: boolean; + private _lastTime: number; + constructor() { + this._paused = false; + this._lastTime = 0; + this.main$ = Observable.create(observer => { + const nextFrame = time => { + observer.next({ + timestamp: time, + delta: time - this._lastTime + }); + this._lastTime = time; + requestAnimationFrame(nextFrame); + }; + nextFrame(0); + }); + + this.game$ = this.main$.filter(() => !this._paused); + + } +} diff --git a/yarn.lock b/yarn.lock index d036c7c39..06a3d9714 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,5 +1,9 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 +"@types/chai": + version "3.4.34" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-3.4.34.tgz#d5335792823bb09cddd5e38c3d211b709183854d" + abbrev@1: version "1.0.9" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135" From cd0e3a50c1616fcbdfe103401c241e307b91a47e Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Tue, 8 Nov 2016 00:10:31 -0400 Subject: [PATCH 08/30] Set minimun scale --- src/game/config.ts | 1 + src/game/util/game-canvas.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/game/config.ts b/src/game/config.ts index 92b886fa5..8e0c5812a 100644 --- a/src/game/config.ts +++ b/src/game/config.ts @@ -3,6 +3,7 @@ export const config = { gridWidth: 20, gridHeight: 15, roundScale: true, + minScale: 0.5, keys: { // 'up': } diff --git a/src/game/util/game-canvas.ts b/src/game/util/game-canvas.ts index b38ad3da1..cc465f9de 100644 --- a/src/game/util/game-canvas.ts +++ b/src/game/util/game-canvas.ts @@ -39,6 +39,10 @@ export class GameCanvas { } } + if (this.scale < config.minScale) { + this.scale = config.minScale; + } + this.stage.x = (this.renderer.width - this.width * this.scale) / 2; this.stage.y = (this.renderer.height - this.height * this.scale) / 2; this.stage.scale.x = this.scale; From a3b8c5c54071fb0f6761c5340948f0a53a12358e Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Tue, 8 Nov 2016 17:41:37 -0400 Subject: [PATCH 09/30] Add character movement --- src/game/config.ts | 7 +++- src/game/entities/player.ts | 77 +++++++++++++++++++++++++++++++++++++ src/game/main.ts | 6 +-- src/game/map/loader.ts | 14 +++---- src/game/util/game-loop.ts | 37 +++++++++++------- src/game/util/keyboard.ts | 21 ++++++++++ 6 files changed, 137 insertions(+), 25 deletions(-) create mode 100644 src/game/entities/player.ts create mode 100644 src/game/util/keyboard.ts diff --git a/src/game/config.ts b/src/game/config.ts index 8e0c5812a..34991d324 100644 --- a/src/game/config.ts +++ b/src/game/config.ts @@ -5,6 +5,11 @@ export const config = { roundScale: true, minScale: 0.5, keys: { - // 'up': + 'up': 38, + 'right': 39, + 'down': 40, + 'left': 37, + 'action': 32, + 'confirm': 13 } }; diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts new file mode 100644 index 000000000..de86c2c1e --- /dev/null +++ b/src/game/entities/player.ts @@ -0,0 +1,77 @@ +import {Keyboard} from '../util/keyboard'; +import {config} from '../config'; +const {Graphics, Container, Texture, Sprite} = PIXI; +import {GameLoop} from '../util/game-loop'; + +export class Player { + private keyboard: Keyboard; + private xSpeed: number; + private ySpeed: number; + private keyState: {[key: string]: boolean}; + private keyMap: {[key: number]: string}; + private _view: PIXI.Sprite; + + get view() { return this._view; } + + set tile(pos: PIXI.Point) { + this._view.position.x = 32 * pos.x + (32 - 24) / 2; + this._view.position.y = 32 * pos.y + (32 - 24); + } + + update(time) { + this._view.position.x += this.xSpeed; + this._view.position.y += this.ySpeed; + } + + constructor(gl: GameLoop) { + this.xSpeed = 0; + this.ySpeed = 0; + this.keyState = {}; + this.keyboard = new Keyboard(); + this.keyboard.keyPress$.subscribe(e => this.updateStateFromKeyboard(e)); + + const texture = Texture.fromImage('assets/basics/nin.png'); + this._view = new Sprite(texture); + this._view.anchor.x = 0; + this._view.anchor.y = 0; + this._view.position.x = 0; + this._view.position.y = 0; + + this.update = this.update.bind(this); + gl.game$.subscribe(this.update); + + this.keyMap = Object.keys(config.keys).reduce((ret, key) => { + ret[config.keys[key]] = key; + return ret; + }, {}); + } + + updateStateFromKeyboard(e: KeyboardEvent) { + let value = e.type === 'keydown'; + let key = this.keyMap[e.which]; + if (!key) { return; } + this.keyState[key] = value; + + if (this.keyState['up']) { + this.ySpeed = -1; + } else if (this.keyState['down']) { + this.ySpeed = 1; + } else { + this.ySpeed = 0; + } + + if (this.keyState['left']) { + this.xSpeed = -1; + } else if (this.keyState['right']) { + this.xSpeed = 1; + } else { + this.xSpeed = 0; + } + + if (this.xSpeed !== 0 && this.ySpeed !== 0) { + this.xSpeed *= 0.7; + this.ySpeed *= 0.7; + } + + } +} diff --git a/src/game/main.ts b/src/game/main.ts index 9d5545b0c..7bc569c87 100644 --- a/src/game/main.ts +++ b/src/game/main.ts @@ -4,10 +4,10 @@ import level1 from './levels/level-01'; import {GameLoop} from './util/game-loop'; import {GameCanvas} from './util/game-canvas'; + let gameLoop = new GameLoop(); let canvas = new GameCanvas(); +canvas.stage.addChild(load(level1.map, gameLoop)); -canvas.stage.addChild(load(level1.map)); - -gameLoop.main$.subscribe(() => canvas.paint()); +gameLoop.render$.subscribe(e => canvas.paint()); diff --git a/src/game/map/loader.ts b/src/game/map/loader.ts index 2669338bc..f4346960f 100644 --- a/src/game/map/loader.ts +++ b/src/game/map/loader.ts @@ -1,6 +1,8 @@ const {Graphics, Container, Texture, Sprite} = PIXI; +import {Player} from '../entities/player'; +import {GameLoop} from '../util/game-loop'; -export function load(map: string[]) { +export function load(map: string[], gl: GameLoop) { const stage = new Container(); const graphics = new Graphics(); stage.addChild(graphics); @@ -10,13 +12,9 @@ export function load(map: string[]) { if (map[row][tile] === 'X') { graphics.drawRect(32 * tile, 32 * row, 32, 32); } else if (map[row][tile] === 'P') { - var texture = Texture.fromImage('assets/basics/nin.png'); - var player = new Sprite(texture); - player.anchor.x = 0; - player.anchor.y = 0; - player.position.x = 32 * tile + (32 - 24) / 2; - player.position.y = 32 * row + (32 - 24); - stage.addChild(player); + const player = new Player(gl); + player.tile = new PIXI.Point(tile, row); + stage.addChild(player.view); } } } diff --git a/src/game/util/game-loop.ts b/src/game/util/game-loop.ts index 575b0cad7..255be52b2 100644 --- a/src/game/util/game-loop.ts +++ b/src/game/util/game-loop.ts @@ -1,4 +1,4 @@ -import { Observable } from 'rxjs/Rx'; +import { Observable, Subject } from 'rxjs/Rx'; interface ITimeEvent { timestamp: number; @@ -8,24 +8,35 @@ interface ITimeEvent { export class GameLoop { main$: Observable; game$: Observable; + render$: Observable; + + private _main$: Subject; + private _render$: Subject; private _paused: boolean; private _lastTime: number; + + private _gameLoop(time) { + let frameInfo = { + timestamp: time, + delta: time - this._lastTime + }; + this._main$.next(frameInfo); + this._render$.next(frameInfo); + this._lastTime = time; + requestAnimationFrame(this._gameLoop); + } + constructor() { this._paused = false; this._lastTime = 0; - this.main$ = Observable.create(observer => { - const nextFrame = time => { - observer.next({ - timestamp: time, - delta: time - this._lastTime - }); - this._lastTime = time; - requestAnimationFrame(nextFrame); - }; - nextFrame(0); - }); + this._main$ = new Subject(); + this._render$ = new Subject(); + this.main$ = this._main$.asObservable(); + this.render$ = this._render$.asObservable(); this.game$ = this.main$.filter(() => !this._paused); - + this._gameLoop = this._gameLoop.bind(this); + requestAnimationFrame(this._gameLoop); } + } diff --git a/src/game/util/keyboard.ts b/src/game/util/keyboard.ts new file mode 100644 index 000000000..40863ca6c --- /dev/null +++ b/src/game/util/keyboard.ts @@ -0,0 +1,21 @@ +import { Observable } from 'rxjs/Rx'; + +export class Keyboard { + private _keysPressed: {[key: number]: boolean}; + keyPress$: Observable; + + constructor() { + this._keysPressed = {}; + this.keyPress$ = Observable + .merge( + Observable.fromEvent(document, 'keyup'), + Observable.fromEvent(document, 'keydown') + ) + .filter(e => { + let old = !!this._keysPressed[e.which]; + this._keysPressed[e.which] = e.type === 'keydown'; + return old !== this._keysPressed[e.which]; + }) + .share(); + } +} From 747081ff5680004bd372417513a456f12ad75c80 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Tue, 8 Nov 2016 17:51:56 -0400 Subject: [PATCH 10/30] import pixi --- src/game/entities/player.ts | 6 +++--- src/game/map/loader.ts | 4 ++-- src/game/util/game-canvas.ts | 25 +++++++++++++++++-------- src/index.html | 1 - src/tsconfig.json | 3 --- webpack.config.js | 2 -- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index de86c2c1e..3399439b0 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -1,6 +1,6 @@ import {Keyboard} from '../util/keyboard'; import {config} from '../config'; -const {Graphics, Container, Texture, Sprite} = PIXI; +import {Point, Texture, Sprite} from 'pixi.js'; import {GameLoop} from '../util/game-loop'; export class Player { @@ -9,11 +9,11 @@ export class Player { private ySpeed: number; private keyState: {[key: string]: boolean}; private keyMap: {[key: number]: string}; - private _view: PIXI.Sprite; + private _view: Sprite; get view() { return this._view; } - set tile(pos: PIXI.Point) { + set tile(pos: Point) { this._view.position.x = 32 * pos.x + (32 - 24) / 2; this._view.position.y = 32 * pos.y + (32 - 24); } diff --git a/src/game/map/loader.ts b/src/game/map/loader.ts index f4346960f..ec2c07800 100644 --- a/src/game/map/loader.ts +++ b/src/game/map/loader.ts @@ -1,4 +1,4 @@ -const {Graphics, Container, Texture, Sprite} = PIXI; +import {Graphics, Container, Point} from 'pixi.js'; import {Player} from '../entities/player'; import {GameLoop} from '../util/game-loop'; @@ -13,7 +13,7 @@ export function load(map: string[], gl: GameLoop) { graphics.drawRect(32 * tile, 32 * row, 32, 32); } else if (map[row][tile] === 'P') { const player = new Player(gl); - player.tile = new PIXI.Point(tile, row); + player.tile = new Point(tile, row); stage.addChild(player.view); } } diff --git a/src/game/util/game-canvas.ts b/src/game/util/game-canvas.ts index cc465f9de..b84c7a861 100644 --- a/src/game/util/game-canvas.ts +++ b/src/game/util/game-canvas.ts @@ -1,14 +1,23 @@ import {config} from '../config'; +import { + SCALE_MODES, + DEFAULT_RENDER_OPTIONS, + WebGLRenderer, + CanvasRenderer, + Container, + autoDetectRenderer, + Graphics +} from 'pixi.js'; -PIXI.SCALE_MODES.DEFAULT = PIXI.SCALE_MODES.NEAREST; -PIXI.DEFAULT_RENDER_OPTIONS.antialias = false; -PIXI.DEFAULT_RENDER_OPTIONS.roundPixels = true; +SCALE_MODES.DEFAULT = SCALE_MODES.NEAREST; +DEFAULT_RENDER_OPTIONS.antialias = false; +DEFAULT_RENDER_OPTIONS.roundPixels = true; export class GameCanvas { scale: number; - renderer: PIXI.WebGLRenderer | PIXI.CanvasRenderer; - stage: PIXI.Container; + renderer: WebGLRenderer | CanvasRenderer; + stage: Container; private _width: number; private _height: number; @@ -58,12 +67,12 @@ export class GameCanvas { this._width = config.tileSize * config.gridWidth; this._height = config.tileSize * config.gridHeight; - this.renderer = PIXI.autoDetectRenderer(0, 0, {backgroundColor : 0}); + this.renderer = autoDetectRenderer(0, 0, {backgroundColor : 0}); - this.stage = new PIXI.Container(); + this.stage = new Container(); this.stage.scale.x = this.scale; this.stage.scale.y = this.scale; - const graphics = new PIXI.Graphics(); + const graphics = new Graphics(); this.stage.addChild(graphics); graphics.beginFill(0x1099bb); graphics.drawRect(0, 0, this.width, this.height); diff --git a/src/index.html b/src/index.html index 74e4c2928..ad84635cf 100644 --- a/src/index.html +++ b/src/index.html @@ -4,7 +4,6 @@ Hacker vs Robot - diff --git a/src/tsconfig.json b/src/tsconfig.json index d8fca0e57..5d67aaeba 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -13,9 +13,6 @@ "baseUrl": "", "typeRoots": [ "./typings" - ], - "types": [ - "PIXI" ] }, "exclude": [ diff --git a/webpack.config.js b/webpack.config.js index 65ecf1c8d..a37389f16 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -35,8 +35,6 @@ module.exports = { template: './index.html' }), new CopyWebpackPlugin([ - {from: '../node_modules/pixi.js/bin/pixi.min.js'}, - {from: '../node_modules/pixi.js/bin/pixi.min.js.map'}, {from: './assets', to: './assets'}, {from: './css', to: './css'} ]) From 179e5dcd56e57058ba83d9bf52532c1273d4535e Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Tue, 8 Nov 2016 21:57:49 -0400 Subject: [PATCH 11/30] Add game monitoring --- package.json | 1 + src/game/config.ts | 6 ++++++ src/game/entities/player.ts | 11 +++++++---- src/game/util/game-loop.ts | 5 +++++ src/index.html | 3 ++- src/tsconfig.json | 3 +++ src/typings/stats/index.d.ts | 12 ++++++++++++ webpack.config.js | 1 + yarn.lock | 4 ++++ 9 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 src/typings/stats/index.d.ts diff --git a/package.json b/package.json index 09f5e5bc8..50cef7504 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "html-webpack-plugin": "^2.24.1", "pixi.js": "^4.1.1", "rxjs": "^5.0.0-rc.2", + "stats.js": "^0.17.0", "ts-loader": "^1.0.0", "typescript": "^2.0.7", "webpack": "2.1.0-beta.25", diff --git a/src/game/config.ts b/src/game/config.ts index 34991d324..95a7a92dc 100644 --- a/src/game/config.ts +++ b/src/game/config.ts @@ -11,5 +11,11 @@ export const config = { 'left': 37, 'action': 32, 'confirm': 13 + }, + entities: { + player: { + speed: 2, + size: 24 + } } }; diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index 3399439b0..bd546401d 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -10,17 +10,19 @@ export class Player { private keyState: {[key: string]: boolean}; private keyMap: {[key: number]: string}; private _view: Sprite; + private config: any; + get view() { return this._view; } set tile(pos: Point) { - this._view.position.x = 32 * pos.x + (32 - 24) / 2; - this._view.position.y = 32 * pos.y + (32 - 24); + this._view.position.x = config.tileSize * pos.x + (config.tileSize - this.config.size) / 2; + this._view.position.y = config.tileSize * pos.y + (config.tileSize - this.config.size); } update(time) { - this._view.position.x += this.xSpeed; - this._view.position.y += this.ySpeed; + this._view.position.x += this.xSpeed * this.config.speed; + this._view.position.y += this.ySpeed * this.config.speed; } constructor(gl: GameLoop) { @@ -28,6 +30,7 @@ export class Player { this.ySpeed = 0; this.keyState = {}; this.keyboard = new Keyboard(); + this.config = Object.assign(config.entities.player); this.keyboard.keyPress$.subscribe(e => this.updateStateFromKeyboard(e)); const texture = Texture.fromImage('assets/basics/nin.png'); diff --git a/src/game/util/game-loop.ts b/src/game/util/game-loop.ts index 255be52b2..baf375515 100644 --- a/src/game/util/game-loop.ts +++ b/src/game/util/game-loop.ts @@ -14,14 +14,17 @@ export class GameLoop { private _render$: Subject; private _paused: boolean; private _lastTime: number; + private _stats: Stats; private _gameLoop(time) { let frameInfo = { timestamp: time, delta: time - this._lastTime }; + this._stats.begin(); this._main$.next(frameInfo); this._render$.next(frameInfo); + this._stats.end(); this._lastTime = time; requestAnimationFrame(this._gameLoop); } @@ -31,6 +34,8 @@ export class GameLoop { this._lastTime = 0; this._main$ = new Subject(); this._render$ = new Subject(); + this._stats = new Stats(); + document.body.appendChild( this._stats.dom ); this.main$ = this._main$.asObservable(); this.render$ = this._render$.asObservable(); diff --git a/src/index.html b/src/index.html index ad84635cf..70b1e0a32 100644 --- a/src/index.html +++ b/src/index.html @@ -2,8 +2,9 @@ - Hacker vs Robot + Hacker vs Robots + diff --git a/src/tsconfig.json b/src/tsconfig.json index 5d67aaeba..551ef0a4a 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -11,6 +11,9 @@ "sourceMap": true, "target": "es5", "baseUrl": "", + "types": [ + "Stats" + ], "typeRoots": [ "./typings" ] diff --git a/src/typings/stats/index.d.ts b/src/typings/stats/index.d.ts new file mode 100644 index 000000000..d4a8e865f --- /dev/null +++ b/src/typings/stats/index.d.ts @@ -0,0 +1,12 @@ +declare class Stats { + showPanel(id: number); + dom: Node; + begin(); + end(); + update(); +} + + +declare module 'stats.js' { + export = Stats; +} diff --git a/webpack.config.js b/webpack.config.js index a37389f16..eddc19f53 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -35,6 +35,7 @@ module.exports = { template: './index.html' }), new CopyWebpackPlugin([ + {from: '../node_modules/stats.js/build/stats.min.js'}, {from: './assets', to: './assets'}, {from: './css', to: './css'} ]) diff --git a/yarn.lock b/yarn.lock index 06a3d9714..b425369b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2559,6 +2559,10 @@ static-module@^1.1.2: static-eval "~0.2.0" through2 "~0.4.1" +stats.js: + version "0.17.0" + resolved "https://registry.yarnpkg.com/stats.js/-/stats.js-0.17.0.tgz#b1c3dc46d94498b578b7fd3985b81ace7131cc7d" + "statuses@>= 1.3.0 < 2", statuses@~1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.3.0.tgz#8e55758cb20e7682c1f4fce8dcab30bf01d1e07a" From 1075103940d4ca8bf01b23217d9ba7b699436752 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Tue, 8 Nov 2016 22:29:17 -0400 Subject: [PATCH 12/30] Add gh-pages build script --- scripts/build-gh-pages.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/build-gh-pages.sh diff --git a/scripts/build-gh-pages.sh b/scripts/build-gh-pages.sh new file mode 100755 index 000000000..411f2afb7 --- /dev/null +++ b/scripts/build-gh-pages.sh @@ -0,0 +1,17 @@ +#! /bin/bash + +branch=`git rev-parse --symbolic-full-name --abbrev-ref HEAD` + +if [ $branch == 'master' ] + then + rm -rf dist + npm run build + message=`git log -1 --pretty=%B` + git checkout gh-pages || exit 1 + find . ! -name 'node_modules' ! -name 'dist' ! -name '.*' -maxdepth 1 | xargs rm -rf + cp -r dist/* . + rm -rf dist + git add . + git commit -a -m "$message" + git checkout master +fi From 980b0f49ab4c5b41d773e3ac6efb0ff572a4094c Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Tue, 8 Nov 2016 23:21:49 -0400 Subject: [PATCH 13/30] Refactor game --- src/{game => }/config.ts | 0 src/game/entities/player.ts | 15 +++++++------- src/game/{util => }/game-canvas.ts | 1 - src/game/{util => }/game-loop.ts | 0 src/game/game.ts | 32 ++++++++++++++++++++++++++++++ src/game/index.ts | 1 + src/game/{util => }/keyboard.ts | 0 src/game/main.ts | 13 ------------ src/game/map.ts | 32 ++++++++++++++++++++++++++++++ src/game/map/loader.ts | 22 -------------------- src/main.ts | 5 +++++ webpack.config.js | 2 +- 12 files changed, 78 insertions(+), 45 deletions(-) rename src/{game => }/config.ts (100%) rename src/game/{util => }/game-canvas.ts (97%) rename src/game/{util => }/game-loop.ts (100%) create mode 100644 src/game/game.ts create mode 100644 src/game/index.ts rename src/game/{util => }/keyboard.ts (100%) delete mode 100644 src/game/main.ts create mode 100644 src/game/map.ts delete mode 100644 src/game/map/loader.ts create mode 100644 src/main.ts diff --git a/src/game/config.ts b/src/config.ts similarity index 100% rename from src/game/config.ts rename to src/config.ts diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index bd546401d..084fb8cb7 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -1,10 +1,8 @@ -import {Keyboard} from '../util/keyboard'; -import {config} from '../config'; +import {config} from '../../config'; import {Point, Texture, Sprite} from 'pixi.js'; -import {GameLoop} from '../util/game-loop'; +import {Game} from '../game'; export class Player { - private keyboard: Keyboard; private xSpeed: number; private ySpeed: number; private keyState: {[key: string]: boolean}; @@ -25,13 +23,14 @@ export class Player { this._view.position.y += this.ySpeed * this.config.speed; } - constructor(gl: GameLoop) { + constructor( + private _game: Game + ) { this.xSpeed = 0; this.ySpeed = 0; this.keyState = {}; - this.keyboard = new Keyboard(); this.config = Object.assign(config.entities.player); - this.keyboard.keyPress$.subscribe(e => this.updateStateFromKeyboard(e)); + _game.keyPress$.subscribe(e => this.updateStateFromKeyboard(e)); const texture = Texture.fromImage('assets/basics/nin.png'); this._view = new Sprite(texture); @@ -41,7 +40,7 @@ export class Player { this._view.position.y = 0; this.update = this.update.bind(this); - gl.game$.subscribe(this.update); + _game.gameLoop$.subscribe(this.update); this.keyMap = Object.keys(config.keys).reduce((ret, key) => { ret[config.keys[key]] = key; diff --git a/src/game/util/game-canvas.ts b/src/game/game-canvas.ts similarity index 97% rename from src/game/util/game-canvas.ts rename to src/game/game-canvas.ts index b84c7a861..afdece32c 100644 --- a/src/game/util/game-canvas.ts +++ b/src/game/game-canvas.ts @@ -78,7 +78,6 @@ export class GameCanvas { graphics.drawRect(0, 0, this.width, this.height); this.resizeCanvas(); - document.body.appendChild(this.renderer.view); window.addEventListener('resize', () => this.resizeCanvas()); } diff --git a/src/game/util/game-loop.ts b/src/game/game-loop.ts similarity index 100% rename from src/game/util/game-loop.ts rename to src/game/game-loop.ts diff --git a/src/game/game.ts b/src/game/game.ts new file mode 100644 index 000000000..2dabd7099 --- /dev/null +++ b/src/game/game.ts @@ -0,0 +1,32 @@ +import level1 from './levels/level-01'; + +import {GameLoop} from './game-loop'; +import {GameCanvas} from './game-canvas'; +import {Keyboard} from './keyboard'; +import {Map} from './map'; + +export class Game { + private gameLoop: GameLoop; + private canvas: GameCanvas; + private keyboard: Keyboard; + + get mainLoop$() { return this.gameLoop.main$; } + get gameLoop$() { return this.gameLoop.game$; } + get renderLoop$() { return this.gameLoop.render$; } + get keyPress$() { return this.keyboard.keyPress$; } + + get view() { return this.canvas.renderer.view; } + + constructor() { + this.gameLoop = new GameLoop(); + this.canvas = new GameCanvas(); + this.keyboard = new Keyboard(); + const map = new Map(this); + map.loadLevel(level1); + this.canvas.stage.addChild(map.view); + } + + start() { + this.gameLoop.render$.subscribe(e => this.canvas.paint()); + } +} diff --git a/src/game/index.ts b/src/game/index.ts new file mode 100644 index 000000000..4fb36a8fd --- /dev/null +++ b/src/game/index.ts @@ -0,0 +1 @@ +export * from './game'; diff --git a/src/game/util/keyboard.ts b/src/game/keyboard.ts similarity index 100% rename from src/game/util/keyboard.ts rename to src/game/keyboard.ts diff --git a/src/game/main.ts b/src/game/main.ts deleted file mode 100644 index 7bc569c87..000000000 --- a/src/game/main.ts +++ /dev/null @@ -1,13 +0,0 @@ -import {load} from './map/loader'; -import level1 from './levels/level-01'; - -import {GameLoop} from './util/game-loop'; -import {GameCanvas} from './util/game-canvas'; - - -let gameLoop = new GameLoop(); -let canvas = new GameCanvas(); - -canvas.stage.addChild(load(level1.map, gameLoop)); - -gameLoop.render$.subscribe(e => canvas.paint()); diff --git a/src/game/map.ts b/src/game/map.ts new file mode 100644 index 000000000..941975c3e --- /dev/null +++ b/src/game/map.ts @@ -0,0 +1,32 @@ +import {Graphics, Container, Point} from 'pixi.js'; +import {Player} from './entities/player'; +import {Game} from './game'; + +export class Map { + private _stage: Container; + + constructor( + private _game: Game + ) { } + + get view() { return this._stage; } + + loadLevel(config: any) { + let map = config.map; + this._stage = new Container(); + const graphics = new Graphics(); + this._stage.addChild(graphics); + graphics.beginFill(0xFFFF00); + for (let row = 0; row < map.length; row += 1) { + for (let tile = 0; tile < map[row].length; tile += 1) { + if (map[row][tile] === 'X') { + graphics.drawRect(32 * tile, 32 * row, 32, 32); + } else if (map[row][tile] === 'P') { + const player = new Player(this._game); + player.tile = new Point(tile, row); + this._stage.addChild(player.view); + } + } + } + } +} diff --git a/src/game/map/loader.ts b/src/game/map/loader.ts deleted file mode 100644 index ec2c07800..000000000 --- a/src/game/map/loader.ts +++ /dev/null @@ -1,22 +0,0 @@ -import {Graphics, Container, Point} from 'pixi.js'; -import {Player} from '../entities/player'; -import {GameLoop} from '../util/game-loop'; - -export function load(map: string[], gl: GameLoop) { - const stage = new Container(); - const graphics = new Graphics(); - stage.addChild(graphics); - graphics.beginFill(0xFFFF00); - for (let row = 0; row < map.length; row += 1) { - for (let tile = 0; tile < map[row].length; tile += 1) { - if (map[row][tile] === 'X') { - graphics.drawRect(32 * tile, 32 * row, 32, 32); - } else if (map[row][tile] === 'P') { - const player = new Player(gl); - player.tile = new Point(tile, row); - stage.addChild(player.view); - } - } - } - return stage; -} diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 000000000..c72825e14 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,5 @@ +import {Game} from './game'; + +const game = new Game(); +document.body.appendChild(game.view); +game.start(); diff --git a/webpack.config.js b/webpack.config.js index eddc19f53..c1a436aeb 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,7 +8,7 @@ const CleanWebpackPlugin = require('clean-webpack-plugin'); module.exports = { context: __dirname + "/src", entry: { - app: "./game/main.ts" + app: "./main.ts" }, devtool: 'source-map', resolve: { From ec3bbf27400708238aa5fb9949bf5fdf72f197df Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Wed, 9 Nov 2016 10:06:01 -0400 Subject: [PATCH 14/30] Add initial map collision detection --- src/game/entities/player.ts | 23 +++++++++++------ src/game/functional/collision.ts | 43 ++++++++++++++++++++++++++++++++ src/game/functional/index.ts | 1 + src/game/game.ts | 32 +++++++++++++----------- src/game/map.ts | 30 ++++++++++++++++------ 5 files changed, 99 insertions(+), 30 deletions(-) create mode 100644 src/game/functional/collision.ts create mode 100644 src/game/functional/index.ts diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index 084fb8cb7..0addc8356 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -1,6 +1,7 @@ import {config} from '../../config'; -import {Point, Texture, Sprite} from 'pixi.js'; +import {Point, Texture, Sprite, Rectangle} from 'pixi.js'; import {Game} from '../game'; +import {moveBody} from '../functional'; export class Player { private xSpeed: number; @@ -9,18 +10,23 @@ export class Player { private keyMap: {[key: number]: string}; private _view: Sprite; private config: any; + private _body: Rectangle; + private _moveBody: (body: Rectangle, dx: number, dy: number) => Rectangle; get view() { return this._view; } set tile(pos: Point) { - this._view.position.x = config.tileSize * pos.x + (config.tileSize - this.config.size) / 2; - this._view.position.y = config.tileSize * pos.y + (config.tileSize - this.config.size); + this._body.x = config.tileSize * pos.x + (config.tileSize - this.config.size - 1) / 2; + this._body.y = config.tileSize * pos.y + (config.tileSize - this.config.size - 1); + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; } update(time) { - this._view.position.x += this.xSpeed * this.config.speed; - this._view.position.y += this.ySpeed * this.config.speed; + this._body = this._moveBody(this._body, this.xSpeed * this.config.speed, this.ySpeed * this.config.speed); + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; } constructor( @@ -30,14 +36,17 @@ export class Player { this.ySpeed = 0; this.keyState = {}; this.config = Object.assign(config.entities.player); + this._body = new Rectangle(0, 0, this.config.size, this.config.size); + this._moveBody = moveBody.bind(null, _game.currentMap); + _game.keyPress$.subscribe(e => this.updateStateFromKeyboard(e)); const texture = Texture.fromImage('assets/basics/nin.png'); this._view = new Sprite(texture); this._view.anchor.x = 0; this._view.anchor.y = 0; - this._view.position.x = 0; - this._view.position.y = 0; + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; this.update = this.update.bind(this); _game.gameLoop$.subscribe(this.update); diff --git a/src/game/functional/collision.ts b/src/game/functional/collision.ts new file mode 100644 index 000000000..67f19301b --- /dev/null +++ b/src/game/functional/collision.ts @@ -0,0 +1,43 @@ +import {Map} from '../map'; +import {Rectangle} from 'pixi.js'; +export function moveBody(map: Map, body: Rectangle, dx: number, dy: number) { + let newBody = body.clone(); + newBody.y += dy; + if (dy > 0) { + let tile = map.tileAt(newBody.right, newBody.bottom) || map.tileAt(newBody.left, newBody.bottom); + if (tile) { + newBody.y = tile.y - newBody.height - 1; + } + } + + if (dy < 0) { + let tile = map.tileAt(newBody.left, newBody.top) || map.tileAt(newBody.right, newBody.top); + if (tile) { + newBody.y = tile.y + tile.height + 1; + } + } + + newBody.x += dx; + if (dx > 0) { + let tile = map.tileAt(newBody.right, newBody.top) || map.tileAt(newBody.right, newBody.bottom); + if (tile) { + newBody.x = tile.x - newBody.width - 1; + } + } + + if (dx < 0) { + let tile = map.tileAt(newBody.left, newBody.top) || map.tileAt(newBody.left, newBody.bottom); + if (tile) { + newBody.x = tile.x + tile.width + 1; + } + } + + + // fix out of bounds + if (newBody.x < 0) { newBody.x = 0; } + if (newBody.y < 0) { newBody.y = 0; } + if (newBody.right > map.width) { newBody.x = map.width - newBody.width; } + if (newBody.bottom > map.height) { newBody.y = map.height - newBody.height; } + + return newBody; +} diff --git a/src/game/functional/index.ts b/src/game/functional/index.ts new file mode 100644 index 000000000..2295b5f39 --- /dev/null +++ b/src/game/functional/index.ts @@ -0,0 +1 @@ +export * from './collision'; diff --git a/src/game/game.ts b/src/game/game.ts index 2dabd7099..74d72f910 100644 --- a/src/game/game.ts +++ b/src/game/game.ts @@ -6,27 +6,29 @@ import {Keyboard} from './keyboard'; import {Map} from './map'; export class Game { - private gameLoop: GameLoop; - private canvas: GameCanvas; - private keyboard: Keyboard; + private _gameLoop: GameLoop; + private _canvas: GameCanvas; + private _keyboard: Keyboard; + private _map: Map; - get mainLoop$() { return this.gameLoop.main$; } - get gameLoop$() { return this.gameLoop.game$; } - get renderLoop$() { return this.gameLoop.render$; } - get keyPress$() { return this.keyboard.keyPress$; } + get mainLoop$() { return this._gameLoop.main$; } + get gameLoop$() { return this._gameLoop.game$; } + get renderLoop$() { return this._gameLoop.render$; } + get keyPress$() { return this._keyboard.keyPress$; } - get view() { return this.canvas.renderer.view; } + get view() { return this._canvas.renderer.view; } + get currentMap() { return this._map; } constructor() { - this.gameLoop = new GameLoop(); - this.canvas = new GameCanvas(); - this.keyboard = new Keyboard(); - const map = new Map(this); - map.loadLevel(level1); - this.canvas.stage.addChild(map.view); + this._gameLoop = new GameLoop(); + this._canvas = new GameCanvas(); + this._keyboard = new Keyboard(); + this._map = new Map(this); + this._map.loadLevel(level1); + this._canvas.stage.addChild(this._map.view); } start() { - this.gameLoop.render$.subscribe(e => this.canvas.paint()); + this._gameLoop.render$.subscribe(e => this._canvas.paint()); } } diff --git a/src/game/map.ts b/src/game/map.ts index 941975c3e..c484bcb6b 100644 --- a/src/game/map.ts +++ b/src/game/map.ts @@ -1,27 +1,41 @@ -import {Graphics, Container, Point} from 'pixi.js'; +import {Graphics, Container, Point, Rectangle} from 'pixi.js'; import {Player} from './entities/player'; import {Game} from './game'; +import {config} from '../config'; export class Map { private _stage: Container; + private _map: string[]; constructor( private _game: Game ) { } get view() { return this._stage; } + get width() { return config.tileSize * config.gridWidth; } + get height() { return config.tileSize * config.gridHeight; } - loadLevel(config: any) { - let map = config.map; + tileAt(x: number, y: number) { + x = Math.floor(x / config.tileSize); + y = Math.floor(y / config.tileSize); + if (this._map[y][x] === 'X') { + return new Rectangle(x * config.tileSize, y * config.tileSize, config.tileSize, config.tileSize); + } else { + return null; + } + } + + loadLevel(level: any) { + this._map = level.map; this._stage = new Container(); const graphics = new Graphics(); this._stage.addChild(graphics); graphics.beginFill(0xFFFF00); - for (let row = 0; row < map.length; row += 1) { - for (let tile = 0; tile < map[row].length; tile += 1) { - if (map[row][tile] === 'X') { - graphics.drawRect(32 * tile, 32 * row, 32, 32); - } else if (map[row][tile] === 'P') { + for (let row = 0; row < this._map.length; row += 1) { + for (let tile = 0; tile < this._map[row].length; tile += 1) { + if (this._map[row][tile] === 'X') { + graphics.drawRect(config.tileSize * tile, config.tileSize * row, config.tileSize, config.tileSize); + } else if (this._map[row][tile] === 'P') { const player = new Player(this._game); player.tile = new Point(tile, row); this._stage.addChild(player.view); From 6eb62ea81223851e2b2a082850e4aae61e19d44f Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Wed, 9 Nov 2016 14:46:39 -0400 Subject: [PATCH 15/30] Add ranged initial version --- src/config.ts | 4 ++ src/game/entities/index.ts | 2 + src/game/entities/player.ts | 1 + src/game/entities/ranged.ts | 71 ++++++++++++++++++++++++ src/game/functional/collision.ts | 95 +++++++++++++++++++++++--------- src/game/levels/level-01.ts | 30 +++++----- src/game/map.ts | 21 ++++++- 7 files changed, 179 insertions(+), 45 deletions(-) create mode 100644 src/game/entities/index.ts create mode 100644 src/game/entities/ranged.ts diff --git a/src/config.ts b/src/config.ts index 95a7a92dc..9624ccba6 100644 --- a/src/config.ts +++ b/src/config.ts @@ -16,6 +16,10 @@ export const config = { player: { speed: 2, size: 24 + }, + ranged: { + radius: 4, + size: 32 } } }; diff --git a/src/game/entities/index.ts b/src/game/entities/index.ts new file mode 100644 index 000000000..e8284e603 --- /dev/null +++ b/src/game/entities/index.ts @@ -0,0 +1,2 @@ +export * from './player'; +export * from './ranged'; diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index 0addc8356..3e9b5a873 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -15,6 +15,7 @@ export class Player { private _moveBody: (body: Rectangle, dx: number, dy: number) => Rectangle; get view() { return this._view; } + get body() { return this._body; } set tile(pos: Point) { this._body.x = config.tileSize * pos.x + (config.tileSize - this.config.size - 1) / 2; diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts new file mode 100644 index 000000000..20cedadf4 --- /dev/null +++ b/src/game/entities/ranged.ts @@ -0,0 +1,71 @@ +import {config} from '../../config'; +import {Point, Rectangle, Graphics, Circle} from 'pixi.js'; +import {Game} from '../game'; +import { + inRange, + lineOfSight +} from '../functional'; + +export class Ranged { + private _view: Graphics; + private config: any; + private _body: Rectangle; + private _range: Circle; + private _connectLine: Graphics; + + get view() { return this._view; } + + private _playerInRange(): boolean { + return inRange(this._range, this._game.currentMap.player.body) && + lineOfSight(this._game.currentMap, + this._range.x, this._range.y, + this._game.currentMap.player.body.x + this._game.currentMap.player.body.width / 2, + this._game.currentMap.player.body.y + this._game.currentMap.player.body.height / 2 + ); + } + + set tile(pos: Point) { + this._body.x = config.tileSize * pos.x + (config.tileSize) / 2; + this._body.y = config.tileSize * pos.y + (config.tileSize) / 2; + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; + this._range.x = this._body.x; + this._range.y = this._body.y; + } + + update(time) { + if (this._playerInRange()) { + console.log('updating tower'); + let player = this._game.currentMap.player.body; + this._connectLine.clear(); + this._connectLine.lineStyle(1, 0x00FF00, 1); + this._connectLine.moveTo(this._body.x, this._body.y); + this._connectLine.lineTo(player.x + player.width / 2, player.y + player.height / 2); + this._connectLine.lineWidth = 3; + this._game.currentMap.view.addChild(this._connectLine); + } else { + this._game.currentMap.view.removeChild(this._connectLine); + } + } + + constructor( + private _game: Game + ) { + this.config = Object.assign(config.entities.ranged); + this._body = new Rectangle(0, 0, this.config.size, this.config.size); + this._range = new Circle(0, 0, config.tileSize * this.config.radius ); + this._connectLine = new Graphics(); + const graphics = new Graphics(); + graphics.beginFill(0x00FF00, 0.2); + graphics.drawCircle( 0, 0, config.tileSize * this.config.radius ); + graphics.beginFill(0xFF8888); + graphics.drawCircle( 0, 0, config.tileSize / 2 ); + + this._view = graphics; + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; + + this.update = this.update.bind(this); + _game.gameLoop$.subscribe(this.update); + } +} diff --git a/src/game/functional/collision.ts b/src/game/functional/collision.ts index 67f19301b..a1cf26b77 100644 --- a/src/game/functional/collision.ts +++ b/src/game/functional/collision.ts @@ -1,43 +1,84 @@ import {Map} from '../map'; -import {Rectangle} from 'pixi.js'; +import {Rectangle, Circle} from 'pixi.js'; + +export function fixOutOfBOunds(map: Map, body: Rectangle) { + let newBody = body.clone(); + if (newBody.x < 0) { newBody.x = 0; } + if (newBody.y < 0) { newBody.y = 0; } + if (newBody.right > map.width) { newBody.x = map.width - newBody.width; } + if (newBody.bottom > map.height) { newBody.y = map.height - newBody.height; } + return newBody; +} + +export function wallCollision(map: Map, body: Rectangle) { + return map.tileAt(body.right, body.bottom) || + map.tileAt(body.left, body.bottom) || + map.tileAt(body.right, body.top) || + map.tileAt(body.left, body.top); +} + export function moveBody(map: Map, body: Rectangle, dx: number, dy: number) { let newBody = body.clone(); + let tile; + // Y movement newBody.y += dy; - if (dy > 0) { - let tile = map.tileAt(newBody.right, newBody.bottom) || map.tileAt(newBody.left, newBody.bottom); - if (tile) { + tile = wallCollision(map, newBody); + if (tile !== null) { + if (dy > 0) { newBody.y = tile.y - newBody.height - 1; - } - } - - if (dy < 0) { - let tile = map.tileAt(newBody.left, newBody.top) || map.tileAt(newBody.right, newBody.top); - if (tile) { + } else { newBody.y = tile.y + tile.height + 1; } } - + // X movement newBody.x += dx; - if (dx > 0) { - let tile = map.tileAt(newBody.right, newBody.top) || map.tileAt(newBody.right, newBody.bottom); - if (tile) { + tile = wallCollision(map, newBody); + if (tile !== null) { + if (dx > 0) { newBody.x = tile.x - newBody.width - 1; - } - } - - if (dx < 0) { - let tile = map.tileAt(newBody.left, newBody.top) || map.tileAt(newBody.left, newBody.bottom); - if (tile) { + } else { newBody.x = tile.x + tile.width + 1; } } + return fixOutOfBOunds(map, newBody); +} +export function inRange(range: Circle, body: Rectangle) { + return range.contains(body.left, body.bottom) || + range.contains(body.right, body.bottom) || + range.contains(body.left, body.top) || + range.contains(body.right, body.top); +} - // fix out of bounds - if (newBody.x < 0) { newBody.x = 0; } - if (newBody.y < 0) { newBody.y = 0; } - if (newBody.right > map.width) { newBody.x = map.width - newBody.width; } - if (newBody.bottom > map.height) { newBody.y = map.height - newBody.height; } - - return newBody; +export function lineOfSight(map: Map, x0: number, y0: number, x1: number, y1: number): boolean { + let los = true; + let dx = Math.abs(x1 - x0); + let dy = Math.abs(y1 - y0); + let x = x0; + let y = y0; + let n = 1 + dx + dy; + let xInc = (x1 > x0) ? 1 : -1; + let yInc = (y1 > y0) ? 1 : -1; + let error = dx - dy; + dx *= 2; + dy *= 2; + for (; n > 0; --n) { + let tile = map.tileAt(x, y); + if (tile !== null && !tile.contains(x0, y0) && !tile.contains(x1, y1)) { + los = false; + break; + } + if (error > 0) { + x += xInc; + error -= dy; + } else if (error < 0) { + y += yInc; + error += dx; + } else { + x += xInc; + y += yInc; + n--; + } + } + return los; } diff --git a/src/game/levels/level-01.ts b/src/game/levels/level-01.ts index 81408bb44..28ca596ba 100644 --- a/src/game/levels/level-01.ts +++ b/src/game/levels/level-01.ts @@ -1,19 +1,19 @@ export default { map: [ - 'XXXXXXXXXXXXXXXXXXXX', - 'XX X', - 'X X X', - 'XX X X', - 'X X PX X', - 'X X X X', - 'X X X', - 'X X', - 'X X', - 'X X', - 'X X', - 'X X', - 'X X', - 'X X', - 'XXXXXXXXXXXXXXXXXXXX', + ' ', + ' X ', + ' X ', + ' X X ', + ' X X ', + ' X X ', + ' X ', + ' ', + ' ', + ' P ', + ' TX ', + ' ', + ' ', + ' ', + ' ', ] }; diff --git a/src/game/map.ts b/src/game/map.ts index c484bcb6b..23925115e 100644 --- a/src/game/map.ts +++ b/src/game/map.ts @@ -1,11 +1,16 @@ import {Graphics, Container, Point, Rectangle} from 'pixi.js'; -import {Player} from './entities/player'; +import { + Player, + Ranged +} from './entities'; import {Game} from './game'; import {config} from '../config'; export class Map { private _stage: Container; private _map: string[]; + private _player: Player; + private _ranged: Ranged[]; constructor( private _game: Game @@ -14,11 +19,12 @@ export class Map { get view() { return this._stage; } get width() { return config.tileSize * config.gridWidth; } get height() { return config.tileSize * config.gridHeight; } + get player() { return this._player; } tileAt(x: number, y: number) { x = Math.floor(x / config.tileSize); y = Math.floor(y / config.tileSize); - if (this._map[y][x] === 'X') { + if (this._map[y] && (this._map[y][x] === 'X' || this._map[y][x] === 'T')) { return new Rectangle(x * config.tileSize, y * config.tileSize, config.tileSize, config.tileSize); } else { return null; @@ -27,18 +33,27 @@ export class Map { loadLevel(level: any) { this._map = level.map; + this._ranged = []; this._stage = new Container(); const graphics = new Graphics(); this._stage.addChild(graphics); - graphics.beginFill(0xFFFF00); + graphics.beginFill(0xFFFF88); for (let row = 0; row < this._map.length; row += 1) { for (let tile = 0; tile < this._map[row].length; tile += 1) { if (this._map[row][tile] === 'X') { graphics.drawRect(config.tileSize * tile, config.tileSize * row, config.tileSize, config.tileSize); + } + + if (this._map[row][tile] === 'T') { + const ranged = new Ranged(this._game); + ranged.tile = new Point(tile, row); + this._stage.addChild(ranged.view); + this._ranged.push(ranged); } else if (this._map[row][tile] === 'P') { const player = new Player(this._game); player.tile = new Point(tile, row); this._stage.addChild(player.view); + this._player = player; } } } From eea5a2818858c16f93e22e1f81f238a2b668e31f Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Thu, 10 Nov 2016 15:19:16 -0400 Subject: [PATCH 16/30] Prevent ranged from blocking LOS --- src/game/entities/ranged.ts | 19 ++++++++++++------- src/game/functional/collision.ts | 13 ++++++++----- src/game/levels/level-01.ts | 4 ++-- src/game/map.ts | 32 ++++++++++++++++++++------------ 4 files changed, 42 insertions(+), 26 deletions(-) diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts index 20cedadf4..19078533d 100644 --- a/src/game/entities/ranged.ts +++ b/src/game/entities/ranged.ts @@ -14,6 +14,8 @@ export class Ranged { private _connectLine: Graphics; get view() { return this._view; } + get body() { return this._body; } + get type() { return 'ranged'; } private _playerInRange(): boolean { return inRange(this._range, this._game.currentMap.player.body) && @@ -25,12 +27,12 @@ export class Ranged { } set tile(pos: Point) { - this._body.x = config.tileSize * pos.x + (config.tileSize) / 2; - this._body.y = config.tileSize * pos.y + (config.tileSize) / 2; - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; - this._range.x = this._body.x; - this._range.y = this._body.y; + this._body.x = config.tileSize * pos.x; + this._body.y = config.tileSize * pos.y; + this._view.position.x = this._body.x + (config.tileSize) / 2; + this._view.position.y = this._body.y + (config.tileSize) / 2; + this._range.x = this._body.x + (config.tileSize) / 2; + this._range.y = this._body.y + (config.tileSize) / 2; } update(time) { @@ -39,7 +41,10 @@ export class Ranged { let player = this._game.currentMap.player.body; this._connectLine.clear(); this._connectLine.lineStyle(1, 0x00FF00, 1); - this._connectLine.moveTo(this._body.x, this._body.y); + this._connectLine.moveTo( + this._body.x + this._body.width / 2, + this._body.y + this._body.height / 2 + ); this._connectLine.lineTo(player.x + player.width / 2, player.y + player.height / 2); this._connectLine.lineWidth = 3; this._game.currentMap.view.addChild(this._connectLine); diff --git a/src/game/functional/collision.ts b/src/game/functional/collision.ts index a1cf26b77..df1aea349 100644 --- a/src/game/functional/collision.ts +++ b/src/game/functional/collision.ts @@ -20,24 +20,27 @@ export function wallCollision(map: Map, body: Rectangle) { export function moveBody(map: Map, body: Rectangle, dx: number, dy: number) { let newBody = body.clone(); let tile; + // Y movement newBody.y += dy; tile = wallCollision(map, newBody); if (tile !== null) { + let tileBody = tile.body; if (dy > 0) { - newBody.y = tile.y - newBody.height - 1; + newBody.y = tileBody.y - newBody.height - 1; } else { - newBody.y = tile.y + tile.height + 1; + newBody.y = tileBody.y + tileBody.height + 1; } } // X movement newBody.x += dx; tile = wallCollision(map, newBody); if (tile !== null) { + let tileBody = tile.body; if (dx > 0) { - newBody.x = tile.x - newBody.width - 1; + newBody.x = tileBody.x - newBody.width - 1; } else { - newBody.x = tile.x + tile.width + 1; + newBody.x = tileBody.x + tileBody.width + 1; } } return fixOutOfBOunds(map, newBody); @@ -64,7 +67,7 @@ export function lineOfSight(map: Map, x0: number, y0: number, x1: number, y1: nu dy *= 2; for (; n > 0; --n) { let tile = map.tileAt(x, y); - if (tile !== null && !tile.contains(x0, y0) && !tile.contains(x1, y1)) { + if (tile !== null && tile.type === 'block' && !tile.body.contains(x0, y0) && !tile.body.contains(x1, y1)) { los = false; break; } diff --git a/src/game/levels/level-01.ts b/src/game/levels/level-01.ts index 28ca596ba..6d88f9df9 100644 --- a/src/game/levels/level-01.ts +++ b/src/game/levels/level-01.ts @@ -9,9 +9,9 @@ export default { ' X ', ' ', ' ', - ' P ', + ' XP X ', ' TX ', - ' ', + ' T ', ' ', ' ', ' ', diff --git a/src/game/map.ts b/src/game/map.ts index 23925115e..1a389305b 100644 --- a/src/game/map.ts +++ b/src/game/map.ts @@ -6,9 +6,15 @@ import { import {Game} from './game'; import {config} from '../config'; +interface IMapObject { + readonly body: Rectangle; + readonly type: string; +} + export class Map { private _stage: Container; - private _map: string[]; + private _mapConfig: string[]; + private _map: IMapObject[][]; private _player: Player; private _ranged: Ranged[]; @@ -24,32 +30,34 @@ export class Map { tileAt(x: number, y: number) { x = Math.floor(x / config.tileSize); y = Math.floor(y / config.tileSize); - if (this._map[y] && (this._map[y][x] === 'X' || this._map[y][x] === 'T')) { - return new Rectangle(x * config.tileSize, y * config.tileSize, config.tileSize, config.tileSize); - } else { - return null; - } + return (this._map[y] ? this._map[y][x] : null) || null; } loadLevel(level: any) { - this._map = level.map; + this._mapConfig = level.map; this._ranged = []; this._stage = new Container(); const graphics = new Graphics(); this._stage.addChild(graphics); + this._map = Array.apply(null, Array(config.gridHeight)).map(() => []); graphics.beginFill(0xFFFF88); - for (let row = 0; row < this._map.length; row += 1) { - for (let tile = 0; tile < this._map[row].length; tile += 1) { - if (this._map[row][tile] === 'X') { + for (let row = 0; row < this._mapConfig.length; row += 1) { + for (let tile = 0; tile < this._mapConfig[row].length; tile += 1) { + if (this._mapConfig[row][tile] === 'X') { graphics.drawRect(config.tileSize * tile, config.tileSize * row, config.tileSize, config.tileSize); + this._map[row][tile] = { + type: 'block', + body: new Rectangle(config.tileSize * tile, config.tileSize * row, config.tileSize, config.tileSize) + }; } - if (this._map[row][tile] === 'T') { + if (this._mapConfig[row][tile] === 'T') { const ranged = new Ranged(this._game); ranged.tile = new Point(tile, row); this._stage.addChild(ranged.view); this._ranged.push(ranged); - } else if (this._map[row][tile] === 'P') { + this._map[row][tile] = ranged; + } else if (this._mapConfig[row][tile] === 'P') { const player = new Player(this._game); player.tile = new Point(tile, row); this._stage.addChild(player.view); From 19982905826141c976aa24778c83b89a9b1d6537 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Thu, 10 Nov 2016 17:17:22 -0400 Subject: [PATCH 17/30] Add ranged shoots --- src/config.ts | 8 +++- src/game/entities/energyBall.ts | 68 ++++++++++++++++++++++++++++++++ src/game/entities/entity.ts | 10 +++++ src/game/entities/index.ts | 1 + src/game/entities/player.ts | 17 ++++++-- src/game/entities/ranged.ts | 41 +++++++++++++++++-- src/game/functional/collision.ts | 20 ++++++++-- src/game/functional/index.ts | 1 + src/game/functional/math.ts | 6 +++ src/game/game-loop.ts | 2 +- 10 files changed, 161 insertions(+), 13 deletions(-) create mode 100644 src/game/entities/energyBall.ts create mode 100644 src/game/entities/entity.ts create mode 100644 src/game/functional/math.ts diff --git a/src/config.ts b/src/config.ts index 9624ccba6..729b5fe5a 100644 --- a/src/config.ts +++ b/src/config.ts @@ -19,7 +19,13 @@ export const config = { }, ranged: { radius: 4, - size: 32 + size: 32, + shootDelay: 1000, + shootCooldown: 2000 + }, + energyBall: { + size: 20, + speed: 2 } } }; diff --git a/src/game/entities/energyBall.ts b/src/game/entities/energyBall.ts new file mode 100644 index 000000000..a009a4801 --- /dev/null +++ b/src/game/entities/energyBall.ts @@ -0,0 +1,68 @@ +import {Graphics, Rectangle, Point} from 'pixi.js'; +import {Game} from '../game'; +import {IEntity} from './entity'; +import {ITimeEvent} from '../game-loop'; +import {config} from '../../config'; +import {normalizeVector, isOutOfBOunds, wallCollision} from '../functional'; +import {Subscription} from 'rxjs/Rx'; + +export class EnergyBall implements IEntity { + private _speed: Point; + private _body: Rectangle; + private _view: Graphics; + private config: any; + private _subscription: Subscription; + + set tile(pos: Point) { } + set position(pos: Point) { + this._body.x = pos.x - this._body.width / 2; + this._body.y = pos.y - this._body.height / 2; + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; + } + + get position() { + return new Point( + this._body.x + this._body.width / 2, + this._body.y + this._body.height / 2 + ); + } + + get view() { return this._view; } + get body() { return this._body; } + setTarget(entity: IEntity) { + let position = this.position; + let targetPosition = entity.position; + let vectorX = targetPosition.x - position.x; + let vectorY = targetPosition.y - position.y; + this._speed = normalizeVector(vectorX, vectorY); + this._speed.x = this._speed.x * this.config.speed; + this._speed.y = this._speed.y * this.config.speed; + } + + constructor(private _game: Game) { + this.config = Object.assign(config.entities.energyBall); + this._body = new Rectangle(0, 0, this.config.size, this.config.size); + const graphics = new Graphics(); + graphics.beginFill(0xFFFFFF); + graphics.drawCircle( this.config.size / 2, this.config.size / 2, this.config.size / 2 ); + this._view = graphics; + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; + + this.update = this.update.bind(this); + this._subscription = _game.gameLoop$.subscribe(this.update); + } + + update(time: ITimeEvent) { + if (isOutOfBOunds(this._game.currentMap, this._body) || wallCollision(this._game.currentMap, this._body)) { + this._view.destroy(); + this._subscription.unsubscribe(); + } else if (this._speed) { + this._body.x = this._body.x + this._speed.x; + this._body.y = this._body.y + this._speed.y; + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; + } + } +} diff --git a/src/game/entities/entity.ts b/src/game/entities/entity.ts new file mode 100644 index 000000000..5f4c0d72b --- /dev/null +++ b/src/game/entities/entity.ts @@ -0,0 +1,10 @@ +import {DisplayObject, Rectangle, Point} from 'pixi.js'; +import {ITimeEvent} from '../game-loop'; + +export interface IEntity { + update: (time: ITimeEvent) => void; + tile: Point; + position: Point; + readonly view: DisplayObject; + readonly body: Rectangle; +} diff --git a/src/game/entities/index.ts b/src/game/entities/index.ts index e8284e603..aa6c3ad2f 100644 --- a/src/game/entities/index.ts +++ b/src/game/entities/index.ts @@ -1,2 +1,3 @@ export * from './player'; export * from './ranged'; +export * from './energyBall'; diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index 3e9b5a873..f28920354 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -1,9 +1,11 @@ import {config} from '../../config'; import {Point, Texture, Sprite, Rectangle} from 'pixi.js'; import {Game} from '../game'; +import {ITimeEvent} from '../game-loop'; import {moveBody} from '../functional'; +import {IEntity} from './entity'; -export class Player { +export class Player implements IEntity { private xSpeed: number; private ySpeed: number; private keyState: {[key: string]: boolean}; @@ -17,6 +19,13 @@ export class Player { get view() { return this._view; } get body() { return this._body; } + get position() { + return new Point( + this._body.x + this._body.width / 2, + this._body.y + this._body.height / 2 + ); + } + set tile(pos: Point) { this._body.x = config.tileSize * pos.x + (config.tileSize - this.config.size - 1) / 2; this._body.y = config.tileSize * pos.y + (config.tileSize - this.config.size - 1); @@ -24,7 +33,7 @@ export class Player { this._view.position.y = this._body.y; } - update(time) { + update(time: ITimeEvent) { this._body = this._moveBody(this._body, this.xSpeed * this.config.speed, this.ySpeed * this.config.speed); this._view.position.x = this._body.x; this._view.position.y = this._body.y; @@ -40,7 +49,7 @@ export class Player { this._body = new Rectangle(0, 0, this.config.size, this.config.size); this._moveBody = moveBody.bind(null, _game.currentMap); - _game.keyPress$.subscribe(e => this.updateStateFromKeyboard(e)); + _game.keyPress$.subscribe(e => this._updateStateFromKeyboard(e)); const texture = Texture.fromImage('assets/basics/nin.png'); this._view = new Sprite(texture); @@ -58,7 +67,7 @@ export class Player { }, {}); } - updateStateFromKeyboard(e: KeyboardEvent) { + private _updateStateFromKeyboard(e: KeyboardEvent) { let value = e.type === 'keydown'; let key = this.keyMap[e.which]; if (!key) { return; } diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts index 19078533d..e5bb6b4de 100644 --- a/src/game/entities/ranged.ts +++ b/src/game/entities/ranged.ts @@ -1,17 +1,22 @@ import {config} from '../../config'; import {Point, Rectangle, Graphics, Circle} from 'pixi.js'; import {Game} from '../game'; +import {IEntity} from './entity'; +import {EnergyBall} from './energyBall'; +import {ITimeEvent} from '../game-loop'; import { inRange, lineOfSight } from '../functional'; -export class Ranged { +export class Ranged implements IEntity { private _view: Graphics; private config: any; private _body: Rectangle; private _range: Circle; private _connectLine: Graphics; + private _state: 'searching' | 'shooting' | 'cooldown'; + private _timer: number; get view() { return this._view; } get body() { return this._body; } @@ -35,9 +40,25 @@ export class Ranged { this._range.y = this._body.y + (config.tileSize) / 2; } - update(time) { + get position() { + return new Point( + this._body.x + this._body.width / 2, + this._body.y + this._body.height / 2 + ); + } + + shoot() { + let shoot = new EnergyBall(this._game); + shoot.position = new Point( + this._body.x + this._body.width / 2, + this._body.y + this._body.height / 2 + ); + shoot.setTarget(this._game.currentMap.player); + this._game.currentMap.view.addChild(shoot.view); + } + + update(time: ITimeEvent) { if (this._playerInRange()) { - console.log('updating tower'); let player = this._game.currentMap.player.body; this._connectLine.clear(); this._connectLine.lineStyle(1, 0x00FF00, 1); @@ -51,11 +72,25 @@ export class Ranged { } else { this._game.currentMap.view.removeChild(this._connectLine); } + if (this._state === 'searching' && this._playerInRange()) { + this._state = 'shooting'; + this._timer = this.config.shootDelay; + } + if (this._state === 'shooting' && this._timer < 0) { + this._state = 'cooldown'; + this._timer = this.config.shootCooldown; + this.shoot(); + } + if (this._state === 'cooldown' && this._timer < 0) { + this._state = 'searching'; + } + this._timer -= time.delta; } constructor( private _game: Game ) { + this._state = 'searching'; this.config = Object.assign(config.entities.ranged); this._body = new Rectangle(0, 0, this.config.size, this.config.size); this._range = new Circle(0, 0, config.tileSize * this.config.radius ); diff --git a/src/game/functional/collision.ts b/src/game/functional/collision.ts index df1aea349..a91802bde 100644 --- a/src/game/functional/collision.ts +++ b/src/game/functional/collision.ts @@ -1,6 +1,10 @@ import {Map} from '../map'; import {Rectangle, Circle} from 'pixi.js'; +export function isOutOfBOunds(map: Map, body: Rectangle) { + return body.x < 0 || body.y < 0 || body.right > map.width || body.bottom > map.height; +} + export function fixOutOfBOunds(map: Map, body: Rectangle) { let newBody = body.clone(); if (newBody.x < 0) { newBody.x = 0; } @@ -10,11 +14,19 @@ export function fixOutOfBOunds(map: Map, body: Rectangle) { return newBody; } +export function wallAt(map: Map, x, y) { + let tile = map.tileAt(x, y); + if (tile && tile.type !== 'block') { + tile = null; + } + return tile; +} + export function wallCollision(map: Map, body: Rectangle) { - return map.tileAt(body.right, body.bottom) || - map.tileAt(body.left, body.bottom) || - map.tileAt(body.right, body.top) || - map.tileAt(body.left, body.top); + return wallAt(map, body.right, body.bottom) || + wallAt(map, body.left, body.bottom) || + wallAt(map, body.right, body.top) || + wallAt(map, body.left, body.top); } export function moveBody(map: Map, body: Rectangle, dx: number, dy: number) { diff --git a/src/game/functional/index.ts b/src/game/functional/index.ts index 2295b5f39..2c3291239 100644 --- a/src/game/functional/index.ts +++ b/src/game/functional/index.ts @@ -1 +1,2 @@ export * from './collision'; +export * from './math'; diff --git a/src/game/functional/math.ts b/src/game/functional/math.ts new file mode 100644 index 000000000..08134f870 --- /dev/null +++ b/src/game/functional/math.ts @@ -0,0 +1,6 @@ +import { Point } from 'pixi.js'; + +export function normalizeVector(x, y) { + let ratio = 1 / Math.sqrt(x * x + y * y); + return new Point(x * ratio, y * ratio); +} diff --git a/src/game/game-loop.ts b/src/game/game-loop.ts index baf375515..7518339c0 100644 --- a/src/game/game-loop.ts +++ b/src/game/game-loop.ts @@ -1,6 +1,6 @@ import { Observable, Subject } from 'rxjs/Rx'; -interface ITimeEvent { +export interface ITimeEvent { timestamp: number; delta: number; }; From a2363f5bcaf3c4fe8ee1ae0fa385f4ed6862d550 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Thu, 10 Nov 2016 17:44:07 -0400 Subject: [PATCH 18/30] Make ranged walls on move collision detection --- src/game/functional/collision.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/game/functional/collision.ts b/src/game/functional/collision.ts index a91802bde..17803c6c5 100644 --- a/src/game/functional/collision.ts +++ b/src/game/functional/collision.ts @@ -14,19 +14,19 @@ export function fixOutOfBOunds(map: Map, body: Rectangle) { return newBody; } -export function wallAt(map: Map, x, y) { +export function wallAt(map: Map, x: number, y: number, rangedAsWalls = false) { let tile = map.tileAt(x, y); - if (tile && tile.type !== 'block') { + if (tile && !rangedAsWalls && tile.type !== 'block') { tile = null; } return tile; } -export function wallCollision(map: Map, body: Rectangle) { - return wallAt(map, body.right, body.bottom) || - wallAt(map, body.left, body.bottom) || - wallAt(map, body.right, body.top) || - wallAt(map, body.left, body.top); +export function wallCollision(map: Map, body: Rectangle, rangedAsWalls = false) { + return wallAt(map, body.right, body.bottom, rangedAsWalls) || + wallAt(map, body.left, body.bottom, rangedAsWalls) || + wallAt(map, body.right, body.top, rangedAsWalls) || + wallAt(map, body.left, body.top, rangedAsWalls); } export function moveBody(map: Map, body: Rectangle, dx: number, dy: number) { @@ -35,7 +35,7 @@ export function moveBody(map: Map, body: Rectangle, dx: number, dy: number) { // Y movement newBody.y += dy; - tile = wallCollision(map, newBody); + tile = wallCollision(map, newBody, true); if (tile !== null) { let tileBody = tile.body; if (dy > 0) { @@ -46,7 +46,7 @@ export function moveBody(map: Map, body: Rectangle, dx: number, dy: number) { } // X movement newBody.x += dx; - tile = wallCollision(map, newBody); + tile = wallCollision(map, newBody, true); if (tile !== null) { let tileBody = tile.body; if (dx > 0) { From 03d0df5fd4d8e2f941abc8afe898215921ca10fc Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Fri, 11 Nov 2016 12:04:13 -0400 Subject: [PATCH 19/30] Add energyBall player collision --- src/config.ts | 3 +- src/game/entities/energyBall.ts | 21 ++++++- src/game/entities/player.ts | 18 +++--- src/game/entities/ranged.ts | 78 +++++++++++++------------- src/game/functional/collision.ts | 31 ++++++++-- src/game/map.ts | 6 +- src/game/{entities => types}/entity.ts | 1 + src/game/types/index.ts | 2 + src/game/types/mapObject.ts | 6 ++ 9 files changed, 106 insertions(+), 60 deletions(-) rename src/game/{entities => types}/entity.ts (88%) create mode 100644 src/game/types/index.ts create mode 100644 src/game/types/mapObject.ts diff --git a/src/config.ts b/src/config.ts index 729b5fe5a..9248bddf9 100644 --- a/src/config.ts +++ b/src/config.ts @@ -25,7 +25,8 @@ export const config = { }, energyBall: { size: 20, - speed: 2 + speed: 2, + damage: 10 } } }; diff --git a/src/game/entities/energyBall.ts b/src/game/entities/energyBall.ts index a009a4801..681fa03b8 100644 --- a/src/game/entities/energyBall.ts +++ b/src/game/entities/energyBall.ts @@ -1,9 +1,14 @@ import {Graphics, Rectangle, Point} from 'pixi.js'; import {Game} from '../game'; -import {IEntity} from './entity'; +import {IEntity} from '../types'; import {ITimeEvent} from '../game-loop'; import {config} from '../../config'; -import {normalizeVector, isOutOfBOunds, wallCollision} from '../functional'; +import { + normalizeVector, + isOutOfBOunds, + wallCollision, + enemyCollision +} from '../functional'; import {Subscription} from 'rxjs/Rx'; export class EnergyBall implements IEntity { @@ -54,8 +59,18 @@ export class EnergyBall implements IEntity { this._subscription = _game.gameLoop$.subscribe(this.update); } + hit() {} + update(time: ITimeEvent) { - if (isOutOfBOunds(this._game.currentMap, this._body) || wallCollision(this._game.currentMap, this._body)) { + let enemy = enemyCollision(this._game.currentMap, this); + if ( + isOutOfBOunds(this._game.currentMap, this._body) || + wallCollision(this._game.currentMap, this._body) || + enemy + ) { + if (enemy) { + enemy.hit(this.config.damage); + } this._view.destroy(); this._subscription.unsubscribe(); } else if (this._speed) { diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index f28920354..744983b02 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -3,7 +3,7 @@ import {Point, Texture, Sprite, Rectangle} from 'pixi.js'; import {Game} from '../game'; import {ITimeEvent} from '../game-loop'; import {moveBody} from '../functional'; -import {IEntity} from './entity'; +import {IEntity} from '../types'; export class Player implements IEntity { private xSpeed: number; @@ -33,12 +33,6 @@ export class Player implements IEntity { this._view.position.y = this._body.y; } - update(time: ITimeEvent) { - this._body = this._moveBody(this._body, this.xSpeed * this.config.speed, this.ySpeed * this.config.speed); - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; - } - constructor( private _game: Game ) { @@ -67,6 +61,16 @@ export class Player implements IEntity { }, {}); } + hit(damage: number) { + console.log(damage); + } + + update(time: ITimeEvent) { + this._body = this._moveBody(this._body, this.xSpeed * this.config.speed, this.ySpeed * this.config.speed); + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; + } + private _updateStateFromKeyboard(e: KeyboardEvent) { let value = e.type === 'keydown'; let key = this.keyMap[e.which]; diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts index e5bb6b4de..e47afcca5 100644 --- a/src/game/entities/ranged.ts +++ b/src/game/entities/ranged.ts @@ -1,7 +1,7 @@ import {config} from '../../config'; import {Point, Rectangle, Graphics, Circle} from 'pixi.js'; import {Game} from '../game'; -import {IEntity} from './entity'; +import {IEntity} from '../types'; import {EnergyBall} from './energyBall'; import {ITimeEvent} from '../game-loop'; import { @@ -22,15 +22,6 @@ export class Ranged implements IEntity { get body() { return this._body; } get type() { return 'ranged'; } - private _playerInRange(): boolean { - return inRange(this._range, this._game.currentMap.player.body) && - lineOfSight(this._game.currentMap, - this._range.x, this._range.y, - this._game.currentMap.player.body.x + this._game.currentMap.player.body.width / 2, - this._game.currentMap.player.body.y + this._game.currentMap.player.body.height / 2 - ); - } - set tile(pos: Point) { this._body.x = config.tileSize * pos.x; this._body.y = config.tileSize * pos.y; @@ -47,16 +38,30 @@ export class Ranged implements IEntity { ); } - shoot() { - let shoot = new EnergyBall(this._game); - shoot.position = new Point( - this._body.x + this._body.width / 2, - this._body.y + this._body.height / 2 - ); - shoot.setTarget(this._game.currentMap.player); - this._game.currentMap.view.addChild(shoot.view); + constructor( + private _game: Game + ) { + this._state = 'searching'; + this.config = Object.assign(config.entities.ranged); + this._body = new Rectangle(0, 0, this.config.size, this.config.size); + this._range = new Circle(0, 0, config.tileSize * this.config.radius ); + this._connectLine = new Graphics(); + const graphics = new Graphics(); + graphics.beginFill(0x00FF00, 0.2); + graphics.drawCircle( 0, 0, config.tileSize * this.config.radius ); + graphics.beginFill(0xFF8888); + graphics.drawCircle( 0, 0, config.tileSize / 2 ); + + this._view = graphics; + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; + + this.update = this.update.bind(this); + _game.gameLoop$.subscribe(this.update); } + hit() {} + update(time: ITimeEvent) { if (this._playerInRange()) { let player = this._game.currentMap.player.body; @@ -79,7 +84,7 @@ export class Ranged implements IEntity { if (this._state === 'shooting' && this._timer < 0) { this._state = 'cooldown'; this._timer = this.config.shootCooldown; - this.shoot(); + this._shoot(); } if (this._state === 'cooldown' && this._timer < 0) { this._state = 'searching'; @@ -87,25 +92,22 @@ export class Ranged implements IEntity { this._timer -= time.delta; } - constructor( - private _game: Game - ) { - this._state = 'searching'; - this.config = Object.assign(config.entities.ranged); - this._body = new Rectangle(0, 0, this.config.size, this.config.size); - this._range = new Circle(0, 0, config.tileSize * this.config.radius ); - this._connectLine = new Graphics(); - const graphics = new Graphics(); - graphics.beginFill(0x00FF00, 0.2); - graphics.drawCircle( 0, 0, config.tileSize * this.config.radius ); - graphics.beginFill(0xFF8888); - graphics.drawCircle( 0, 0, config.tileSize / 2 ); - - this._view = graphics; - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; + private _shoot() { + let shoot = new EnergyBall(this._game); + shoot.position = new Point( + this._body.x + this._body.width / 2, + this._body.y + this._body.height / 2 + ); + shoot.setTarget(this._game.currentMap.player); + this._game.currentMap.view.addChild(shoot.view); + } - this.update = this.update.bind(this); - _game.gameLoop$.subscribe(this.update); + private _playerInRange(): boolean { + return inRange(this._range, this._game.currentMap.player.body) && + lineOfSight(this._game.currentMap, + this._range.x, this._range.y, + this._game.currentMap.player.body.x + this._game.currentMap.player.body.width / 2, + this._game.currentMap.player.body.y + this._game.currentMap.player.body.height / 2 + ); } } diff --git a/src/game/functional/collision.ts b/src/game/functional/collision.ts index 17803c6c5..415db9ba2 100644 --- a/src/game/functional/collision.ts +++ b/src/game/functional/collision.ts @@ -1,11 +1,15 @@ +import { + IEntity, + IMapObject +} from '../types'; import {Map} from '../map'; import {Rectangle, Circle} from 'pixi.js'; -export function isOutOfBOunds(map: Map, body: Rectangle) { +export function isOutOfBOunds(map: Map, body: Rectangle): boolean { return body.x < 0 || body.y < 0 || body.right > map.width || body.bottom > map.height; } -export function fixOutOfBOunds(map: Map, body: Rectangle) { +export function fixOutOfBOunds(map: Map, body: Rectangle): Rectangle { let newBody = body.clone(); if (newBody.x < 0) { newBody.x = 0; } if (newBody.y < 0) { newBody.y = 0; } @@ -14,7 +18,7 @@ export function fixOutOfBOunds(map: Map, body: Rectangle) { return newBody; } -export function wallAt(map: Map, x: number, y: number, rangedAsWalls = false) { +export function wallAt(map: Map, x: number, y: number, rangedAsWalls = false): IMapObject { let tile = map.tileAt(x, y); if (tile && !rangedAsWalls && tile.type !== 'block') { tile = null; @@ -22,14 +26,29 @@ export function wallAt(map: Map, x: number, y: number, rangedAsWalls = false) { return tile; } -export function wallCollision(map: Map, body: Rectangle, rangedAsWalls = false) { +export function wallCollision(map: Map, body: Rectangle, rangedAsWalls = false): IMapObject { return wallAt(map, body.right, body.bottom, rangedAsWalls) || wallAt(map, body.left, body.bottom, rangedAsWalls) || wallAt(map, body.right, body.top, rangedAsWalls) || wallAt(map, body.left, body.top, rangedAsWalls); } -export function moveBody(map: Map, body: Rectangle, dx: number, dy: number) { +function _rectsCollide(rect1: Rectangle, rect2: Rectangle): boolean { + return rect1.contains(rect2.left, rect2.top) || + rect1.contains(rect2.left, rect2.bottom) || + rect1.contains(rect2.right, rect2.top) || + rect1.contains(rect2.right, rect2.bottom); +} +export function rectsCollide(rect1: Rectangle, rect2: Rectangle): boolean { + return _rectsCollide(rect1, rect2) || _rectsCollide(rect2, rect1); +} + +export function enemyCollision(map: Map, entity: IEntity): IEntity { + let playerBody = map.player.body; + return rectsCollide(entity.body, playerBody) ? map.player : null; +} + +export function moveBody(map: Map, body: Rectangle, dx: number, dy: number): Rectangle { let newBody = body.clone(); let tile; @@ -58,7 +77,7 @@ export function moveBody(map: Map, body: Rectangle, dx: number, dy: number) { return fixOutOfBOunds(map, newBody); } -export function inRange(range: Circle, body: Rectangle) { +export function inRange(range: Circle, body: Rectangle): boolean { return range.contains(body.left, body.bottom) || range.contains(body.right, body.bottom) || range.contains(body.left, body.top) || diff --git a/src/game/map.ts b/src/game/map.ts index 1a389305b..17f7a75df 100644 --- a/src/game/map.ts +++ b/src/game/map.ts @@ -5,11 +5,7 @@ import { } from './entities'; import {Game} from './game'; import {config} from '../config'; - -interface IMapObject { - readonly body: Rectangle; - readonly type: string; -} +import {IMapObject} from './types'; export class Map { private _stage: Container; diff --git a/src/game/entities/entity.ts b/src/game/types/entity.ts similarity index 88% rename from src/game/entities/entity.ts rename to src/game/types/entity.ts index 5f4c0d72b..a1dc73df2 100644 --- a/src/game/entities/entity.ts +++ b/src/game/types/entity.ts @@ -5,6 +5,7 @@ export interface IEntity { update: (time: ITimeEvent) => void; tile: Point; position: Point; + hit: (damage: number) => void; readonly view: DisplayObject; readonly body: Rectangle; } diff --git a/src/game/types/index.ts b/src/game/types/index.ts new file mode 100644 index 000000000..aa634aa69 --- /dev/null +++ b/src/game/types/index.ts @@ -0,0 +1,2 @@ +export * from './entity'; +export * from './mapObject'; diff --git a/src/game/types/mapObject.ts b/src/game/types/mapObject.ts new file mode 100644 index 000000000..260552620 --- /dev/null +++ b/src/game/types/mapObject.ts @@ -0,0 +1,6 @@ +import {Rectangle} from 'pixi.js'; + +export interface IMapObject { + readonly body: Rectangle; + readonly type: string; +} From e206ff9451184f2a4fad78a71d1a0c69d8b4a2b0 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Fri, 11 Nov 2016 13:28:27 -0400 Subject: [PATCH 20/30] Add on blur pause --- src/game/game-loop.ts | 7 +++++++ src/game/game.ts | 8 ++++++++ src/main.ts | 8 ++++++++ 3 files changed, 23 insertions(+) diff --git a/src/game/game-loop.ts b/src/game/game-loop.ts index 7518339c0..1f0cd9f46 100644 --- a/src/game/game-loop.ts +++ b/src/game/game-loop.ts @@ -16,6 +16,13 @@ export class GameLoop { private _lastTime: number; private _stats: Stats; + pause() { + this._paused = true; + } + + unpause() { + this._paused = false; + } private _gameLoop(time) { let frameInfo = { timestamp: time, diff --git a/src/game/game.ts b/src/game/game.ts index 74d72f910..604fe3587 100644 --- a/src/game/game.ts +++ b/src/game/game.ts @@ -19,6 +19,14 @@ export class Game { get view() { return this._canvas.renderer.view; } get currentMap() { return this._map; } + pause() { + this._gameLoop.pause(); + } + + unpause() { + this._gameLoop.unpause(); + } + constructor() { this._gameLoop = new GameLoop(); this._canvas = new GameCanvas(); diff --git a/src/main.ts b/src/main.ts index c72825e14..4a04406ae 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,3 +3,11 @@ import {Game} from './game'; const game = new Game(); document.body.appendChild(game.view); game.start(); + +window.addEventListener('blur', () => { + game.pause(); +}); + +window.addEventListener('focus', () => { + game.unpause(); +}); From f4af4ec53a13de19868c010a105b0b049b3046fe Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Fri, 11 Nov 2016 15:46:34 -0400 Subject: [PATCH 21/30] Refactor entities code --- src/config.ts | 3 +- src/game/entities/energyBall.ts | 34 ++++---- src/game/entities/player.ts | 130 ++++++++++++++++++++----------- src/game/entities/ranged.ts | 23 +++--- src/game/entities/wall.ts | 22 ++++++ src/game/functional/collision.ts | 14 ++-- src/game/map.ts | 20 ++++- src/game/types/entity.ts | 19 ++++- src/game/types/index.ts | 3 +- src/game/types/mapObject.ts | 6 -- src/game/types/robot.ts | 6 ++ src/game/types/unit.ts | 7 ++ 12 files changed, 197 insertions(+), 90 deletions(-) create mode 100644 src/game/entities/wall.ts delete mode 100644 src/game/types/mapObject.ts create mode 100644 src/game/types/robot.ts create mode 100644 src/game/types/unit.ts diff --git a/src/config.ts b/src/config.ts index 9248bddf9..41305a5ed 100644 --- a/src/config.ts +++ b/src/config.ts @@ -15,7 +15,8 @@ export const config = { entities: { player: { speed: 2, - size: 24 + size: 24, + hackDistance: 20 }, ranged: { radius: 4, diff --git a/src/game/entities/energyBall.ts b/src/game/entities/energyBall.ts index 681fa03b8..73fdaac2a 100644 --- a/src/game/entities/energyBall.ts +++ b/src/game/entities/energyBall.ts @@ -1,6 +1,6 @@ import {Graphics, Rectangle, Point} from 'pixi.js'; import {Game} from '../game'; -import {IEntity} from '../types'; +import {IEntity, teamType} from '../types'; import {ITimeEvent} from '../game-loop'; import {config} from '../../config'; import { @@ -12,10 +12,13 @@ import { import {Subscription} from 'rxjs/Rx'; export class EnergyBall implements IEntity { + get type() { return 'energyBall'; } + get team(): teamType { return 'robot'; } + private _speed: Point; private _body: Rectangle; private _view: Graphics; - private config: any; + private _config: any; private _subscription: Subscription; set tile(pos: Point) { } @@ -35,22 +38,13 @@ export class EnergyBall implements IEntity { get view() { return this._view; } get body() { return this._body; } - setTarget(entity: IEntity) { - let position = this.position; - let targetPosition = entity.position; - let vectorX = targetPosition.x - position.x; - let vectorY = targetPosition.y - position.y; - this._speed = normalizeVector(vectorX, vectorY); - this._speed.x = this._speed.x * this.config.speed; - this._speed.y = this._speed.y * this.config.speed; - } constructor(private _game: Game) { - this.config = Object.assign(config.entities.energyBall); - this._body = new Rectangle(0, 0, this.config.size, this.config.size); + this._config = Object.assign(config.entities.energyBall); + this._body = new Rectangle(0, 0, this._config.size, this._config.size); const graphics = new Graphics(); graphics.beginFill(0xFFFFFF); - graphics.drawCircle( this.config.size / 2, this.config.size / 2, this.config.size / 2 ); + graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.size / 2 ); this._view = graphics; this._view.position.x = this._body.x; this._view.position.y = this._body.y; @@ -69,7 +63,7 @@ export class EnergyBall implements IEntity { enemy ) { if (enemy) { - enemy.hit(this.config.damage); + enemy.hit(this._config.damage); } this._view.destroy(); this._subscription.unsubscribe(); @@ -80,4 +74,14 @@ export class EnergyBall implements IEntity { this._view.position.y = this._body.y; } } + + setTarget(entity: IEntity) { + let position = this.position; + let targetPosition = entity.position; + let vectorX = targetPosition.x - position.x; + let vectorY = targetPosition.y - position.y; + this._speed = normalizeVector(vectorX, vectorY); + this._speed.x = this._speed.x * this._config.speed; + this._speed.y = this._speed.y * this._config.speed; + } } diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index 744983b02..d0aa50eba 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -1,20 +1,32 @@ import {config} from '../../config'; -import {Point, Texture, Sprite, Rectangle} from 'pixi.js'; +import { + Point, + Texture, + Sprite, + Rectangle, + Container, + Graphics +} from 'pixi.js'; import {Game} from '../game'; import {ITimeEvent} from '../game-loop'; import {moveBody} from '../functional'; -import {IEntity} from '../types'; - -export class Player implements IEntity { - private xSpeed: number; - private ySpeed: number; - private keyState: {[key: string]: boolean}; - private keyMap: {[key: number]: string}; - private _view: Sprite; - private config: any; +import {IUnit, teamType} from '../types'; + +export class Player implements IUnit { + get type() { return 'hacker'; } + get team(): teamType { return 'hacker'; } + + private _xSpeed: number; + private _ySpeed: number; + private _keyState: {[key: string]: boolean}; + private _keyMap: {[key: number]: string}; + private _view: Container; + private _config: any; private _body: Rectangle; - - private _moveBody: (body: Rectangle, dx: number, dy: number) => Rectangle; + private _hackingPoint: Point; + private _hackingPointX: number; + private _hackingPointY: number; + private _hackingView: Graphics; get view() { return this._view; } get body() { return this._body; } @@ -27,35 +39,49 @@ export class Player implements IEntity { } set tile(pos: Point) { - this._body.x = config.tileSize * pos.x + (config.tileSize - this.config.size - 1) / 2; - this._body.y = config.tileSize * pos.y + (config.tileSize - this.config.size - 1); + this._body.x = config.tileSize * pos.x + (config.tileSize - this._config.size - 1) / 2; + this._body.y = config.tileSize * pos.y + (config.tileSize - this._config.size - 1); this._view.position.x = this._body.x; this._view.position.y = this._body.y; + let point = this.position; + this._hackingPoint = new Point(point.x + this._hackingPointX, point.y + this._hackingPointY); } constructor( private _game: Game ) { - this.xSpeed = 0; - this.ySpeed = 0; - this.keyState = {}; - this.config = Object.assign(config.entities.player); - this._body = new Rectangle(0, 0, this.config.size, this.config.size); - this._moveBody = moveBody.bind(null, _game.currentMap); + this._xSpeed = 0; + this._ySpeed = 0; + this._keyState = {}; + this._config = Object.assign(config.entities.player); - _game.keyPress$.subscribe(e => this._updateStateFromKeyboard(e)); + this._body = new Rectangle(0, 0, this._config.size, this._config.size); + this._hackingPointX = 0; + this._hackingPointY = -config.tileSize; + let point = this.position; + this._hackingPoint = new Point(point.x + this._hackingPointX, point.y + this._hackingPointY); const texture = Texture.fromImage('assets/basics/nin.png'); - this._view = new Sprite(texture); - this._view.anchor.x = 0; - this._view.anchor.y = 0; - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; + const sprite = new Sprite(texture); + sprite.anchor.x = 0; + sprite.anchor.y = 0; + sprite.position.x = this._body.x; + sprite.position.y = this._body.y; + this._view = new Container(); + this._view.addChild(sprite); + + this._hackingView = new Graphics(); + this._hackingView.beginFill(0xFF0000, 0.8); + this._hackingView.drawCircle(0, 0, 3); + this._hackingView.x = this._hackingPointX + this._body.width / 2; + this._hackingView.y = this._hackingPointY + this._body.width / 2; + this._view.addChild(this._hackingView); + _game.keyPress$.subscribe(e => this._updateStateFromKeyboard(e)); this.update = this.update.bind(this); _game.gameLoop$.subscribe(this.update); - this.keyMap = Object.keys(config.keys).reduce((ret, key) => { + this._keyMap = Object.keys(config.keys).reduce((ret, key) => { ret[config.keys[key]] = key; return ret; }, {}); @@ -66,36 +92,52 @@ export class Player implements IEntity { } update(time: ITimeEvent) { - this._body = this._moveBody(this._body, this.xSpeed * this.config.speed, this.ySpeed * this.config.speed); + this._body = this._moveBody(this._body, this._xSpeed * this._config.speed, this._ySpeed * this._config.speed); this._view.position.x = this._body.x; this._view.position.y = this._body.y; + let point = this.position; + this._hackingPoint = new Point(point.x + this._hackingPointX, point.y + this._hackingPointY); + this._hackingView.x = this._hackingPointX + this._body.width / 2; + this._hackingView.y = this._hackingPointY + this._body.height / 2; + } + + private _moveBody(body: Rectangle, dx: number, dy: number): Rectangle { + return moveBody(this._game.currentMap, body, dx, dy); } private _updateStateFromKeyboard(e: KeyboardEvent) { let value = e.type === 'keydown'; - let key = this.keyMap[e.which]; + let key = this._keyMap[e.which]; if (!key) { return; } - this.keyState[key] = value; - - if (this.keyState['up']) { - this.ySpeed = -1; - } else if (this.keyState['down']) { - this.ySpeed = 1; + this._keyState[key] = value; + + if (this._keyState['up']) { + this._ySpeed = -1; + this._hackingPointX = 0; + this._hackingPointY = -this._config.hackDistance; + } else if (this._keyState['down']) { + this._ySpeed = 1; + this._hackingPointX = 0; + this._hackingPointY = this._config.hackDistance; } else { - this.ySpeed = 0; + this._ySpeed = 0; } - if (this.keyState['left']) { - this.xSpeed = -1; - } else if (this.keyState['right']) { - this.xSpeed = 1; + if (this._keyState['left']) { + this._xSpeed = -1; + this._hackingPointX = -this._config.hackDistance; + this._hackingPointY = 0; + } else if (this._keyState['right']) { + this._xSpeed = 1; + this._hackingPointX = this._config.hackDistance; + this._hackingPointY = 0; } else { - this.xSpeed = 0; + this._xSpeed = 0; } - if (this.xSpeed !== 0 && this.ySpeed !== 0) { - this.xSpeed *= 0.7; - this.ySpeed *= 0.7; + if (this._xSpeed !== 0 && this._ySpeed !== 0) { + this._xSpeed *= 0.7; + this._ySpeed *= 0.7; } } diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts index e47afcca5..52fcec2a5 100644 --- a/src/game/entities/ranged.ts +++ b/src/game/entities/ranged.ts @@ -1,7 +1,7 @@ import {config} from '../../config'; import {Point, Rectangle, Graphics, Circle} from 'pixi.js'; import {Game} from '../game'; -import {IEntity} from '../types'; +import {IRobot, teamType} from '../types'; import {EnergyBall} from './energyBall'; import {ITimeEvent} from '../game-loop'; import { @@ -9,9 +9,12 @@ import { lineOfSight } from '../functional'; -export class Ranged implements IEntity { +export class Ranged implements IRobot { + get type() { return 'ranged'; } + get team(): teamType { return 'robot'; } + private _view: Graphics; - private config: any; + private _config: any; private _body: Rectangle; private _range: Circle; private _connectLine: Graphics; @@ -20,7 +23,6 @@ export class Ranged implements IEntity { get view() { return this._view; } get body() { return this._body; } - get type() { return 'ranged'; } set tile(pos: Point) { this._body.x = config.tileSize * pos.x; @@ -42,13 +44,13 @@ export class Ranged implements IEntity { private _game: Game ) { this._state = 'searching'; - this.config = Object.assign(config.entities.ranged); - this._body = new Rectangle(0, 0, this.config.size, this.config.size); - this._range = new Circle(0, 0, config.tileSize * this.config.radius ); + this._config = Object.assign(config.entities.ranged); + this._body = new Rectangle(0, 0, this._config.size, this._config.size); + this._range = new Circle(0, 0, config.tileSize * this._config.radius ); this._connectLine = new Graphics(); const graphics = new Graphics(); graphics.beginFill(0x00FF00, 0.2); - graphics.drawCircle( 0, 0, config.tileSize * this.config.radius ); + graphics.drawCircle( 0, 0, config.tileSize * this._config.radius ); graphics.beginFill(0xFF8888); graphics.drawCircle( 0, 0, config.tileSize / 2 ); @@ -60,6 +62,7 @@ export class Ranged implements IEntity { _game.gameLoop$.subscribe(this.update); } + hack() {} hit() {} update(time: ITimeEvent) { @@ -79,11 +82,11 @@ export class Ranged implements IEntity { } if (this._state === 'searching' && this._playerInRange()) { this._state = 'shooting'; - this._timer = this.config.shootDelay; + this._timer = this._config.shootDelay; } if (this._state === 'shooting' && this._timer < 0) { this._state = 'cooldown'; - this._timer = this.config.shootCooldown; + this._timer = this._config.shootCooldown; this._shoot(); } if (this._state === 'cooldown' && this._timer < 0) { diff --git a/src/game/entities/wall.ts b/src/game/entities/wall.ts new file mode 100644 index 000000000..7298b05eb --- /dev/null +++ b/src/game/entities/wall.ts @@ -0,0 +1,22 @@ +import {Point, Rectangle, Graphics} from 'pixi.js'; +import {IEntity, teamType} from '../types'; +import {Game} from '../game'; + + +export class Wall implements IEntity { + get type() { return 'block'; } + get team(): teamType { return 'neutral'; } + + _body: Rectangle; + _view: Graphics; + set tile(tile: Point) {} + set position(tile: Point) {} + get body() { return this._body; } + get view() { return this._view; } + + constructor( + private _game: Game + ) {} + + update() {} +} diff --git a/src/game/functional/collision.ts b/src/game/functional/collision.ts index 415db9ba2..b44a1cf91 100644 --- a/src/game/functional/collision.ts +++ b/src/game/functional/collision.ts @@ -1,6 +1,6 @@ import { IEntity, - IMapObject + IUnit } from '../types'; import {Map} from '../map'; import {Rectangle, Circle} from 'pixi.js'; @@ -18,7 +18,7 @@ export function fixOutOfBOunds(map: Map, body: Rectangle): Rectangle { return newBody; } -export function wallAt(map: Map, x: number, y: number, rangedAsWalls = false): IMapObject { +export function wallAt(map: Map, x: number, y: number, rangedAsWalls = false): IEntity { let tile = map.tileAt(x, y); if (tile && !rangedAsWalls && tile.type !== 'block') { tile = null; @@ -26,7 +26,7 @@ export function wallAt(map: Map, x: number, y: number, rangedAsWalls = false): I return tile; } -export function wallCollision(map: Map, body: Rectangle, rangedAsWalls = false): IMapObject { +export function wallCollision(map: Map, body: Rectangle, rangedAsWalls = false): IEntity { return wallAt(map, body.right, body.bottom, rangedAsWalls) || wallAt(map, body.left, body.bottom, rangedAsWalls) || wallAt(map, body.right, body.top, rangedAsWalls) || @@ -43,9 +43,9 @@ export function rectsCollide(rect1: Rectangle, rect2: Rectangle): boolean { return _rectsCollide(rect1, rect2) || _rectsCollide(rect2, rect1); } -export function enemyCollision(map: Map, entity: IEntity): IEntity { +export function enemyCollision(map: Map, entity: IEntity): IUnit { let playerBody = map.player.body; - return rectsCollide(entity.body, playerBody) ? map.player : null; + return rectsCollide(entity.body, playerBody) ? map.player : null; } export function moveBody(map: Map, body: Rectangle, dx: number, dy: number): Rectangle { @@ -56,7 +56,7 @@ export function moveBody(map: Map, body: Rectangle, dx: number, dy: number): Rec newBody.y += dy; tile = wallCollision(map, newBody, true); if (tile !== null) { - let tileBody = tile.body; + let tileBody = tile.body; if (dy > 0) { newBody.y = tileBody.y - newBody.height - 1; } else { @@ -67,7 +67,7 @@ export function moveBody(map: Map, body: Rectangle, dx: number, dy: number): Rec newBody.x += dx; tile = wallCollision(map, newBody, true); if (tile !== null) { - let tileBody = tile.body; + let tileBody = tile.body; if (dx > 0) { newBody.x = tileBody.x - newBody.width - 1; } else { diff --git a/src/game/map.ts b/src/game/map.ts index 17f7a75df..1fbc8e4f5 100644 --- a/src/game/map.ts +++ b/src/game/map.ts @@ -5,12 +5,14 @@ import { } from './entities'; import {Game} from './game'; import {config} from '../config'; -import {IMapObject} from './types'; +import { + IEntity +} from './types'; export class Map { private _stage: Container; private _mapConfig: string[]; - private _map: IMapObject[][]; + private _map: IEntity[][]; private _player: Player; private _ranged: Ranged[]; @@ -23,6 +25,15 @@ export class Map { get height() { return config.tileSize * config.gridHeight; } get player() { return this._player; } + unitAt(x: number, y: number): IEntity { + for (let ranged of this._ranged) { + if (ranged.body.contains(x, y)) { + return ranged; + } + } + return null; + } + tileAt(x: number, y: number) { x = Math.floor(x / config.tileSize); y = Math.floor(y / config.tileSize); @@ -43,6 +54,11 @@ export class Map { graphics.drawRect(config.tileSize * tile, config.tileSize * row, config.tileSize, config.tileSize); this._map[row][tile] = { type: 'block', + team: 'neutral', + set tile(v) {}, + set position(v) {}, + update() {}, + view: null, body: new Rectangle(config.tileSize * tile, config.tileSize * row, config.tileSize, config.tileSize) }; } diff --git a/src/game/types/entity.ts b/src/game/types/entity.ts index a1dc73df2..5f1ae522d 100644 --- a/src/game/types/entity.ts +++ b/src/game/types/entity.ts @@ -1,11 +1,22 @@ -import {DisplayObject, Rectangle, Point} from 'pixi.js'; +import { + Circle, + Rectangle, + DisplayObject, + Point +} from 'pixi.js'; + import {ITimeEvent} from '../game-loop'; +// Anything with a body on the map +// Entities can collide with other units + +export type teamType = 'neutral' | 'hacker' | 'robot'; export interface IEntity { - update: (time: ITimeEvent) => void; + team: teamType; tile: Point; position: Point; - hit: (damage: number) => void; + update: (time: ITimeEvent) => void; + readonly type: string; + readonly body: Rectangle | Circle; readonly view: DisplayObject; - readonly body: Rectangle; } diff --git a/src/game/types/index.ts b/src/game/types/index.ts index aa634aa69..5c0eb3684 100644 --- a/src/game/types/index.ts +++ b/src/game/types/index.ts @@ -1,2 +1,3 @@ export * from './entity'; -export * from './mapObject'; +export * from './unit'; +export * from './robot'; diff --git a/src/game/types/mapObject.ts b/src/game/types/mapObject.ts deleted file mode 100644 index 260552620..000000000 --- a/src/game/types/mapObject.ts +++ /dev/null @@ -1,6 +0,0 @@ -import {Rectangle} from 'pixi.js'; - -export interface IMapObject { - readonly body: Rectangle; - readonly type: string; -} diff --git a/src/game/types/robot.ts b/src/game/types/robot.ts new file mode 100644 index 000000000..a363fecdb --- /dev/null +++ b/src/game/types/robot.ts @@ -0,0 +1,6 @@ +import {IUnit} from './unit'; + + +export interface IRobot { + hack: (value: number) => void; +} diff --git a/src/game/types/unit.ts b/src/game/types/unit.ts new file mode 100644 index 000000000..48b08a925 --- /dev/null +++ b/src/game/types/unit.ts @@ -0,0 +1,7 @@ +import {IEntity} from './Entity'; + +// Units can take hits + +export interface IUnit extends IEntity { + hit: (damage: number) => void; +} From 72f4c941cdab866965b802b7fb34352f78919517 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Fri, 11 Nov 2016 19:30:57 -0400 Subject: [PATCH 22/30] Refactor entities II --- src/config.ts | 2 +- src/game/entities/energyBall.ts | 66 ++++++++++++++-------------- src/game/entities/player.ts | 76 ++++++++++++--------------------- src/game/entities/ranged.ts | 75 ++++++++++++++++---------------- src/game/functional/index.ts | 1 + src/game/functional/math.ts | 58 ++++++++++++++++++++++++- src/game/functional/object.ts | 6 +++ 7 files changed, 165 insertions(+), 119 deletions(-) create mode 100644 src/game/functional/object.ts diff --git a/src/config.ts b/src/config.ts index 41305a5ed..341c9cdf4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -19,7 +19,7 @@ export const config = { hackDistance: 20 }, ranged: { - radius: 4, + radius: 32 * 4, size: 32, shootDelay: 1000, shootCooldown: 2000 diff --git a/src/game/entities/energyBall.ts b/src/game/entities/energyBall.ts index 73fdaac2a..bdd6a5b64 100644 --- a/src/game/entities/energyBall.ts +++ b/src/game/entities/energyBall.ts @@ -7,13 +7,14 @@ import { normalizeVector, isOutOfBOunds, wallCollision, - enemyCollision + enemyCollision, + rectToPoint, + pointToRect } from '../functional'; import {Subscription} from 'rxjs/Rx'; export class EnergyBall implements IEntity { get type() { return 'energyBall'; } - get team(): teamType { return 'robot'; } private _speed: Point; private _body: Rectangle; @@ -21,36 +22,29 @@ export class EnergyBall implements IEntity { private _config: any; private _subscription: Subscription; + get view() { return this._view; } + get body() { return this._body; } + get team(): teamType { return 'robot'; } + get position() { return rectToPoint(this._body); } + set tile(pos: Point) { } set position(pos: Point) { - this._body.x = pos.x - this._body.width / 2; - this._body.y = pos.y - this._body.height / 2; - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; - } - - get position() { - return new Point( - this._body.x + this._body.width / 2, - this._body.y + this._body.height / 2 - ); + this._body = pointToRect(pos, this._config.size, this._config.size); + this._updateView(); } - get view() { return this._view; } - get body() { return this._body; } - constructor(private _game: Game) { this._config = Object.assign(config.entities.energyBall); - this._body = new Rectangle(0, 0, this._config.size, this._config.size); + const graphics = new Graphics(); graphics.beginFill(0xFFFFFF); graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.size / 2 ); this._view = graphics; - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; - this.update = this.update.bind(this); - this._subscription = _game.gameLoop$.subscribe(this.update); + this.position = new Point(); + this._updateView(); + + this._subscription = _game.gameLoop$.subscribe(e => this.update(e)); } hit() {} @@ -60,28 +54,38 @@ export class EnergyBall implements IEntity { if ( isOutOfBOunds(this._game.currentMap, this._body) || wallCollision(this._game.currentMap, this._body) || - enemy + enemy !== null ) { if (enemy) { enemy.hit(this._config.damage); } - this._view.destroy(); - this._subscription.unsubscribe(); + this.destroy(); } else if (this._speed) { - this._body.x = this._body.x + this._speed.x; - this._body.y = this._body.y + this._speed.y; - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; + this.position = new Point( + this.position.x + this._speed.x, + this.position.y + this._speed.y, + ); } } setTarget(entity: IEntity) { let position = this.position; let targetPosition = entity.position; - let vectorX = targetPosition.x - position.x; - let vectorY = targetPosition.y - position.y; - this._speed = normalizeVector(vectorX, vectorY); + this._speed = normalizeVector( + targetPosition.x - position.x, + targetPosition.y - position.y + ); this._speed.x = this._speed.x * this._config.speed; this._speed.y = this._speed.y * this._config.speed; } + + destroy() { + this._view.destroy(); + this._subscription.unsubscribe(); + } + + private _updateView() { + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; + } } diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index d0aa50eba..5b24bc2d0 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -9,12 +9,16 @@ import { } from 'pixi.js'; import {Game} from '../game'; import {ITimeEvent} from '../game-loop'; -import {moveBody} from '../functional'; +import { + moveBody, + rectToPoint, + tileToRect, + reverseKeys +} from '../functional'; import {IUnit, teamType} from '../types'; export class Player implements IUnit { get type() { return 'hacker'; } - get team(): teamType { return 'hacker'; } private _xSpeed: number; private _ySpeed: number; @@ -30,61 +34,36 @@ export class Player implements IUnit { get view() { return this._view; } get body() { return this._body; } - - get position() { - return new Point( - this._body.x + this._body.width / 2, - this._body.y + this._body.height / 2 - ); - } + get team(): teamType { return 'hacker'; } + get position() { return rectToPoint(this._body); } set tile(pos: Point) { - this._body.x = config.tileSize * pos.x + (config.tileSize - this._config.size - 1) / 2; - this._body.y = config.tileSize * pos.y + (config.tileSize - this._config.size - 1); - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; - let point = this.position; - this._hackingPoint = new Point(point.x + this._hackingPointX, point.y + this._hackingPointY); + this._body = tileToRect(pos, this._config.size, this._config.size); + this._hackingPoint = new Point(pos.x + this._hackingPointX, pos.y + this._hackingPointY); + this._updateView(); } constructor( private _game: Game ) { + this._config = Object.assign(config.entities.player); this._xSpeed = 0; this._ySpeed = 0; this._keyState = {}; - this._config = Object.assign(config.entities.player); - - this._body = new Rectangle(0, 0, this._config.size, this._config.size); - this._hackingPointX = 0; - this._hackingPointY = -config.tileSize; - let point = this.position; - this._hackingPoint = new Point(point.x + this._hackingPointX, point.y + this._hackingPointY); - - const texture = Texture.fromImage('assets/basics/nin.png'); - const sprite = new Sprite(texture); - sprite.anchor.x = 0; - sprite.anchor.y = 0; - sprite.position.x = this._body.x; - sprite.position.y = this._body.y; this._view = new Container(); + const sprite = new Sprite(Texture.fromImage('assets/basics/nin.png')); this._view.addChild(sprite); + this._keyMap = reverseKeys(config.keys); this._hackingView = new Graphics(); this._hackingView.beginFill(0xFF0000, 0.8); this._hackingView.drawCircle(0, 0, 3); - this._hackingView.x = this._hackingPointX + this._body.width / 2; - this._hackingView.y = this._hackingPointY + this._body.width / 2; this._view.addChild(this._hackingView); - _game.keyPress$.subscribe(e => this._updateStateFromKeyboard(e)); - this.update = this.update.bind(this); - _game.gameLoop$.subscribe(this.update); + this.tile = new Point(); - this._keyMap = Object.keys(config.keys).reduce((ret, key) => { - ret[config.keys[key]] = key; - return ret; - }, {}); + _game.keyPress$.subscribe(e => this._updateStateFromKeyboard(e)); + _game.gameLoop$.subscribe(e => this.update(e)); } hit(damage: number) { @@ -93,10 +72,14 @@ export class Player implements IUnit { update(time: ITimeEvent) { this._body = this._moveBody(this._body, this._xSpeed * this._config.speed, this._ySpeed * this._config.speed); - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; let point = this.position; this._hackingPoint = new Point(point.x + this._hackingPointX, point.y + this._hackingPointY); + this._updateView(); + } + + private _updateView() { + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; this._hackingView.x = this._hackingPointX + this._body.width / 2; this._hackingView.y = this._hackingPointY + this._body.height / 2; } @@ -113,28 +96,25 @@ export class Player implements IUnit { if (this._keyState['up']) { this._ySpeed = -1; - this._hackingPointX = 0; - this._hackingPointY = -this._config.hackDistance; } else if (this._keyState['down']) { this._ySpeed = 1; - this._hackingPointX = 0; - this._hackingPointY = this._config.hackDistance; } else { this._ySpeed = 0; } if (this._keyState['left']) { this._xSpeed = -1; - this._hackingPointX = -this._config.hackDistance; - this._hackingPointY = 0; } else if (this._keyState['right']) { this._xSpeed = 1; - this._hackingPointX = this._config.hackDistance; - this._hackingPointY = 0; } else { this._xSpeed = 0; } + if ((this._xSpeed !== 0 || this._ySpeed !== 0) && (this._xSpeed === 0 || this._ySpeed === 0)) { + this._hackingPointX = this._xSpeed * this._config.hackDistance; + this._hackingPointY = this._ySpeed * this._config.hackDistance; + } + if (this._xSpeed !== 0 && this._ySpeed !== 0) { this._xSpeed *= 0.7; this._ySpeed *= 0.7; diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts index 52fcec2a5..71787e36f 100644 --- a/src/game/entities/ranged.ts +++ b/src/game/entities/ranged.ts @@ -1,17 +1,24 @@ import {config} from '../../config'; -import {Point, Rectangle, Graphics, Circle} from 'pixi.js'; +import { + Point, + Rectangle, + Graphics, + Circle +} from 'pixi.js'; import {Game} from '../game'; import {IRobot, teamType} from '../types'; import {EnergyBall} from './energyBall'; import {ITimeEvent} from '../game-loop'; import { inRange, - lineOfSight + lineOfSight, + rectToPoint, + tileToRect, + tileToCircle } from '../functional'; export class Ranged implements IRobot { get type() { return 'ranged'; } - get team(): teamType { return 'robot'; } private _view: Graphics; private _config: any; @@ -23,43 +30,34 @@ export class Ranged implements IRobot { get view() { return this._view; } get body() { return this._body; } + get team(): teamType { return 'robot'; } + get position() { return rectToPoint(this._body); } set tile(pos: Point) { - this._body.x = config.tileSize * pos.x; - this._body.y = config.tileSize * pos.y; - this._view.position.x = this._body.x + (config.tileSize) / 2; - this._view.position.y = this._body.y + (config.tileSize) / 2; - this._range.x = this._body.x + (config.tileSize) / 2; - this._range.y = this._body.y + (config.tileSize) / 2; - } - - get position() { - return new Point( - this._body.x + this._body.width / 2, - this._body.y + this._body.height / 2 - ); + this._body = tileToRect(pos, this._config.size, this._config.size); + this._range = tileToCircle(pos, this._config.radius); + this._updateView(); } constructor( private _game: Game ) { - this._state = 'searching'; this._config = Object.assign(config.entities.ranged); - this._body = new Rectangle(0, 0, this._config.size, this._config.size); - this._range = new Circle(0, 0, config.tileSize * this._config.radius ); + this._state = 'searching'; + this._connectLine = new Graphics(); const graphics = new Graphics(); graphics.beginFill(0x00FF00, 0.2); - graphics.drawCircle( 0, 0, config.tileSize * this._config.radius ); + graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.radius ); graphics.beginFill(0xFF8888); - graphics.drawCircle( 0, 0, config.tileSize / 2 ); - + graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.size / 2 ); this._view = graphics; - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; + this._game.currentMap.view.addChild(this._connectLine); - this.update = this.update.bind(this); - _game.gameLoop$.subscribe(this.update); + this.tile = new Point(); + this._updateView(); + + _game.gameLoop$.subscribe(e => this.update(e)); } hack() {} @@ -67,18 +65,17 @@ export class Ranged implements IRobot { update(time: ITimeEvent) { if (this._playerInRange()) { - let player = this._game.currentMap.player.body; + let player = this._game.currentMap.player; this._connectLine.clear(); this._connectLine.lineStyle(1, 0x00FF00, 1); this._connectLine.moveTo( - this._body.x + this._body.width / 2, - this._body.y + this._body.height / 2 + this.position.x, + this.position.y ); - this._connectLine.lineTo(player.x + player.width / 2, player.y + player.height / 2); + this._connectLine.lineTo(player.position.x, player.position.y); this._connectLine.lineWidth = 3; - this._game.currentMap.view.addChild(this._connectLine); } else { - this._game.currentMap.view.removeChild(this._connectLine); + this._connectLine.clear(); } if (this._state === 'searching' && this._playerInRange()) { this._state = 'shooting'; @@ -95,12 +92,14 @@ export class Ranged implements IRobot { this._timer -= time.delta; } + private _updateView() { + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; + } + private _shoot() { let shoot = new EnergyBall(this._game); - shoot.position = new Point( - this._body.x + this._body.width / 2, - this._body.y + this._body.height / 2 - ); + shoot.position = this.position; shoot.setTarget(this._game.currentMap.player); this._game.currentMap.view.addChild(shoot.view); } @@ -109,8 +108,8 @@ export class Ranged implements IRobot { return inRange(this._range, this._game.currentMap.player.body) && lineOfSight(this._game.currentMap, this._range.x, this._range.y, - this._game.currentMap.player.body.x + this._game.currentMap.player.body.width / 2, - this._game.currentMap.player.body.y + this._game.currentMap.player.body.height / 2 + this._game.currentMap.player.position.x, + this._game.currentMap.player.position.y ); } } diff --git a/src/game/functional/index.ts b/src/game/functional/index.ts index 2c3291239..a400eabf5 100644 --- a/src/game/functional/index.ts +++ b/src/game/functional/index.ts @@ -1,2 +1,3 @@ export * from './collision'; export * from './math'; +export * from './object'; diff --git a/src/game/functional/math.ts b/src/game/functional/math.ts index 08134f870..23574078d 100644 --- a/src/game/functional/math.ts +++ b/src/game/functional/math.ts @@ -1,6 +1,62 @@ -import { Point } from 'pixi.js'; +import { + Circle, + Rectangle, + Point +} from 'pixi.js'; + +import {config} from '../../config'; export function normalizeVector(x, y) { let ratio = 1 / Math.sqrt(x * x + y * y); return new Point(x * ratio, y * ratio); } + +export function rectToPoint(rect: Rectangle): Point { + return new Point( + rect.x + rect.width / 2, + rect.y + rect.height / 2 + ); +} + +export function pointToRect(point: Point, width: number, height: number): Rectangle { + return new Rectangle( + point.x - width / 2, + point.y - height / 2, + width, + height + ); +} + +export function pointToCircle(point: Point, radius: number): Circle { + return new Circle( + point.x, + point.y, + radius + ); +} + +export function tileToPoint(tile: Point): Point { + return new Point( + tile.x * config.tileSize + config.tileSize / 2, + tile.y * config.tileSize + config.tileSize / 2, + ); +} + +export function tileToRect(tile: Point, width: number, height: number): Rectangle { + const point = tileToPoint(tile); + return new Rectangle( + point.x - width / 2, + point.y - height / 2, + width, + height + ); +} + +export function tileToCircle(tile: Point, radius: number): Circle { + const point = tileToPoint(tile); + return new Circle( + point.x, + point.y, + radius + ); +} diff --git a/src/game/functional/object.ts b/src/game/functional/object.ts new file mode 100644 index 000000000..15dc0a6dc --- /dev/null +++ b/src/game/functional/object.ts @@ -0,0 +1,6 @@ +export function reverseKeys(obj: any) { + return Object.keys(obj).reduce((ret, key) => { + ret[obj[key]] = key; + return ret; + }, {}); +} From 371b8a94429a4894b5d13cf1002451a445a36b55 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Fri, 11 Nov 2016 21:06:07 -0400 Subject: [PATCH 23/30] Add body drawing to Map --- src/config.ts | 2 + src/game/entities/energyBall.ts | 1 + src/game/entities/ranged.ts | 32 ++++-------- src/game/game-canvas.ts | 2 +- src/game/game-loop.ts | 5 ++ src/game/game.ts | 3 +- src/game/map.ts | 93 ++++++++++++++++++++++++++++++--- src/game/types/unit.ts | 3 ++ 8 files changed, 110 insertions(+), 31 deletions(-) diff --git a/src/config.ts b/src/config.ts index 341c9cdf4..f9cec027d 100644 --- a/src/config.ts +++ b/src/config.ts @@ -4,6 +4,8 @@ export const config = { gridHeight: 15, roundScale: true, minScale: 0.5, + drawBodies: true, + drawView: true, keys: { 'up': 38, 'right': 39, diff --git a/src/game/entities/energyBall.ts b/src/game/entities/energyBall.ts index bdd6a5b64..6ffe99fa8 100644 --- a/src/game/entities/energyBall.ts +++ b/src/game/entities/energyBall.ts @@ -80,6 +80,7 @@ export class EnergyBall implements IEntity { } destroy() { + this._game.currentMap.removeEntity(this); this._view.destroy(); this._subscription.unsubscribe(); } diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts index 71787e36f..05eea61bb 100644 --- a/src/game/entities/ranged.ts +++ b/src/game/entities/ranged.ts @@ -6,7 +6,7 @@ import { Circle } from 'pixi.js'; import {Game} from '../game'; -import {IRobot, teamType} from '../types'; +import {IEntity, IRobot, teamType} from '../types'; import {EnergyBall} from './energyBall'; import {ITimeEvent} from '../game-loop'; import { @@ -23,19 +23,21 @@ export class Ranged implements IRobot { private _view: Graphics; private _config: any; private _body: Rectangle; - private _range: Circle; - private _connectLine: Graphics; + private _fov: Circle; private _state: 'searching' | 'shooting' | 'cooldown'; private _timer: number; + private _target: IEntity; get view() { return this._view; } get body() { return this._body; } get team(): teamType { return 'robot'; } + get fov() { return this._fov; } + get target() { return this._target; } get position() { return rectToPoint(this._body); } set tile(pos: Point) { this._body = tileToRect(pos, this._config.size, this._config.size); - this._range = tileToCircle(pos, this._config.radius); + this._fov = tileToCircle(pos, this._config.radius); this._updateView(); } @@ -45,14 +47,10 @@ export class Ranged implements IRobot { this._config = Object.assign(config.entities.ranged); this._state = 'searching'; - this._connectLine = new Graphics(); const graphics = new Graphics(); - graphics.beginFill(0x00FF00, 0.2); - graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.radius ); graphics.beginFill(0xFF8888); graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.size / 2 ); this._view = graphics; - this._game.currentMap.view.addChild(this._connectLine); this.tile = new Point(); this._updateView(); @@ -65,17 +63,9 @@ export class Ranged implements IRobot { update(time: ITimeEvent) { if (this._playerInRange()) { - let player = this._game.currentMap.player; - this._connectLine.clear(); - this._connectLine.lineStyle(1, 0x00FF00, 1); - this._connectLine.moveTo( - this.position.x, - this.position.y - ); - this._connectLine.lineTo(player.position.x, player.position.y); - this._connectLine.lineWidth = 3; + this._target = this._game.currentMap.player; } else { - this._connectLine.clear(); + this._target = null; } if (this._state === 'searching' && this._playerInRange()) { this._state = 'shooting'; @@ -101,13 +91,13 @@ export class Ranged implements IRobot { let shoot = new EnergyBall(this._game); shoot.position = this.position; shoot.setTarget(this._game.currentMap.player); - this._game.currentMap.view.addChild(shoot.view); + this._game.currentMap.addEntity(shoot); } private _playerInRange(): boolean { - return inRange(this._range, this._game.currentMap.player.body) && + return inRange(this._fov, this._game.currentMap.player.body) && lineOfSight(this._game.currentMap, - this._range.x, this._range.y, + this._fov.x, this._fov.y, this._game.currentMap.player.position.x, this._game.currentMap.player.position.y ); diff --git a/src/game/game-canvas.ts b/src/game/game-canvas.ts index afdece32c..c471beeca 100644 --- a/src/game/game-canvas.ts +++ b/src/game/game-canvas.ts @@ -58,7 +58,7 @@ export class GameCanvas { this.stage.scale.y = this.scale; } - paint() { + render() { this.renderer.render(this.stage); } diff --git a/src/game/game-loop.ts b/src/game/game-loop.ts index 1f0cd9f46..2537987b4 100644 --- a/src/game/game-loop.ts +++ b/src/game/game-loop.ts @@ -9,9 +9,11 @@ export class GameLoop { main$: Observable; game$: Observable; render$: Observable; + preRender$: Observable; private _main$: Subject; private _render$: Subject; + private _preRender$: Subject; private _paused: boolean; private _lastTime: number; private _stats: Stats; @@ -30,6 +32,7 @@ export class GameLoop { }; this._stats.begin(); this._main$.next(frameInfo); + this._preRender$.next(frameInfo); this._render$.next(frameInfo); this._stats.end(); this._lastTime = time; @@ -41,11 +44,13 @@ export class GameLoop { this._lastTime = 0; this._main$ = new Subject(); this._render$ = new Subject(); + this._preRender$ = new Subject(); this._stats = new Stats(); document.body.appendChild( this._stats.dom ); this.main$ = this._main$.asObservable(); this.render$ = this._render$.asObservable(); + this.preRender$ = this._preRender$.asObservable(); this.game$ = this.main$.filter(() => !this._paused); this._gameLoop = this._gameLoop.bind(this); requestAnimationFrame(this._gameLoop); diff --git a/src/game/game.ts b/src/game/game.ts index 604fe3587..ec7b68374 100644 --- a/src/game/game.ts +++ b/src/game/game.ts @@ -13,6 +13,7 @@ export class Game { get mainLoop$() { return this._gameLoop.main$; } get gameLoop$() { return this._gameLoop.game$; } + get preRenderLoop$() { return this._gameLoop.preRender$; } get renderLoop$() { return this._gameLoop.render$; } get keyPress$() { return this._keyboard.keyPress$; } @@ -37,6 +38,6 @@ export class Game { } start() { - this._gameLoop.render$.subscribe(e => this._canvas.paint()); + this._gameLoop.render$.subscribe(e => this._canvas.render()); } } diff --git a/src/game/map.ts b/src/game/map.ts index 1fbc8e4f5..e98836ba5 100644 --- a/src/game/map.ts +++ b/src/game/map.ts @@ -1,4 +1,9 @@ -import {Graphics, Container, Point, Rectangle} from 'pixi.js'; +import { + Graphics, + Container, + Point, + Rectangle +} from 'pixi.js'; import { Player, Ranged @@ -6,19 +11,28 @@ import { import {Game} from './game'; import {config} from '../config'; import { - IEntity + IEntity, + IUnit } from './types'; export class Map { - private _stage: Container; private _mapConfig: string[]; private _map: IEntity[][]; private _player: Player; private _ranged: Ranged[]; + private _entities: IEntity[]; + + private _stage: Container; + private _viewLayer: Container; + private _bodyLayer: Graphics; constructor( private _game: Game - ) { } + ) { + if (config.drawBodies) { + _game.preRenderLoop$.subscribe(e => this.update(e)); + } + } get view() { return this._stage; } get width() { return config.tileSize * config.gridWidth; } @@ -40,14 +54,71 @@ export class Map { return (this._map[y] ? this._map[y][x] : null) || null; } + update(time) { + this._bodyLayer.clear(); + for (let entity of this._entities) { + let fov = (entity).fov; + if (fov) { + this._bodyLayer.beginFill(0xAA7722, 0.2); + this._bodyLayer.lineStyle(1, 0xAA7722, 0.8); + this._bodyLayer.drawShape(fov); + } + } + for (let entity of this._entities) { + let body = entity.body; + if (body) { + this._bodyLayer.beginFill(0x00FF00, 0.2); + this._bodyLayer.lineStyle(1, 0x00FF00, 0.8); + this._bodyLayer.drawShape(body); + } + } + + for (let entity of this._entities) { + let target = (entity).target; + if (target) { + this._bodyLayer.lineStyle(1, 0x00FFFF, 0.8); + this._bodyLayer.moveTo( + entity.position.x, + entity.position.y + ); + this._bodyLayer.lineTo(target.position.x, target.position.y); + } + } + } + + addEntity(entity: IEntity) { + this._viewLayer.addChild(entity.view); + this._entities.push(entity); + } + + removeEntity(entity: IEntity) { + this._viewLayer.removeChild(entity.view); + const index = this._entities.indexOf(entity); + if (index > -1) { + this._entities.splice(index, 1); + } + } + loadLevel(level: any) { this._mapConfig = level.map; + this._map = Array.apply(null, Array(config.gridHeight)).map(() => []); this._ranged = []; + this._entities = []; + this._stage = new Container(); const graphics = new Graphics(); - this._stage.addChild(graphics); - this._map = Array.apply(null, Array(config.gridHeight)).map(() => []); graphics.beginFill(0xFFFF88); + if (config.drawView) { + this._viewLayer = new Container(); + this._stage.addChild(this._viewLayer); + this._viewLayer.addChild(graphics); + } + + if (config.drawBodies) { + this._bodyLayer = new Graphics(); + this._stage.addChild(this._bodyLayer); + } + for (let row = 0; row < this._mapConfig.length; row += 1) { for (let tile = 0; tile < this._mapConfig[row].length; tile += 1) { if (this._mapConfig[row][tile] === 'X') { @@ -66,14 +137,20 @@ export class Map { if (this._mapConfig[row][tile] === 'T') { const ranged = new Ranged(this._game); ranged.tile = new Point(tile, row); - this._stage.addChild(ranged.view); this._ranged.push(ranged); this._map[row][tile] = ranged; + this._entities.push(ranged); + if (config.drawView) { + this._viewLayer.addChild(ranged.view); + } } else if (this._mapConfig[row][tile] === 'P') { const player = new Player(this._game); player.tile = new Point(tile, row); - this._stage.addChild(player.view); this._player = player; + this._entities.push(player); + if (config.drawView) { + this._viewLayer.addChild(player.view); + } } } } diff --git a/src/game/types/unit.ts b/src/game/types/unit.ts index 48b08a925..b8c9359d6 100644 --- a/src/game/types/unit.ts +++ b/src/game/types/unit.ts @@ -1,7 +1,10 @@ +import {IShape} from 'pixi.js'; import {IEntity} from './Entity'; // Units can take hits export interface IUnit extends IEntity { hit: (damage: number) => void; + fov?: IShape; + target?: IEntity; } From 4e7fc53b7ef1930f4453dfb4d49a9cc4e8e55852 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Fri, 11 Nov 2016 21:27:59 -0400 Subject: [PATCH 24/30] Add Wall entity --- src/game/entities/index.ts | 1 + src/game/entities/wall.ts | 35 +++++++++++++++++++---- src/game/map.ts | 58 ++++++++++++++++---------------------- 3 files changed, 54 insertions(+), 40 deletions(-) diff --git a/src/game/entities/index.ts b/src/game/entities/index.ts index aa6c3ad2f..07775b1c3 100644 --- a/src/game/entities/index.ts +++ b/src/game/entities/index.ts @@ -1,3 +1,4 @@ export * from './player'; export * from './ranged'; export * from './energyBall'; +export * from './wall'; diff --git a/src/game/entities/wall.ts b/src/game/entities/wall.ts index 7298b05eb..4edadcd48 100644 --- a/src/game/entities/wall.ts +++ b/src/game/entities/wall.ts @@ -1,22 +1,45 @@ import {Point, Rectangle, Graphics} from 'pixi.js'; import {IEntity, teamType} from '../types'; import {Game} from '../game'; +import { + tileToRect +} from '../functional'; +import {config} from '../../config'; export class Wall implements IEntity { get type() { return 'block'; } - get team(): teamType { return 'neutral'; } - _body: Rectangle; - _view: Graphics; - set tile(tile: Point) {} - set position(tile: Point) {} + private _body: Rectangle; + private _view: Graphics; + get body() { return this._body; } get view() { return this._view; } + get team(): teamType { return 'neutral'; } + + set tile(pos: Point) { + this._body = tileToRect(pos, config.tileSize, config.tileSize); + this._updateView(); + } + set position(tile: Point) {} + constructor( private _game: Game - ) {} + ) { + const graphics = new Graphics(); + graphics.beginFill(0xFFFF88); + graphics.drawRect( 0, 0, config.tileSize, config.tileSize ); + this._view = graphics; + + this.tile = new Point(); + this._updateView(); + } update() {} + + _updateView() { + this._view.position.x = this._body.x; + this._view.position.y = this._body.y; + } } diff --git a/src/game/map.ts b/src/game/map.ts index e98836ba5..4ee3df127 100644 --- a/src/game/map.ts +++ b/src/game/map.ts @@ -6,7 +6,8 @@ import { } from 'pixi.js'; import { Player, - Ranged + Ranged, + Wall } from './entities'; import {Game} from './game'; import {config} from '../config'; @@ -19,7 +20,6 @@ export class Map { private _mapConfig: string[]; private _map: IEntity[][]; private _player: Player; - private _ranged: Ranged[]; private _entities: IEntity[]; private _stage: Container; @@ -40,9 +40,9 @@ export class Map { get player() { return this._player; } unitAt(x: number, y: number): IEntity { - for (let ranged of this._ranged) { - if (ranged.body.contains(x, y)) { - return ranged; + for (let entity of this._entities) { + if (entity.body.contains(x, y)) { + return entity; } } return null; @@ -87,31 +87,31 @@ export class Map { } addEntity(entity: IEntity) { - this._viewLayer.addChild(entity.view); this._entities.push(entity); + if (config.drawView) { + this._viewLayer.addChild(entity.view); + } } removeEntity(entity: IEntity) { - this._viewLayer.removeChild(entity.view); const index = this._entities.indexOf(entity); if (index > -1) { this._entities.splice(index, 1); } + if (config.drawView) { + this._viewLayer.removeChild(entity.view); + } } loadLevel(level: any) { this._mapConfig = level.map; this._map = Array.apply(null, Array(config.gridHeight)).map(() => []); - this._ranged = []; this._entities = []; this._stage = new Container(); - const graphics = new Graphics(); - graphics.beginFill(0xFFFF88); if (config.drawView) { this._viewLayer = new Container(); this._stage.addChild(this._viewLayer); - this._viewLayer.addChild(graphics); } if (config.drawBodies) { @@ -121,38 +121,28 @@ export class Map { for (let row = 0; row < this._mapConfig.length; row += 1) { for (let tile = 0; tile < this._mapConfig[row].length; tile += 1) { + let entity: IEntity = null; if (this._mapConfig[row][tile] === 'X') { - graphics.drawRect(config.tileSize * tile, config.tileSize * row, config.tileSize, config.tileSize); - this._map[row][tile] = { - type: 'block', - team: 'neutral', - set tile(v) {}, - set position(v) {}, - update() {}, - view: null, - body: new Rectangle(config.tileSize * tile, config.tileSize * row, config.tileSize, config.tileSize) - }; + entity = new Wall(this._game); + this._map[row][tile] = entity; } if (this._mapConfig[row][tile] === 'T') { - const ranged = new Ranged(this._game); - ranged.tile = new Point(tile, row); - this._ranged.push(ranged); - this._map[row][tile] = ranged; - this._entities.push(ranged); - if (config.drawView) { - this._viewLayer.addChild(ranged.view); - } + entity = new Ranged(this._game); + this._map[row][tile] = entity; } else if (this._mapConfig[row][tile] === 'P') { - const player = new Player(this._game); - player.tile = new Point(tile, row); - this._player = player; - this._entities.push(player); + entity = new Player(this._game); + this._player = entity; + } + if (entity) { + entity.tile = new Point(tile, row); + this._entities.push(entity); if (config.drawView) { - this._viewLayer.addChild(player.view); + this._viewLayer.addChild(entity.view); } } } } } + } From f9d7277eee7bb830f4388d3d0edc165e66f0637b Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Fri, 11 Nov 2016 23:27:41 -0400 Subject: [PATCH 25/30] Add ranged hacking --- src/config.ts | 8 +++--- src/game/entities/energyBall.ts | 5 ++-- src/game/entities/player.ts | 17 ++++++------- src/game/entities/ranged.ts | 43 +++++++++++++++++++++++++-------- src/game/entities/wall.ts | 2 +- src/game/game-canvas.ts | 2 +- src/game/levels/level-01.ts | 2 +- src/game/map.ts | 24 ++++++++++-------- src/game/types/robot.ts | 2 +- src/game/types/unit.ts | 1 + src/game/ui/hackMeter.ts | 17 +++++++++++++ src/game/ui/index.ts | 1 + 12 files changed, 85 insertions(+), 39 deletions(-) create mode 100644 src/game/ui/hackMeter.ts create mode 100644 src/game/ui/index.ts diff --git a/src/config.ts b/src/config.ts index f9cec027d..fd8bb2024 100644 --- a/src/config.ts +++ b/src/config.ts @@ -4,7 +4,7 @@ export const config = { gridHeight: 15, roundScale: true, minScale: 0.5, - drawBodies: true, + drawBodies: false, drawView: true, keys: { 'up': 38, @@ -18,13 +18,15 @@ export const config = { player: { speed: 2, size: 24, - hackDistance: 20 + hackDistance: 20, + hackSpeed: 10 }, ranged: { radius: 32 * 4, size: 32, shootDelay: 1000, - shootCooldown: 2000 + shootCooldown: 2000, + hackMeter: 50 }, energyBall: { size: 20, diff --git a/src/game/entities/energyBall.ts b/src/game/entities/energyBall.ts index 6ffe99fa8..69dc3ec79 100644 --- a/src/game/entities/energyBall.ts +++ b/src/game/entities/energyBall.ts @@ -1,6 +1,6 @@ import {Graphics, Rectangle, Point} from 'pixi.js'; import {Game} from '../game'; -import {IEntity, teamType} from '../types'; +import {IEntity, IUnit, teamType} from '../types'; import {ITimeEvent} from '../game-loop'; import {config} from '../../config'; import { @@ -13,7 +13,7 @@ import { } from '../functional'; import {Subscription} from 'rxjs/Rx'; -export class EnergyBall implements IEntity { +export class EnergyBall implements IUnit { get type() { return 'energyBall'; } private _speed: Point; @@ -24,6 +24,7 @@ export class EnergyBall implements IEntity { get view() { return this._view; } get body() { return this._body; } + get hitbox() { return this._body; } get team(): teamType { return 'robot'; } get position() { return rectToPoint(this._body); } diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index 5b24bc2d0..77261ae3b 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -5,7 +5,7 @@ import { Sprite, Rectangle, Container, - Graphics + Circle } from 'pixi.js'; import {Game} from '../game'; import {ITimeEvent} from '../game-loop'; @@ -15,7 +15,7 @@ import { tileToRect, reverseKeys } from '../functional'; -import {IUnit, teamType} from '../types'; +import {IRobot, IUnit, teamType} from '../types'; export class Player implements IUnit { get type() { return 'hacker'; } @@ -30,10 +30,10 @@ export class Player implements IUnit { private _hackingPoint: Point; private _hackingPointX: number; private _hackingPointY: number; - private _hackingView: Graphics; get view() { return this._view; } get body() { return this._body; } + get hitbox() { return new Circle(this._hackingPoint.x, this._hackingPoint.y, 3); } get team(): teamType { return 'hacker'; } get position() { return rectToPoint(this._body); } @@ -55,11 +55,6 @@ export class Player implements IUnit { this._view.addChild(sprite); this._keyMap = reverseKeys(config.keys); - this._hackingView = new Graphics(); - this._hackingView.beginFill(0xFF0000, 0.8); - this._hackingView.drawCircle(0, 0, 3); - this._view.addChild(this._hackingView); - this.tile = new Point(); _game.keyPress$.subscribe(e => this._updateStateFromKeyboard(e)); @@ -75,13 +70,15 @@ export class Player implements IUnit { let point = this.position; this._hackingPoint = new Point(point.x + this._hackingPointX, point.y + this._hackingPointY); this._updateView(); + let robot = this._game.currentMap.unitAt(this._hackingPoint, 'robot'); + if (robot && robot.type === 'ranged') { + (robot).hack(this._config.hackSpeed * time.delta / 1000); + } } private _updateView() { this._view.position.x = this._body.x; this._view.position.y = this._body.y; - this._hackingView.x = this._hackingPointX + this._body.width / 2; - this._hackingView.y = this._hackingPointY + this._body.height / 2; } private _moveBody(body: Rectangle, dx: number, dy: number): Rectangle { diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts index 05eea61bb..316c41172 100644 --- a/src/game/entities/ranged.ts +++ b/src/game/entities/ranged.ts @@ -3,7 +3,8 @@ import { Point, Rectangle, Graphics, - Circle + Circle, + Container } from 'pixi.js'; import {Game} from '../game'; import {IEntity, IRobot, teamType} from '../types'; @@ -16,21 +17,26 @@ import { tileToRect, tileToCircle } from '../functional'; +import {HackMeter} from '../ui'; export class Ranged implements IRobot { get type() { return 'ranged'; } - private _view: Graphics; + private _view: Container; private _config: any; private _body: Rectangle; private _fov: Circle; private _state: 'searching' | 'shooting' | 'cooldown'; private _timer: number; private _target: IEntity; + private _hackMeter: number; + private _hackMeterView: HackMeter; + private _team: teamType; + private _graphics: Graphics; get view() { return this._view; } get body() { return this._body; } - get team(): teamType { return 'robot'; } + get team(): teamType { return this._team; } get fov() { return this._fov; } get target() { return this._target; } get position() { return rectToPoint(this._body); } @@ -46,11 +52,16 @@ export class Ranged implements IRobot { ) { this._config = Object.assign(config.entities.ranged); this._state = 'searching'; + this._team = 'robot'; + this._hackMeter = 0; - const graphics = new Graphics(); - graphics.beginFill(0xFF8888); - graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.size / 2 ); - this._view = graphics; + this._graphics = new Graphics(); + this._graphics.beginFill(0xA2A0E5); + this._graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.size / 2 ); + this._view = new Container(); + this._view.addChild(this._graphics); + this._hackMeterView = new HackMeter(); + this._view.addChild(this._hackMeterView.view); this.tile = new Point(); this._updateView(); @@ -58,16 +69,28 @@ export class Ranged implements IRobot { _game.gameLoop$.subscribe(e => this.update(e)); } - hack() {} + hack(value: number) { + this._hackMeter += value; + if (this._hackMeter >= this._config.hackMeter) { + this._hackMeter = 0; + this._team = 'hacker'; + this._state = 'searching'; + this._graphics.clear(); + this._graphics.beginFill(0x63DAE6); + this._graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.size / 2 ); + } + this._hackMeterView.setProgress(this._hackMeter / this._config.hackMeter); + } + hit() {} update(time: ITimeEvent) { - if (this._playerInRange()) { + if (this._team !== 'hacker' && this._playerInRange()) { this._target = this._game.currentMap.player; } else { this._target = null; } - if (this._state === 'searching' && this._playerInRange()) { + if (this._state === 'searching' && this._target) { this._state = 'shooting'; this._timer = this._config.shootDelay; } diff --git a/src/game/entities/wall.ts b/src/game/entities/wall.ts index 4edadcd48..413e45997 100644 --- a/src/game/entities/wall.ts +++ b/src/game/entities/wall.ts @@ -28,7 +28,7 @@ export class Wall implements IEntity { private _game: Game ) { const graphics = new Graphics(); - graphics.beginFill(0xFFFF88); + graphics.beginFill(0xE3E238); graphics.drawRect( 0, 0, config.tileSize, config.tileSize ); this._view = graphics; diff --git a/src/game/game-canvas.ts b/src/game/game-canvas.ts index c471beeca..7337ddb23 100644 --- a/src/game/game-canvas.ts +++ b/src/game/game-canvas.ts @@ -74,7 +74,7 @@ export class GameCanvas { this.stage.scale.y = this.scale; const graphics = new Graphics(); this.stage.addChild(graphics); - graphics.beginFill(0x1099bb); + graphics.beginFill(0x538247); graphics.drawRect(0, 0, this.width, this.height); this.resizeCanvas(); diff --git a/src/game/levels/level-01.ts b/src/game/levels/level-01.ts index 6d88f9df9..9f1d5ed1c 100644 --- a/src/game/levels/level-01.ts +++ b/src/game/levels/level-01.ts @@ -11,8 +11,8 @@ export default { ' ', ' XP X ', ' TX ', - ' T ', ' ', + ' T ', ' ', ' ', ] diff --git a/src/game/map.ts b/src/game/map.ts index 4ee3df127..f2d2429a9 100644 --- a/src/game/map.ts +++ b/src/game/map.ts @@ -1,8 +1,7 @@ import { Graphics, Container, - Point, - Rectangle + Point } from 'pixi.js'; import { Player, @@ -39,9 +38,9 @@ export class Map { get height() { return config.tileSize * config.gridHeight; } get player() { return this._player; } - unitAt(x: number, y: number): IEntity { + unitAt(point: Point, team?: string): IEntity { for (let entity of this._entities) { - if (entity.body.contains(x, y)) { + if (entity.body.contains(point.x, point.y) && (!team || entity.team === team)) { return entity; } } @@ -59,8 +58,8 @@ export class Map { for (let entity of this._entities) { let fov = (entity).fov; if (fov) { - this._bodyLayer.beginFill(0xAA7722, 0.2); - this._bodyLayer.lineStyle(1, 0xAA7722, 0.8); + this._bodyLayer.beginFill(0xFFFF00, 0.2); + this._bodyLayer.lineStyle(1, 0xFFFF00, 0.8); this._bodyLayer.drawShape(fov); } } @@ -77,13 +76,18 @@ export class Map { let target = (entity).target; if (target) { this._bodyLayer.lineStyle(1, 0x00FFFF, 0.8); - this._bodyLayer.moveTo( - entity.position.x, - entity.position.y - ); + this._bodyLayer.moveTo(entity.position.x, entity.position.y); this._bodyLayer.lineTo(target.position.x, target.position.y); } } + for (let entity of this._entities) { + let hitbox = (entity).hitbox; + if (hitbox) { + this._bodyLayer.beginFill(0xFF2222, 0.2); + this._bodyLayer.lineStyle(1, 0xFF2222, 0.8); + this._bodyLayer.drawShape(hitbox); + } + } } addEntity(entity: IEntity) { diff --git a/src/game/types/robot.ts b/src/game/types/robot.ts index a363fecdb..b38af4e2e 100644 --- a/src/game/types/robot.ts +++ b/src/game/types/robot.ts @@ -1,6 +1,6 @@ import {IUnit} from './unit'; -export interface IRobot { +export interface IRobot extends IUnit { hack: (value: number) => void; } diff --git a/src/game/types/unit.ts b/src/game/types/unit.ts index b8c9359d6..d1f1660a9 100644 --- a/src/game/types/unit.ts +++ b/src/game/types/unit.ts @@ -6,5 +6,6 @@ import {IEntity} from './Entity'; export interface IUnit extends IEntity { hit: (damage: number) => void; fov?: IShape; + hitbox?: IShape; target?: IEntity; } diff --git a/src/game/ui/hackMeter.ts b/src/game/ui/hackMeter.ts new file mode 100644 index 000000000..5850eee80 --- /dev/null +++ b/src/game/ui/hackMeter.ts @@ -0,0 +1,17 @@ +import {Graphics} from 'pixi.js'; +import {config} from '../../config'; + +export class HackMeter { + private _view: Graphics; + get view() { return this._view; } + + constructor() { + this._view = new Graphics(); + } + + setProgress(progress: number) { + this._view.clear(); + this._view.beginFill(0x00FF00); + this._view.drawRect(0, 0, config.tileSize * progress, 3); + } +} diff --git a/src/game/ui/index.ts b/src/game/ui/index.ts new file mode 100644 index 000000000..006989e7c --- /dev/null +++ b/src/game/ui/index.ts @@ -0,0 +1 @@ +export * from './hackMeter'; From 3071115088d871ba533a1c4497b162fa33967827 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Sat, 12 Nov 2016 13:40:15 -0400 Subject: [PATCH 26/30] Update readme --- README.md | 96 ++++++-------------------------------------------- src/index.html | 8 +++++ 2 files changed, 19 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index f37319c61..aabe1be80 100644 --- a/README.md +++ b/README.md @@ -1,94 +1,20 @@ -# GitHub Game Off 2016 +# Hacker vs Robots -![GitHub Game Off 2016 Theme is Hacking, Modding, or Augmenting](https://cloud.githubusercontent.com/assets/121322/19498019/d8827370-9543-11e6-82d8-6da822b6147b.png) +Game entry for the [Game Off 2016][ggo16] -
- - English · - 日本語 - -
+Use your hacking abilities to neutralize all robots. -## The Challenge +## How to play -You have the entire month of November to create a game *loosely* based on the theme **hacking, modding and/or augmenting**. +Game can be played at https://ropilz.github.io/game-off-2016/. Move the hacker with ↑, ↓, ← and →. Get close to an +enemy unit to start hacking it. Neutralize all robots to win! -What do we mean by **loosely** based on hacking, modding and/or augmenting? We literally mean, *loosely* based. Some examples might be: +Found a bug? [create an issue][hvs-issues] we will be glad about it :). -* an endless runner where you *hack* down binary trees in your path with a pixelated axe, -* a *modern* take on a classic e.g. a roguelike set in a 3D or VR world, or -* an *augmented* reality game bringing octopus/cat hybrids into the real world. +## How to contribute -Unleash your creativity. You can work alone or with a team and build for any platform or device. The use of open source game engines and libraries is encouraged but not required. - -We'll highlight some of our favorites on the GitHub blog, and the world will get to enjoy (and maybe even contribute to and/or learn from) your creations. - -## How to participate - -* [Sign up for a free personal account][github-signup] if you don't already have one. -* Fork [this repository][game-off-repo] to your personal account (or to a [free organization account][github-signup-org]). -* Clone the repository on your computer and build your game. -* Push your game source code to your forked repository before Dec 1st. -* Update the `README.md` file to include a description of your game, how/where to play/download it, how to build/compile it, what dependencies it has, etc. -* Submit your final game using this [form][wufoo-form]. - -## It's dangerous to go alone - -If you're **new to Git, GitHub, or version control**… - -* [Git Documentation](https://git-scm.com/documentation) - everything you need to know about version control, and how to get started with Git. -* [GitHub Help](https://help.github.com/) - everything you need to know about GitHub. -* Questions about GitHub? Please [contact our Support team][github-support] and they'll be delighted to help you. -* Questions specific to the GitHub Game Off? Please [create an issue][game-off-repo-issues]. This will be the official FAQ. - -The official Twitter hashtag for the Game Off is `#ggo16`. We look forward to playing with your creations. - -GLHF! <3 - -## お題 - -11月いっぱいを使って、ゲームを作ってください。作ってもらいたいゲームのテーマは大まかに言って、**hacking, modding and/or augmenting(ハック、改造もしくは拡張)**です。 - -"**大まか**に言ってhacking, modding and/or augmenting(ハック、改造もしくは拡張)"とはどういう意味でしょうか? 文字通り、*大まか*にテーマに沿っていればいいということです。 - -例えば、こんな例も含まれるということです: - -* ピクセル製の斧をつかってあなたが*叩き切った*(*hack* down)バイナリツリー上をランナーが走り続けるゲームとか -* ゲームの古典をベースに*現代的*(*modern*)な解釈をするとか(例えばローグライクゲームを3DやVRの世界で再現してみる) -* タコと猫のハイブリッドを現実世界に持ち込むような*拡張*現実(*augmented* reality)ゲームとか - -みなさんのクリエイティビティを最大限発揮できるように、1人で作業してもチームで作業しても問題ありませんし、作るゲームがどんなプラットフォーム向けでもどんなデバイス向けでも不問とします。また、オープンソースのゲームエンジンやライブラリを使用することは歓迎しますが、必須ではありません。 - -ご応募いただいたゲームのうちいくつかはGitHubのブログで取り上げる予定です。世界中があなたが作ったゲームを楽しんでくれると思います。(そしてあなたのゲームに対して貢献もしてくれるかもしれませんし、同時にあなたのゲームから何かを学び取ることもあるでしょう) - -## 参加方法 - -* まだGitHubのアカウントを持っていない場合、[GitHubにサインアップしてアカウントを作ってください。(無料のもので問題ありません)][github-signup] -* [このリポジトリ][game-off-repo]を自分のアカウントにフォークしてください。(もしくは[オーガニゼーションにフォークしても問題ありません。もちろん無料プランでいいです。][github-signup-org]) -* 自身のコンピュータにリポジトリをクローンして、ゲームを開発してください。 -* ゲームのソースコードをフォークした自分のリポジトリに12月1日になる前にプッシュしてください。 -* `README.md`ファイルを更新して、ゲームの説明、プレイの仕方、ダウンロードの仕方、またはビルド/コンパイルの方法、依存しているライブラリ等の説明、等々、必要な情報を含めてください。 -* 最後にこの[フォーム][wufoo-form]を使ってゲームをサブミットしてください。 - -## ヒトリデハキケンジャ コレヲ サズケヨウ - -もし**GitやGitHub、バージョン管理そのものについて初心者なのであれば**... - -* [Git Documentation](https://git-scm.com/documentation) - バージョンコントロールについてと、Gitを使い始めるために必要な情報はここにあります。(日本語で読める情報としては[Pro Gitの日本語版](https://git-scm.com/book/ja/v2)があります) -* [GitHub Help](https://help.github.com/) - GitHubについてはこちらを参照してください。 -* GitHubについて質問したいことがあれば、ぜひ[ここから問い合わせてください!(ただし英語でお願いします :bow: )][github-support] サポートチームが助けてくれます。 -* GitHub Game Offに関する質問については、[ここにIssueを作って聞いてください。(英語でお願いします)][game-off-repo-issues]. これが公式のFAQになっていく予定です。 - -このGame OffのためのTwitterの公式ハッシュタグは`#ggo16`です。皆さんのゲームで遊べるのを楽しみにしています。 - -GLHF! <3 +Fork this repo and run `yarn install` or `npm install` at the root of the project to install all dependencies, then run `npm run start` and you will have the game running locally 🎉. -[game-off-repo]: https://github.com/github/game-off-2016/ -[game-off-repo-issues]: https://github.com/github/game-off-2016/issues -[git-documentation]: https://git-scm.com/documentation -[github-help]: https://help.github.com/ -[github-signup]: https://github.com/signup/free -[github-signup-org]: https://github.com/organizations/new -[github-support]: https://github.com/contact?form%5Bsubject%5D=GitHub%20Game%20Off -[wufoo-form]: https://gameoff.wufoo.com/forms/game-off-2016/ +[ggo16]: http://gameoff.github.com/ +[hvs-issues]: https://github.com/ropilz/game-off-2016/issues diff --git a/src/index.html b/src/index.html index 70b1e0a32..896087448 100644 --- a/src/index.html +++ b/src/index.html @@ -5,6 +5,14 @@ Hacker vs Robots + From 638f9e806da59571265da7e09e9781544e34edf4 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Mon, 14 Nov 2016 09:10:44 -0400 Subject: [PATCH 27/30] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aabe1be80..6cf81a00d 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Found a bug? [create an issue][hvs-issues] we will be glad about it :). ## How to contribute -Fork this repo and run `yarn install` or `npm install` at the root of the project to install all dependencies, then run `npm run start` and you will have the game running locally 🎉. +Fork this repo and run `yarn install` or `npm install` at the root of the project to install all dependencies, then run `npm start` and you will have the game running locally 🎉. [ggo16]: http://gameoff.github.com/ From cdde2d5160aa38015f25f61a5f211090377874f7 Mon Sep 17 00:00:00 2001 From: Rodrigo Claros Date: Thu, 17 Nov 2016 17:36:37 -0400 Subject: [PATCH 28/30] Refactor Entity --- src/config.ts | 8 ++- src/game/entities/energyBall.ts | 63 +++++++---------------- src/game/entities/index.ts | 1 + src/game/entities/melee.ts | 85 +++++++++++++++++++++++++++++++ src/game/entities/player.ts | 67 +++++++++++------------- src/game/entities/ranged.ts | 87 ++++++++++++-------------------- src/game/entities/robot.ts | 40 +++++++++++++++ src/game/entities/unit.ts | 68 +++++++++++++++++++++++++ src/game/functional/collision.ts | 33 ++++++++++++ src/game/levels/level-01.ts | 2 +- src/game/map.ts | 24 +++++---- src/game/types/entity.ts | 7 ++- src/game/types/robot.ts | 2 +- src/game/types/unit.ts | 2 +- 14 files changed, 332 insertions(+), 157 deletions(-) create mode 100644 src/game/entities/melee.ts create mode 100644 src/game/entities/robot.ts create mode 100644 src/game/entities/unit.ts diff --git a/src/config.ts b/src/config.ts index fd8bb2024..8ffce3630 100644 --- a/src/config.ts +++ b/src/config.ts @@ -24,10 +24,14 @@ export const config = { ranged: { radius: 32 * 4, size: 32, - shootDelay: 1000, - shootCooldown: 2000, + shootDelay: 100, + shootCooldown: 200, hackMeter: 50 }, + melee: { + size: 30, + maxWalkDistance: 32 * 4, + }, energyBall: { size: 20, speed: 2, diff --git a/src/game/entities/energyBall.ts b/src/game/entities/energyBall.ts index 69dc3ec79..761b52958 100644 --- a/src/game/entities/energyBall.ts +++ b/src/game/entities/energyBall.ts @@ -1,60 +1,44 @@ import {Graphics, Rectangle, Point} from 'pixi.js'; -import {Game} from '../game'; -import {IEntity, IUnit, teamType} from '../types'; +import {IEntity, teamType} from '../types'; import {ITimeEvent} from '../game-loop'; import {config} from '../../config'; import { normalizeVector, isOutOfBOunds, wallCollision, - enemyCollision, - rectToPoint, - pointToRect + enemyCollision } from '../functional'; -import {Subscription} from 'rxjs/Rx'; -export class EnergyBall implements IUnit { + +import {Unit} from './unit'; + +export class EnergyBall extends Unit { get type() { return 'energyBall'; } + get team(): teamType { return 'robot'; } private _speed: Point; - private _body: Rectangle; - private _view: Graphics; private _config: any; - private _subscription: Subscription; + get hitbox() { return this.body; } - get view() { return this._view; } - get body() { return this._body; } - get hitbox() { return this._body; } - get team(): teamType { return 'robot'; } - get position() { return rectToPoint(this._body); } + _initBody() { + return new Rectangle(0, 0, this._config.size, this._config.size); + } - set tile(pos: Point) { } - set position(pos: Point) { - this._body = pointToRect(pos, this._config.size, this._config.size); - this._updateView(); + _initView() { + return new Graphics() + .beginFill(0xFFFFFF) + .drawCircle( 0, 0, this._config.size / 2); } - constructor(private _game: Game) { + _preInit() { this._config = Object.assign(config.entities.energyBall); - - const graphics = new Graphics(); - graphics.beginFill(0xFFFFFF); - graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.size / 2 ); - this._view = graphics; - - this.position = new Point(); - this._updateView(); - - this._subscription = _game.gameLoop$.subscribe(e => this.update(e)); } - hit() {} - update(time: ITimeEvent) { let enemy = enemyCollision(this._game.currentMap, this); if ( - isOutOfBOunds(this._game.currentMap, this._body) || - wallCollision(this._game.currentMap, this._body) || + isOutOfBOunds(this._game.currentMap, this.body) || + wallCollision(this._game.currentMap, this.body) || enemy !== null ) { if (enemy) { @@ -79,15 +63,4 @@ export class EnergyBall implements IUnit { this._speed.x = this._speed.x * this._config.speed; this._speed.y = this._speed.y * this._config.speed; } - - destroy() { - this._game.currentMap.removeEntity(this); - this._view.destroy(); - this._subscription.unsubscribe(); - } - - private _updateView() { - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; - } } diff --git a/src/game/entities/index.ts b/src/game/entities/index.ts index 07775b1c3..9492e15f5 100644 --- a/src/game/entities/index.ts +++ b/src/game/entities/index.ts @@ -2,3 +2,4 @@ export * from './player'; export * from './ranged'; export * from './energyBall'; export * from './wall'; +export * from './melee'; diff --git a/src/game/entities/melee.ts b/src/game/entities/melee.ts new file mode 100644 index 000000000..af2bdcb28 --- /dev/null +++ b/src/game/entities/melee.ts @@ -0,0 +1,85 @@ +import {Graphics, Rectangle, Point} from 'pixi.js'; +import {Game} from '../game'; +import {IEntity, IUnit, teamType} from '../types'; +import {ITimeEvent} from '../game-loop'; +import { + normalizeVector, + isOutOfBOunds, + wallCollision, + enemyCollision, + rectToPoint, + pointToRect +} from '../functional'; + +import {Robot} from './robot'; +import {config} from '../../config'; + +export class Melee extends Robot { + get type() { return 'melee'; } + get team(): teamType { return 'robot'; } + + _hackResistence() { return 10; } + + private _config: any; + private _state: 'idle' | 'moving'; + + _preInit() { + this._config = config.entities.melee; + this._state = 'idle'; + } + + _changeTeam() {} + + _initBody() { + return new Rectangle(0, 0, 32, 32); + } + + _initView() { + const halfTile = this._config.size / 2; + return this._addView(new Graphics() + .beginFill(0xA2A0E5) + .drawPolygon([ + new Point(0, -halfTile), + new Point(-halfTile, halfTile), + new Point(halfTile, halfTile) + ])); + } + + private _getRandomPoint() { + return new Point( + this.position.x + (-this._config.walkDistance + 2 * this._config.walkDistance * Math.random()), + this.position.y + (-this._config.walkDistance + 2 * this._config.walkDistance * Math.random()) + ); + } + + // moveToLocation(pos: Point) { + // let position = this.position; + // let targetPosition = entity.position; + // this._speed = normalizeVector( + // targetPosition.x - position.x, + // targetPosition.y - position.y + // ); + // this._speed.x = this._speed.x * this._config.speed; + // this._speed.y = this._speed.y * this._config.speed; + // } + // + // update(time: ITimeEvent) { + // let enemy = enemyCollision(this._game.currentMap, this); + // if ( + // isOutOfBOunds(this._game.currentMap, this.body) || + // wallCollision(this._game.currentMap, this.body) || + // enemy !== null + // ) { + // if (enemy) { + // enemy.hit(this._config.damage); + // } + // this.destroy(); + // } else if (this._speed) { + // this.position = new Point( + // this.position.x + this._speed.x, + // this.position.y + this._speed.y, + // ); + // } + // } + +} diff --git a/src/game/entities/player.ts b/src/game/entities/player.ts index 77261ae3b..7724afdec 100644 --- a/src/game/entities/player.ts +++ b/src/game/entities/player.ts @@ -12,75 +12,68 @@ import {ITimeEvent} from '../game-loop'; import { moveBody, rectToPoint, - tileToRect, + pointToRect, reverseKeys } from '../functional'; import {IRobot, IUnit, teamType} from '../types'; -export class Player implements IUnit { +import {Unit} from './unit'; + +export class Player extends Unit { get type() { return 'hacker'; } + get team(): teamType { return 'hacker'; } private _xSpeed: number; private _ySpeed: number; + private _config: any; private _keyState: {[key: string]: boolean}; private _keyMap: {[key: number]: string}; - private _view: Container; - private _config: any; - private _body: Rectangle; private _hackingPoint: Point; private _hackingPointX: number; private _hackingPointY: number; - get view() { return this._view; } - get body() { return this._body; } get hitbox() { return new Circle(this._hackingPoint.x, this._hackingPoint.y, 3); } - get team(): teamType { return 'hacker'; } - get position() { return rectToPoint(this._body); } - set tile(pos: Point) { - this._body = tileToRect(pos, this._config.size, this._config.size); - this._hackingPoint = new Point(pos.x + this._hackingPointX, pos.y + this._hackingPointY); - this._updateView(); - } - - constructor( - private _game: Game - ) { - this._config = Object.assign(config.entities.player); + _preInit(game: Game) { this._xSpeed = 0; this._ySpeed = 0; this._keyState = {}; - this._view = new Container(); - const sprite = new Sprite(Texture.fromImage('assets/basics/nin.png')); - this._view.addChild(sprite); this._keyMap = reverseKeys(config.keys); + this._config = Object.assign({}, config.entities.player); + } + + _postInit(game: Game) { + game.keyPress$.subscribe(e => this._updateStateFromKeyboard(e)); + } - this.tile = new Point(); + _initBody() { + return new Rectangle(0, 0, this._config.size, this._config.size); + } - _game.keyPress$.subscribe(e => this._updateStateFromKeyboard(e)); - _game.gameLoop$.subscribe(e => this.update(e)); + _initView() { + let container = new Container(); + const sprite = new Sprite(Texture.fromImage('assets/basics/nin.png')); + sprite.anchor.x = 0.5; + sprite.anchor.y = 0.5; + container.addChild(sprite); + return container; } - hit(damage: number) { - console.log(damage); + _setPosition(pos: Point) { + this._hackingPoint = new Point(pos.x + this._hackingPointX, pos.y + this._hackingPointY); + super._setPosition(pos); } update(time: ITimeEvent) { - this._body = this._moveBody(this._body, this._xSpeed * this._config.speed, this._ySpeed * this._config.speed); - let point = this.position; - this._hackingPoint = new Point(point.x + this._hackingPointX, point.y + this._hackingPointY); - this._updateView(); + let position = this._moveBody(this.body, this._xSpeed * this._config.speed, this._ySpeed * this._config.speed); + this.position = rectToPoint(position); let robot = this._game.currentMap.unitAt(this._hackingPoint, 'robot'); - if (robot && robot.type === 'ranged') { + if (robot && (robot.type === 'ranged' || robot.type === 'melee')) { + debugger; (robot).hack(this._config.hackSpeed * time.delta / 1000); } } - private _updateView() { - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; - } - private _moveBody(body: Rectangle, dx: number, dy: number): Rectangle { return moveBody(this._game.currentMap, body, dx, dy); } diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts index 316c41172..826f62c8c 100644 --- a/src/game/entities/ranged.ts +++ b/src/game/entities/ranged.ts @@ -3,87 +3,67 @@ import { Point, Rectangle, Graphics, - Circle, - Container + Circle } from 'pixi.js'; -import {Game} from '../game'; -import {IEntity, IRobot, teamType} from '../types'; +import {IEntity, teamType} from '../types'; import {EnergyBall} from './energyBall'; import {ITimeEvent} from '../game-loop'; import { inRange, lineOfSight, - rectToPoint, - tileToRect, - tileToCircle + pointToCircle } from '../functional'; -import {HackMeter} from '../ui'; -export class Ranged implements IRobot { +import {Robot} from './robot'; + +export class Ranged extends Robot { get type() { return 'ranged'; } + get team(): teamType { return this._team; } - private _view: Container; private _config: any; - private _body: Rectangle; private _fov: Circle; private _state: 'searching' | 'shooting' | 'cooldown'; private _timer: number; private _target: IEntity; - private _hackMeter: number; - private _hackMeterView: HackMeter; private _team: teamType; private _graphics: Graphics; - get view() { return this._view; } - get body() { return this._body; } - get team(): teamType { return this._team; } - get fov() { return this._fov; } - get target() { return this._target; } - get position() { return rectToPoint(this._body); } + _hackResistence() { return this._config.hackMeter; } - set tile(pos: Point) { - this._body = tileToRect(pos, this._config.size, this._config.size); - this._fov = tileToCircle(pos, this._config.radius); - this._updateView(); + _changeTeam() { + this._team = 'hacker'; + this._state = 'searching'; + this._graphics.clear(); + this._graphics.beginFill(0x63DAE6); + this._graphics.drawCircle( 0, 0, this._config.size / 2 ); } - constructor( - private _game: Game - ) { - this._config = Object.assign(config.entities.ranged); + get fov() { return this._fov; } + get target() { return this._target; } + + _preInit() { + this._config = Object.assign({}, config.entities.ranged); this._state = 'searching'; this._team = 'robot'; - this._hackMeter = 0; + this._fov = pointToCircle(new Point(0, 0), this._config.radius); + } + + _initBody() { + return new Rectangle(0, 0, this._config.size, this._config.size); + } + _initView() { this._graphics = new Graphics(); this._graphics.beginFill(0xA2A0E5); - this._graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.size / 2 ); - this._view = new Container(); - this._view.addChild(this._graphics); - this._hackMeterView = new HackMeter(); - this._view.addChild(this._hackMeterView.view); - - this.tile = new Point(); - this._updateView(); - - _game.gameLoop$.subscribe(e => this.update(e)); + this._graphics.drawCircle( 0, 0, this._config.size / 2 ); + return this._addView(this._graphics); } - hack(value: number) { - this._hackMeter += value; - if (this._hackMeter >= this._config.hackMeter) { - this._hackMeter = 0; - this._team = 'hacker'; - this._state = 'searching'; - this._graphics.clear(); - this._graphics.beginFill(0x63DAE6); - this._graphics.drawCircle( this._config.size / 2, this._config.size / 2, this._config.size / 2 ); - } - this._hackMeterView.setProgress(this._hackMeter / this._config.hackMeter); + _setPosition(pos: Point) { + this._fov = pointToCircle(pos, this._config.radius); + super._setPosition(pos); } - hit() {} - update(time: ITimeEvent) { if (this._team !== 'hacker' && this._playerInRange()) { this._target = this._game.currentMap.player; @@ -105,11 +85,6 @@ export class Ranged implements IRobot { this._timer -= time.delta; } - private _updateView() { - this._view.position.x = this._body.x; - this._view.position.y = this._body.y; - } - private _shoot() { let shoot = new EnergyBall(this._game); shoot.position = this.position; diff --git a/src/game/entities/robot.ts b/src/game/entities/robot.ts new file mode 100644 index 000000000..a718338b8 --- /dev/null +++ b/src/game/entities/robot.ts @@ -0,0 +1,40 @@ +import { + DisplayObject, + Container +} from 'pixi.js'; + +import {Unit} from './unit'; +import {HackMeter} from '../ui'; +import {config} from '../../config'; + +export abstract class Robot extends Unit { + protected abstract _hackResistence(): number; + protected abstract _changeTeam(): void; + + private _hackMeter: number; + private _hackMeterView: HackMeter; + + protected _addView(dO: DisplayObject) { + let container = new Container(); + this._hackMeterView = new HackMeter(); + this._hackMeterView.view.position.x = -config.tileSize / 2; + this._hackMeterView.view.position.y = -config.tileSize / 2; + container.addChild(dO); + container.addChild(this._hackMeterView.view); + return container; + } + + constructor(game: any) { + super(game); + this._hackMeter = 0; + } + + hack(value: number) { + this._hackMeter += value; + if (this._hackMeter >= this._hackResistence() ) { + this._hackMeter = 0; + this._changeTeam(); + } + this._hackMeterView.setProgress(this._hackMeter / this._hackResistence()); + } +} diff --git a/src/game/entities/unit.ts b/src/game/entities/unit.ts new file mode 100644 index 000000000..07e59d9b2 --- /dev/null +++ b/src/game/entities/unit.ts @@ -0,0 +1,68 @@ +import { + Point, + IHitArea, + Rectangle, + DisplayObject +} from 'pixi.js'; +import {Subscription} from 'rxjs/Rx'; + +import { + IUnit, + teamType +} from '../types'; + +import { + tileToPoint, + pointToRect +} from '../functional'; +import {ITimeEvent} from '../game-loop'; +import {Game} from '../game'; + +export abstract class Unit implements IUnit { + abstract get type(): string; + abstract get team(): teamType; + protected abstract _initBody(): Rectangle; + protected abstract _initView(): DisplayObject; + + private _body: Rectangle; + private _hitbox: IHitArea; + private _view: DisplayObject; + private _subscription: Subscription; + private _position: Point; + + get view() { return this._view; } + get body() { return this._body; } + get hitbox() { return this._hitbox; } + set tile(pos: Point) { this.position = tileToPoint(pos); } + public get position() { return this._position; } + public set position(pos: Point) { this._setPosition(pos); } + + constructor(protected _game: Game) { + this._preInit(_game); + this._body = this._initBody(); + this._view = this._initView(); + this._subscription = _game.gameLoop$.subscribe(e => this.update(e)); + this._postInit(_game); + } + + hit(damage: number) {} + update(time: ITimeEvent) {} + protected _preInit(game: Game) {} + protected _postInit(game: Game) {} + + protected _updateView() { + this._view.position = this.position.clone(); + } + + protected _setPosition(pos: Point) { + this._position = pos.clone(); + this._body = pointToRect(pos, this._body.width, this._body.height); + this._updateView(); + } + + destroy() { + this._game.currentMap.removeEntity(this); + this._view.destroy(); + this._subscription.unsubscribe(); + } +} diff --git a/src/game/functional/collision.ts b/src/game/functional/collision.ts index b44a1cf91..20f2e7bba 100644 --- a/src/game/functional/collision.ts +++ b/src/game/functional/collision.ts @@ -116,3 +116,36 @@ export function lineOfSight(map: Map, x0: number, y0: number, x1: number, y1: nu } return los; } + + +// class Rect { +// private _x: number; +// private _y: number; +// +// constructor(x: number, y: number) { +// this._x = x; +// this._y = y; +// } +// } + + +class Rect { + constructor( + private _x = 0, + private _y = 0 + ) {} + + get x() { return this._x; } + get y() { return this._y; } + + set(values: {x?: number, y?: number}) { + return new Rect( + values.x || this._x, + values.y || this._y + ); + } +} + +let a = new Rect(); + +a = a.set({x: 5}); diff --git a/src/game/levels/level-01.ts b/src/game/levels/level-01.ts index 9f1d5ed1c..91cdf7eb5 100644 --- a/src/game/levels/level-01.ts +++ b/src/game/levels/level-01.ts @@ -12,7 +12,7 @@ export default { ' XP X ', ' TX ', ' ', - ' T ', + ' T M ', ' ', ' ', ] diff --git a/src/game/map.ts b/src/game/map.ts index f2d2429a9..f6f1ce9b1 100644 --- a/src/game/map.ts +++ b/src/game/map.ts @@ -6,6 +6,7 @@ import { import { Player, Ranged, + Melee, Wall } from './entities'; import {Game} from './game'; @@ -14,12 +15,14 @@ import { IEntity, IUnit } from './types'; +import {Robot} from './entities/robot'; export class Map { private _mapConfig: string[]; private _map: IEntity[][]; private _player: Player; private _entities: IEntity[]; + private _robots: Robot[]; private _stage: Container; private _viewLayer: Container; @@ -39,9 +42,9 @@ export class Map { get player() { return this._player; } unitAt(point: Point, team?: string): IEntity { - for (let entity of this._entities) { - if (entity.body.contains(point.x, point.y) && (!team || entity.team === team)) { - return entity; + for (let unit of this._robots) { + if (unit.body.contains(point.x, point.y) && (!team || unit.team === team)) { + return unit; } } return null; @@ -95,6 +98,9 @@ export class Map { if (config.drawView) { this._viewLayer.addChild(entity.view); } + if (entity instanceof Robot) { + this._robots.push(entity); + } } removeEntity(entity: IEntity) { @@ -111,6 +117,7 @@ export class Map { this._mapConfig = level.map; this._map = Array.apply(null, Array(config.gridHeight)).map(() => []); this._entities = []; + this._robots = []; this._stage = new Container(); if (config.drawView) { @@ -129,21 +136,18 @@ export class Map { if (this._mapConfig[row][tile] === 'X') { entity = new Wall(this._game); this._map[row][tile] = entity; - } - - if (this._mapConfig[row][tile] === 'T') { + } else if (this._mapConfig[row][tile] === 'T') { entity = new Ranged(this._game); this._map[row][tile] = entity; } else if (this._mapConfig[row][tile] === 'P') { entity = new Player(this._game); this._player = entity; + } else if (this._mapConfig[row][tile] === 'M') { + entity = new Melee(this._game); } if (entity) { entity.tile = new Point(tile, row); - this._entities.push(entity); - if (config.drawView) { - this._viewLayer.addChild(entity.view); - } + this.addEntity(entity); } } } diff --git a/src/game/types/entity.ts b/src/game/types/entity.ts index 5f1ae522d..c813a6ab3 100644 --- a/src/game/types/entity.ts +++ b/src/game/types/entity.ts @@ -1,6 +1,5 @@ import { - Circle, - Rectangle, + IHitArea, DisplayObject, Point } from 'pixi.js'; @@ -15,8 +14,8 @@ export interface IEntity { team: teamType; tile: Point; position: Point; - update: (time: ITimeEvent) => void; + update(time: ITimeEvent): void; readonly type: string; - readonly body: Rectangle | Circle; + readonly body: IHitArea; readonly view: DisplayObject; } diff --git a/src/game/types/robot.ts b/src/game/types/robot.ts index b38af4e2e..9a5013ba9 100644 --- a/src/game/types/robot.ts +++ b/src/game/types/robot.ts @@ -2,5 +2,5 @@ import {IUnit} from './unit'; export interface IRobot extends IUnit { - hack: (value: number) => void; + hack(value: number): void; } diff --git a/src/game/types/unit.ts b/src/game/types/unit.ts index d1f1660a9..b4575ef29 100644 --- a/src/game/types/unit.ts +++ b/src/game/types/unit.ts @@ -4,7 +4,7 @@ import {IEntity} from './Entity'; // Units can take hits export interface IUnit extends IEntity { - hit: (damage: number) => void; + hit(damage: number): void; fov?: IShape; hitbox?: IShape; target?: IEntity; From 746629af1293db24a8845fc4e6e6af059dd97d4a Mon Sep 17 00:00:00 2001 From: dENIS Date: Wed, 23 Nov 2016 20:56:00 -0400 Subject: [PATCH 29/30] Set closest enemy as robots target --- src/game/entities/energyBall.ts | 3 +- src/game/entities/ranged.ts | 39 +++++++----- src/game/functional/collision.ts | 102 ++++++++++++++++++++++--------- src/game/map.ts | 1 + src/typings/pixi/index.d.ts | 2 +- 5 files changed, 100 insertions(+), 47 deletions(-) diff --git a/src/game/entities/energyBall.ts b/src/game/entities/energyBall.ts index 761b52958..ed1afeb0c 100644 --- a/src/game/entities/energyBall.ts +++ b/src/game/entities/energyBall.ts @@ -53,9 +53,8 @@ export class EnergyBall extends Unit { } } - setTarget(entity: IEntity) { + setTarget(targetPosition: Point) { let position = this.position; - let targetPosition = entity.position; this._speed = normalizeVector( targetPosition.x - position.x, targetPosition.y - position.y diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts index 826f62c8c..547f8f204 100644 --- a/src/game/entities/ranged.ts +++ b/src/game/entities/ranged.ts @@ -9,8 +9,9 @@ import {IEntity, teamType} from '../types'; import {EnergyBall} from './energyBall'; import {ITimeEvent} from '../game-loop'; import { - inRange, - lineOfSight, + collide, + isInLOS, + getDistance, pointToCircle } from '../functional'; @@ -25,6 +26,7 @@ export class Ranged extends Robot { private _state: 'searching' | 'shooting' | 'cooldown'; private _timer: number; private _target: IEntity; + private _targetPosition: Point; private _team: teamType; private _graphics: Graphics; @@ -65,12 +67,10 @@ export class Ranged extends Robot { } update(time: ITimeEvent) { - if (this._team !== 'hacker' && this._playerInRange()) { - this._target = this._game.currentMap.player; - } else { - this._target = null; - } + this._target = this._getClosestEnemy(); + if (this._state === 'searching' && this._target) { + this._targetPosition = this._target.position; this._state = 'shooting'; this._timer = this._config.shootDelay; } @@ -88,16 +88,25 @@ export class Ranged extends Robot { private _shoot() { let shoot = new EnergyBall(this._game); shoot.position = this.position; - shoot.setTarget(this._game.currentMap.player); + shoot.setTarget(this._targetPosition); this._game.currentMap.addEntity(shoot); } - private _playerInRange(): boolean { - return inRange(this._fov, this._game.currentMap.player.body) && - lineOfSight(this._game.currentMap, - this._fov.x, this._fov.y, - this._game.currentMap.player.position.x, - this._game.currentMap.player.position.y - ); + private _getClosestEnemy(): IEntity { + let target = this._game.currentMap.robots + .filter(rob => this.team !== rob.team && collide(this._fov, rob.body)) + .sort(rob => getDistance(this, rob)) + .find(rob => isInLOS(this._game.currentMap, this._fov.x, this._fov.y ,rob.position.x, rob.position.y)) + + if(target === undefined) { + let player = this._game.currentMap.player; + if( this.team !== player.team && + collide(this._fov, player.body) && + isInLOS(this._game.currentMap, this._fov.x, this._fov.y , player.position.x, player.position.y)) { + target = player; + } + } + + return target; } } diff --git a/src/game/functional/collision.ts b/src/game/functional/collision.ts index 20f2e7bba..d7c03c801 100644 --- a/src/game/functional/collision.ts +++ b/src/game/functional/collision.ts @@ -3,7 +3,7 @@ import { IUnit } from '../types'; import {Map} from '../map'; -import {Rectangle, Circle} from 'pixi.js'; +import {Rectangle, Circle, Ellipse, Polygon, IHitArea, SHAPES} from 'pixi.js'; export function isOutOfBOunds(map: Map, body: Rectangle): boolean { return body.x < 0 || body.y < 0 || body.right > map.width || body.bottom > map.height; @@ -33,16 +33,6 @@ export function wallCollision(map: Map, body: Rectangle, rangedAsWalls = false): wallAt(map, body.left, body.top, rangedAsWalls); } -function _rectsCollide(rect1: Rectangle, rect2: Rectangle): boolean { - return rect1.contains(rect2.left, rect2.top) || - rect1.contains(rect2.left, rect2.bottom) || - rect1.contains(rect2.right, rect2.top) || - rect1.contains(rect2.right, rect2.bottom); -} -export function rectsCollide(rect1: Rectangle, rect2: Rectangle): boolean { - return _rectsCollide(rect1, rect2) || _rectsCollide(rect2, rect1); -} - export function enemyCollision(map: Map, entity: IEntity): IUnit { let playerBody = map.player.body; return rectsCollide(entity.body, playerBody) ? map.player : null; @@ -77,14 +67,80 @@ export function moveBody(map: Map, body: Rectangle, dx: number, dy: number): Rec return fixOutOfBOunds(map, newBody); } -export function inRange(range: Circle, body: Rectangle): boolean { - return range.contains(body.left, body.bottom) || - range.contains(body.right, body.bottom) || - range.contains(body.left, body.top) || - range.contains(body.right, body.top); +function _rectsCollide(rect1: Rectangle, rect2: Rectangle): boolean { + return rect1.contains(rect2.left, rect2.top) || + rect1.contains(rect2.left, rect2.bottom) || + rect1.contains(rect2.right, rect2.top) || + rect1.contains(rect2.right, rect2.bottom); +} + +export function rectsCollide(rect1: Rectangle, rect2: Rectangle): boolean { + return _rectsCollide(rect1, rect2) || _rectsCollide(rect2, rect1); +} + +export function rectCircCollide(rect: Rectangle, circ: Circle): boolean { + return circ.contains(rect.left, rect.bottom) || + circ.contains(rect.right, rect.bottom) || + circ.contains(rect.left, rect.top) || + circ.contains(rect.right, rect.top); +} + +export function rectPolyCollide(rect: Rectangle, poly: Polygon): boolean { + return poly.contains(rect.left, rect.top) || + poly.contains(rect.left, rect.bottom) || + poly.contains(rect.right, rect.top) || + poly.contains(rect.right, rect.bottom); } -export function lineOfSight(map: Map, x0: number, y0: number, x1: number, y1: number): boolean { +export function circsCollide(circ1: Circle, circ2: Circle): boolean { + return true; +} + +export function circPolyCollide(circ: Circle, poly: Polygon): boolean { + return true; +} + +export function polysCollide(poly1: Polygon, poly2: Polygon): boolean { + return true; +} + +export function getDistance(e1: IEntity, e2: IEntity): number { + return Math.sqrt((e1.position.x-e2.position.x)^2 + (e1.position.y-e2.position.y)^2); +} + +export function collide(a: IHitArea, b: IHitArea): boolean { + switch(a.type){ + case SHAPES.RECT : return rectCollide( a, b) + case SHAPES.CIRC : return circCollide( a, b) + case SHAPES.POLY : return polyCollide( a, b) + } +} + +export function rectCollide(rect: Rectangle, b: IHitArea): boolean { + switch(b.type) { + case SHAPES.RECT : return rectsCollide(rect, b) + case SHAPES.CIRC : return rectCircCollide(rect, b) + case SHAPES.POLY : return rectPolyCollide(rect, b) + } +} + +export function circCollide(circ: Circle, b: IHitArea): boolean { + switch(b.type){ + case SHAPES.RECT : return rectCircCollide( b, circ) + case SHAPES.CIRC : return circsCollide(circ, b) + case SHAPES.POLY : return circPolyCollide(circ, b) + } +} + +export function polyCollide(poly: Polygon, b: IHitArea): boolean { + switch(b.type){ + case SHAPES.RECT : return rectPolyCollide( b, poly) + case SHAPES.CIRC : return circPolyCollide( b, poly) + case SHAPES.POLY : return polysCollide(poly, b) + } +} + +export function isInLOS(map: Map, x0: number, y0: number, x1: number, y1: number): boolean { let los = true; let dx = Math.abs(x1 - x0); let dy = Math.abs(y1 - y0); @@ -117,18 +173,6 @@ export function lineOfSight(map: Map, x0: number, y0: number, x1: number, y1: nu return los; } - -// class Rect { -// private _x: number; -// private _y: number; -// -// constructor(x: number, y: number) { -// this._x = x; -// this._y = y; -// } -// } - - class Rect { constructor( private _x = 0, diff --git a/src/game/map.ts b/src/game/map.ts index f6f1ce9b1..c3863a46f 100644 --- a/src/game/map.ts +++ b/src/game/map.ts @@ -40,6 +40,7 @@ export class Map { get width() { return config.tileSize * config.gridWidth; } get height() { return config.tileSize * config.gridHeight; } get player() { return this._player; } + get robots() { return this._robots; } unitAt(point: Point, team?: string): IEntity { for (let unit of this._robots) { diff --git a/src/typings/pixi/index.d.ts b/src/typings/pixi/index.d.ts index 5c920e780..13adc54e8 100644 --- a/src/typings/pixi/index.d.ts +++ b/src/typings/pixi/index.d.ts @@ -653,7 +653,7 @@ declare namespace PIXI { export interface IHitArea extends IShape { contains(x: number, y: number): boolean; - + type: number; } export class Circle { From 572691f928d19352a8ce3060f6015eb8ad180d13 Mon Sep 17 00:00:00 2001 From: dENIS Date: Fri, 25 Nov 2016 12:42:17 -0400 Subject: [PATCH 30/30] Now melee moves around the map loocking for a target --- src/config.ts | 4 +- src/game/entities/melee.ts | 103 ++++++++++++++++++++++++------------ src/game/entities/ranged.ts | 28 +--------- src/game/entities/robot.ts | 36 ++++++++++++- src/typings/pixi/index.d.ts | 4 +- 5 files changed, 112 insertions(+), 63 deletions(-) diff --git a/src/config.ts b/src/config.ts index 8ffce3630..e5ef09dc7 100644 --- a/src/config.ts +++ b/src/config.ts @@ -30,7 +30,9 @@ export const config = { }, melee: { size: 30, - maxWalkDistance: 32 * 4, + maxWalkDistance: 64 * 4, + minWalkDistance: 32, + speed: 1, }, energyBall: { size: 20, diff --git a/src/game/entities/melee.ts b/src/game/entities/melee.ts index af2bdcb28..9af2e4709 100644 --- a/src/game/entities/melee.ts +++ b/src/game/entities/melee.ts @@ -1,4 +1,7 @@ -import {Graphics, Rectangle, Point} from 'pixi.js'; +import {Graphics, + Rectangle, + Point, + } from 'pixi.js'; import {Game} from '../game'; import {IEntity, IUnit, teamType} from '../types'; import {ITimeEvent} from '../game-loop'; @@ -22,10 +25,14 @@ export class Melee extends Robot { private _config: any; private _state: 'idle' | 'moving'; + private _speed: Point; + private _destiny: Point; + protected _fov: Rectangle; _preInit() { this._config = config.entities.melee; this._state = 'idle'; + this._fov = new Rectangle(0,0,32*4,32*4); } _changeTeam() {} @@ -45,41 +52,69 @@ export class Melee extends Robot { ])); } - private _getRandomPoint() { - return new Point( - this.position.x + (-this._config.walkDistance + 2 * this._config.walkDistance * Math.random()), - this.position.y + (-this._config.walkDistance + 2 * this._config.walkDistance * Math.random()) + _setPosition(pos: Point) { + this._fov = new Rectangle(pos.x, pos.y, 32*4, 32*4); + super._setPosition(pos); + } + + + update(time: ITimeEvent) { + let enemy = enemyCollision(this._game.currentMap, this); + + if (enemy) { + enemy.hit(this._config.damage); + } else { + this._point(this._getDestiny()); + this._setPosition(new Point( + this.position.x + this._speed.x, + this.position.y + this._speed.y + )); + } + } + + private _point(pos: Point) { + let position = this.position; + this._destiny = pos; + + this._speed = normalizeVector( + pos.x - position.x, + pos.y - position.y ); + this._speed.x = this._speed.x * this._config.speed; + this._speed.y = this._speed.y * this._config.speed; + } + + private _hasDestiny(): boolean { + return this._destiny && + !this._isInDestiny() && + !isOutOfBOunds(this._game.currentMap, this.body) && + wallCollision(this._game.currentMap, this.body) === null } - // moveToLocation(pos: Point) { - // let position = this.position; - // let targetPosition = entity.position; - // this._speed = normalizeVector( - // targetPosition.x - position.x, - // targetPosition.y - position.y - // ); - // this._speed.x = this._speed.x * this._config.speed; - // this._speed.y = this._speed.y * this._config.speed; - // } - // - // update(time: ITimeEvent) { - // let enemy = enemyCollision(this._game.currentMap, this); - // if ( - // isOutOfBOunds(this._game.currentMap, this.body) || - // wallCollision(this._game.currentMap, this.body) || - // enemy !== null - // ) { - // if (enemy) { - // enemy.hit(this._config.damage); - // } - // this.destroy(); - // } else if (this._speed) { - // this.position = new Point( - // this.position.x + this._speed.x, - // this.position.y + this._speed.y, - // ); - // } - // } + private _isInDestiny(): boolean { + return Math.abs(this._destiny.x - this.position.x) < Math.abs(this._speed.x) && + Math.abs(this._destiny.y - this.position.y) < Math.abs(this._speed.y) + } + + private _getDestiny(): Point { + let destiny; + + this._target = this._getClosestEnemy(); + if (this._target) destiny = this._target.position; + else if (!this._hasDestiny()) destiny = this._getRandomDestiny(); + else destiny = this._destiny; + + return destiny; + } + + private _getRandomDestiny() { + let radius = Math.random()*(this._config.maxWalkDistance - this._config.minWalkDistance) + this._config.minWalkDistance; + let angle = Math.random()*2*Math.PI; + + let dX = Math.cos(angle)*radius; + let dY = Math.sin(angle)*radius; + + return new Point(this.position.x + dX, this.position.y + dY); + } } diff --git a/src/game/entities/ranged.ts b/src/game/entities/ranged.ts index 547f8f204..2e9efbdf1 100644 --- a/src/game/entities/ranged.ts +++ b/src/game/entities/ranged.ts @@ -9,9 +9,6 @@ import {IEntity, teamType} from '../types'; import {EnergyBall} from './energyBall'; import {ITimeEvent} from '../game-loop'; import { - collide, - isInLOS, - getDistance, pointToCircle } from '../functional'; @@ -21,11 +18,11 @@ export class Ranged extends Robot { get type() { return 'ranged'; } get team(): teamType { return this._team; } + protected _fov: Circle; + private _config: any; - private _fov: Circle; private _state: 'searching' | 'shooting' | 'cooldown'; private _timer: number; - private _target: IEntity; private _targetPosition: Point; private _team: teamType; private _graphics: Graphics; @@ -40,9 +37,6 @@ export class Ranged extends Robot { this._graphics.drawCircle( 0, 0, this._config.size / 2 ); } - get fov() { return this._fov; } - get target() { return this._target; } - _preInit() { this._config = Object.assign({}, config.entities.ranged); this._state = 'searching'; @@ -91,22 +85,4 @@ export class Ranged extends Robot { shoot.setTarget(this._targetPosition); this._game.currentMap.addEntity(shoot); } - - private _getClosestEnemy(): IEntity { - let target = this._game.currentMap.robots - .filter(rob => this.team !== rob.team && collide(this._fov, rob.body)) - .sort(rob => getDistance(this, rob)) - .find(rob => isInLOS(this._game.currentMap, this._fov.x, this._fov.y ,rob.position.x, rob.position.y)) - - if(target === undefined) { - let player = this._game.currentMap.player; - if( this.team !== player.team && - collide(this._fov, player.body) && - isInLOS(this._game.currentMap, this._fov.x, this._fov.y , player.position.x, player.position.y)) { - target = player; - } - } - - return target; - } } diff --git a/src/game/entities/robot.ts b/src/game/entities/robot.ts index a718338b8..517246b5d 100644 --- a/src/game/entities/robot.ts +++ b/src/game/entities/robot.ts @@ -1,16 +1,29 @@ import { DisplayObject, - Container + Container, + IHitArea, + Point } from 'pixi.js'; +import { + collide, + isInLOS, + getDistance, + pointToCircle +} from '../functional'; + import {Unit} from './unit'; import {HackMeter} from '../ui'; import {config} from '../../config'; +import {IEntity} from '../types'; export abstract class Robot extends Unit { protected abstract _hackResistence(): number; protected abstract _changeTeam(): void; + protected _fov: IHitArea; + protected _target: IEntity; + private _hackMeter: number; private _hackMeterView: HackMeter; @@ -37,4 +50,25 @@ export abstract class Robot extends Unit { } this._hackMeterView.setProgress(this._hackMeter / this._hackResistence()); } + + get fov() { return this._fov; } + get target() { return this._target; } + + protected _getClosestEnemy(): IEntity { + let target = this._game.currentMap.robots + .filter(rob => this.team !== rob.team && collide(this._fov, rob.body)) + .sort(rob => getDistance(this, rob)) + .find(rob => isInLOS(this._game.currentMap, this._fov.x, this._fov.y ,rob.position.x, rob.position.y)) + + if(target === undefined) { + let player = this._game.currentMap.player; + if( this.team !== player.team && + collide(this._fov, player.body) && + isInLOS(this._game.currentMap, this._fov.x, this._fov.y , player.position.x, player.position.y)) { + target = player; + } + } + + return target; + } } diff --git a/src/typings/pixi/index.d.ts b/src/typings/pixi/index.d.ts index 13adc54e8..4dbb63133 100644 --- a/src/typings/pixi/index.d.ts +++ b/src/typings/pixi/index.d.ts @@ -1,4 +1,4 @@ -// type definitions for Pixi.js + // type definitions for Pixi.js // project: https://github.com/pixijs/pixi.js/tree/dev // definitions by: clark-stevenson // definitions: https://github.com/borisyankov/DefinitelyTyped @@ -654,6 +654,8 @@ declare namespace PIXI { contains(x: number, y: number): boolean; type: number; + x: number; + y: number; } export class Circle {