From f444cb15c3ab27300c75d7e02c1229f1dd5cba7d Mon Sep 17 00:00:00 2001
From: Ross Kettle <ross.p.kettle@gmail.com>
Date: Wed, 28 May 2014 12:45:26 +1200
Subject: [PATCH 1/3] Updated README.md

---
 .gitignore                                         |   1 +
 README.md                                          | 314 +++++++++++++++++----
 build/kiwi.js                                      |   2 +-
 build/kiwi.min.js                                  |   4 +-
 docs/classes/Kiwi.Animations.Animation.html        |   2 +-
 docs/classes/Kiwi.Animations.Sequence.html         |   2 +-
 docs/classes/Kiwi.Animations.Tween.html            |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Back.html        |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Bounce.html      |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Circular.html    |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Cubic.html       |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Elastic.html     |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Exponential.html |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Linear.html      |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Quadratic.html   |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Quartic.html     |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Quintic.html     |   2 +-
 .../Kiwi.Animations.Tweens.Easing.Sinusoidal.html  |   2 +-
 .../Kiwi.Animations.Tweens.TweenManager.html       |   2 +-
 docs/classes/Kiwi.Camera.html                      |   2 +-
 docs/classes/Kiwi.CameraManager.html               |   2 +-
 docs/classes/Kiwi.Component.html                   |   2 +-
 docs/classes/Kiwi.ComponentManager.html            |   2 +-
 docs/classes/Kiwi.Components.AnimationManager.html |   2 +-
 docs/classes/Kiwi.Components.ArcadePhysics.html    |   2 +-
 docs/classes/Kiwi.Components.Box.html              |   2 +-
 docs/classes/Kiwi.Components.Input.html            |   2 +-
 docs/classes/Kiwi.Components.Sound.html            |   2 +-
 docs/classes/Kiwi.Entity.html                      |   2 +-
 docs/classes/Kiwi.Files.DataLibrary.html           |   2 +-
 docs/classes/Kiwi.Files.File.html                  |   2 +-
 docs/classes/Kiwi.Files.FileStore.html             |   2 +-
 docs/classes/Kiwi.Files.Loader.html                |   2 +-
 docs/classes/Kiwi.Game.html                        |   2 +-
 docs/classes/Kiwi.GameManager.html                 |   2 +-
 docs/classes/Kiwi.GameObjects.Sprite.html          |   2 +-
 docs/classes/Kiwi.GameObjects.StaticImage.html     |   2 +-
 docs/classes/Kiwi.GameObjects.Textfield.html       |   2 +-
 docs/classes/Kiwi.GameObjects.Tilemap.TileMap.html |   2 +-
 .../Kiwi.GameObjects.Tilemap.TileMapLayer.html     |   2 +-
 .../classes/Kiwi.GameObjects.Tilemap.TileType.html |   2 +-
 docs/classes/Kiwi.Geom.AABB.html                   |   2 +-
 docs/classes/Kiwi.Geom.Circle.html                 |   2 +-
 docs/classes/Kiwi.Geom.Intersect.html              |   2 +-
 docs/classes/Kiwi.Geom.IntersectResult.html        |   2 +-
 docs/classes/Kiwi.Geom.Line.html                   |   2 +-
 docs/classes/Kiwi.Geom.Matrix.html                 |   2 +-
 docs/classes/Kiwi.Geom.Point.html                  |   2 +-
 docs/classes/Kiwi.Geom.Ray.html                    |   2 +-
 docs/classes/Kiwi.Geom.Rectangle.html              |   2 +-
 docs/classes/Kiwi.Geom.Transform.html              |   2 +-
 docs/classes/Kiwi.Geom.Vector2.html                |   2 +-
 docs/classes/Kiwi.Group.html                       |   2 +-
 docs/classes/Kiwi.HUD.HUDComponents.Counter.html   |   2 +-
 docs/classes/Kiwi.HUD.HUDComponents.Time.html      |   2 +-
 .../Kiwi.HUD.HUDComponents.WidgetInput.html        |   2 +-
 docs/classes/Kiwi.HUD.HUDDisplay.html              |   2 +-
 docs/classes/Kiwi.HUD.HUDManager.html              |   2 +-
 docs/classes/Kiwi.HUD.HUDWidget.html               |   2 +-
 docs/classes/Kiwi.HUD.Widget.Bar.html              |   2 +-
 docs/classes/Kiwi.HUD.Widget.BasicScore.html       |   2 +-
 docs/classes/Kiwi.HUD.Widget.Button.html           |   2 +-
 docs/classes/Kiwi.HUD.Widget.Icon.html             |   2 +-
 docs/classes/Kiwi.HUD.Widget.IconBar.html          |   2 +-
 docs/classes/Kiwi.HUD.Widget.Menu.html             |   2 +-
 docs/classes/Kiwi.HUD.Widget.MenuItem.html         |   2 +-
 docs/classes/Kiwi.HUD.Widget.TextField.html        |   2 +-
 docs/classes/Kiwi.HUD.Widget.Time.html             |   2 +-
 docs/classes/Kiwi.IChild.html                      |   2 +-
 docs/classes/Kiwi.Input.Finger.html                |   2 +-
 docs/classes/Kiwi.Input.InputManager.html          |  20 +-
 docs/classes/Kiwi.Input.Key.html                   |   2 +-
 docs/classes/Kiwi.Input.Keyboard.html              |   2 +-
 docs/classes/Kiwi.Input.Keycodes.html              |   2 +-
 docs/classes/Kiwi.Input.Mouse.html                 |   2 +-
 docs/classes/Kiwi.Input.MouseCursor.html           |   2 +-
 docs/classes/Kiwi.Input.Pointer.html               |   2 +-
 docs/classes/Kiwi.Input.Touch.html                 |   2 +-
 docs/classes/Kiwi.PluginManager.html               |   2 +-
 docs/classes/Kiwi.Renderers.CanvasRenderer.html    |   2 +-
 docs/classes/Kiwi.Renderers.GLArrayBuffer.html     |   2 +-
 .../Kiwi.Renderers.GLElementArrayBuffer.html       |   2 +-
 docs/classes/Kiwi.Renderers.GLRenderManager.html   |   2 +-
 docs/classes/Kiwi.Renderers.GLTextureManager.html  |   2 +-
 docs/classes/Kiwi.Renderers.GLTextureWrapper.html  |   2 +-
 docs/classes/Kiwi.Renderers.Renderer.html          |   2 +-
 .../Kiwi.Renderers.TextureAtlasRenderer.html       |   2 +-
 docs/classes/Kiwi.Shaders.ShaderManager.html       |   2 +-
 docs/classes/Kiwi.Shaders.ShaderPair.html          |   2 +-
 docs/classes/Kiwi.Shaders.TextureAtlasShader.html  |   2 +-
 docs/classes/Kiwi.Signal.html                      |   2 +-
 docs/classes/Kiwi.SignalBinding.html               |   2 +-
 docs/classes/Kiwi.Sound.Audio.html                 |   2 +-
 docs/classes/Kiwi.Sound.AudioLibrary.html          |   2 +-
 docs/classes/Kiwi.Sound.AudioManager.html          |   2 +-
 docs/classes/Kiwi.Stage.html                       |   2 +-
 docs/classes/Kiwi.State.html                       |   2 +-
 docs/classes/Kiwi.StateConfig.html                 |   2 +-
 docs/classes/Kiwi.StateManager.html                |   2 +-
 docs/classes/Kiwi.System.Bootstrap.html            |   2 +-
 docs/classes/Kiwi.System.Device.html               |   2 +-
 docs/classes/Kiwi.Textures.SingleImage.html        |   2 +-
 docs/classes/Kiwi.Textures.SpriteSheet.html        |   2 +-
 docs/classes/Kiwi.Textures.TextureAtlas.html       |   2 +-
 docs/classes/Kiwi.Textures.TextureLibrary.html     |   2 +-
 docs/classes/Kiwi.Time.Clock.html                  |   2 +-
 docs/classes/Kiwi.Time.ClockManager.html           |   2 +-
 docs/classes/Kiwi.Time.MasterClock.html            |   2 +-
 docs/classes/Kiwi.Time.Timer.html                  |   2 +-
 docs/classes/Kiwi.Time.TimerEvent.html             |   2 +-
 docs/classes/Kiwi.Utils.Canvas.html                |   2 +-
 docs/classes/Kiwi.Utils.Common.html                |   2 +-
 docs/classes/Kiwi.Utils.GameMath.html              |   2 +-
 docs/classes/Kiwi.Utils.RandomDataGenerator.html   |   2 +-
 docs/classes/Kiwi.Utils.RequestAnimationFrame.html |   2 +-
 docs/classes/Kiwi.Utils.Version.html               |   2 +-
 docs/data.json                                     |  20 +-
 docs/files/src_Kiwi.ts.html                        |   4 +-
 docs/files/src_animations_Animation.ts.html        |   2 +-
 docs/files/src_animations_Sequence.ts.html         |   2 +-
 docs/files/src_animations_tweens_Tween.ts.html     |   2 +-
 .../src_animations_tweens_TweenManager.ts.html     |   2 +-
 .../src_animations_tweens_easing_Back.ts.html      |   2 +-
 .../src_animations_tweens_easing_Bounce.ts.html    |   2 +-
 .../src_animations_tweens_easing_Circular.ts.html  |   2 +-
 .../src_animations_tweens_easing_Cubic.ts.html     |   2 +-
 .../src_animations_tweens_easing_Elastic.ts.html   |   2 +-
 ...rc_animations_tweens_easing_Exponential.ts.html |   2 +-
 .../src_animations_tweens_easing_Linear.ts.html    |   2 +-
 .../src_animations_tweens_easing_Quadratic.ts.html |   2 +-
 .../src_animations_tweens_easing_Quartic.ts.html   |   2 +-
 .../src_animations_tweens_easing_Quintic.ts.html   |   2 +-
 ...src_animations_tweens_easing_Sinusoidal.ts.html |   2 +-
 docs/files/src_components_AnimationManager.ts.html |   2 +-
 docs/files/src_components_ArcadePhysics.ts.html    |   2 +-
 docs/files/src_components_Box.ts.html              |   2 +-
 docs/files/src_components_Input.ts.html            |   2 +-
 docs/files/src_components_Sound.ts.html            |   2 +-
 docs/files/src_core_Camera.ts.html                 |   2 +-
 docs/files/src_core_CameraManager.ts.html          |   2 +-
 docs/files/src_core_Component.ts.html              |   2 +-
 docs/files/src_core_ComponentManager.ts.html       |   2 +-
 docs/files/src_core_Entity.ts.html                 |   2 +-
 docs/files/src_core_Game.ts.html                   |   2 +-
 docs/files/src_core_Group.ts.html                  |   2 +-
 docs/files/src_core_IChild.ts.html                 |   2 +-
 docs/files/src_core_PluginManager.ts.html          |   2 +-
 docs/files/src_core_Signal.ts.html                 |   2 +-
 docs/files/src_core_SignalBinding.ts.html          |   2 +-
 docs/files/src_core_Stage.ts.html                  |   2 +-
 docs/files/src_core_State.ts.html                  |   2 +-
 docs/files/src_core_StateConfig.ts.html            |   2 +-
 docs/files/src_core_StateManager.ts.html           |   2 +-
 docs/files/src_file_DataLibrary.ts.html            |   2 +-
 docs/files/src_file_File.ts.html                   |   2 +-
 docs/files/src_file_FileStore.ts.html              |   2 +-
 docs/files/src_file_Loader.ts.html                 |   2 +-
 docs/files/src_gameobjects_Sprite.ts.html          |   2 +-
 docs/files/src_gameobjects_StaticImage.ts.html     |   2 +-
 docs/files/src_gameobjects_Textfield.ts.html       |   2 +-
 docs/files/src_gameobjects_tilemap_TileMap.ts.html |   2 +-
 .../src_gameobjects_tilemap_TileMapLayer.ts.html   |   2 +-
 .../files/src_gameobjects_tilemap_TileType.ts.html |   2 +-
 docs/files/src_geom_AABB.ts.html                   |   2 +-
 docs/files/src_geom_Circle.ts.html                 |   2 +-
 docs/files/src_geom_Intersect.ts.html              |   2 +-
 docs/files/src_geom_IntersectResult.ts.html        |   2 +-
 docs/files/src_geom_Line.ts.html                   |   2 +-
 docs/files/src_geom_Matrix.ts.html                 |   2 +-
 docs/files/src_geom_Point.ts.html                  |   2 +-
 docs/files/src_geom_Ray.ts.html                    |   2 +-
 docs/files/src_geom_Rectangle.ts.html              |   2 +-
 docs/files/src_geom_Transform.ts.html              |   2 +-
 docs/files/src_geom_Vector2.ts.html                |   2 +-
 docs/files/src_hud_HUDDisplay.ts.html              |   2 +-
 docs/files/src_hud_HUDManager.ts.html              |   2 +-
 docs/files/src_hud_HUDWidget.ts.html               |   2 +-
 docs/files/src_hud_components_Counter.ts.html      |   2 +-
 docs/files/src_hud_components_Time.ts.html         |   2 +-
 docs/files/src_hud_components_WidgetInput.ts.html  |   2 +-
 docs/files/src_hud_widgets_Bar.ts.html             |   2 +-
 docs/files/src_hud_widgets_BasicScore.ts.html      |   2 +-
 docs/files/src_hud_widgets_Button.ts.html          |   2 +-
 docs/files/src_hud_widgets_Icon.ts.html            |   2 +-
 docs/files/src_hud_widgets_IconBar.ts.html         |   2 +-
 docs/files/src_hud_widgets_Menu.ts.html            |   2 +-
 docs/files/src_hud_widgets_MenuItem.ts.html        |   2 +-
 docs/files/src_hud_widgets_TextField.ts.html       |   2 +-
 docs/files/src_hud_widgets_Time.ts.html            |   2 +-
 docs/files/src_input_Finger.ts.html                |   2 +-
 docs/files/src_input_InputManager.ts.html          |  25 +-
 docs/files/src_input_Key.ts.html                   |   2 +-
 docs/files/src_input_Keyboard.ts.html              |   2 +-
 docs/files/src_input_Keycodes.ts.html              |   2 +-
 docs/files/src_input_Mouse.ts.html                 |   2 +-
 docs/files/src_input_MouseCursor.ts.html           |   2 +-
 docs/files/src_input_Pointer.ts.html               |   2 +-
 docs/files/src_input_Touch.ts.html                 |   2 +-
 docs/files/src_render_CanvasRenderer.ts.html       |   2 +-
 docs/files/src_render_GLArrayBuffer.ts.html        |   2 +-
 docs/files/src_render_GLElementArrayBuffer.ts.html |   2 +-
 docs/files/src_render_GLRenderManager.ts.html      |   2 +-
 docs/files/src_render_GLShaderManager.ts.html      |   2 +-
 docs/files/src_render_GLTextureManager.ts.html     |   2 +-
 docs/files/src_render_GLTextureWrapper.ts.html     |   2 +-
 docs/files/src_render_renderers_Renderer.ts.html   |   2 +-
 ...c_render_renderers_TextureAtlasRenderer.ts.html |   2 +-
 docs/files/src_render_shaders_ShaderPair.ts.html   |   2 +-
 .../src_render_shaders_TextureAtlasShader.ts.html  |   2 +-
 docs/files/src_sound_Audio.ts.html                 |   2 +-
 docs/files/src_sound_AudioLibrary.ts.html          |   2 +-
 docs/files/src_sound_AudioManager.ts.html          |   2 +-
 docs/files/src_system_Bootstrap.ts.html            |   2 +-
 docs/files/src_system_Device.ts.html               |   2 +-
 docs/files/src_textures_SingleImage.ts.html        |   2 +-
 docs/files/src_textures_SpriteSheet.ts.html        |   2 +-
 docs/files/src_textures_TextureAtlas.ts.html       |   2 +-
 docs/files/src_textures_TextureLibrary.ts.html     |   2 +-
 docs/files/src_time_Clock.ts.html                  |   2 +-
 docs/files/src_time_ClockManager.ts.html           |   2 +-
 docs/files/src_time_MasterClock.ts.html            |   2 +-
 docs/files/src_time_Timer.ts.html                  |   2 +-
 docs/files/src_time_TimerEvent.ts.html             |   2 +-
 docs/files/src_utils_Canvas.ts.html                |   2 +-
 docs/files/src_utils_Common.ts.html                |   2 +-
 docs/files/src_utils_GameMath.ts.html              |   2 +-
 docs/files/src_utils_RandomDataGenerator.ts.html   |   2 +-
 docs/files/src_utils_RequestAnimationFrame.ts.html |   2 +-
 docs/files/src_utils_Version.ts.html               |   2 +-
 docs/index.html                                    |   2 +-
 docs/modules/Animations.html                       |   2 +-
 docs/modules/Components.html                       |   2 +-
 docs/modules/Easing.html                           |   2 +-
 docs/modules/Files.html                            |   2 +-
 docs/modules/GameObjects.html                      |   2 +-
 docs/modules/Geom.html                             |   2 +-
 docs/modules/HUD.html                              |   2 +-
 docs/modules/HUDComponents.html                    |   2 +-
 docs/modules/Input.html                            |   2 +-
 docs/modules/Kiwi.html                             |   2 +-
 docs/modules/Renderers.html                        |   2 +-
 docs/modules/Shaders.html                          |   2 +-
 docs/modules/Sound.html                            |   2 +-
 docs/modules/System.html                           |   2 +-
 docs/modules/Textures.html                         |   2 +-
 docs/modules/Tilemap.html                          |   2 +-
 docs/modules/Time.html                             |   2 +-
 docs/modules/Tweens.html                           |   2 +-
 docs/modules/Utils.html                            |   2 +-
 docs/modules/Widget.html                           |   2 +-
 examples/kiwi.js                                   |  33 ++-
 templateGame/lib/kiwi.js                           |  33 ++-
 252 files changed, 595 insertions(+), 345 deletions(-)

diff --git a/.gitignore b/.gitignore
index f205d97..ea32125 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,5 +44,6 @@ _ReSharper*/
 !/templateGame/*/*.js
 /node_modules
 /GLTests
+/testgl
 tscommand.tmp.txt
 .tscache/build/*
\ No newline at end of file
diff --git a/README.md b/README.md
index 4987ce9..6b65727 100644
--- a/README.md
+++ b/README.md
@@ -1,86 +1,280 @@
-Kiwi.JS 1.0.0
+Kiwi.js 1.0 
 ============
 
-Kiwi.JS is the worlds easiest to use Open Source HTML5 game framework for making both mobile and desktop browser games. Our focus is blazingly fast WebGL and Canvas rendering. Our mission is to foster an open source community and democratize game creation!! 
+![Splash](http://kiwi-js.s3.amazonaws.com/wounds-with-friends.jpg) 
 
-- [Getting Started Tutorials](http://www.kiwijs.org/documentation/getting-started/)  
-- [Code Examples](http://www.kiwijs.org/examples/)  
-- [API Documentation](http://api.kiwijs.org/)  
-- [Contact](http://www.kiwijs.org/help/)  
+Kiwi.js is the worlds easiest to use Open Source HTML5 game framework for making both mobile and desktop HTML5 browser games. 
 
-Visit our homepage [www.kiwijs.org](http://kiwijs.org) for more information about using Kiwi.JS to build your next game, on our site you'll find plenty of examples and tutorials to get you started.
-    
-##What's new in Kiwi.JS 0.7?
+Our focus is blazingly fast WebGL rendering and complimentary tools to make professional quality serious games. We use [CocoonJS](https://www.ludei.com/) for publishing games and App creation. 
 
-- This release includes numerous WebGL rewrites, bug fixes and optimisations which greatly improve stability and extensibility.
-- Works with Cocoon/WebGL combination - tested on iPad2 and numerous Android devices
-- Streamlined sprite rendering shader
-- The build now includes gl-matrix.js (minified version) so there is no longer a need to include this manually
-- A typescript linter task has been added to the grunt file - thanks ellisonleao
+Version: 1.0 "Iwatani"
 
-##Welcome to Kiwi.JS!! 
+- Visit the [Official Website](http://www.kiwijs.org/documentation/getting-started/)
+- Follow us on [Twitter](http://www.twitter.com/kiwijsengine)
+- Explore Source code for [Kiwi.js examples](http://www.kiwijs.org/examples/)  
+- Read our [API Documentation](http://api.kiwijs.org/) 
+- Browse our Plugin Repository
+- [Contact](http://www.kiwijs.org/help/) us for more information
 
-* An open source HTML5 game framework for game creation
-* Targeting native mobile apps as well as both desktop and mobile browsers
-* WebGL and 2D Canvas rendering
-* Support for Cocoon.JS as a native mobile app deployment solution 
 
-##License
+##Welcome to Kiwi!  
+
+
+Born out of a desire to democratize HTML5 game development and to make something that we love available to the masses, we bring you Kiwi.js.
+
+We don’t mean to brag (too much), but Kiwi.js is fast. With hardware accelerated WebGL rendering, you can expect your games to be easily deployed across mobile and desktop browsers. But wait, they can also be deployed to mobile devices as native apps, using the [CocoonJS](https://www.ludei.com/) framework.
+
+Our mission is to follow the best open source community practices. We’re backing that up by providing professional support when its needed, so everyone — commercial developers as well as indies — feel the love.
+
+And we do think you’re going to feel the love. What couldn’t you love about a game engine that is named after a fluffy adorable bird *and* one of the world’s greatest game inventors?
 
-* GPLv2
 
-*Supporters of the MIT Licence rejoice! In coming weeks Kiwi.JS 1.0 will be released and available for download, we will make available versions of Kiwi.JS that are licended under the more permissive MIT Licence and the GPLv2 License.*
+##How to Guides
+
+Have you ever been trying to figure out how to do something on a website and the help pages resemble a [Goosebumps](https://en.wikipedia.org/wiki/Goosebumps) choose your own adventure book? So have we, which is why we have spent literally hundreds of hours writing good help documents for Kiwi.js developers.
+
+Our [Official Documentation Codex](http://www.kiwijs.org/documentation/getting-started/) is here if you do get stuck.
 
 ##Features
 
+####Powerful Rendering
+Kiwi uses a custom built WebGL rendering system for targetting modern mobile and desktop browsers as well as mobile apps through [CocoonJS](https://www.ludei.com/).
+
+Not only is Kiwi lightning quick but it is also extendable, meaning that fellow contributors can easily write there own powerful rendering Plugins and Add-ons using WebGL Shaders. For instance our WebGL Particle Plugin creates stunning special FX using this systmem.
+
+Of course, you can render to canvas too, which means older browsers, and mobile browsers, don't miss out.
+
+####Mobile Publishing
+Kiwi.js is closely aligned with Ludei's [CocoonJS](https://www.ludei.com/). You can use Cocoon to wrap up your game and play it on iOS or Android devices.
+
+####State Management
+A state management system lets you easily move between and manage game states. Each state has an optional preloader phase, a create phase, an update loop, and a destroy phase. Each of the phases are highly configurable.
+
+####Flexible Asset Loading and Management
+It's easy to load in images, sound and data. You can decide when you want it to load (e.g. in a single payload at the beginning, or on a per state basis). When your assets are loaded they're super easy to access from data libraries.
+
+####Gameobjects - Sprites, Images, Textfields 
+Gameobjects are objects that get rendered in your game. Whether they're frame-based sprites, webGL particles, static images or textfields, they all can be moved in the game world and placed in the scene graph.
+
+####Entity/Component system
+Each gameobject is an "Entity" and can have "components" attached to it. Components are small pieces of code that do something useful. For instance the arcade physics system is implmented as a component. If you want your game object to use physics, simply attach a physics component to it. Some of the standard gameobjects have components such as animation already attached. You can also write your own components.
+
+####Scenegraph (Grouping objects)
+The scenegraph represents all of the gameobjects that visible in your gameworld. You can group objects, and place groups within groups. You can animate and move your objects and groups and they'll behave in a consistent manner depending on how they are nested.
+
+####Animation
+Sprites have an animation component that enables frame by animation from spritesheets and texture atlases. You can easily define frame sequences and frame lengths, play, pause, loop and reverse animations. There is also a built in tweening system.
+
+####Input (Including Touch)
+Kiwi.js supports input for mouse, keyboard and of course touch. Mouse and touch events are easily handled by Kiwi.js pointer objects, so in most cases you don't have to worry about where the input is coming from.
+
+####Camera 
+Your game world is viewed through a controllable camera, which you can move and spin.
+
+####Tilemaps
+Kiwi.js has support for tilemaps, including multiple tile layers. The Tiled map data format is supported, including isometric tiles. You can programatically generate tile maps, and once a tile map is created you can easily manipulate the data to change the tilemap dynamically.
+
+####Audio
+Kiwi.js supports the WebAudio api, and falls back to using <audio> tag when it is not available. Audio sprites are also supported, unless of course your device happens to be some weird futuristic gheto blaster.
+
+####Monitization
+As fellow game developers we know what it is like to be hungry, shivering on the corner holding a can of change in one hand and a damp “will code for cash” cardboard sign in the other. 
+
+Because of this, creating an In-App Purchasing Plugin to allow you to monetize your games was a top priority and is available now.
+
+[CocoonJS](https://www.ludei.com/) users can easily sell add a virtual currency to consumable goods via the AppStore
+
+
+####Plugin System
+As part of our dedication to open source principles, the plugin system lets developers extend many aspects of Kiwi.js. The rules around creating them are unobtrusive, making plugins easy to create and attach. Plugins will soon be able to be sold in the upcoming Kiwi.js marketplace.
+
+####Integration with powerful tools
+Kiwi.js is part of a larger ecosystem of products which will enable you to create games and game content using specialised tools such as the Gamefroot cloud based game building solution. [Because you can never get enough power](https://www.youtube.com/watch?v=YQwYNca4iog) 
+
+
+
+##Getting Started
+
+![Splash](http://kiwi-js.s3.amazonaws.com/html5-conference-game.png)
+
+There are several ways to get started, starting from scratch is the generally accepted way to go about this, but if you want to get up and running even faster, Kiwi.js "Blueprint" games will help get your game building experience off to a flying start.
+
+Choose from any of the following:
+- HTML5 match-three game
+- HTML5 top-down game
+- HTML5 dressup game
+- HTML5 breakout game
+- HTML5 roguelike game
+- HTML5 platform game (in dev coming soon)
+- HTML5 crossword (in dev coming soon)
+- HTML5 hidden object (in dev coming soon)
+- HTML5 tower defense (in dev coming soon)
+- HTML5 poker game (in dev coming soon)
+
+There will be an ever increasing library of free and premium blueprints to get you started.
+
+##Starting from scratch
+
+The easiest way to start with a blank game is to take a copy of the `/gameTemplate` folder. This contains a recommnded folder structure and all default files already in place.
+
+You will need to use a web server to open the index file.
+
+A more advanced, but still simple, way to create a blank game is to use the [Kiwi.js Yeoman Generator](https://github.com/gamelab/generator-kiwigame). This will create build files and other goodies for you as well.
+
+
+
+###Viewing the examples
+The `/examples` folder contains a number of basic examples for you to try and to view the source code. In the next minor version of Kiwi.js these will be moved to a separate repo.
+
+You will need to use a php web server to open the index file in the examples folder. This is a temporary arrangement, and when the examples are moved this will no longer be the case.
+
+
 
-* State Management
-* Extensible game objects (such as sprites)
-* Entity/Component system
-* 2D Canvas 
-* 2D WebGL rendering
-* Target Cocoon.js 
-* Full nested display list
-* HTML5 HUD
-* Tween Engine (based on Tween.js)
-* Signals
-* Spritesheets, Texture Atlases and Tilemaps
-* Multitouch support
-* Geometry Utilities
-* Plugin System
-* Arcade Physics
-* File Management and loading
-* Clocks and Timers
-
-##Build
-
-Kiwi.js is currently using Typescript 9.0.1
+###What's in this repo?
+
+Note: If you just want to use the framework, the kiwi.js and kiwi.min.js files are located in the `/build` folder, and the docs in the `/docs` folder, and there is a template game in the `/templateGame` folder. You probably don't need to worry about the rest of the repo! 
+
+###Folders
+
+* build - The kiwi.js and kiwi.min.js files  
+* src - The kiwi.js framework source code
+* docs - API documentation on the Kiwi.JS framework.
+* docstyles - Used to store assets for building docs.
+* examples - These examples are soon to moved to a new repo and updated (See more info below)
+* templateGame - An example TemplateGame to help you on your way to developing a Kiwi.JS game.  
+
+###Files
+
+* .gitignore - mask files from git
+* bower.json - see below about bower installation
+* grunfile.js - used for building the framework
+* license.txt - The MIT license 
+* package.json - the npm package used for installing dev dependencies
+* README.md - this file!
+* tslint.json - the tslint configuration file
+
+
+![Splash](http://html5experts.jp/wp-content/uploads/2013/11/image05.png)
+
+##Getting and building the library
+
+###Bower
+If you use the [Bower](http://bower.io/) package manager you can install kiwi.js with
+```
+bower install kiwijs
+```
+
+###Yeoman
+If you use the [Yeoman](https://github.com/gamelab/generator-kiwigame) scaffolding system you can install a blank kiwi.js game with
+
+```
+yo kiwijs
+```
+
+It's best to look at our Yeoman Game Generator repo for full details.
+
+
+###Using Grunt
+
+
+This requires installing node.js, and the grunt CLI package. 
+There are a few thing you can do with grunt, including linting and compiling the typescript, uglifying the result and compiling the docs.
+
+To build, lint and uglify use the default
+```
+grunt
+```
+
+To do all of the above plus compile the docs
+```
+grunt full
+```
+
+To just build the docs
+```
+grunt docs
+```
+
+The csproj and grunt compilation methods both output a single kiwi.js file in `/build`
+Grunt will also create a min.js version and also output a kiwi.d.ts definition file in `/build` as well
+
+###Building Kiwi manually
+
+You don't need to build the library to use it. The repo has prebuilt files in the `/build` folder.
+
+Kiwi.js is currently using Typescript 0.9.5
 Either - use Visual Studio/TS extension. There are csproj files for both the main project and also the examples.
-Or - use the grunt file. This requires installing node.js, and the grunt CLI package. 
 
-The csproj and grunt compilation methods both output a single kiwi.js file in /build
-Grunt will also create a min.js version and also output a kiwi.d.ts definition file in /build as well
+##Extending Kiwi.js
+
+You want Plugins? [We got Plugins!](http://www.kiwijs.org/documentation/kiwi-js-plugin-tutorials/).
+
+The concept of Plugins, and how they might apply to game creation, is something we're very interested in. Years of working in the open source space and hacking open source tools has provided us with the qualifications necessary to create a system that works for you.
+
+We built from the ground up as a plugable system. You can add multiple plugins to your game, or write plugins yourself. Soon, you'll even be able to sell your own plugins in the Kiwi.js marketplace.
+
+Kiwi.js is built in such a way that your plugins can do very simple or very powerful things. For example:
+
+
+- A utility plugin, such as an inventory for keeping track of items a player has collected.
+- A gameobject plugin, that creates programmable tower defense unit.
+- A component plugin, such as a specialised physics system that can be applied to any gameobject.
+- A rendering plugin, that creates new renderers and WebGL shaders that give your game an entirely different look.
+- A service plugin, such as an ad-network or in-app purchasing system.
+- Stop your bathtub from automatically draining whenever you try to take a bath.
+
+To learn about building Plugins view the tutorials on [kiwijs.org](http://www.kiwijs.org/documentation/tutorials/what-are-plugins-in-kiwi-js/). You can also get started with Plugins using the Kiwi.js [Yeoman Plugin Generator](https://github.com/gamelab/generator-kiwiplugin). 
+
+
+##Tools
+
+### Visual Game Maker
+Gamefroot is the worlds most powerful and easy to use browser-based game editor.
 
-##Folders
+We've partnered with [Gamefroot](http://gamefroot.com/leveleditor) and we're pleased to let you know that Kiwi.js integration is in development and coming your way soon.
 
-* build  
-* src  
-* docs - API documentation on the Kiwi.JS engine.
-* examples 
-* templateGame - An example TemplateGame to help you on your way to developing a Kiwi.JS game.   
+Stay tuned for more updates and more tools!
 
-##Contribute
+##Roadmap
 
-We'd love you to get involved in making the Kiwi.JS game engine the best damn game framework in the world! If you'd like to contribute please get in touch, fork/clone the repo and have a dig around. Make pull requests on the dev branch.
+Here are some of the features planned for future release.
 
-If you discover a bug or find yourself just wanting to jump on in and help make this blueprint even better please file an issue and get stuck in. We're a friendly bunch and hope people find themselves wanting to get involved. 
+####Version 2.0 "Bushnell"
+
+- Multiplayer capability (yup, thats right!)
+- WebGL lighting
+- Tools!
+- New Physics engine 
+
+##Contributing
+
+We'd love for you to get involved and help make Kiwi.js the best damn game framework in the world! If you'd like to contribute please get in touch, fork/clone the repo and have a dig around.
+
+- If you find a bug then please report it on GitHub issues
+- If you have feature request, or have written a game or demo that shows Kiwi in use then please get in touch. We'd love to hear from you! Please email: dan@gamefroot.com
+- If you have a pull request for Kiwi, please only do so against the dev branch and not against the master branch. 
+- Before submitting a Pull Request please run your code through JSHint to check for stylistic or formatting errors.
+
+##Bugs?
+
+If you discover a bug and find yourself wanting to jump in and help make the world of HTML5 gaming a better, less buggy, place, please add said bug to our issues tracker with as much information as possible, especially source code demonstrating the issue.
 
 https://github.com/gamelab/kiwi.js/issues/new
 
-##Core Contributors
+##Community
 
-Ross Kettle  
-Ben Harding  
-Richard Davey  
+A massive shoutout to our contributors!
+
+- Ross Kettle
+- Ben Harding
+- Phil Wickliffe
+- Zach Frieberg
+- Locky Reid
+- Ido Yehieli
+
+*Kiwi.js also uses code from a number of open source projects. Effort has been made to clearly identify authors in the code comments. If you notice and missing or incorrect attribution please let us know.*
+
+
+##License
 
-Kiwi.JS also uses code from a number of open source projects. Effort has been made to clearly identify authors in the code comments. If you notice and missing or incorrect attribution please let us know.    
+* MIT
\ No newline at end of file
diff --git a/build/kiwi.js b/build/kiwi.js
index a6132d6..c3249e5 100644
--- a/build/kiwi.js
+++ b/build/kiwi.js
@@ -29811,7 +29811,7 @@ var Kiwi;
     * @type string
     * @public
     */
-    Kiwi.VERSION = "0.7.0";
+    Kiwi.VERSION = "1.0.0";
 
     //DIFFERENT RENDERER STATIC VARIABLES
     /**
diff --git a/build/kiwi.min.js b/build/kiwi.min.js
index 09a104a..526800c 100644
--- a/build/kiwi.min.js
+++ b/build/kiwi.min.js
@@ -3,8 +3,8 @@ var Kiwi;!function(a){var b=function(){function b(b,c,d,e){"undefined"==typeof b
 var g=[];if(!(b>this.width||c>this.height)){0>b&&(b=0),0>c&&(c=0),b+d>this.width&&(d=this.width-b),c+e>this.height&&(e=this.height-c);for(var h=c;c+e>h;h++)for(var i=b;b+d>i;i++){var j=this.getIndexFromXY(i,h);if(-1!==j){var k=this.tileData[j];(this.tilemap.tileTypes[k].allowCollisions&f)!==a.Components.ArcadePhysics.NONE&&g.push({index:j,type:k,x:i*this.tileWidth,y:h*this.tileHeight})}}return g}},c.prototype.update=function(){b.prototype.update.call(this),this.physics.update()},c.prototype._calculateBoundaries=function(b){if(this.orientation==a.GameObjects.Tilemap.ORTHOGONAL){var c=1/this.scaleX,d=1/this.scaleY;return this._maxX=Math.min(Math.ceil(b.width/this.tileWidth)+1,this.width)*c,this._maxY=Math.min(Math.ceil(b.height/this.tileHeight)+1,this.height)*d,this._startX=Math.floor((-b.transform.x-this.transform.worldX)/this.tileWidth*c),this._startY=Math.floor((-b.transform.y-this.transform.worldY)/this.tileHeight*d),this._startX<0&&(this._startX=0),this._startY<0&&(this._startY=0),this._maxX>this.width&&(this._maxX=this.width),this._maxY>this.height&&(this._maxY=this.height),this._startX+this._maxX>this.width&&(this._maxX=this.width-this._startX),this._startY+this._maxY>this.height&&(this._maxY=this.height-this._startY),void 0}this.orientation==a.GameObjects.Tilemap.ISOMETRIC&&(this._startX=0,this._startY=0,this._maxX=this.width,this._maxY=this.height)},c.prototype.chartToScreen=function(a,b,c){return{x:a.x*b-a.y*b,y:a.x*c/2+a.y*c/2}},c.prototype.screenToChart=function(a,b,c){var d=Math.floor(a.x/b),e=Math.floor((a.y-d*(c/2))/c);return{x:d+e,y:e}},c.prototype.render=function(b){if(!(this.visible===!1||this.alpha<.1||this.exists===!1)){var c=this.game.stage.ctx;c.save(),this.alpha>0&&this.alpha<=1&&(c.globalAlpha=this.alpha);var d=this.transform,e=d.getConcatenatedMatrix();c.transform(e.a,e.b,e.c,e.d,e.tx+d.rotPointX-b.transform.rotPointX,e.ty+d.rotPointY-b.transform.rotPointY),this._calculateBoundaries(b,e);for(var f=this._startY;f<this._startY+this._maxY;f++)for(var g=this._startX;g<this._startX+this._maxX;g++)if((this._temptype=this.getTileFromXY(g,f))&&-1!==this._temptype.cellIndex){var h,i,j=this.atlas.cells[this._temptype.cellIndex];if(this.orientation==a.GameObjects.Tilemap.ISOMETRIC){var k=(this._temptype.offset.x,this._temptype.offset.y,this.tileWidth*(2*this.width-1),this.tileHeight*this.height,this.tileWidth/2),l=this.chartToScreen({x:g,y:f},this.tileWidth/2,this.tileHeight);h=l.x+this._temptype.offset.x-k,i=l.y-(j.h-this.tileHeight)+this._temptype.offset.y}else h=g*this.tileWidth+this._temptype.offset.x,i=f*this.tileHeight-(j.h-this.tileHeight)+this._temptype.offset.y;c.drawImage(this.atlas.image,j.x,j.y,j.w,j.h,h,i,j.w,j.h)}return c.restore(),!0}},c.prototype.renderGL=function(b,c,d){"undefined"==typeof d&&(d=null);var e=[],f=new a.Geom.Point,g=new a.Geom.Point,h=new a.Geom.Point,i=new a.Geom.Point,j=this.transform,k=j.getConcatenatedMatrix();this._calculateBoundaries(c,k);for(var l=this._startY;l<this._startY+this._maxY;l++)for(var m=this._startX;m<this._startX+this._maxX;m++)if(this._temptype=this.getTileFromXY(m,l),-1!=this._temptype.cellIndex){var n,o,p=this.atlas.cells[this._temptype.cellIndex];if(this.orientation==a.GameObjects.Tilemap.ISOMETRIC){var q=(this._temptype.offset.x,this._temptype.offset.y,this.tileWidth*(2*this.width-1),this.tileHeight*this.height,this.tileWidth/2),r=this.chartToScreen({x:m,y:l},this.tileWidth/2,this.tileHeight);n=r.x+this._temptype.offset.x-q,o=r.y+this._temptype.offset.y}else n=m*this.tileWidth+this._temptype.offset.x,o=l*this.tileHeight+this._temptype.offset.y;f.setTo(n-j.rotPointX,o-j.rotPointY-(p.h-this.tileHeight)),g.setTo(n+p.w-j.rotPointX,o-j.rotPointY-(p.h-this.tileHeight)),h.setTo(n+p.w-j.rotPointX,o+p.h-j.rotPointY-(p.h-this.tileHeight)),i.setTo(n-j.rotPointX,o+p.h-j.rotPointY-(p.h-this.tileHeight)),f=k.transformPoint(f),g=k.transformPoint(g),h=k.transformPoint(h),i=k.transformPoint(i),e.push(f.x+j.rotPointX,f.y+j.rotPointY,p.x,p.y,this.alpha,g.x+j.rotPointX,g.y+j.rotPointY,p.x+p.w,p.y,this.alpha,h.x+j.rotPointX,h.y+j.rotPointY,p.x+p.w,p.y+p.h,this.alpha,i.x+j.rotPointX,i.y+j.rotPointY,p.x,p.y+p.h,this.alpha)}this.glRenderer.concatBatch(e)},c}(a.Entity);b.TileMapLayer=c}(b.Tilemap||(b.Tilemap={}));b.Tilemap}(a.GameObjects||(a.GameObjects={}));a.GameObjects}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(b){function c(c,d){if("undefined"==typeof d&&(d=!0),b.call(this,c,"Animation"),this.currentAnimation=null,this.entity=c,this._atlas=this.entity.atlas,this._animations={},1==d)for(var e=0;e<this._atlas.sequences.length;e++)this.createFromSequence(this._atlas.sequences[e],!1);if(this._animations["default"])this.currentAnimation=this._animations["default"];else{for(var f=[],e=0;e<this._atlas.cells.length;e++)f.push(e);this.currentAnimation=this.add("default",f,.1,!0,!1)}this.onChange=new a.Signal,this.onPlay=new a.Signal,this.onStop=new a.Signal,this.onUpdate=new a.Signal}return __extends(c,b),Object.defineProperty(c.prototype,"isPlaying",{get:function(){return this.currentAnimation.isPlaying},enumerable:!0,configurable:!0}),c.prototype.objType=function(){return"AnimationManager"},c.prototype.add=function(b,c,d,e,f,g){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),"undefined"==typeof g&&(g=!0);var h=new a.Animations.Sequence(b,c,d,e);return 1==g&&this._atlas.sequences.push(h),this.createFromSequence(h,f)},c.prototype.createFromSequence=function(b,c){return"undefined"==typeof c&&(c=!1),this._animations[b.name]=new a.Animations.Animation(b.name,b,this.entity.clock,this),c&&this.play(b.name),this._animations[b.name]},c.prototype.play=function(a,b){return"undefined"==typeof a&&(a=this.currentAnimation.name),"undefined"==typeof b&&(b=!0),0==b&&this.currentAnimation.name===a&&1==this.currentAnimation.isPlaying?this.currentAnimation:this._play(a)},c.prototype.playAt=function(a,b){return"undefined"==typeof b&&(b=this.currentAnimation.name),this._play(b,a)},c.prototype._play=function(a,b){return"undefined"==typeof b&&(b=null),this._setCurrentAnimation(a),null!==b?this.currentAnimation.playAt(b):this.currentAnimation.play(),this.onPlay.dispatch(this.currentAnimation),this.updateCellIndex(),this.currentAnimation},c.prototype.stop=function(){this.isPlaying===!0&&(this.currentAnimation.stop(),this.onStop.dispatch(this.currentAnimation))},c.prototype.pause=function(){this.currentAnimation.pause()},c.prototype.resume=function(){this.currentAnimation.resume()},c.prototype.switchTo=function(a,b){"undefined"==typeof b&&(b=null);var c=!1;switch(typeof a){case"string":this.currentAnimation.name!==a&&(this._setCurrentAnimation(a),c=!0);break;case"number":this.currentAnimation.frameIndex=a,c=!0}(b||null===b&&this.isPlaying&&c)&&this.play(),0==b&&this.isPlaying&&this.stop(),this.updateCellIndex()},c.prototype.nextFrame=function(){this.currentAnimation.nextFrame(),this.updateCellIndex()},c.prototype.prevFrame=function(){this.currentAnimation.prevFrame(),this.updateCellIndex()},c.prototype._setCurrentAnimation=function(a){this.currentAnimation.name!==a&&(null!==this.currentAnimation&&this.currentAnimation.stop(),this._animations[a]&&(this.currentAnimation=this._animations[a],this.onChange.dispatch(a,this.currentAnimation)))},c.prototype.update=function(){this.currentAnimation&&this.currentAnimation.update()},Object.defineProperty(c.prototype,"currentCell",{get:function(){return this.currentAnimation.currentCell},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"frameIndex",{get:function(){return this.currentAnimation.frameIndex},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"length",{get:function(){return this.currentAnimation.length},enumerable:!0,configurable:!0}),c.prototype.getAnimation=function(a){return this._animations[a]},c.prototype.updateCellIndex=function(){"undefined"!=typeof this.currentAnimation&&(this.onUpdate.dispatch(this.currentAnimation),this.entity.cellIndex=this.currentAnimation.currentCell)},c.prototype.destroy=function(){b.prototype.destroy.call(this);for(var a in this._animations)this._animations[a].destroy(),delete this._animations[a];delete this._animations,delete this.currentAnimation,delete this._atlas},c}(a.Component);b.AnimationManager=c}(a.Components||(a.Components={}));a.Components}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(b){function c(c,d,e,f,g){"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),"undefined"==typeof g&&(g=0),b.call(this,c,"Box"),this.autoUpdate=!0,this.entity=c,this.dirty=!0,this._rawBounds=new a.Geom.Rectangle(d,e,f,g),this._rawCenter=new a.Geom.Point(d+f/2,e+g/2),this._rawHitbox=new a.Geom.Rectangle,this._hitboxOffset=new a.Geom.Point,this.hitbox=new a.Geom.Rectangle(0,0,f,g),this.autoUpdate=!0}return __extends(c,b),c.prototype.objType=function(){return"Box"},Object.defineProperty(c.prototype,"hitboxOffset",{get:function(){return this.dirty&&1==this.autoUpdate&&null!==this.entity.atlas&&(this._hitboxOffset.x=this.entity.atlas.cells[this.entity.cellIndex].hitboxes[0].x,this._hitboxOffset.y=this.entity.atlas.cells[this.entity.cellIndex].hitboxes[0].y),this._hitboxOffset},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"rawHitbox",{get:function(){if(this.dirty&&(this._rawHitbox.x=this.rawBounds.x+this.hitboxOffset.x,this._rawHitbox.y=this.rawBounds.y+this.hitboxOffset.y,1==this.autoUpdate)){var a=this.entity.atlas;null!==a&&(this._rawHitbox.width=a.cells[this.entity.cellIndex].hitboxes[0].w,this._rawHitbox.height=a.cells[this.entity.cellIndex].hitboxes[0].h)}return this._rawHitbox},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"hitbox",{get:function(){return this.dirty&&(this._transformedHitbox=this._rotateHitbox(this.rawHitbox.clone())),this._transformedHitbox},set:function(a){this._hitboxOffset.x=a.x,this._hitboxOffset.y=a.y,this._rawHitbox=a,this._rawHitbox.x+=this._rawBounds.x,this._rawHitbox.y+=this._rawBounds.y,this.autoUpdate=!1},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"worldHitbox",{get:function(){return this.dirty&&(this._worldHitbox=this._rotateHitbox(this.rawHitbox.clone(),!0)),this._worldHitbox},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"rawBounds",{get:function(){return this.dirty&&(this._rawBounds.x=this.entity.x,this._rawBounds.y=this.entity.y,this._rawBounds.width=this.entity.width,this._rawBounds.height=this.entity.height),this._rawBounds},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"rawCenter",{get:function(){return this.dirty&&(this._rawCenter.x=this.rawBounds.x+this.rawBounds.width/2,this._rawCenter.y=this.rawBounds.y+this.rawBounds.height/2),this._rawCenter},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"center",{get:function(){if(this.dirty){var b=this.entity.transform,c=b.getConcatenatedMatrix();c.setTo(c.a,c.b,c.c,c.d,b.x+b.rotPointX,b.y+b.rotPointY),this._transformedCenter=c.transformPoint(new a.Geom.Point(this.entity.width/2-b.rotPointX,this.entity.height/2-b.rotPointY))}return this._transformedCenter},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"bounds",{get:function(){return this.dirty&&(this._transformedBounds=this._rotateRect(this.rawBounds.clone())),this._transformedBounds},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"worldBounds",{get:function(){return this.dirty&&(this._worldBounds=this._rotateRect(this.rawBounds.clone(),!0)),this._worldBounds},enumerable:!0,configurable:!0}),c.prototype._rotateRect=function(b,c){"undefined"==typeof c&&(c=!1);var d=new a.Geom.Rectangle,e=this.entity.transform,f=e.getConcatenatedMatrix();return c?f.setTo(f.a,f.b,f.c,f.d,e.worldX+e.rotPointX,e.worldY+e.rotPointY):f.setTo(f.a,f.b,f.c,f.d,e.x+e.rotPointX,e.y+e.rotPointY),d=this.extents(f.transformPoint({x:-e.rotPointX,y:-e.rotPointY}),f.transformPoint({x:-e.rotPointX+b.width,y:-e.rotPointY}),f.transformPoint({x:-e.rotPointX+b.width,y:-e.rotPointY+b.height}),f.transformPoint({x:-e.rotPointX,y:-e.rotPointY+b.height}))},c.prototype._rotateHitbox=function(b,c){"undefined"==typeof c&&(c=!1);var d=new a.Geom.Rectangle,e=this.entity.transform,f=e.getConcatenatedMatrix();return c?f.setTo(f.a,f.b,f.c,f.d,e.worldX+e.rotPointX,e.worldY+e.rotPointY):f.setTo(f.a,f.b,f.c,f.d,e.x+e.rotPointX,e.y+e.rotPointY),d=this.extents(f.transformPoint({x:-e.rotPointX+this._hitboxOffset.x,y:-e.rotPointY+this._hitboxOffset.y}),f.transformPoint({x:-e.rotPointX+b.width+this._hitboxOffset.x,y:-e.rotPointY+this._hitboxOffset.y}),f.transformPoint({x:-e.rotPointX+b.width+this._hitboxOffset.x,y:-e.rotPointY+b.height+this._hitboxOffset.y}),f.transformPoint({x:-e.rotPointX+this._hitboxOffset.x,y:-e.rotPointY+b.height+this._hitboxOffset.y}))},c.prototype.draw=function(a){var b=this.entity.transform;a.strokeStyle="red",a.strokeRect(this.rawBounds.x,this.rawBounds.y,this.rawBounds.width,this.rawBounds.height),a.fillRect(this.rawCenter.x-1,this.rawCenter.y-1,3,3),a.strokeRect(b.x+b.rotPointX-3,b.y+b.rotPointY-3,7,7),a.strokeStyle="blue",a.strokeRect(this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height),a.strokeStyle="green",a.strokeRect(this.hitbox.x,this.hitbox.y,this.hitbox.width,this.hitbox.height),a.strokeStyle="white",a.strokeRect(this.rawHitbox.x,this.rawHitbox.y,this.rawHitbox.width,this.rawHitbox.height)},c.prototype.extents=function(b,c,d,e){var f=Math.min(b.x,c.x,d.x,e.x),g=Math.max(b.x,c.x,d.x,e.x),h=Math.min(b.y,c.y,d.y,e.y),i=Math.max(b.y,c.y,d.y,e.y);return new a.Geom.Rectangle(f,h,g-f,i-h)},c.prototype.destroy=function(){b.prototype.destroy.call(this),delete this.entity},c}(a.Component);b.Box=c}(a.Components||(a.Components={}));a.Components}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(b){function c(c,d,e){"undefined"==typeof e&&(e=!1),b.call(this,c,"Input"),this._isDragging=null,this._dragEnabled=!1,this._dragSnapToCenter=!1,this._nowDown=null,this._nowUp=null,this._nowEntered=null,this._nowLeft=null,this._nowDragging=null,this._onEntered=new a.Signal,this._onLeft=new a.Signal,this._onDown=new a.Signal,this._onUp=new a.Signal,this._onDragStarted=new a.Signal,this._onDragStopped=new a.Signal,this._box=d,this._distance=new a.Geom.Point,this._withinBounds=null,this._outsideBounds=!0,this._isUp=!0,this._isDown=null,this._isDragging=null,this._justEntered=!1,this._tempDragDisabled=!1,this._tempPoint=new a.Geom.Point,this._tempCircle=new a.Geom.Circle(0,0,0),this.enabled=e}return __extends(c,b),c.prototype.objType=function(){return"Input"},Object.defineProperty(c.prototype,"onEntered",{get:function(){return 0==this.enabled&&(this.enabled=!0),this._onEntered},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onLeft",{get:function(){return 0==this.enabled&&(this.enabled=!0),this._onLeft},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onDown",{get:function(){return 0==this.enabled&&(this.enabled=!0),this._onDown},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onUp",{get:function(){return 0==this.enabled&&(this.enabled=!0),this._onUp},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onDragStarted",{get:function(){return this._onDragStarted},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onDragStopped",{get:function(){return this._onDragStopped},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onRelease",{get:function(){return this.onUp},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onPress",{get:function(){return this.onDown},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"enabled",{get:function(){return this._enabled},set:function(a){this._enabled=a},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isDown",{get:function(){return null!==this._isDown},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isUp",{get:function(){return this._isUp},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"withinBounds",{get:function(){return null!==this._withinBounds},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"outsideBounds",{get:function(){return this._outsideBounds},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isDragging",{get:function(){return null!==this._isDragging},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"dragDistance",{get:function(){return this._dragDistance},set:function(a){this._dragDistance=a},enumerable:!0,configurable:!0}),c.prototype.enableDrag=function(a,b){"undefined"==typeof a&&(a=!1),"undefined"==typeof b&&(b=1),0==this.enabled&&(this.enabled=!0),this._dragEnabled=!0,this._dragSnapToCenter=a,this._dragDistance=b,this._isDragging=null},c.prototype.disableDrag=function(){this._dragEnabled=!1,this._isDragging=null},c.prototype.update=function(){this.enabled!==!1&&this.game&&this.owner.active!==!1&&this.owner.willRender!==!1&&(this._nowDown=null,this._nowUp=null,this._nowEntered=null,this._nowLeft=null,this._nowDragging=null,a.DEVICE.touch?this._updateTouch():this._updateMouse(),this.isDragging&&(this._tempPoint=this.game.cameras.defaultCamera.transformPoint(this._isDragging.point),this._dragSnapToCenter===!1?(this.owner.transform.x=a.Utils.GameMath.snapTo(this._tempPoint.x-this._box.hitboxOffset.x-this._distance.x,this._dragDistance),this.owner.transform.y=a.Utils.GameMath.snapTo(this._tempPoint.y-this._box.hitboxOffset.y-this._distance.y,this._dragDistance)):(this.owner.transform.x=a.Utils.GameMath.snapTo(this._tempPoint.x-this._box.hitboxOffset.x-this._box.worldHitbox.width/2,this._dragDistance),this.owner.transform.y=a.Utils.GameMath.snapTo(this._tempPoint.y-this._box.hitboxOffset.y-this._box.worldHitbox.height/2,this._dragDistance))))},c.prototype._updateTouch=function(){for(var a=0;a<this.game.input.touch.maximumPointers;a++)this.game.input.touch.fingers[a].active===!0?this._evaluateTouchPointer(this.game.input.touch.fingers[a]):this.isDown===!0&&this._isDown.id===this.game.input.touch.fingers[a].id?this._nowUp=this.game.input.touch.fingers[a]:this.isDown===!1&&null===this._nowUp&&this.withinBounds===!0&&this._withinBounds.id===this.game.input.touch.fingers[a].id&&(this._nowUp=this.game.input.touch.fingers[a]);null!==this._nowEntered&&this.withinBounds===!1&&(this._withinBounds=this._nowEntered,this._outsideBounds=!1,this._onEntered.dispatch(this.owner,this._nowEntered)),null!==this._nowLeft&&this.withinBounds===!0&&(this._withinBounds=null,this._outsideBounds=!0,this._onLeft.dispatch(this.owner,this._nowLeft)),null!==this._nowDown&&this.isDown===!1&&(this._onDown.dispatch(this.owner,this._nowDown),this._isDown=this._nowDown,this._isUp=!1,this._withinBounds=this._nowDown,this._outsideBounds=!1),1==this._dragEnabled&&this.isDragging===!1&&null!==this._nowDragging&&(this._onDragStarted.dispatch(this.owner,this._nowDragging),this._isDragging=this._nowDragging),null!==this._nowUp&&(this._onUp.dispatch(this.owner,this._nowUp),this._isDown=null,this._isUp=!0,this._withinBounds=null,this._outsideBounds=!0,this.isDragging===!0&&this._isDragging.id==this._nowUp.id&&(this._isDragging=null,this._onDragStopped.dispatch(this.owner,this._nowUp)))},c.prototype._evaluateTouchPointer=function(b){(this.isDown===!1||this._isDown.id===b.id)&&(this._tempPoint=this.game.cameras.defaultCamera.transformPoint(b.point),this._tempCircle.setTo(this._tempPoint.x,this._tempPoint.y,b.circle.diameter),a.Geom.Intersect.circleToRectangle(this._tempCircle,this._box.worldHitbox).result?((this.isDown===!0&&this._isDown.id===b.id||this.isDown===!1&&b.duration>1)&&(this._nowEntered=b),this.isDown===!1&&b.frameDuration<2&&(this._nowDown=b),this._dragEnabled&&0==this.isDragging&&1==this.isDown&&(this._distance.x=this._tempPoint.x-this._box.worldHitbox.left,this._distance.y=this._tempPoint.y-this._box.worldHitbox.top,this._nowDragging=b)):this.isDown===!0?this._nowLeft=b:this.withinBounds===!0&&this._withinBounds.id==b.id&&(this._nowLeft=b))},c.prototype._updateMouse=function(){this._evaluateMousePointer(this.game.input.mouse.cursor),null!==this._nowLeft&&this._onLeft.dispatch(this.owner,this._nowLeft),null!==this._nowEntered&&this._onEntered.dispatch(this.owner,this._nowEntered),null!==this._nowDown&&this.isDown===!1&&(this._onDown.dispatch(this.owner,this._nowDown),this._isDown=this._nowDown,this._isUp=!1),1==this._dragEnabled&&this.isDragging===!1&&null!==this._nowDragging&&(this._onDragStarted.dispatch(this.owner,this._nowDragging),this._isDragging=this._nowDragging),this.isDown===!0&&null!==this._nowUp&&this._isDown.id===this._nowUp.id&&(this._onUp.dispatch(this.owner,this._nowUp),this.isDragging===!0&&this._isDragging.id==this._nowUp.id&&(this._isDragging=null,this._onDragStopped.dispatch(this.owner,this._nowUp)),this._isDown=null,this._isUp=!0)},c.prototype._evaluateMousePointer=function(b){this._tempPoint=this.game.cameras.defaultCamera.transformPoint(b.point),a.Geom.Intersect.pointToRectangle(this._tempPoint,this._box.worldHitbox).result?(this._dragEnabled&&this.isDragging===!1&&(this._distance.x=this._tempPoint.x-this._box.worldHitbox.left,this._distance.y=this._tempPoint.y-this._box.worldHitbox.top),this.withinBounds===!1&&(this._nowEntered=b,this._withinBounds=b,this._outsideBounds=!1,this._justEntered=!0)):this.withinBounds===!0&&this.isDragging===!1&&(this._nowLeft=b,this._withinBounds=null,this._outsideBounds=!0),b.isDown===!0?(this._justEntered&&(this._isDown=b,this._isUp=!1,this._tempDragDisabled=!0),this.withinBounds===!0&&this.isDown===!1&&null===this._nowDown&&(this._nowDown=b),this._dragEnabled===!0&&0==this.isDragging&&this._tempDragDisabled===!1&&1==this.isDown&&(this._nowDragging=b)):(this._tempDragDisabled===!0&&(this._tempDragDisabled=!1),this.isDown===!0&&(this._nowUp=b)),this._justEntered&&(this._justEntered=!1)},c.prototype.destroy=function(){b.prototype.destroy.call(this),this.enabled=!1,delete this._box,delete this._isDown,delete this._isUp,delete this._isDragging,delete this._dragEnabled,this._onDown&&this._onDown.dispose(),delete this._onDown,this._onDragStarted&&this._onDragStarted.dispose(),delete this._onDragStarted,this._onUp&&this._onUp.dispose(),delete this._onUp,this._onLeft&&this._onLeft.dispose(),delete this._onLeft,this._onEntered&&this._onEntered.dispose(),delete this._onEntered,this._onDragStopped&&this._onDragStopped.dispose(),delete this._onDragStopped,delete this._dragDistance},c}(a.Component);b.Input=c}(a.Components||(a.Components={}));a.Components}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(a){function b(b){a.call(this,b,"Sound"),this._audio=[]}return __extends(b,a),b.prototype.objType=function(){return"Sound"},b.prototype.addSound=function(a,b,c,d){if("undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=!1),1!=this._validate(a)){var e=this.game.audio.add(b,c,d);return this._audio[a]=e,e}},b.prototype.removeSound=function(a){0!=this._validate(a)&&(this._audio[a].stop(),this._audio[a].destroy(),delete this._audio[a])},b.prototype.getSound=function(a){return 0!=this._validate(a)?this._audio[a]:void 0},b.prototype._validate=function(a){return void 0===this._audio[a]?!1:!0},b.prototype.play=function(a){0!=this._validate(a)&&this._audio[a].play()},b.prototype.stop=function(a){0!=this._validate(a)&&this._audio[a].stop()},b.prototype.pause=function(a){0!=this._validate(a)&&this._audio[a].pause()},b.prototype.resume=function(a){0!=this._validate(a)&&this._audio[a].resume()},b.prototype.destroy=function(){a.prototype.destroy.call(this);for(var b in this._audio)this._audio[b].stop(),this._audio[b].destroy(),delete this._audio[b];delete this._audio},b}(a.Component);b.Sound=c}(a.Components||(a.Components={}));a.Components}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(b){function c(d,e){b.call(this,d,"ArcadePhysics"),this._callbackFunction=null,this._callbackContext=null,this.parent=d,this.box=e,this.transform=this.parent.transform,this.last=new a.Geom.Point(this.transform.worldX,this.transform.worldY),this.mass=1,this.elasticity=0,this.immovable=!1,this.moves=!0,this.touching=c.NONE,this.wasTouching=c.NONE,this.allowCollisions=c.ANY,this.velocity=new a.Geom.Point,this.acceleration=new a.Geom.Point,this.drag=new a.Geom.Point,this.maxVelocity=new a.Geom.Point(1e4,1e4),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e4}return __extends(c,b),c.prototype.isTouching=function(a){return(this.touching&a)==a},c.prototype.solid=function(a){return void 0!==a&&(this.allowCollisions=a?c.ANY:c.NONE),(this.allowCollisions&c.ANY)>c.NONE},c.prototype.setCallback=function(a,b){this._callbackFunction=a,this._callbackContext=b},c.separate=function(a,b){var c=this.separateX(a,b),d=this.separateY(a,b);return c||d},c.separateX=function(b,d){var e=b.components.getComponent("ArcadePhysics"),f=d.components.getComponent("ArcadePhysics");if(e.immovable&&f.immovable)return!1;var g=0,h=e.transform.worldX-e.last.x,i=f.transform.worldX-f.last.x;if(h==i)return!1;var j=h>0?h:-h,k=i>0?i:-i,l=e.box.worldHitbox,m=f.box.worldHitbox,n=new a.Geom.Rectangle(l.x-(h>0?h:0),e.last.y+e.box.hitboxOffset.y,l.width+(h>0?h:-h),l.height),o=new a.Geom.Rectangle(m.x-(i>0?i:0),f.last.y+f.box.hitboxOffset.y,m.width+(i>0?i:-i),m.height);if(n.x+n.width>o.x&&n.x<o.x+o.width&&n.y+n.height>o.y&&n.y<o.y+o.height){var p=j+k+c.OVERLAP_BIAS;h>i?(g=l.x+l.width-m.x,!(g>p)&&e.allowCollisions&c.RIGHT&&f.allowCollisions&c.LEFT?(e.touching|=c.RIGHT,f.touching|=c.LEFT):g=0):(g=l.x-m.width-m.x,!(-g>p)&&e.allowCollisions&c.LEFT&&f.allowCollisions&c.RIGHT?(e.touching|=c.LEFT,f.touching|=c.RIGHT):g=0)}if(0!=g){var q=e.velocity.x,r=f.velocity.x;if(e.immovable||f.immovable)e.immovable?f.immovable||(f.transform.x=f.transform.x+g,f.velocity.x=q-r*f.elasticity):(e.transform.x=e.transform.x-g,e.velocity.x=r-q*e.elasticity);else{g*=.5,e.transform.x=e.transform.x-g,f.transform.x=f.transform.x+g;var s=Math.sqrt(r*r*f.mass/e.mass)*(r>0?1:-1),t=Math.sqrt(q*q*e.mass/f.mass)*(q>0?1:-1),u=.5*(s+t);s-=u,t-=u,e.velocity.x=u+s*e.elasticity,f.velocity.x=u+t*f.elasticity}return!0}return!1},c.separateY=function(b,d){var e=b.components.getComponent("ArcadePhysics"),f=d.components.getComponent("ArcadePhysics");if(e.immovable&&f.immovable)return!1;var g=0,h=e.transform.worldY-e.last.y,i=f.transform.worldY-f.last.y;if(h==i)return!1;var j=h>0?h:-h,k=i>0?i:-i,l=e.box.worldHitbox,m=f.box.worldHitbox,n=new a.Geom.Rectangle(l.x,l.y-(h>0?h:0),l.width,l.height+j),o=new a.Geom.Rectangle(m.x,m.y-(i>0?i:0),m.width,m.height+k);if(n.x+n.width>o.x&&n.x<o.x+o.width&&n.y+n.height>o.y&&n.y<o.y+o.height){var p=j+k+c.OVERLAP_BIAS;if(h>i?(g=l.y+l.height-m.y,!(g>p)&&e.allowCollisions&c.DOWN&&f.allowCollisions&c.UP?(e.touching|=c.DOWN,f.touching|=c.UP):g=0):(g=l.y-m.height-m.y,!(-g>p)&&e.allowCollisions&c.UP&&f.allowCollisions&c.DOWN?(e.touching|=c.UP,f.touching|=c.DOWN):g=0),0!=g){var q=e.velocity.y,r=f.velocity.y;if(e.immovable||f.immovable)e.immovable?f.immovable||(f.transform.y=f.transform.y+g,f.velocity.y=q-r*f.elasticity,b.active&&e.moves&&i>h&&(f.transform.x=f.transform.worldX+b.transform.worldX-e.last.x)):(e.transform.y=e.transform.y-g,e.velocity.y=r-q*e.elasticity,d.active&&f.moves&&h>i&&(e.transform.x=e.transform.worldX+d.transform.worldX-f.last.x));else{g*=.5,e.transform.y=e.transform.y-g,f.transform.y=f.transform.y+g;var s=Math.sqrt(r*r*f.mass/e.mass)*(r>0?1:-1),t=Math.sqrt(q*q*e.mass/f.mass)*(q>0?1:-1),u=.5*(s+t);s-=u,t-=u,e.velocity.y=u+s*e.elasticity,f.velocity.y=u+t*f.elasticity}return!0}}return!1},c.separateTiles=function(a,b,c){if(0==a.components.hasComponent("ArcadePhysics"))return!1;if(a.components.getComponent("ArcadePhysics").immovable)return!1;for(var d=!1,e=!1,f=0;f<c.length;f++){var g=c[f];d||(d=this.separateTilesX(a,b,g)),e||(e=this.separateTilesY(a,b,g))}return d||e},c.separateTilesX=function(b,d,e){var f=b.components.getComponent("ArcadePhysics"),g=d.components.getComponent("ArcadePhysics"),h=f.transform.worldX-f.last.x,i=g.transform.worldX-g.last.x;if(h==i)return!1;var j=h>0?h:-h,k=i>0?i:-i,l=0,m=j+k+c.OVERLAP_BIAS,n=f.box.worldHitbox,o=d.tilemap.tileTypes,p=d.tileData,q=g.transform.worldX+e.x,r=new a.Geom.Rectangle(n.x-(h>0?h:0),f.last.y+f.box.hitboxOffset.y,n.width+(h>0?h:-h),n.height),s=new a.Geom.Rectangle(q-(i>0?i:0),g.last.y+e.y,d.tileWidth+(i>0?i:-i),d.tileHeight);if(r.x+r.width>s.x&&r.x<s.x+s.width&&r.y+r.height>s.y&&r.y<s.y+s.height&&(h>i?(l=n.x+n.width-q,!(l>m)&&f.allowCollisions&c.RIGHT&&o[p[e.index]].allowCollisions&c.LEFT?f.touching|=c.RIGHT:l=0):(l=n.x-d.tileWidth-q,!(-l>m)&&f.allowCollisions&c.LEFT&&o[p[e.index]].allowCollisions&c.RIGHT?f.touching|=c.LEFT:l=0),0!=l)){var t=f.velocity.x,u=g.velocity.x;return f.transform.x=f.transform.x-l,f.velocity.x=u-t*f.elasticity,!0}return!1},c.separateTilesY=function(b,d,e){var f=b.components.getComponent("ArcadePhysics"),g=d.components.getComponent("ArcadePhysics"),h=f.transform.worldY-f.last.y,i=g.transform.worldY-g.last.y;if(h==i)return!1;var j=h>0?h:-h,k=i>0?i:-i,l=0,m=j+k+c.OVERLAP_BIAS,n=f.box.worldHitbox,o=d.tilemap.tileTypes,p=d.tileData,q=d.transform.worldY+e.y,r=new a.Geom.Rectangle(n.x,n.y-(h>0?h:0),n.width,n.height+j),s=new a.Geom.Rectangle(g.transform.worldX+e.x,q-(i>0?i:0),d.tileWidth,d.tileHeight+k);if(r.x+r.width>s.x&&r.x<s.x+s.width&&r.y+r.height>s.y&&r.y<s.y+s.height&&(h>i?(l=n.y+n.height-q,!(l>m)&&f.allowCollisions&c.DOWN&&o[p[e.index]].allowCollisions&c.UP?f.touching|=c.DOWN:l=0):(l=n.y-d.tileHeight-q,!(-l>m)&&f.allowCollisions&c.UP&&o[p[e.index]].allowCollisions&c.DOWN?f.touching|=c.UP:l=0),0!=l)){var t=f.velocity.y,u=g.velocity.y;return f.transform.y=f.transform.y-l,f.velocity.y=u-t*f.elasticity,!0}return!1},c.prototype.overlapsTiles=function(b,d,e){if("undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=a.Components.ArcadePhysics.ANY),this.parent.childType()!==a.TILE_LAYER)return!1;var f=this.parent.getOverlappingTiles(b,e);return f.length>0?(d&&c.separateTiles(b,this.parent,f),!0):!1},c.prototype.overlaps=function(a,b){if("undefined"==typeof b&&(b=!1),0!=a.components.hasComponent("Box")){var d=a.components.getComponent("Box"),e=d.worldHitbox.x+d.worldHitbox.width>this.box.worldHitbox.x&&d.worldHitbox.x<this.box.worldHitbox.x+this.box.worldHitbox.width&&d.worldHitbox.y+d.worldHitbox.height>this.box.worldHitbox.y&&d.worldHitbox.y<this.box.worldHitbox.y+this.box.worldHitbox.height;return e&&(b&&c.separate(this.owner,a),null!==this._callbackFunction&&null!==this._callbackContext&&this._callbackFunction.call(this._callbackContext,this.owner,a)),e}},c.prototype.overlapsGroup=function(b,c){"undefined"==typeof c&&(c=!1);for(var d=!1,e=0;e<b.members.length;e++)b.members[e].childType()===a.GROUP?this.overlapsGroup(b.members[e],c):this.overlaps(b.members[e],c)&&(null!==this._callbackContext&&null!==this._callbackFunction&&this._callbackFunction.call(this._callbackContext,this.owner,b.members[e]),d=!0);return d},c.prototype.overlapsArray=function(b,c){"undefined"==typeof c&&(c=!1);for(var d=!1,e=0;e<b.length;e++)"undefined"!=typeof b[e].childType&&(b[e].childType()==a.GROUP?this.overlapsGroup(b[e],c):this.overlaps(b[e],c)&&(null!==this._callbackFunction&&null!==this._callbackContext&&this._callbackFunction.call(this._callbackContext,this.owner,b[e]),d=!0));return d},c.computeVelocity=function(a,b,d,e){return"undefined"==typeof b&&(b=0),"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=1e4),0!=b?a+=b*c.updateInterval:0!=d&&(d*=c.updateInterval,a-d>0?a-=d:0>a+d?a+=d:a=0),0!=a&&1e4!=e&&(a>e?a=e:-e>a&&(a=-e)),a},c.prototype.updateMotion=function(){var a,b;b=(c.computeVelocity(this.angularVelocity,this.angularAcceleration,this.angularDrag,this.maxAngular)-this.angularVelocity)/2,this.angularVelocity+=b,this.transform.rotation+=this.angularVelocity*c.updateInterval,this.angularVelocity+=b,b=(c.computeVelocity(this.velocity.x,this.acceleration.x,this.drag.x,this.maxVelocity.x)-this.velocity.x)/2,this.velocity.x+=b,a=this.velocity.x*c.updateInterval,this.velocity.x+=b,this.transform.x=this.transform.x+a,b=(c.computeVelocity(this.velocity.y,this.acceleration.y,this.drag.y,this.maxVelocity.y)-this.velocity.y)/2,this.velocity.y+=b,a=this.velocity.y*c.updateInterval,this.velocity.y+=b,this.transform.y=this.transform.y+a
 },c.prototype.update=function(){this.last.x=this.transform.worldX,this.last.y=this.transform.worldY,this.moves&&this.updateMotion(),this.wasTouching=this.touching,this.touching=c.NONE},c.prototype.destroy=function(){b.prototype.destroy.call(this),delete this.transform,delete this.owner,delete this._callbackContext,delete this._callbackFunction},c.prototype.objType=function(){return"ArcadePhysics"},c.collide=function(a,b,d){return"undefined"==typeof d&&(d=!0),c.overlaps(a,b,d)},c.collideGroup=function(a,b,d){return"undefined"==typeof d&&(d=!0),c.overlapsObjectGroup(a,b,d)},c.collideGroupGroup=function(a,b,d){return"undefined"==typeof d&&(d=!0),c.overlapsGroupGroup(a,b,d)},c.overlaps=function(a,b,c){"undefined"==typeof c&&(c=!0);var d=a.components.getComponent("ArcadePhysics");return d.overlaps(b,c)},c.overlapsObjectGroup=function(a,b,c){"undefined"==typeof c&&(c=!0);var d=a.components.getComponent("ArcadePhysics");return d.overlapsGroup(b,c)},c.overlapsGroupGroup=function(b,d,e){"undefined"==typeof e&&(e=!0);for(var f=!1,g=b.members,h=0;h<b.members.length;)g[h].childType()==a.GROUP?c.overlapsGroupGroup(g[h++],d,e)&&(f=!0):c.overlapsObjectGroup(g[h++],d,e)&&(f=!0);return f},c.overlapsArrayGroup=function(b,d,e){"undefined"==typeof e&&(e=!0);for(var f=!1,g=0;g<b.length;g++)"undefined"!=typeof b[g].childType&&(b[g].childType()===a.GROUP?c.overlapsGroupGroup(b[g],d,e)&&(f=!0):c.overlapsObjectGroup(b[g],d,e)&&(f=!0));return f},c.updateInterval=.1,c.LEFT=1,c.RIGHT=16,c.UP=256,c.DOWN=4096,c.NONE=0,c.CEILING=c.UP,c.FLOOR=c.DOWN,c.WALL=c.LEFT|c.RIGHT,c.ANY=c.LEFT|c.RIGHT|c.UP|c.DOWN,c.OVERLAP_BIAS=4,c}(a.Component);b.ArcadePhysics=c}(a.Components||(a.Components={}));a.Components}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._calculateBytes=!0,this._fileTotal=0,this._currentFile=0,this._bytesTotal=0,this._bytesLoaded=0,this._bytesCurrent=0,this._fileChunk=0,this._percentLoaded=0,this._complete=!1,this._game=a}return b.prototype.objType=function(){return"Loader"},b.prototype.boot=function(){this._fileList=[],this._loadList=[]},b.prototype.init=function(a,b,c){"undefined"==typeof a&&(a=null),"undefined"==typeof b&&(b=null),"undefined"==typeof c&&(c=!1),this._fileList.length=0,this._loadList.length=0,this._calculateBytes=c,this._complete=!1,null!==a&&(this._onProgressCallback=a),null!==b&&(this._onCompleteCallback=b)},b.prototype.addImage=function(b,c,d,e,f,g,h){"undefined"==typeof h&&(h=!0);var i=new a.Files.File(this._game,a.Files.File.IMAGE,c,b,!0,h);i.metadata={width:d,height:e,offsetX:f,offsetY:g},this._fileList.push(i)},b.prototype.addSpriteSheet=function(b,c,d,e,f,g,h,i,j,k,l,m){"undefined"==typeof m&&(m=!0);var n=new a.Files.File(this._game,a.Files.File.SPRITE_SHEET,c,b,!0,m);n.metadata={frameWidth:d,frameHeight:e,numCells:f,rows:g,cols:h,sheetOffsetX:i,sheetOffsetY:j,cellOffsetX:k,cellOffsetY:l},this._fileList.push(n)},b.prototype.addTextureAtlas=function(b,c,d,e,f){"undefined"==typeof f&&(f=!0);var g=new a.Files.File(this._game,a.Files.File.TEXTURE_ATLAS,c,b,!0,f),h=new a.Files.File(this._game,a.Files.File.JSON,e,d,!0,f);g.metadata={jsonID:d},h.metadata={imageID:b},this._fileList.push(g,h)},b.prototype.addAudio=function(b,c,d,e){if("undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=!0),a.Utils.Common.isString(c))this.attemptToAddAudio(b,c,d,e);else if(a.Utils.Common.isArray(c))for(var f=0;f<c.length&&(0==a.Utils.Common.isString(c[f])||1!=this.attemptToAddAudio(b,c[f],d,e));f++);},b.prototype.attemptToAddAudio=function(b,c,d,e){var f=new a.Files.File(this._game,a.Files.File.AUDIO,c,b,!0,d),g=!1;switch(f.fileExtension){case"mp3":g=a.DEVICE.mp3;break;case"ogg":case"oga":g=a.DEVICE.ogg;break;case"m4a":g=a.DEVICE.m4a;break;case"wav":case"wave":g=a.DEVICE.wav}return 1==g||0==e?(this._fileList.push(f),!0):(this._game.debug&&console.error("Kiwi.Loader: Audio Format not supported on this Device/Browser."),!1)},b.prototype.addJSON=function(b,c,d){"undefined"==typeof d&&(d=!0),this._fileList.push(new a.Files.File(this._game,a.Files.File.JSON,c,b,!0,d))},b.prototype.addXML=function(b,c,d){"undefined"==typeof d&&(d=!0),this._fileList.push(new a.Files.File(this._game,a.Files.File.XML,c,b,!0,d))},b.prototype.addBinaryFile=function(b,c,d){"undefined"==typeof d&&(d=!0),this._fileList.push(new a.Files.File(this._game,a.Files.File.BINARY_DATA,c,b,!0,d))},b.prototype.addTextFile=function(b,c,d){"undefined"==typeof d&&(d=!0),this._fileList.push(new a.Files.File(this._game,a.Files.File.TEXT_DATA,c,b,!0,d))},b.prototype.startLoad=function(){0===this._fileList.length?this._onCompleteCallback():(this._onProgressCallback(0,0,null),this._fileTotal=this._fileList.length,this._bytesLoaded=0,this._bytesTotal=0,this._bytesCurrent=0,this._currentFile=0,this._fileChunk=0,this._percentLoaded=0,this._calculateBytes===!0?this.getNextFileSize():(this._fileChunk=Math.floor(100/this._fileTotal),this._loadList=this._fileList,this.nextFile()))},b.prototype.getNextFileSize=function(){var a=this;if(0===this._fileList.length){var b=this._fileList.shift();b.getFileDetails(function(b){return a.addToBytesTotal(b)})}else this.nextFile()},b.prototype.addToBytesTotal=function(a){this._bytesTotal+=a.fileSize,this._loadList.push(a),this.getNextFileSize()},b.prototype.nextFile=function(){var a=this;this._currentFile++;var b=this._loadList.shift();b.load(function(b){return a.fileLoadComplete(b)},function(b){return a.fileLoadProgress(b)})},b.prototype.fileLoadProgress=function(a){this._calculateBytes===!0&&(this._bytesCurrent=a.bytesLoaded,this._onProgressCallback&&this._onProgressCallback(this.getPercentLoaded(),this.getBytesLoaded(),a))},b.prototype.fileLoadComplete=function(a){this._calculateBytes===!0?(this._bytesLoaded+=a.bytesTotal,this._bytesCurrent=0,this._onProgressCallback&&this._onProgressCallback(this.getPercentLoaded(),this._bytesLoaded,a)):this._onProgressCallback&&this._onProgressCallback(this.getPercentLoaded(),0,a),0===this._loadList.length?(this._complete=!0,this._game.debug&&console.log("All files have loaded"),this._onCompleteCallback&&this._onCompleteCallback()):this.nextFile()},b.prototype.getBytesLoaded=function(){return this._bytesLoaded+this._bytesCurrent},b.prototype.getPercentLoaded=function(){return this._calculateBytes===!0?Math.round(this.getBytesLoaded()/this._bytesTotal*100):Math.round(this._currentFile/this._fileTotal*100)},b.prototype.calculateBytes=function(a){return a&&(this._calculateBytes=a),this._calculateBytes},b.prototype.complete=function(){return this._complete},b}();b.Loader=c}(a.Files||(a.Files={}));a.Files}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._game=a,this.data={}}return b.prototype.objType=function(){return"DataLibrary"},b.prototype.clear=function(){for(var a in this.data)delete this.data[a]},b.prototype.add=function(b){switch(b.dataType){case a.Files.File.JSON:case a.Files.File.XML:case a.Files.File.BINARY_DATA:case a.Files.File.TEXT_DATA:this.data[b.key]=b}},b.prototype.rebuild=function(a,b){this.clear(),this._game.debug&&console.log("Kiwi.DataLibrary: Rebuilding Data Library");for(var c=a.keys,d=0;d<c.length;d++){var e=this._game.fileStore.getFile(c[d]);e.isData&&(this._game.debug&&console.log("  Kiwi.DataLibrary: Adding Data: "+e.fileName),b.dataLibrary.add(e))}},b}();b.DataLibrary=c}(a.Files||(a.Files={}));a.Files}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(b,c,d,e,f,g){"undefined"==typeof e&&(e=""),"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=!0),this._xhr=null,this._saveToFileStore=!0,this._useTagLoader=!0,this.fileSize=0,this.ETag="",this.lastModified="",this.timeStarted=0,this.timeFinished=0,this.duration=0,this.hasError=!1,this.success=!1,this.onCompleteCallback=null,this.onProgressCallback=null,this.lastProgress=0,this.percentLoaded=0,this.status=0,this.statusText="",this.bytesLoaded=0,this.bytesTotal=0,this.readyState=0,this.timeOutDelay=4e3,this.hasTimedOut=!1,this.timedOut=0,this.attemptCounter=0,this.maxLoadAttempts=2,this.maxHeadLoadAttempts=1,this._game=b,this.dataType=c,this.fileURL=d,d.lastIndexOf("/")>-1?(this.fileName=d.substr(d.lastIndexOf("/")+1),this.filePath=d.substr(0,d.lastIndexOf("/")+1)):(this.filePath="",this.fileName=d),this.fileExtension=d.substr(d.lastIndexOf(".")+1).toLowerCase(),this._useTagLoader=a.DEVICE.blob?!0:!0,this.dataType===a.Files.File.AUDIO&&(this._useTagLoader=this._game.audio.usingAudioTag===!0?!0:!1),this.dataType===a.Files.File.JSON&&(this._useTagLoader=!1),this._saveToFileStore=f,this._fileStore=this._game.fileStore,this.ownerState=this._game.states.current&&!g?this._game.states.current:null,this.key=""===this.key?this.fileName:e}return b.prototype.objType=function(){return"File"},b.prototype.addTag=function(a){-1==this._tags.indexOf(a)&&this._tags.push(a)},b.prototype.removeTag=function(a){var b=this._tags.indexOf(a);-1!=b&&this._tags.splice(b,1)},b.prototype.hasTag=function(a){return-1==this._tags.indexOf(a)?!1:!0},Object.defineProperty(b.prototype,"isTexture",{get:function(){return this.dataType===b.IMAGE||this.dataType===b.SPRITE_SHEET||this.dataType===b.TEXTURE_ATLAS?!0:!1},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"isAudio",{get:function(){return this.dataType===b.AUDIO?!0:!1},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"isData",{get:function(){return this.dataType===b.XML||this.dataType===b.JSON||this.dataType===b.TEXT_DATA||this.dataType===b.BINARY_DATA?!0:!1},enumerable:!0,configurable:!0}),b.prototype.load=function(a,b,c,d,e){"undefined"==typeof a&&(a=null),"undefined"==typeof b&&(b=null),"undefined"==typeof c&&(c=null),this._game.debug&&console.log("Kiwi.File: Attempting to load: "+this.fileName),this.onCompleteCallback=a,this.onProgressCallback=b,void 0!=d&&(this.maxLoadAttempts=d),void 0!=e&&(this.timeOutDelay=e),null!==c&&(this._fileStore=c,this._saveToFileStore=!0),this.start(),this._useTagLoader===!0?this.tagLoader():this.xhrLoader()},b.prototype.start=function(){this.timeStarted=Date.now(),this.lastProgress=Date.now(),this.percentLoaded=0,this.attemptCounter=0},b.prototype.stop=function(){this.percentLoaded=100,this.timeFinished=Date.now(),this.duration=this.timeFinished-this.timeStarted},b.prototype.tagLoader=function(){var b=this;this.dataType===a.Files.File.IMAGE||this.dataType===a.Files.File.SPRITE_SHEET||this.dataType===a.Files.File.TEXTURE_ATLAS?(this.data=new Image,this.data.src=this.fileURL,this.data.onload=function(a){return b.tagLoaderOnLoad(a)},this.data.onerror=function(a){return b.tagLoaderOnError(a)},this.data.onreadystatechange=function(a){return b.tagLoaderOnReadyStateChange(a)}):this.dataType===a.Files.File.AUDIO&&(this.data=document.createElement("audio"),this.data.src=this.fileURL,this.data.preload="auto",this._game.audio.locked?this.tagLoaderAudioLocked():(this.data.addEventListener("canplaythrough",function(){return b.tagLoaderProgressThrough(null)},!1),this._game.deviceTargetOption==a.TARGET_COCOON?this.data.load():(this.data.volume=0,this.data.play())))},b.prototype.tagLoaderOnReadyStateChange=function(){},b.prototype.tagLoaderOnError=function(a){this.hasError=!0,this.error=a,this.onCompleteCallback&&this.onCompleteCallback(this)},b.prototype.tagLoaderProgressThrough=function(){var b=this;100!==this.percentLoaded&&(this.dataType===a.Files.File.AUDIO&&(this.data.removeEventListener("canplaythrough",function(){return b.tagLoaderProgressThrough(null)}),this.data.pause(),this.data.currentTime=0,this.data.volume=1),this.tagLoaderOnLoad(null))},b.prototype.tagLoaderAudioLocked=function(){this.percentLoaded=100,this.tagLoaderOnLoad(null)},b.prototype.tagLoaderOnLoad=function(){this.stop(),this._game.debug&&console.log("Kiwi.File: Successfully Loaded: "+this.fileName),this._saveToFileStore===!0&&this._fileStore.addFile(this.key,this),this.onCompleteCallback&&this.onCompleteCallback(this)},b.prototype.xhrLoader=function(){var a=this;this.attemptCounter++,this._xhr=new XMLHttpRequest,this._xhr.open("GET",this.fileURL,!0),null!==this.timeOutDelay&&(this._xhr.timeout=this.timeOutDelay),this._xhr.responseType="arraybuffer",this._xhr.onloadstart=function(b){return a.xhrOnLoadStart(b)},this._xhr.onprogress=function(b){return a.xhrOnProgress(b)},this._xhr.ontimeout=function(b){return a.xhrOnTimeout(b)},this._xhr.onabort=function(b){return a.xhrOnAbort(b)},this._xhr.onload=function(b){return a.xhrOnLoad(b)},this._xhr.onreadystatechange=function(b){return a.xhrOnReadyStateChange(b)},this._xhr.send()},b.prototype.xhrOnReadyStateChange=function(a){this.readyState=a.target.readyState,4===this.readyState&&this.xhrOnLoad(a)},b.prototype.xhrOnLoadStart=function(a){this.timeStarted=a.timeStamp,this.lastProgress=a.timeStamp},b.prototype.xhrOnAbort=function(a){this._game.debug&&console.log("Kiwi.File: "+this.fileName+" loading was aborted."),this.error=a},b.prototype.xhrOnError=function(a){this._game.debug&&console.log("Kiwi.File: Error during load: "+this.fileName),this.error=a},b.prototype.xhrOnTimeout=function(a){this._game.debug&&console.log("Kiwi.File: Timed out: "+this.fileName),this.hasTimedOut=!0,this.timedOut=Date.now(),this.error=a},b.prototype.xhrOnProgress=function(a){this.bytesLoaded=parseInt(a.loaded),this.bytesTotal=parseInt(a.totalSize),this.percentLoaded=Math.round(this.bytesLoaded/this.bytesTotal*100),this.onProgressCallback&&this.onProgressCallback(this)},b.prototype.xhrOnLoad=function(){this.timeFinished>0||(this.status=this._xhr.status,this.statusText=this._xhr.statusText,200===this._xhr.status?(this.stop(),this.success=!0,this.hasError=!1,this._game.debug&&console.log("Kiwi.File: Successfully Loaded: "+this.fileName),this.fileType=this._xhr.getResponseHeader("Content-Type"),this.bytesTotal=parseInt(this._xhr.getResponseHeader("Content-Length")),this.lastModified=this._xhr.getResponseHeader("Last-Modified"),this.ETag=this._xhr.getResponseHeader("ETag"),this.buffer=this._xhr.response,this.processFile()):this.attemptCounter>=this.maxLoadAttempts?(this.success=!1,this.hasError=!0,this._game.debug&&console.error("Kiwi.File: "+this.fileName+" wasn't loaded."),this.parseComplete()):(this._game.debug&&console.log("Kiwi.File: Retrying to load: "+this.fileName),this.xhrLoader()))},b.prototype.processFile=function(){switch(this.dataType){case a.Files.File.IMAGE:case a.Files.File.SPRITE_SHEET:case a.Files.File.TEXTURE_ATLAS:this.createBlob();break;case a.Files.File.JSON:this.data="";for(var b=new Uint8Array(this.buffer),c=0;c<b.length;c++)this.data+=String.fromCharCode(b[c]);this.parseComplete();break;case a.Files.File.AUDIO:if(this._game.audio.usingWebAudio){this.data={raw:this._xhr.response,decoded:!1,buffer:null};var d=this;this._game.audio.context.decodeAudioData(this.data.raw,function(a){a&&(d.data.buffer=a,d.data.decoded=!0,d.parseComplete())})}break;default:this.parseComplete()}},b.prototype.createBlob=function(){var a=this;this.data=document.createElement("img"),this.data.onload=function(){return a.revoke()};var b="";"jpg"===this.fileExtension||"jpeg"===this.fileExtension?b="image/jpeg":"png"===this.fileExtension?b="image/png":"gif"===this.fileExtension&&(b="image/gif");var c=new window.Blob([this.buffer],{type:b});window.URL?this.data.src=window.URL.createObjectURL(c):window.webkitURL&&(this.data.src=window.webkitURL.createObjectURL(c))},b.prototype.revoke=function(){window.URL?window.URL.revokeObjectURL(this.data.src):window.webkitURL&&window.webkitURL.revokeObjectURL(this.data.src),this.parseComplete()},b.prototype.parseComplete=function(){this._saveToFileStore===!0&&this._fileStore.addFile(this.key,this),this.onCompleteCallback&&this.onCompleteCallback(this)},b.prototype.getFileDetails=function(a,b,c){"undefined"==typeof a&&(a=null),"undefined"==typeof c&&(c=this.timeOutDelay),this.onCompleteCallback=a,void 0!==this.maxHeadLoadAttempts&&(this.maxHeadLoadAttempts=b),this.attemptCounter=0,this.sendXHRHeadRequest(c)},b.prototype.sendXHRHeadRequest=function(a){var b=this;this.attemptCounter++,this._xhr=new XMLHttpRequest,this._xhr.open("HEAD",this.fileURL,!1),this._xhr.onload=function(a){return b.getXHRResponseHeaders(a)},this._xhr.ontimeout=function(a){return b.xhrHeadOnTimeout(a)},this._xhr.onerror=function(a){return b.xhrHeadOnError(a)},null!==this.timeOutDelay&&(this._xhr.timeout=a),this._xhr.send()},b.prototype.xhrHeadOnTimeout=function(a){this.hasTimedOut=!0,this.timedOut=Date.now(),this.error=a},b.prototype.xhrHeadOnError=function(a){this.hasError=!0,this.error=a,this.status=this._xhr.status,this.statusText=this._xhr.statusText},b.prototype.getXHRResponseHeaders=function(){this.status=this._xhr.status,this.statusText=this._xhr.statusText,200===this._xhr.status?(this.fileType=this._xhr.getResponseHeader("Content-Type"),this.fileSize=parseInt(this._xhr.getResponseHeader("Content-Length")),this.lastModified=this._xhr.getResponseHeader("Last-Modified"),this.ETag=this._xhr.getResponseHeader("ETag"),this.completeXHRHeadRequest(!0)):this.completeXHRHeadRequest(!1)},b.prototype.completeXHRHeadRequest=function(a){return 0==a&&this.attemptCounter<this.maxLoadAttempts?(this.sendXHRHeadRequest(this.timeOutDelay),void 0):(this.onCompleteCallback&&(this.attemptCounter=0,this.onCompleteCallback(this)),void 0)},b.IMAGE=0,b.SPRITE_SHEET=1,b.TEXTURE_ATLAS=2,b.AUDIO=3,b.JSON=4,b.XML=5,b.BINARY_DATA=6,b.TEXT_DATA=7,b}();b.File=c}(a.Files||(a.Files={}));a.Files}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a){this._size=0,this._game=a,this._files={}}return a.prototype.objType=function(){return"FileStore"},a.prototype.boot=function(){},a.prototype.getFile=function(a){return this._files[a]},a.prototype.getFilesByTag=function(a){var b={};for(var c in this._files)this._files[c].hasTag(a)&&(b[c]=this._files[c]);return b},a.prototype.removeFilesByTag=function(a){var b=0;for(var c in this._files)this._files[c].hasTag(a)&&(this.removeFile(c),b++);return b},Object.defineProperty(a.prototype,"keys",{get:function(){var a=new Array;for(var b in this._files)a.push(b);return a},enumerable:!0,configurable:!0}),a.prototype.size=function(){return this._size},a.prototype.addFile=function(a,b){return this._files[a]?!1:(this._files[a]=b,this._size++,!0)},a.prototype.exists=function(a){return this._files[a]?!0:!1},a.prototype.removeStateFiles=function(a){for(var b in this._files)this._files[b].ownerState===a&&this.removeFile(b)},a.prototype.removeFile=function(a){return this._files[a]?(this._files[a]=null,delete this._files[a],!0):!1},a}();a.FileStore=b}(a.Files||(a.Files={}));a.Files}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(){this.isReady=!1,this.container=null,this.input=null}return b.prototype.objType=function(){return"Bootstrap"},b.prototype.boot=function(a,b,c){"undefined"==typeof b&&(b=null),"undefined"==typeof c&&(c=!0);var d=this;this._callback=b,this._domParent=a,this._createContainer=c,"complete"===document.readyState||"interactive"===document.readyState?this.ready():(document.addEventListener("DOMContentLoaded",function(){return d.ready()},!1),window.addEventListener("load",function(){return d.ready()},!1))},b.prototype.ready=function(){var a=this;this.isReady!==!0&&(document.body?(this.isReady=!0,this._createContainer===!0&&(""===this._domParent?(this.container=document.createElement("div"),this._setupContainer("KiwiGame"+Date.now().toString()),document.body.appendChild(this.container)):document.getElementById(this._domParent)?(this.container=document.getElementById(this._domParent),this._setupContainer()):(this.container=document.createElement("div"),this._setupContainer(this._domParent),document.body.appendChild(this.container))),null!==this._callback&&this._callback()):window.setTimeout(function(){return a.ready()},13))},b.prototype._setupContainer=function(b){"undefined"==typeof b&&(b=""),b&&(this.container.id=b),this.container.style.width=a.Stage.DEFAULT_WIDTH+"px",this.container.style.height=a.Stage.DEFAULT_HEIGHT+"px",this.container.style.position="relative",this.container.style.overflow="hidden"},b}();b.Bootstrap=c}(a.System||(a.System={}));a.System}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(){this.iOS=!1,this.android=!1,this.chromeOS=!1,this.linux=!1,this.macOS=!1,this.windows=!1,this.windowsPhone=!1,this.canvas=!1,this.file=!1,this.fileSystem=!1,this.localStorage=!1,this.webGL=!1,this.worker=!1,this.blob=!1,this.touch=!1,this.pointerEnabled=!1,this.arora=!1,this.chrome=!1,this.epiphany=!1,this.firefox=!1,this.ie=!1,this.ieVersion=0,this.ieMobile=!1,this.mobileSafari=!1,this.midori=!1,this.opera=!1,this.safari=!1,this.webApp=!1,this.audioData=!1,this.webaudio=!1,this.ogg=!1,this.mp3=!1,this.wav=!1,this.m4a=!1,this.iPhone=!1,this.iPhone4=!1,this.iPad=!1,this.pixelRatio=0,this._checkAudio(),this._checkBrowser(),this._checkDevice(),this._checkFeatures(),this._checkOS()}return a.prototype.objType=function(){return"Device"},a.prototype._checkOS=function(){var a=navigator.userAgent;/Android/.test(a)?this.android=!0:/CrOS/.test(a)?this.chromeOS=!0:/iP[ao]d|iPhone/i.test(a)?this.iOS=!0:/Linux/.test(a)?this.linux=!0:/Mac OS/.test(a)?this.macOS=!0:/Windows Phone/.test(a)?this.windowsPhone=!0:/Windows/.test(a)&&(this.windows=!0)},a.prototype._checkFeatures=function(){"undefined"!=typeof window.Blob&&(this.blob=!0),this.canvas=!!window.CanvasRenderingContext2D;try{this.localStorage=!!localStorage.getItem}catch(a){this.localStorage=!1}this.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),this.fileSystem=!!window.requestFileSystem,this.webGL=!!window.WebGLRenderingContext,this.worker=!!window.Worker,("ontouchstart"in document.documentElement||window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>0||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>0)&&(this.touch=!0),(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&(this.pointerEnabled=!0)},a.prototype._checkBrowser=function(){{var a=navigator.userAgent;navigator.appName}/Arora/.test(a)?this.arora=!0:/Chrome/.test(a)?this.chrome=!0:/Epiphany/.test(a)?this.epiphany=!0:/Firefox/.test(a)?this.firefox=!0:/Mobile Safari/.test(a)?this.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(a)?(this.ie=!0,this.ieVersion=parseInt(RegExp.$1),/IEMobile/.test(a)&&(this.ieMobile=!0)):/Trident/.test(a)?(this.ie=!0,/rv:(\d+\.\d+)\)/.test(a),this.ieVersion=parseInt(RegExp.$1)):/Midori/.test(a)?this.midori=!0:/Opera/.test(a)?this.opera=!0:/Safari/.test(a)&&(this.safari=!0),navigator.standalone&&(this.webApp=!0)},a.prototype._checkAudio=function(){this.audioData=!!window.Audio,this.webaudio=!(!window.webkitAudioContext&&!window.AudioContext);var a=document.createElement("audio"),b=!1;try{(b=!!a.canPlayType)&&(a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(this.ogg=!0),a.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(this.mp3=!0),a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(this.wav=!0),(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;").replace(/^no$/,""))&&(this.m4a=!0))}catch(c){}},a.prototype._checkDevice=function(){this.pixelRatio=window.devicePixelRatio||1,this.iPhone=-1!=navigator.userAgent.toLowerCase().indexOf("iphone"),this.iPhone4=2==this.pixelRatio&&this.iPhone,this.iPad=-1!=navigator.userAgent.toLowerCase().indexOf("ipad")},a.prototype.getAll=function(){var a="";return a=a.concat("Device\n"),a=a.concat("iPhone : "+this.iPhone+"\n"),a=a.concat("iPhone4 : "+this.iPhone4+"\n"),a=a.concat("iPad : "+this.iPad+"\n"),a=a.concat("\n"),a=a.concat("Operating System\n"),a=a.concat("iOS: "+this.iOS+"\n"),a=a.concat("Android: "+this.android+"\n"),a=a.concat("ChromeOS: "+this.chromeOS+"\n"),a=a.concat("Linux: "+this.linux+"\n"),a=a.concat("MacOS: "+this.macOS+"\n"),a=a.concat("Windows: "+this.windows+"\n"),a=a.concat("\n"),a=a.concat("Browser\n"),a=a.concat("Arora: "+this.arora+"\n"),a=a.concat("Chrome: "+this.chrome+"\n"),a=a.concat("Epiphany: "+this.epiphany+"\n"),a=a.concat("Firefox: "+this.firefox+"\n"),a=a.concat("Internet Explorer: "+this.ie+" ("+this.ieVersion+")\n"),a=a.concat("Mobile Safari: "+this.mobileSafari+"\n"),a=a.concat("Midori: "+this.midori+"\n"),a=a.concat("Opera: "+this.opera+"\n"),a=a.concat("Safari: "+this.safari+"\n"),a=a.concat("\n"),a=a.concat("Features\n"),a=a.concat("Blob: "+this.blob+"\n"),a=a.concat("Canvas: "+this.canvas+"\n"),a=a.concat("File: "+this.file+"\n"),a=a.concat("FileSystem: "+this.fileSystem+"\n"),a=a.concat("LocalStorage: "+this.localStorage+"\n"),a=a.concat("WebGL: "+this.webGL+"\n"),a=a.concat("Worker: "+this.worker+"\n"),a=a.concat("Touch: "+this.touch+"\n"),a=a.concat("\n"),a=a.concat("Audio\n"),a=a.concat("Audio Data: "+this.canvas+"\n"),a=a.concat("Web Audio: "+this.canvas+"\n"),a=a.concat("Can play OGG: "+this.canvas+"\n"),a=a.concat("Can play MP3: "+this.canvas+"\n"),a=a.concat("Can play M4A: "+this.canvas+"\n"),a=a.concat("Can play WAV: "+this.canvas+"\n")},a}();a.Device=b}(a.System||(a.System={}));a.System}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d,e){this.dirty=!1,this.cellIndex=0,this.name=a,this.cells=c||new Array,this.sequences=e||new Array,this.image=d,this._type=b}return b.prototype.objType=function(){return"TextureAtlas"},Object.defineProperty(b.prototype,"type",{get:function(){return this._type},enumerable:!0,configurable:!0}),b.prototype.readJSON=function(b){var c=JSON.parse(b);void 0!==c.name&&(this.name=c.name);for(var d=0;d<c.cells.length;d++)this.cells.push(c.cells[d]),void 0===c.cells[d].hitboxes&&(this.cells[d].hitboxes=new Array,this.cells[d].hitboxes.push({x:0,y:0,w:this.cells[d].w,h:this.cells[d].h}));if(c.sequences)for(var d=0;d<c.sequences.length;d++){var e=new a.Animations.Sequence(c.sequences[d].name,c.sequences[d].cells);void 0!==c.sequences[d].speed&&(e.speed=c.sequences[d].speed),void 0!==c.sequences[d].loop&&(e.loop=c.sequences[d].loop),this.sequences.push(e)}},b.SINGLE_IMAGE=0,b.SPRITE_SHEET=1,b.TEXTURE_ATLAS=2,b}();b.TextureAtlas=c}(a.Textures||(a.Textures={}));a.Textures}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._game=a,this.textures=new Object}return b.prototype.objType=function(){return"TextureLibrary"},b.prototype.clear=function(){for(var a in this.textures)delete this.textures[a]},b.prototype.add=function(b){if(this.textures[b.name]=b,this._game.renderOption===a.RENDERER_WEBGL){(-1==a.Utils.Common.base2Sizes.indexOf(b.image.width)||-1==a.Utils.Common.base2Sizes.indexOf(b.image.height))&&console.log("Kiwi.TextureLibrary: Warning:Image is not of base2 size and may not render correctly.");var c=this._game.renderer;c.addTexture(this._game.stage.gl,b)}},b.prototype.addFromFile=function(b){switch(this._game.renderOption===a.RENDERER_WEBGL&&this._game.deviceTargetOption!=a.TARGET_COCOON&&(b=this._rebuildImage(b)),b.dataType){case a.Files.File.SPRITE_SHEET:this.textures[b.key]=this._buildSpriteSheet(b);break;case a.Files.File.IMAGE:this.textures[b.key]=this._buildImage(b);break;case a.Files.File.TEXTURE_ATLAS:this.textures[b.key]=this._buildTextureAtlas(b)}},b.prototype._rebuildImage=function(b){var c=a.Utils.Common.convertToBase2(b.data);return(b.data.width!==c.width||b.data.height!==c.height)&&(b.dataType===a.Files.File.SPRITE_SHEET?(b.metadata.rows||(b.metadata.rows=b.data.height/b.metadata.frameHeight),b.metadata.cols||(b.metadata.cols=b.data.width/b.metadata.frameWidth)):b.dataType===a.Files.File.IMAGE&&(b.metadata.width||(b.metadata.width=b.data.width),b.metadata.height||(b.metadata.height=b.data.height)),this._game.debug&&console.log("Kiwi.TextureLibrary: "+b.fileName+" has been rebuilt to be base2."),b.data=c),b},b.prototype._buildTextureAtlas=function(b){var c=new a.Textures.TextureAtlas(b.key,a.Textures.TextureAtlas.TEXTURE_ATLAS,null,b.data),d=b.metadata,e=this._game.fileStore.getFile(d.jsonID).data;return e.trim(),c.readJSON(e),c},b.prototype._buildSpriteSheet=function(b){var c=b.metadata,d=new a.Textures.SpriteSheet(b.key,b.data,c.frameWidth,c.frameHeight,c.numCells,c.rows,c.cols,c.sheetOffsetX,c.sheetOffsetY,c.cellOffsetX,c.cellOffsetY);return d},b.prototype._buildImage=function(b){var c=b.metadata;return new a.Textures.SingleImage(b.key,b.data,c.width,c.height,c.offsetX,c.offsetY)},b.prototype.rebuild=function(a,b){this.clear(),this._game.debug&&console.log("Kiwi.TextureLibrary: Rebuilding Texture Library");for(var c=a.keys,d=0;d<c.length;d++){var e=this._game.fileStore.getFile(c[d]);e.isTexture&&(this._game.debug&&console.log("  Kiwi.TextureLibrary: Adding Texture: "+e.fileName),b.textureLibrary.addFromFile(e))}},b}();b.TextureLibrary=c}(a.Textures||(a.Textures={}));a.Textures}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(b){function c(c,d,e,f,g,h,i,j,k,l,m){this.cellWidth=e,this.cellHeight=f,this._cols=i||d.width/e,this._rows=h||d.height/f,this.numCells=g||this.cols*this.rows,this.sheetOffsetX=j||0,this.sheetOffsetY=k||0,this.cellOffsetX=l||0,this.cellOffsetY=m||0,b.call(this,c,a.Textures.TextureAtlas.SPRITE_SHEET,this.generateAtlasCells(),d,this.sequences)}return __extends(c,b),c.prototype.objType=function(){return"SpriteSheet"},Object.defineProperty(c.prototype,"rows",{get:function(){return this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"cols",{get:function(){return this._cols},enumerable:!0,configurable:!0}),c.prototype.generateAtlasCells=function(){for(var b=new Array,c=new Array,d=this.sheetOffsetX,e=this.sheetOffsetY,f=0,g=0;g<this.rows;g++){for(var h=0;h<this.cols;h++)b.push({x:d,y:e,w:this.cellWidth,h:this.cellHeight,hitboxes:[{x:0,y:0,w:this.cellWidth,h:this.cellHeight}]}),c.push(f++),d+=this.cellOffsetX+this.cellWidth;d=this.sheetOffsetX,e+=this.cellOffsetY+this.cellHeight}return this.sequences=new Array,this.sequences.push(new a.Animations.Sequence("default",c)),b},c}(a.Textures.TextureAtlas);b.SpriteSheet=c}(a.Textures||(a.Textures={}));a.Textures}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(b){function c(c,d,e,f,g,h){this.width=e||d.width,this.height=f||d.height,this.offsetX=g||0,this.offsetY=h||0,b.call(this,c,a.Textures.TextureAtlas.SINGLE_IMAGE,this.generateAtlasCells(),d)}return __extends(c,b),c.prototype.objType=function(){return"SingleImage"},c.prototype.generateAtlasCells=function(){return[{x:this.offsetX,y:this.offsetY,w:this.width,h:this.height,hitboxes:[{x:0,y:0,w:this.width,h:this.height}]}]},c}(a.Textures.TextureAtlas);b.SingleImage=c}(a.Textures||(a.Textures={}));a.Textures}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Back"},a.In=function(a){var b=1.70158;return a*a*((b+1)*a-b)},a.Out=function(a){var b=1.70158;return--a*a*((b+1)*a+b)+1},a.InOut=function(a){var b=2.5949095;return(a*=2)<1?.5*a*a*((b+1)*a-b):.5*((a-=2)*a*((b+1)*a+b)+2)},a}();a.Back=b}(a.Easing||(a.Easing={}));a.Easing}(a.Tweens||(a.Tweens={}));a.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){!function(b){var c=function(){function b(){}return b.prototype.objType=function(){return"Bounce"},b.In=function(b){return 1-a.Animations.Tweens.Easing.Bounce.Out(1-b)},b.Out=function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},b.InOut=function(b){return.5>b?.5*a.Animations.Tweens.Easing.Bounce.In(2*b):.5*a.Animations.Tweens.Easing.Bounce.Out(2*b-1)+.5},b}();b.Bounce=c}(b.Easing||(b.Easing={}));b.Easing}(b.Tweens||(b.Tweens={}));b.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Circular"},a.In=function(a){return 1-Math.sqrt(1-a*a)},a.Out=function(a){return Math.sqrt(1- --a*a)},a.InOut=function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},a}();a.Circular=b}(a.Easing||(a.Easing={}));a.Easing}(a.Tweens||(a.Tweens={}));
 a.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Cubic"},a.In=function(a){return a*a*a},a.Out=function(a){return--a*a*a+1},a.InOut=function(a){return(a*=2)<1?.5*a*a*a:.5*((a-=2)*a*a+2)},a}();a.Cubic=b}(a.Easing||(a.Easing={}));a.Easing}(a.Tweens||(a.Tweens={}));a.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Elastic"},a.In=function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),-(c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)))},a.Out=function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),c*Math.pow(2,-10*a)*Math.sin(2*(a-b)*Math.PI/d)+1)},a.InOut=function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),(a*=2)<1?-.5*c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d):c*Math.pow(2,-10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)*.5+1)},a}();a.Elastic=b}(a.Easing||(a.Easing={}));a.Easing}(a.Tweens||(a.Tweens={}));a.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Exponential"},a.In=function(a){return 0===a?0:Math.pow(1024,a-1)},a.Out=function(a){return 1===a?1:1-Math.pow(2,-10*a)},a.InOut=function(a){return 0===a?0:1===a?1:(a*=2)<1?.5*Math.pow(1024,a-1):.5*(-Math.pow(2,-10*(a-1))+2)},a}();a.Exponential=b}(a.Easing||(a.Easing={}));a.Easing}(a.Tweens||(a.Tweens={}));a.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Linear"},a.None=function(a){return a},a}();a.Linear=b}(a.Easing||(a.Easing={}));a.Easing}(a.Tweens||(a.Tweens={}));a.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Quadratic"},a.In=function(a){return a*a},a.Out=function(a){return a*(2-a)},a.InOut=function(a){return(a*=2)<1?.5*a*a:-.5*(--a*(a-2)-1)},a}();a.Quadratic=b}(a.Easing||(a.Easing={}));a.Easing}(a.Tweens||(a.Tweens={}));a.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Quartic"},a.In=function(a){return a*a*a*a},a.Out=function(a){return 1- --a*a*a*a},a.InOut=function(a){return(a*=2)<1?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)},a}();a.Quartic=b}(a.Easing||(a.Easing={}));a.Easing}(a.Tweens||(a.Tweens={}));a.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Quintic"},a.In=function(a){return a*a*a*a*a},a.Out=function(a){return--a*a*a*a*a+1},a.InOut=function(a){return(a*=2)<1?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)},a}();a.Quintic=b}(a.Easing||(a.Easing={}));a.Easing}(a.Tweens||(a.Tweens={}));a.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Sinusoidal"},a.In=function(a){return 1-Math.cos(a*Math.PI/2)},a.Out=function(a){return Math.sin(a*Math.PI/2)},a.InOut=function(a){return.5*(1-Math.cos(Math.PI*a))},a}();a.Sinusoidal=b}(a.Easing||(a.Easing={}));a.Easing}(a.Tweens||(a.Tweens={}));a.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(){function b(a){this._game=a,this._tweens=[]}return b.prototype.objType=function(){return"TweenManager"},b.prototype.getAll=function(){return this._tweens},b.prototype.removeAll=function(){this._tweens.length=0},b.prototype.create=function(b){return new a.Animations.Tween(b,this._game)},b.prototype.add=function(a){return a.setParent(this._game),this._tweens.push(a),a},b.prototype.remove=function(a){var b=this._tweens.indexOf(a);-1!==b&&this._tweens.splice(b,1)},b.prototype.update=function(){if(0===this._tweens.length)return!1;for(var a=0,b=this._tweens.length;b>a;)this._tweens[a].update(this._game.time.now())?a++:(this._tweens.splice(a,1),b--);return!0},b}();b.TweenManager=c}(b.Tweens||(b.Tweens={}));b.Tweens}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(b,c){"undefined"==typeof c&&(c=null),this._game=null,this._manager=null,this._object=null,this._valuesStart={},this._valuesEnd={},this._duration=1e3,this._delayTime=0,this._startTime=null,this._easingFunction=a.Animations.Tweens.Easing.Linear.None,this._interpolationFunction=a.Utils.GameMath.linearInterpolation,this._chainedTweens=[],this._onStartCallback=null,this._onStartContext=null,this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onUpdateContext=null,this._onCompleteCallback=null,this._onCompleteCalled=!1,this._onCompleteContext=null,this.isRunning=!1,this._object=b,null!==c&&(this._game=c,this._manager=this._game.tweens),this.isRunning=!1}return b.prototype.objType=function(){return"Tween"},b.prototype.to=function(a,b,c,d){return"undefined"==typeof b&&(b=1e3),"undefined"==typeof c&&(c=null),"undefined"==typeof d&&(d=!1),this._duration=b,this._valuesEnd=a,null!==c&&(this._easingFunction=c),d===!0?this.start():this},b.prototype.start=function(){if(null!==this._game&&null!==this._object){this.isRunning=!0,this._manager.add(this),this._onStartCallbackFired=!1,this._onCompleteCalled=!1,this._startTime=this._game.time.now()+this._delayTime;for(var a in this._valuesEnd)if(null!==this._object[a]&&a in this._object){if(this._valuesEnd[a]instanceof Array){if(0===this._valuesEnd[a].length)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._valuesStart[a]="function"==typeof this._object[a]?this._object[a]():this._object[a]}return this}},b.prototype.stop=function(){return null!==this._manager&&this._manager.remove(this),this.isRunning=!1,this},b.prototype.setParent=function(a){this._game=a,this._manager=this._game.tweens},b.prototype.delay=function(a){return this._delayTime=a,this},b.prototype.easing=function(a){return this._easingFunction=a,this},b.prototype.interpolation=function(a){return this._interpolationFunction=a,this},b.prototype.chain=function(a){return this._chainedTweens.push(a),this},b.prototype.onStart=function(a,b){return this._onStartCallback=a,this._onStartContext=b,this},b.prototype.onUpdate=function(a,b){return this._onUpdateCallback=a,this._onUpdateContext=b,this},b.prototype.onComplete=function(a,b){return this._onCompleteCallback=a,this._onCompleteContext=b,this},b.prototype.update=function(a){if(a<this._startTime)return!0;this._onStartCallbackFired===!1&&(null!==this._onStartCallback&&this._onStartCallback.call(this._onStartContext,this._object),this._onStartCallbackFired=!0);var b=(a-this._startTime)/this._duration;b=b>1?1:b;var c=this._easingFunction(b);for(var d in this._valuesStart){var e=this._valuesStart[d],f=this._valuesEnd[d];f instanceof Array?this._object[d]=this._interpolationFunction(f,c):"function"==typeof this._object[d]?this._object[d](e+(f-e)*c):this._object[d]=e+(f-e)*c}if(null!==this._onUpdateCallback&&this._onUpdateCallback.call(this._onUpdateContext,this._object,c),1==b){this.isRunning=!1,null!==this._onCompleteCallback&&0==this._onCompleteCalled&&(this._onCompleteCalled=!0,this._onCompleteCallback.call(this._onCompleteContext,this._object));for(var g=0;g<this._chainedTweens.length;g++)this._chainedTweens[g].start();return!1}return!0},b}();b.Tween=c}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this.numDrawCalls=0,this._game=a}return b.prototype.boot=function(){},b.prototype.objType=function(){return"CanvasRenderer"},b.prototype._recurse=function(b){if(b.willRender)if(b.childType()===a.GROUP)for(var c=0;c<b.members.length;c++)this._recurse(b.members[c]);else this.numDrawCalls++,b.render(this._currentCamera)},b.prototype.requestRendererInstance=function(a,b){return"undefined"==typeof b&&(b=null),null},b.prototype.requestSharedRenderer=function(a,b){return"undefined"==typeof b&&(b=null),null},b.prototype.initState=function(){},b.prototype.endState=function(){},b.prototype.render=function(a){this.numDrawCalls=0,this._currentCamera=a;var b=this._game.states.current.members;this._game.stage.ctx.fillStyle="#"+this._game.stage.color,this._game.stage.ctx.fillRect(0,0,this._game.stage.canvas.width,this._game.stage.canvas.height);var c=a.transform.getConcatenatedMatrix(),d=a.transform;this._game.stage.ctx.save(),this._game.stage.ctx.setTransform(c.a,c.b,c.c,c.d,c.tx+d.rotPointX,c.ty+d.rotPointY);for(var e=0;e<b.length;e++)this._recurse(b[e]);this._game.stage.ctx.restore()},b}();b.CanvasRenderer=c}(a.Renderers||(a.Renderers={}));a.Renderers}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){if(this._currentRenderer=null,this._entityCount=0,this.numDrawCalls=0,this._maxItems=1e3,this._currentTextureAtlas=null,this._sharedRenderers={},this._game=a,"undefined"==typeof mat4)throw"ERROR: gl-matrix.js is missing"}return b.prototype.boot=function(){this._textureManager=new a.Renderers.GLTextureManager,this._shaderManager=new a.Shaders.ShaderManager,this._init()},b.prototype.objType=function(){return"GLRenderManager"},b.prototype.addTexture=function(a,b){this._textureManager.uploadTexture(a,b)},b.prototype.addSharedRenderer=function(b,c){return"undefined"==typeof c&&(c=null),!a.Renderers[b]||b in this._sharedRenderers?!1:(this._sharedRenderers[b]=new a.Renderers[b](this._game.stage.gl,this._shaderManager,c),!0)},b.prototype.requestSharedRenderer=function(a,b){"undefined"==typeof b&&(b=null);var c=this._sharedRenderers[a];return c?c:this.addSharedRenderer(a,b)?this._sharedRenderers[a]:(console.log("no renderer called "+a),null)},b.prototype.requestRendererInstance=function(b,c){if("undefined"==typeof c&&(c=null),b in a.Renderers){var d=new a.Renderers[b](this._game.stage.gl,this._shaderManager,c);return d}return console.log("No renderer with id "+b+" exists"),null},b.prototype._init=function(){console.log("Intialising WebGL");var a=this._game.stage.gl;this._stageResolution=new Float32Array([this._game.stage.width,this._game.stage.height]),a.viewport(0,0,this._game.stage.width,this._game.stage.height),a.enable(a.BLEND),a.blendFunc(a.SRC_ALPHA,a.ONE_MINUS_SRC_ALPHA),this._shaderManager.init(a,"TextureAtlasShader"),this.camMatrix=mat3.create(),this._game.stage.onResize.add(function(b,c){this._stageResolution=new Float32Array([b,c]),this.currentRenderer&&this._currentRenderer.updateStageResolution(a,this._stageResolution),a.viewport(0,0,b,c)},this)},b.prototype.initState=function(a){this._textureManager.uploadTextureLibrary(this._game.stage.gl,a.textureLibrary)},b.prototype.endState=function(){this._textureManager.clearTextures(this._game.stage.gl),console.log("ending WebGL on State")},b.prototype.render=function(a){if(0==this._game.states.current.members.length)return console.log("nothing to render"),void 0;var b=this._game.stage.gl;this.numDrawCalls=0,this._textureManager.numTextureWrites=0,this._entityCount=0;var c=this._game.stage.normalizedColor;b.clearColor(c.r,c.g,c.b,c.a),b.clear(b.COLOR_BUFFER_BIT);var d=a.transform.getConcatenatedMatrix(),e=a.transform,f=vec2.create(),g=vec2.create(),h=vec2.create();vec2.set(g,e.scaleX,e.scaleY),vec2.set(f,e.rotPointX+d.tx,e.rotPointY+d.ty),vec2.set(h,d.tx,d.ty),mat3.identity(this.camMatrix),mat3.translate(this.camMatrix,this.camMatrix,f),mat3.rotate(this.camMatrix,this.camMatrix,e.rotation),mat3.translate(this.camMatrix,this.camMatrix,h),mat3.scale(this.camMatrix,this.camMatrix,g),vec2.negate(f,f),mat3.translate(this.camMatrix,this.camMatrix,f),this.collateRenderSequence(),this.collateBatches(),this.renderBatches(b,a)},b.prototype.collateRenderSequence=function(){this._sequence=[];var a=this._game.states.current;this.collateChild(a)},b.prototype.collateChild=function(b){if(b.childType()===a.GROUP)for(var c=0;c<b.members.length;c++)this.collateChild(b.members[c]);else{var d=b;this._sequence.push({entity:d,renderer:d.glRenderer,shader:d.glRenderer.shaderPair,isBatchRenderer:d.glRenderer.isBatchRenderer,texture:d.atlas})}},b.prototype.collateBatches=function(){var a=null,b=null,c=null;this._batches=[];for(var d,e=0;e<this._sequence.length;e++){if(!this._sequence[e].isBatchRenderer||this._sequence[e].renderer!==a||this._sequence[e].shader!==b||this._sequence[e].texture!==c){var d=this._batches.push(new Array)-1;a=this._sequence[e].renderer,b=this._sequence[e].shader,c=this._sequence[e].texture}this._batches[d].push(this._sequence[e])}},b.prototype.renderBatches=function(a,b){for(var c=0;c<this._batches.length;c++){var d=this._batches[c];d[0].isBatchRenderer?this.renderBatch(a,d,b):this.renderEntity(a,d[0].entity,b)}},b.prototype.renderBatch=function(a,b,c){this.setupGLState(a,b[0].entity),this._currentRenderer.clear(a,{camMatrix:this.camMatrix});for(var d=0;d<b.length;d++)b[d].entity.renderGL(a,c);this._currentRenderer.draw(a)},b.prototype.renderEntity=function(a,b,c){this.setupGLState(a,b),b.renderGL(a,c)},b.prototype.setupGLState=function(a,b){b.atlas!==this._currentTextureAtlas&&this._switchTexture(a,b),b.glRenderer!==this._currentRenderer&&this._switchRenderer(a,b)},b.prototype._switchRenderer=function(a,b){this._currentRenderer&&this._currentRenderer.disable(a),this._currentRenderer=b.glRenderer,this._currentRenderer.enable(a,{camMatrix:this.camMatrix,stageResolution:this._stageResolution,textureAtlas:this._currentTextureAtlas})},b.prototype._switchTexture=function(a,b){this._currentTextureAtlas=b.atlas,this._currentRenderer&&this._currentRenderer.updateTextureSize(a,new Float32Array([this._currentTextureAtlas.glTextureWrapper.image.width,this._currentTextureAtlas.glTextureWrapper.image.height])),this._textureManager.useTexture(a,b.atlas.glTextureWrapper)},b}();b.GLRenderManager=c}(a.Renderers||(a.Renderers={}));a.Renderers}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(){this._shaderPairs={}}return Object.defineProperty(b.prototype,"currentShader",{get:function(){return this._currentShader},enumerable:!0,configurable:!0}),b.prototype.init=function(a,b){this._currentShader=this.requestShader(a,b)},b.prototype.requestShader=function(a,b,c){"undefined"==typeof c&&(c=!0);var d;return b in this._shaderPairs?(d=this._shaderPairs[b],d.loaded||this._loadShader(a,d),c&&this._useShader(a,d),d):this.shaderExists?(d=this._addShader(a,b),this._loadShader(a,d),c&&this._useShader(a,d),d):(console.log("Shader "+b+" does not exist"),null)},b.prototype.shaderExists=function(b,c){return c in a.Shaders},b.prototype._addShader=function(b,c){return this._shaderPairs[c]=new a.Shaders[c],this._shaderPairs[c]},b.prototype._loadShader=function(a,b){b.init(a)},b.prototype._useShader=function(a,b){b!==this._currentShader&&(this._currentShader=b),a.useProgram(b.shaderProgram)},b}();b.ShaderManager=c}(a.Shaders||(a.Shaders={}));a.Shaders}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a,b,c){"undefined"==typeof c&&(c=!1),this._created=!1,this._uploaded=!1,this.textureAtlas=b,this.image=b.image,this._numBytes=this.image.width*this.image.height*4,this.createTexture(a),c&&this.uploadTexture(a)}return Object.defineProperty(a.prototype,"numBytes",{get:function(){return this._numBytes},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"created",{get:function(){return this._created},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"uploaded",{get:function(){return this._uploaded},enumerable:!0,configurable:!0}),a.prototype.createTexture=function(a){return this.texture=a.createTexture(),this._created=!0,!0},a.prototype.uploadTexture=function(a){var b=!1;return this.created||this.createTexture(a),this.uploaded?console.log("...not uploading:the image is already uploaded"):(a.bindTexture(a.TEXTURE_2D,this.texture),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,this.image),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.bindTexture(a.TEXTURE_2D,null),this._uploaded=!0,b=!0),b},a.prototype.refreshTexture=function(a){a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,this.image)},a.prototype.deleteTexture=function(a){return a.bindTexture(a.TEXTURE_2D,this.texture),a.deleteTexture(this.texture),this._uploaded=!1,this._created=!1,!0},a}();a.GLTextureWrapper=b}(a.Renderers||(a.Renderers={}));a.Renderers}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(){this.numTextureWrites=0,this._numTexturesUsed=0,this._usedTextureMem=0,this.maxTextureMem=1024*b.DEFAULT_MAX_TEX_MEM_MB*1024,this._textureWrapperCache=new Array}return Object.defineProperty(b.prototype,"usedTextureMem",{get:function(){return this._usedTextureMem},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"numTexturesUsed",{get:function(){return this._numTexturesUsed},enumerable:!0,configurable:!0}),b.prototype._addTextureToCache=function(a){this._textureWrapperCache.push(a)},b.prototype._deleteTexture=function(a,b){this._textureWrapperCache[b].deleteTexture(a),this._usedTextureMem-=this._textureWrapperCache[b].numBytes,this._numTexturesUsed--},b.prototype._uploadTexture=function(a,b){return b.numBytes+this._usedTextureMem<=this.maxTextureMem?(b.uploadTexture(a),this._usedTextureMem+=b.numBytes,this._numTexturesUsed++,!0):!1},b.prototype.uploadTextureLibrary=function(a,b){this._textureWrapperCache=new Array;for(var c in b.textures)this.uploadTexture(a,b.textures[c])},b.prototype.uploadTexture=function(b,c){var d=new a.Renderers.GLTextureWrapper(b,c);this._addTextureToCache(d),c.glTextureWrapper=d,this._uploadTexture(b,d)||console.log("...skipped uploading texture due to allocated texture memory exceeded")},b.prototype.clearTextures=function(a){for(var b=0;b<this._textureWrapperCache.length;b++)this._textureWrapperCache[b].deleteTexture(a),this._textureWrapperCache[b].textureAtlas.glTextureWrapper=null;this._textureWrapperCache=new Array},b.prototype.useTexture=function(a,b){return b.created&&b.uploaded||(this._uploadTexture(a,b)||(this._freeSpace(a,b.numBytes),this._uploadTexture(a,b)),this.numTextureWrites++),b.created&&b.uploaded?(a.bindTexture(a.TEXTURE_2D,b.texture),!0):!1},b.prototype._freeSpace=function(a,b){for(var c=99999999999,d=-1,e=0;e<this._textureWrapperCache.length;e++){var f=this._textureWrapperCache[e].numBytes;if(f===b&&this._textureWrapperCache[e].uploaded)return this._deleteTexture(a,e),!0;f>b&&c>f&&(c=f,d=e)}return!0},b.DEFAULT_MAX_TEX_MEM_MB=1024,b}();b.GLTextureManager=c}(a.Renderers||(a.Renderers={}));a.Renderers}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(b,c,d,e){"undefined"==typeof e&&(e=!0),this._created=!1,this._uploaded=!1,this.items=d||a.squareVertices,this.itemSize=c||2,this.numItems=this.items.length/this.itemSize,this.createBuffer(b),e&&this.uploadBuffer(b,this.items)}return Object.defineProperty(a.prototype,"created",{get:function(){return this._created},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"uploaded",{get:function(){return this._uploaded},enumerable:!0,configurable:!0}),a.prototype.clear=function(){this.items=new Array},a.prototype.createBuffer=function(a){return this.buffer=a.createBuffer(),this._created=!0,!0},a.prototype.uploadBuffer=function(a,b){this.items=b,this.numItems=this.items.length/this.itemSize;var c=new Float32Array(this.items);return a.bindBuffer(a.ARRAY_BUFFER,this.buffer),a.bufferData(a.ARRAY_BUFFER,c,a.DYNAMIC_DRAW),this._uploaded=!0,!0},a.prototype.deleteBuffer=function(a){return a.bindBuffer(a.ARRAY_BUFFER,this.buffer),a.deleteBuffer(this.buffer),this.uploaded=!1,this.created=!1,!0},a.squareVertices=[0,0,100,0,100,100,0,100],a.squareUVs=[0,0,.1,0,.1,.1,0,.1],a.squareCols=[1,1,1,1],a}();a.GLArrayBuffer=b}(a.Renderers||(a.Renderers={}));a.Renderers}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(b,c,d,e){"undefined"==typeof e&&(e=!0),this.indices=d||a.square,this.itemSize=c||1,this.numItems=this.indices.length/this.itemSize,e&&(this.buffer=this.init(b))}return a.prototype.clear=function(){this.indices=new Array},a.prototype.init=function(a){var b=a.createBuffer();return a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,b),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.indices),a.STATIC_DRAW),b},a.prototype.refresh=function(a){return this.numItems=this.indices.length/this.itemSize,a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.buffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array(this.indices),a.STATIC_DRAW),this.buffer},a.square=[0,1,2,0,2,3],a}();a.GLElementArrayBuffer=b}(a.Renderers||(a.Renderers={}));a.Renderers}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a,b,c){"undefined"==typeof c&&(c=!1),this.loaded=!1,this._isBatchRenderer=!1,this.shaderManager=b,this._isBatchRenderer=c,this.loaded=!0}return a.prototype.enable=function(a,b){"undefined"==typeof b&&(b=null)},a.prototype.disable=function(){},a.prototype.clear=function(){},a.prototype.draw=function(){},a.prototype.updateStageResolution=function(){},a.prototype.updateTextureSize=function(){},Object.defineProperty(a.prototype,"isBatchRenderer",{get:function(){return this._isBatchRenderer},enumerable:!0,configurable:!0}),a.RENDERER_ID="Renderer",a}();a.Renderer=b}(a.Renderers||(a.Renderers={}));a.Renderers}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(b){function c(c,d,e){"undefined"==typeof e&&(e=null),b.call(this,c,d,!0),this._maxItems=1e3;var f=5;this._vertexBuffer=new a.Renderers.GLArrayBuffer(c,f);var g=6;this._indexBuffer=new a.Renderers.GLElementArrayBuffer(c,1,this._generateIndices(this._maxItems*g)),this.shaderPair=this.shaderManager.requestShader(c,"TextureAtlasShader")}return __extends(c,b),c.prototype.enable=function(a,b){"undefined"==typeof b&&(b=null),this.shaderPair=this.shaderManager.requestShader(a,"TextureAtlasShader"),a.uniform1i(this.shaderPair.uniforms.uSampler.location,0),a.uniform2fv(this.shaderPair.uniforms.uResolution.location,b.stageResolution),a.uniformMatrix3fv(this.shaderPair.uniforms.uCamMatrix.location,!1,b.camMatrix),this.updateTextureSize(a,new Float32Array([b.textureAtlas.glTextureWrapper.image.width,b.textureAtlas.glTextureWrapper.image.height]))},c.prototype.disable=function(a){a.disableVertexAttribArray(this.shaderPair.attributes.aXYUV),a.disableVertexAttribArray(this.shaderPair.attributes.aAlpha)},c.prototype.clear=function(a,b){this._vertexBuffer.clear(),a.uniformMatrix3fv(this.shaderPair.uniforms.uCamMatrix.location,!1,b.camMatrix)},c.prototype.draw=function(a){this._vertexBuffer.uploadBuffer(a,this._vertexBuffer.items),a.enableVertexAttribArray(this.shaderPair.attributes.aXYUV),a.vertexAttribPointer(this.shaderPair.attributes.aXYUV,4,a.FLOAT,!1,20,0),a.enableVertexAttribArray(this.shaderPair.attributes.aAlpha),a.vertexAttribPointer(this.shaderPair.attributes.aAlpha,1,a.FLOAT,!1,20,16),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this._indexBuffer.buffer),a.drawElements(a.TRIANGLES,this._vertexBuffer.items.length/20*6,a.UNSIGNED_SHORT,0)},c.prototype._generateIndices=function(a){for(var b=new Array,c=0;a>c;c++)b.push(4*c+0,4*c+1,4*c+2,4*c+0,4*c+2,4*c+3);return b},c.prototype.updateStageResolution=function(a,b){a.uniform2fv(this.shaderPair.uniforms.uResolution.location,b)},c.prototype.updateTextureSize=function(a,b){a.uniform2fv(this.shaderPair.uniforms.uTextureSize.location,b)},c.prototype.addToBatch=function(b,c){var d=c.transform,e=d.getConcatenatedMatrix(),f=c.atlas.cells[c.cellIndex],g=new a.Geom.Point(0-d.rotPointX,0-d.rotPointY),h=new a.Geom.Point(f.w-d.rotPointX,0-d.rotPointY),i=new a.Geom.Point(f.w-d.rotPointX,f.h-d.rotPointY),j=new a.Geom.Point(0-d.rotPointX,f.h-d.rotPointY);g=e.transformPoint(g),h=e.transformPoint(h),i=e.transformPoint(i),j=e.transformPoint(j),this._vertexBuffer.items.push(g.x+d.rotPointX,g.y+d.rotPointY,f.x,f.y,c.alpha,h.x+d.rotPointX,h.y+d.rotPointY,f.x+f.w,f.y,c.alpha,i.x+d.rotPointX,i.y+d.rotPointY,f.x+f.w,f.y+f.h,c.alpha,j.x+d.rotPointX,j.y+d.rotPointY,f.x,f.y+f.h,c.alpha)},c.prototype.concatBatch=function(a){this._vertexBuffer.items=this._vertexBuffer.items.concat(a)},c.RENDERER_ID="TextureAtlasRenderer",c}(a.Renderers.Renderer);b.TextureAtlasRenderer=c}(a.Renderers||(a.Renderers={}));a.Renderers}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(){this.loaded=!1}return a.prototype.init=function(a){this.vertShader=this.compile(a,this.vertSource.join("\n"),a.VERTEX_SHADER),this.fragShader=this.compile(a,this.fragSource.join("\n"),a.FRAGMENT_SHADER),this.shaderProgram=this.attach(a,this.vertShader,this.fragShader),this.loaded=!0},a.prototype.attach=function(a,b,c){var d=a.createProgram();return a.attachShader(d,c),a.attachShader(d,b),a.linkProgram(d),d},a.prototype.compile=function(a,b,c){var d=a.createShader(c);return a.shaderSource(d,b),a.compileShader(d),a.getShaderParameter(d,a.COMPILE_STATUS)?d:null},a.prototype.setParam=function(a,b){this.uniforms[a].value=b,this.uniforms[a].dirty=!0},a.prototype.applyUniforms=function(a){for(var b in this.uniforms)this.applyUniform(a,b)},a.prototype.applyUniform=function(a,b){var c=this.uniforms[b];this.uniforms[b].dirty&&(console.log(b),a["uniform"+c.type](c.location,c.value),this.uniforms[b].dirty=!1)},a.prototype.initUniforms=function(a){for(var b in this.uniforms){var c=this.uniforms[b];c.location=a.getUniformLocation(this.shaderProgram,b),c.dirty=!0,c.value=null}},a.RENDERER_ID="ShaderPair",a}();a.ShaderPair=b}(a.Shaders||(a.Shaders={}));a.Shaders}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(a){function b(){a.call(this),this.attributes={aXYUV:null,aAlpha:null},this.uniforms={uCamMatrix:{type:"mat3"},uResolution:{type:"2fv"},uTextureSize:{type:"2fv"},uSampler:{type:"1i"}},this.fragSource=["precision mediump float;","varying vec2 vTextureCoord;","varying float vAlpha;","uniform sampler2D uSampler;","void main(void) {","gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));","gl_FragColor.a *= vAlpha;","}"],this.vertSource=["attribute vec4 aXYUV;","attribute float aAlpha;","uniform mat3 uCamMatrix;","uniform vec2 uResolution;","uniform vec2 uTextureSize;","varying vec2 vTextureCoord;","varying float vAlpha;","void main(void) {","   vec2 pos = (uCamMatrix * vec3(aXYUV.xy,1)).xy; ","   gl_Position = vec4((pos / uResolution * 2.0 - 1.0) * vec2(1, -1), 0, 1);","   vTextureCoord = aXYUV.zw / uTextureSize;","   vAlpha = aAlpha;","}"]}return __extends(b,a),b.prototype.init=function(b){a.prototype.init.call(this,b),this.attributes.aXYUV=b.getAttribLocation(this.shaderProgram,"aXYUV"),this.attributes.aAlpha=b.getAttribLocation(this.shaderProgram,"aAlpha"),this.initUniforms(b)},b}(a.Shaders.ShaderPair);b.TextureAtlasShader=c}(a.Shaders||(a.Shaders={}));a.Shaders}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d){this._frameIndex=0,this._startTime=null,this._reverse=!1,this._isPlaying=!1,this._onStop=null,this._onPlay=null,this._onUpdate=null,this._onLoop=null,this.name=a,this._sequence=b,this._speed=b.speed,this._loop=b.loop,this._clock=c,this._parent=d}return b.prototype.objType=function(){return"Animation"},Object.defineProperty(b.prototype,"loop",{get:function(){return this._loop},set:function(a){this._loop=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"frameIndex",{get:function(){return this._frameIndex},set:function(a){this._validateFrame(a)&&(this._frameIndex=a)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"currentCell",{get:function(){return this._sequence.cells[this.frameIndex]},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"speed",{get:function(){return this._speed},set:function(a){this._speed=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"reverse",{get:function(){return this._reverse},set:function(a){this._reverse=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"isPlaying",{get:function(){return this._isPlaying},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onStop",{get:function(){return null==this._onStop&&(this._onStop=new a.Signal),this._onStop},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onPlay",{get:function(){return null==this._onPlay&&(this._onPlay=new a.Signal),this._onPlay},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onUpdate",{get:function(){return null==this._onUpdate&&(this._onUpdate=new a.Signal),this._onUpdate},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onLoop",{get:function(){return null==this._onLoop&&(this._onLoop=new a.Signal),this._onLoop},enumerable:!0,configurable:!0}),b.prototype._start=function(a){"undefined"==typeof a&&(a=null),null!==a&&(this.frameIndex=a),this._isPlaying=!0,this._startTime=this._clock.elapsed(),this._tick=this._startTime+this._speed,null!==this._onPlay&&this._onPlay.dispatch()},b.prototype.play=function(){this._frameIndex===this.length-1&&(this.frameIndex=0),this.playAt(this._frameIndex)},b.prototype.playAt=function(a){this._start(a)},b.prototype.pause=function(){this.stop()},b.prototype.resume=function(){null!==this._startTime&&(this._isPlaying=!0)},b.prototype.stop=function(){this._isPlaying&&(this._isPlaying=!1,null!==this._onStop&&this._onStop.dispatch())},b.prototype.nextFrame=function(){this._frameIndex++,this._frameIndex>=this.length&&(this.frameIndex=0)},b.prototype.prevFrame=function(){this._frameIndex--,this._frameIndex<0&&(this.frameIndex=this.length-1)},b.prototype.update=function(){this._isPlaying&&this._clock.elapsed()>=this._tick&&(this._tick=this._clock.elapsed()+this._speed,this._validateFrame(this._frameIndex+(1==this._reverse?-1:1))?(this._frameIndex+=1==this._reverse?-1:1,this._parent.updateCellIndex(),null!==this._onUpdate&&this._onUpdate.dispatch()):this._loop?(this._frameIndex=this._reverse?this.length-1:0,this._parent.updateCellIndex(),null!==this._onLoop&&this._onLoop.dispatch()):this._parent.stop())},b.prototype._validateFrame=function(a){return a<this.length&&a>=0},Object.defineProperty(b.prototype,"length",{get:function(){return this._sequence.cells.length},enumerable:!0,configurable:!0}),b.prototype.destroy=function(){this._isPlaying=!1,delete this._clock,delete this._sequence,delete this._parent,this._onLoop&&this._onLoop.dispose(),this._onStop&&this._onStop.dispose(),this._onPlay&&this._onPlay.dispose(),this._onUpdate&&this._onUpdate.dispose(),delete this._onLoop,delete this._onStop,delete this._onPlay,delete this._onUpdate,delete this.frameIndex,delete this.loop,delete this._reverse,delete this._tick},b}();b.Animation=c}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a,b,c,d){"undefined"==typeof c&&(c=.1),"undefined"==typeof d&&(d=!0),this.name=a,this.cells=b,this.speed=c,this.loop=d}return a}();a.Sequence=b}(a.Animations||(a.Animations={}));a.Animations}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a,b,c){this.preventDefault=!1,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.timeUp=0,this.repeats=0,this._manager=a,this.game=this._manager.game,this.keyCode=b,c&&this.update(c)
-}return a.prototype.objType=function(){return"Key"},Object.defineProperty(a.prototype,"duration",{get:function(){return this.isDown&&(this.timeDown=this.game.time.now()),this.timeDown<this.timeUp?0:this.timeDown-this.timeUp},enumerable:!0,configurable:!0}),a.prototype.update=function(a){this.keyCode=a.keyCode,this.preventDefault&&a.preventDefault(),"keydown"===a.type?(this.altKey=a.altKey,this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.isDown===!0?(this.repeats++,this.timeDown=this.game.time.now()):(this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now(),this.repeats=0)):"keyup"===a.type&&(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now())},a.prototype.justPressed=function(a){return"undefined"==typeof a&&(a=this._manager.justPressedRate),this.isDown===!0&&this.timeDown+a>this.game.time.now()?!0:!1},a.prototype.justReleased=function(a){return"undefined"==typeof a&&(a=this._manager.justReleasedRate),this.isUp===!0&&this.timeUp+a>this.game.time.now()?!0:!1},a.prototype.reset=function(){this.isDown=!1,this.isUp=!0,this.timeUp=0,this.timeDown=0,this.repeats=0,this.altKey=!1,this.shiftKey=!1,this.ctrlKey=!1},a}();a.Key=b}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._keys=[],this.justPressedRate=200,this.justReleasedRate=200,this.game=a}return b.prototype.objType=function(){return"Keyboard"},Object.defineProperty(b.prototype,"keys",{get:function(){return this._keys},enumerable:!0,configurable:!0}),b.prototype.boot=function(){this.onKeyUp=new a.Signal,this.onKeyDown=new a.Signal,this.onKeyDownOnce=new a.Signal,this.start()},b.prototype.update=function(){},b.prototype.start=function(){var b=this;this.game.deviceTargetOption===a.TARGET_BROWSER&&(document.body.addEventListener("keydown",function(a){return b._keyPressed(a)},!1),document.body.addEventListener("keyup",function(a){return b._keyReleased(a)},!1))},b.prototype.stop=function(){var b=this;this.game.deviceTargetOption===a.TARGET_BROWSER&&(document.body.removeEventListener("keydown",function(a){return b._keyPressed(a)},!1),document.body.removeEventListener("keyup",function(a){return b._keyReleased(a)},!1))},b.prototype._keyPressed=function(b){this._keys[b.keyCode]?this._keys[b.keyCode].update(b):this._keys[b.keyCode]=new a.Input.Key(this,b.keyCode,b),0==this._keys[b.keyCode].repeats&&this.onKeyDownOnce.dispatch(b.keyCode,this._keys[b.keyCode]),this.onKeyDown.dispatch(b.keyCode,this._keys[b.keyCode])},b.prototype._keyReleased=function(b){this._keys[b.keyCode]?this._keys[b.keyCode].update(b):this._keys[b.keyCode]=new a.Input.Key(this,b.keyCode,b),this.onKeyUp.dispatch(b.keyCode,this._keys[b.keyCode])},b.prototype.addKey=function(b,c){"undefined"==typeof c&&(c=!1);var d=new a.Input.Key(this,b);return d.preventDefault=c,this._keys[b]=d},b.prototype.justPressed=function(a,b){return"undefined"==typeof b&&(b=this.justPressedRate),this._keys[a]?this._keys[a].justPressed(b):!1},b.prototype.justReleased=function(a,b){return"undefined"==typeof b&&(b=this.justReleasedRate),this._keys[a]?this._keys[a].justReleased(b):!1},b.prototype.isDown=function(a){return this._keys[a]?this._keys[a].isDown:!1},b.prototype.isUp=function(a){return this._keys[a]?this._keys[a].isUp:!1},b.prototype.reset=function(){for(var a in this._keys)this._keys[a].reset()},b}();b.Keyboard=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Keycodes"},a.A="A".charCodeAt(0),a.B="B".charCodeAt(0),a.C="C".charCodeAt(0),a.D="D".charCodeAt(0),a.E="E".charCodeAt(0),a.F="F".charCodeAt(0),a.G="G".charCodeAt(0),a.H="H".charCodeAt(0),a.I="I".charCodeAt(0),a.J="J".charCodeAt(0),a.K="K".charCodeAt(0),a.L="L".charCodeAt(0),a.M="M".charCodeAt(0),a.N="N".charCodeAt(0),a.O="O".charCodeAt(0),a.P="P".charCodeAt(0),a.Q="Q".charCodeAt(0),a.R="R".charCodeAt(0),a.S="S".charCodeAt(0),a.T="T".charCodeAt(0),a.U="U".charCodeAt(0),a.V="V".charCodeAt(0),a.W="W".charCodeAt(0),a.X="X".charCodeAt(0),a.Y="Y".charCodeAt(0),a.Z="Z".charCodeAt(0),a.ZERO="0".charCodeAt(0),a.ONE="1".charCodeAt(0),a.TWO="2".charCodeAt(0),a.THREE="3".charCodeAt(0),a.FOUR="4".charCodeAt(0),a.FIVE="5".charCodeAt(0),a.SIX="6".charCodeAt(0),a.SEVEN="7".charCodeAt(0),a.EIGHT="8".charCodeAt(0),a.NINE="9".charCodeAt(0),a.NUMPAD_0=96,a.NUMPAD_1=97,a.NUMPAD_2=98,a.NUMPAD_3=99,a.NUMPAD_4=100,a.NUMPAD_5=101,a.NUMPAD_6=102,a.NUMPAD_7=103,a.NUMPAD_8=104,a.NUMPAD_9=105,a.NUMPAD_MULTIPLY=106,a.NUMPAD_ADD=107,a.NUMPAD_ENTER=108,a.NUMPAD_SUBTRACT=109,a.NUMPAD_DECIMAL=110,a.NUMPAD_DIVIDE=111,a.F1=112,a.F2=113,a.F3=114,a.F4=115,a.F5=116,a.F6=117,a.F7=118,a.F8=119,a.F9=120,a.F10=121,a.F11=122,a.F12=123,a.F13=124,a.F14=125,a.F15=126,a.COLON=186,a.EQUALS=187,a.UNDERSCORE=189,a.QUESTION_MARK=191,a.TILDE=192,a.OPEN_BRACKET=219,a.BACKWARD_SLASH=220,a.CLOSED_BRACKET=221,a.QUOTES=222,a.BACKSPACE=8,a.TAB=9,a.CLEAR=12,a.ENTER=13,a.SHIFT=16,a.CONTROL=17,a.ALT=18,a.CAPS_LOCK=20,a.ESC=27,a.SPACEBAR=32,a.PAGE_UP=33,a.PAGE_DOWN=34,a.END=35,a.HOME=36,a.LEFT=37,a.UP=38,a.RIGHT=39,a.DOWN=40,a.INSERT=45,a.DELETE=46,a.HELP=47,a.NUM_LOCK=144,a}();a.Keycodes=b}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this.game=a}return b.prototype.objType=function(){return"InputManager"},Object.defineProperty(b.prototype,"pointers",{get:function(){return this._pointers},enumerable:!0,configurable:!0}),b.prototype.boot=function(){this._pointers=[],this.mouse=new a.Input.Mouse(this.game),this.mouse.boot(),this.keyboard=new a.Input.Keyboard(this.game),this.keyboard.boot(),this.touch=new a.Input.Touch(this.game),this.touch.boot(),1==a.DEVICE.touch?(this.touch.touchDown.add(this._onDownEvent,this),this.touch.touchUp.add(this._onUpEvent,this),this._pointers=this.touch.fingers):(this.mouse.onDown.add(this._onDownEvent,this),this.mouse.onUp.add(this._onUpEvent,this),this._pointers.push(this.mouse.cursor)),this.isDown=!1,this.position=new a.Geom.Point,this.onDown=new a.Signal,this.onUp=new a.Signal},b.prototype._onDownEvent=function(a,b,c,d,e,f){this.onDown.dispatch(a,b,c,d,e,f)},b.prototype._onUpEvent=function(a,b,c,d,e,f){this.onUp.dispatch(a,b,c,d,e,f)},Object.defineProperty(b.prototype,"onPressed",{get:function(){return this.onDown},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onReleased",{get:function(){return this.onUp},enumerable:!0,configurable:!0}),b.prototype.update=function(){this.mouse.update(),this.keyboard.update(),this.touch.update(),this.touch.touchEnabled?this.position.setTo(this.touch.x,this.touch.y):this.position.setTo(this.mouse.x,this.mouse.y),this.isDown=this.mouse.isDown||this.touch.isDown},b.prototype.reset=function(){this.mouse.reset(),this.keyboard.reset(),this.touch.reset()},Object.defineProperty(b.prototype,"x",{get:function(){return this.position.x},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"y",{get:function(){return this.position.y},enumerable:!0,configurable:!0}),b}();b.InputManager=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._domElement=null,this._game=a}return b.prototype.objType=function(){return"Mouse"},Object.defineProperty(b.prototype,"cursor",{get:function(){return this._cursor},enumerable:!0,configurable:!0}),b.prototype.boot=function(){this._domElement=this._game.stage.container,this._cursor=new a.Input.MouseCursor(this._game),this._cursor.active=!0,this._cursor.id=1,this.onDown=new a.Signal,this.onUp=new a.Signal,this.onWheel=new a.Signal,this.start()},Object.defineProperty(b.prototype,"isDown",{get:function(){return this._cursor.isDown},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"isUp",{get:function(){return this._cursor.isUp},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"duration",{get:function(){return this._cursor.duration},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"x",{get:function(){return this._cursor.x},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"y",{get:function(){return this._cursor.y},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"wheelDeltaX",{get:function(){return this._cursor.wheelDeltaX},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"wheelDeltaY",{get:function(){return this._cursor.wheelDeltaY},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"ctrlKey",{get:function(){return this._cursor.ctrlKey},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"shiftKey",{get:function(){return this._cursor.shiftKey},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"altKey",{get:function(){return this._cursor.altKey},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"button",{get:function(){return this._cursor.button},enumerable:!0,configurable:!0}),b.prototype.update=function(){this._cursor.update()},b.prototype.start=function(){var b=this;this._game.deviceTargetOption===a.TARGET_BROWSER?a.DEVICE.ie&&a.DEVICE.ieVersion<9?(this._domElement.attachEvent("onmousedown",function(a){return b.onMouseDown(a)}),this._domElement.attachEvent("onmousemove",function(a){return b.onMouseMove(a)}),this._domElement.attachEvent("onmouseup",function(a){return b.onMouseUp(a)}),this._domElement.attachEvent("onmousewheel",function(a){return b.onMouseWheel(a)})):(this._domElement.addEventListener("mousedown",function(a){return b.onMouseDown(a)},!0),this._domElement.addEventListener("mousemove",function(a){return b.onMouseMove(a)},!0),this._domElement.addEventListener("mouseup",function(a){return b.onMouseUp(a)},!0),this._domElement.addEventListener("mousewheel",function(a){return b.onMouseWheel(a)},!0),this._domElement.addEventListener("DOMMouseScroll",function(a){return b.onMouseWheel(a)},!0)):this._game.deviceTargetOption===a.TARGET_COCOON&&(this._game.stage.canvas.addEventListener("mousedown",function(a){return b.onMouseDown(a)},!0),this._game.stage.canvas.addEventListener("mousemove",function(a){return b.onMouseMove(a)},!0),this._game.stage.canvas.addEventListener("mouseup",function(a){return b.onMouseUp(a)},!0),this._game.stage.canvas.addEventListener("mousewheel",function(a){return b.onMouseWheel(a)},!0),this._game.stage.canvas.addEventListener("DOMMouseScroll",function(a){return b.onMouseWheel(a)},!0))},b.prototype.stop=function(){var b=this;this._game.deviceTargetOption===a.TARGET_BROWSER&&(this._domElement.removeEventListener("mousedown",function(a){return b.onMouseDown(a)},!1),this._domElement.removeEventListener("mousedown",this.onMouseDown,!1),this._domElement.removeEventListener("mousemove",this.onMouseMove,!1),this._domElement.removeEventListener("mouseup",this.onMouseUp,!1),this._domElement.removeEventListener("mousewheel",this.onMouseWheel,!1),this._domElement.removeEventListener("DOMMouseScroll",this.onMouseWheel,!1))},b.prototype.onMouseDown=function(a){this._cursor.start(a),this.onDown.dispatch(this._cursor.x,this._cursor.y,this._cursor.timeDown,this._cursor.timeUp,this.duration,this._cursor)},b.prototype.onMouseMove=function(a){this._cursor.move(a)},b.prototype.onMouseUp=function(a){this._cursor.stop(a),this.onUp.dispatch(this._cursor.x,this._cursor.y,this._cursor.timeDown,this._cursor.timeUp,this.duration,this._cursor)},b.prototype.onMouseWheel=function(a){this._cursor.wheel(a),this.onWheel.dispatch(this._cursor.wheelDeltaX,this._cursor.wheelDeltaY,this._cursor)},b.prototype.justPressed=function(a){return"undefined"==typeof a&&(a=this._cursor.justPressedRate),this._cursor.justPressed(a)},b.prototype.justReleased=function(a){return"undefined"==typeof a&&(a=this._cursor.justReleasedRate),this._cursor.justReleased(a)},b.prototype.reset=function(){this._cursor.reset()},b.LEFT_BUTTON=0,b.MIDDLE_BUTTON=1,b.RIGHT_BUTTON=2,b}();b.Mouse=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._domElement=null,this.isDown=!1,this.isUp=!0,this._maxPointers=10,this._game=a}return b.prototype.objType=function(){return"TouchManager"},Object.defineProperty(b.prototype,"fingers",{get:function(){return this._fingers},enumerable:!0,configurable:!0}),b.prototype.boot=function(){this._domElement=this._game.stage.container,this.finger1=new a.Input.Finger(this._game),this.finger2=new a.Input.Finger(this._game),this.finger3=new a.Input.Finger(this._game),this.finger4=new a.Input.Finger(this._game),this.finger5=new a.Input.Finger(this._game),this.finger6=new a.Input.Finger(this._game),this.finger7=new a.Input.Finger(this._game),this.finger8=new a.Input.Finger(this._game),this.finger9=new a.Input.Finger(this._game),this.finger10=new a.Input.Finger(this._game),this._fingers=[this.finger1,this.finger2,this.finger3,this.finger4,this.finger5,this.finger6,this.finger7,this.finger8,this.finger9,this.finger10],this.latestFinger=this.finger1,this.touchDown=new a.Signal,this.touchUp=new a.Signal,this.touchCancel=new a.Signal,this.start()},b.prototype.start=function(){var b=this;if(a.DEVICE.touch)if(this.touchEnabled=!0,this._game.deviceTargetOption===a.TARGET_BROWSER)if(a.DEVICE.pointerEnabled){var c="pointerup",d="pointerdown",e="pointerenter",f="pointerleave",g="pointercancel",h="pointermove";if(window.navigator.msPointerEnabled)var c="MSPointerUp",d="MSPointerDown",e="MSPointerEnter",f="MSPointerLeave",g="MSPointerCancel",h="MSPointerMove";this._domElement.addEventListener(c,function(a){return b.onPointerStart(a)},!1),this._domElement.addEventListener(d,function(a){return b.onPointerEnd(a)},!1),this._domElement.addEventListener(e,function(a){return b.onPointerEnter(a)},!1),this._domElement.addEventListener(f,function(a){return b.onPointerLeave(a)},!1),this._domElement.addEventListener(g,function(a){return b.onPointerCancel(a)},!1),this._domElement.addEventListener(h,function(a){return b.onPointerMove(a)},!1)}else this._domElement.addEventListener("touchstart",function(a){return b.onTouchStart(a)},!1),this._domElement.addEventListener("touchmove",function(a){return b.onTouchMove(a)},!1),this._domElement.addEventListener("touchend",function(a){return b.onTouchEnd(a)},!1),this._domElement.addEventListener("touchenter",function(a){return b.onTouchEnter(a)},!1),this._domElement.addEventListener("touchleave",function(a){return b.onTouchLeave(a)},!1),this._domElement.addEventListener("touchcancel",function(a){return b.onTouchCancel(a)},!1),document.addEventListener("touchmove",function(a){return b.consumeTouchMove(a)},!1);else this._game.deviceTargetOption===a.TARGET_COCOON&&(this._game.stage.canvas.addEventListener("touchstart",function(a){return b.onTouchStart(a)},!1),this._game.stage.canvas.addEventListener("touchmove",function(a){return b.onTouchMove(a)},!1),this._game.stage.canvas.addEventListener("touchend",function(a){return b.onTouchEnd(a)},!1),this._game.stage.canvas.addEventListener("touchenter",function(a){return b.onTouchEnter(a)},!1),this._game.stage.canvas.addEventListener("touchleave",function(a){return b.onTouchLeave(a)},!1),this._game.stage.canvas.addEventListener("touchcancel",function(a){return b.onTouchCancel(a)},!1));else this.touchEnabled=!1},b.prototype.consumeTouchMove=function(a){a.preventDefault()},Object.defineProperty(b.prototype,"x",{get:function(){return this.latestFinger.x},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"y",{get:function(){return this.latestFinger.y},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"maximumPointers",{get:function(){return this._maxPointers},set:function(a){0>a&&(a=1),a>this._fingers.length&&(a=this._fingers.length),this._maxPointers=a},enumerable:!0,configurable:!0}),b.prototype._registerFinger=function(a,b){for(var c=0;c<this._maxPointers;c++)if(this._fingers[c].active===!1){this._fingers[c].id=b,this._fingers[c].start(a),this.latestFinger=this._fingers[c],this.touchDown.dispatch(this._fingers[c].x,this._fingers[c].y,this._fingers[c].timeDown,this._fingers[c].timeUp,this._fingers[c].duration,this._fingers[c]),this.isDown=!0,this.isUp=!1;break}},b.prototype._deregisterFinger=function(a,b){for(var c=0;c<this._fingers.length;c++)if(this._fingers[c].active&&this._fingers[c].id===b){this._fingers[c].stop(a),this.latestFinger=this._fingers[c],this.touchUp.dispatch(this._fingers[c].x,this._fingers[c].y,this._fingers[c].timeDown,this._fingers[c].timeUp,this._fingers[c].duration,this._fingers[c]),this.isDown=!1,this.isUp=!0;break}for(var d=0;d<this._fingers.length;d++)this._fingers[d].active&&(this.isDown=!0,this.isUp=!1)},b.prototype._cancelFinger=function(a,b){for(var c=0;c<this._fingers.length;c++)if(this._fingers[c].active&&this._fingers[c].id===b){this._fingers[c].stop(a),this.touchCancel.dispatch(this._fingers[c].x,this._fingers[c].y,this._fingers[c].timeDown,this._fingers[c].timeUp,this._fingers[c].duration,this._fingers[c]);break}for(var d=0;d<this._fingers.length;d++)this._fingers[d].active&&(this.isDown=!0,this.isUp=!1)},b.prototype._enterFinger=function(a,b){for(var c=0;c<this._maxPointers;c++)if(this._fingers[c].active===!1){this._fingers[c].id=b,this._fingers[c].start(a),this.latestFinger=this._fingers[c],this.isDown=!0,this.isUp=!1;break}},b.prototype._leaveFinger=function(a,b){for(var c=0;c<this._fingers.length;c++)if(this._fingers[c].active&&this._fingers[c].id===b){this._fingers[c].leave(a);break}},b.prototype._moveFinger=function(a,b){for(var c=0;c<this._fingers.length;c++)if(this._fingers[c].active&&this._fingers[c].id===b){this._fingers[c].move(a),this.latestFinger=this._fingers[c];break}},b.prototype.onTouchStart=function(a){for(var b=0;b<a.changedTouches.length;b++)this._registerFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onTouchCancel=function(a){for(var b=0;b<a.changedTouches.length;b++)this._cancelFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onTouchEnter=function(a){for(var b=0;b<a.changedTouches.length;b++)this._enterFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onTouchLeave=function(a){for(var b=0;b<a.changedTouches.length;b++)this._leaveFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onTouchMove=function(a){for(var b=0;b<a.changedTouches.length;b++)this._moveFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onTouchEnd=function(a){for(var b=0;b<a.changedTouches.length;b++)this._deregisterFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onPointerStart=function(a){"touch"===a.type&&this._registerFinger(a,a.pointerId)},b.prototype.onPointerCancel=function(a){"touch"===a.type&&this._cancelFinger(a,a.pointerId)},b.prototype.onPointerEnter=function(a){"touch"===a.type&&this._enterFinger(a,a.pointerId)},b.prototype.onPointerLeave=function(a){"touch"===a.type&&this._leaveFinger(a,a.pointerId)},b.prototype.onPointerMove=function(a){"touch"===a.type&&this._moveFinger(a,a.pointerId)},b.prototype.onPointerEnd=function(a){"touch"===a.type&&this._deregisterFinger(a,a.pointerId)},b.prototype.update=function(){if(this.touchEnabled&&this.isDown)for(var a=0;a<this._fingers.length;a++)this._fingers[a].active&&this._fingers[a].update()},b.prototype.stop=function(){var b=this;this.touchEnabled&&(this._game.deviceTargetOption===a.TARGET_BROWSER?(this._domElement.removeEventListener("touchstart",function(a){return b.onTouchStart(a)},!1),this._domElement.removeEventListener("touchmove",function(a){return b.onTouchMove(a)},!1),this._domElement.removeEventListener("touchend",function(a){return b.onTouchEnd(a)},!1),this._domElement.removeEventListener("touchenter",function(a){return b.onTouchEnter(a)},!1),this._domElement.removeEventListener("touchleave",function(a){return b.onTouchLeave(a)},!1),this._domElement.removeEventListener("touchcancel",function(a){return b.onTouchCancel(a)},!1)):this._game.deviceTargetOption===a.TARGET_COCOON&&(this._game.stage.canvas.removeEventListener("touchstart",function(a){return b.onTouchStart(a)},!1),this._game.stage.canvas.removeEventListener("touchmove",function(a){return b.onTouchMove(a)},!1),this._game.stage.canvas.removeEventListener("touchend",function(a){return b.onTouchEnd(a)},!1),this._game.stage.canvas.removeEventListener("touchenter",function(a){return b.onTouchEnter(a)},!1),this._game.stage.canvas.removeEventListener("touchleave",function(a){return b.onTouchLeave(a)},!1),this._game.stage.canvas.removeEventListener("touchcancel",function(a){return b.onTouchCancel(a)},!1)))},b.prototype.reset=function(){for(var a=0;a<this._fingers.length;a++)this._fingers[a].reset()},b}();b.Touch=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(b){this.x=-1,this.y=-1,this.clientX=-1,this.clientY=-1,this.pageX=-1,this.pageY=-1,this.screenX=-1,this.screenY=-1,this.isDown=!1,this.isUp=!0,this.withinGame=!1,this.active=!1,this.timeDown=0,this.timeUp=0,this.duration=0,this.frameDuration=0,this.justPressedRate=200,this.justReleasedRate=200,this._game=b,this.point=new a.Geom.Point,this.circle=new a.Geom.Circle(0,0,1),this.startPoint=new a.Geom.Point,this.endPoint=new a.Geom.Point}return b.prototype.objType=function(){return"Pointer"},Object.defineProperty(b.prototype,"game",{get:function(){return this._game},enumerable:!0,configurable:!0}),b.prototype.start=function(a){this.move(a),this.startPoint.setTo(this.x,this.y),this.frameDuration=0,this.withinGame=!0,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now()},b.prototype.stop=function(){this.withinGame=!1,this.endPoint.setTo(this.x,this.y),this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now(),this.duration=this.timeUp-this.timeDown},b.prototype.move=function(a){this.clientX=a.clientX,this.clientY=a.clientY,this.pageX=a.pageX,this.pageY=a.pageY,this.screenX=a.screenX,this.screenY=a.screenY,this.x=(this.pageX-this.game.stage.offset.x)*this.game.stage.scaleX,this.y=(this.pageY-this.game.stage.offset.y)*this.game.stage.scaleY,this.point.setTo(this.x,this.y),this.circle.x=this.x,this.circle.y=this.y,this.duration=this.game.time.now()-this.timeDown},b.prototype.justPressed=function(a){return"undefined"==typeof a&&(a=this.justPressedRate),this.isDown===!0&&this.timeDown+a>this._game.time.now()?!0:!1},b.prototype.justReleased=function(a){return"undefined"==typeof a&&(a=this.justReleasedRate),this.isUp===!0&&this.timeUp+a>this._game.time.now()?!0:!1},b.prototype.reset=function(){this.isDown=!1,this.isUp=!0,this.timeDown=0,this.timeUp=0,this.duration=0,this.frameDuration=0},b.prototype.update=function(){this.isDown===!0&&(this.frameDuration++,this.duration=this._game.time.now()-this.timeDown)},b}();b.Pointer=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments),this.wheelDeltaX=0,this.wheelDeltaY=0}return __extends(b,a),b.prototype.objType=function(){return"MouseCursor"},b.prototype.start=function(b){this.ctrlKey=b.ctrlKey,this.shiftKey=b.shiftKey,this.altKey=b.altKey,this.button-b.button,a.prototype.start.call(this,b)},b.prototype.stop=function(b){this.move(b),a.prototype.stop.call(this,b)},b.prototype.wheel=function(a){this.wheelDeltaX=a.wheelDeltaX?a.wheelDeltaX:a.deltaX,this.wheelDeltaY=a.wheelDeltaY?a.wheelDeltaY:a.deltaY},b}(a.Input.Pointer);b.MouseCursor=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(a){function b(b){a.call(this,b),this.circle.diameter=44}return __extends(b,a),b.prototype.objType=function(){return"Finger"},b.prototype.start=function(b){this.active=!0,a.prototype.start.call(this,b)},b.prototype.stop=function(b){this.active=!1,a.prototype.stop.call(this,b)},b.prototype.leave=function(a){this.withinGame=!1,this.move(a)},b.prototype.reset=function(){this.active=!1,a.prototype.reset.call(this)},b}(a.Input.Pointer);b.Finger=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d){this.cx=0,this.cy=0,this.halfWidth=0,this.halfHeight=0,this.cx=a||0,this.cy=b||0,this.halfWidth=c/2||0,this.halfHeight=d/2||0}return b.prototype.objType=function(){return"AABB"},Object.defineProperty(b.prototype,"height",{get:function(){return 2*this.halfHeight},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"width",{get:function(){return 2*this.halfWidth},enumerable:!0,configurable:!0}),b.prototype.draw=function(a){return a.beginPath(),a.moveTo(this.cx-this.halfWidth,this.cy),a.lineTo(this.cx+this.halfWidth,this.cy),a.moveTo(this.cx,this.cy-this.halfHeight),a.lineTo(this.cx,this.cy+this.halfHeight),a.stroke(),this},b.prototype.setPosition=function(a,b){return this.cx=a,this.cy=b,this},b.prototype.setPositionPoint=function(a){return this.cx=a.x,this.cy=a.y,this},b.prototype.toRect=function(){return new a.Geom.Rectangle(this.cx-this.halfWidth,this.cy-this.halfHeight,2*this.halfWidth,2*this.halfHeight)},b.prototype.fromRect=function(a){return this.halfWidth=a.width/2,this.halfHeight=a.height/2,this.cx=a.x+this.halfWidth,this.cy=a.y+this.halfHeight,this},b}();b.AABB=c}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c){"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),this._diameter=0,this._radius=0,this.x=0,this.y=0,this.setTo(a,b,c)}return b.prototype.objType=function(){return"Circle"},Object.defineProperty(b.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"circumference",{get:function(){return 2*Math.PI*this._radius},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"bottom",{get:function(){return this.y+this._radius},set:function(a){isNaN(a)||(a<this.y?(this._radius=0,this._diameter=0):this.radius=a-this.y)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"left",{get:function(){return this.x-this._radius},set:function(a){isNaN(a)||(a<this.x?this.radius=this.x-a:(this._radius=0,this._diameter=0))},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"right",{get:function(){return this.x+this._radius},set:function(a){a&&!isNaN(a)&&(a>this.x?this.radius=a-this.x:(this._radius=0,this._diameter=0))},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"top",{get:function(){return this.y-this._radius},set:function(a){a&&!isNaN(a)&&(a>this.y?(this._radius=0,this._diameter=0):this.radius=this.y-a)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"area",{get:function(){return this._radius>0?Math.PI*this._radius*this._radius:0},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"isEmpty",{get:function(){return this._diameter<=0?!0:!1},enumerable:!0,configurable:!0}),b.prototype.clone=function(a){return"undefined"==typeof a&&(a=new b),a.setTo(this.x,this.y,this._diameter)},b.prototype.copyFrom=function(a){return this.setTo(a.x,a.y,a.diameter)},b.prototype.copyTo=function(a){return a.copyFrom(this)},b.prototype.distanceTo=function(a,b){"undefined"==typeof b&&(b=!1);var c=this.x-a.x,d=this.y-a.y;return b===!0?Math.round(Math.sqrt(c*c+d*d)):Math.sqrt(c*c+d*d)},b.prototype.equals=function(a){return this.x===a.x&&this.y===a.y&&this.diameter===a.diameter?!0:!1},b.prototype.intersects=function(a){return this.distanceTo(a,!1)<this._radius+a._radius?!0:!1},b.prototype.circumferencePoint=function(b,c,d){return"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=new a.Geom.Point),c===!0&&(b*=Math.PI/180),d.x=this.x+this._radius*Math.cos(b),d.y=this.y+this._radius*Math.sin(b),d},b.prototype.offset=function(a,b){return isNaN(a)||isNaN(b)||(this.x+=a,this.y+=b),this},b.prototype.offsetPoint=function(a){return this.offset(a.x,a.y)},b.prototype.setTo=function(a,b,c){return this.x=a,this.y=b,this._diameter=c,this._radius=.5*c,this},b.prototype.toString=function(){return"[{Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"},b}();b.Circle=c}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a,b,c,d){"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.setTo(a,b,c,d)}return a.prototype.objType=function(){return"Ray"},a.prototype.clone=function(b){return"undefined"==typeof b&&(b=new a),b.setTo(this.x1,this.y1,this.x2,this.y2)},a.prototype.copyFrom=function(a){return this.setTo(a.x1,a.y1,a.x2,a.y2)},a.prototype.copyTo=function(a){return a.copyFrom(this)},a.prototype.setTo=function(a,b,c,d){return"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.x1=a,this.y1=b,this.x2=c,this.y2=d,this},Object.defineProperty(a.prototype,"angle",{get:function(){return Math.atan2(this.x2-this.x1,this.y2-this.y1)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"slope",{get:function(){return(this.y2-this.y1)/(this.x2-this.x1)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"yIntercept",{get:function(){return this.y1-this.slope*this.x1},enumerable:!0,configurable:!0}),a.prototype.isPointOnRay=function(a,b){return(a-this.x1)*(this.y2-this.y1)===(this.x2-this.x1)*(b-this.y1)&&Math.atan2(b-this.y1,a-this.x1)==Math.atan2(this.y2-this.y1,this.x2-this.x1)?!0:!1},a.prototype.toString=function(){return"[{Ray (x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+")}]"},a}();a.Ray=b}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(){}return b.prototype.objType=function(){return"Intersect"},b.distance=function(a,b,c,d){return Math.sqrt((c-a)*(c-a)+(d-b)*(d-b))},b.distanceSquared=function(a,b,c,d){return(c-a)*(c-a)+(d-b)*(d-b)},b.lineToLine=function(b,c,d){"undefined"==typeof d&&(d=new a.Geom.IntersectResult);var e=(b.x1-b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1-c.x2);return 0!==e&&(d.result=!0,d.x=((b.x1*b.y2-b.y1*b.x2)*(c.x1-c.x2)-(b.x1-b.x2)*(c.x1*c.y2-c.y1*c.x2))/e,d.y=((b.x1*b.y2-b.y1*b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1*c.y2-c.y1*c.x2))/e),d},b.lineToLineSegment=function(b,c,d){"undefined"==typeof d&&(d=new a.Geom.IntersectResult);var e=(b.x1-b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1-c.x2);if(0!==e){d.x=((b.x1*b.y2-b.y1*b.x2)*(c.x1-c.x2)-(b.x1-b.x2)*(c.x1*c.y2-c.y1*c.x2))/e,d.y=((b.x1*b.y2-b.y1*b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1*c.y2-c.y1*c.x2))/e;var f=Math.max(c.x1,c.x2),g=Math.min(c.x1,c.x2),h=Math.max(c.y1,c.y2),i=Math.min(c.y1,c.y2);((d.x<=f&&d.x>=g)==!0||(d.y<=h&&d.y>=i)==!0)&&(d.result=!0)}return d},b.lineToRawSegment=function(b,c,d,e,f,g){"undefined"==typeof g&&(g=new a.Geom.IntersectResult);var h=(b.x1-b.x2)*(d-f)-(b.y1-b.y2)*(c-e);if(0!==h){g.x=((b.x1*b.y2-b.y1*b.x2)*(c-e)-(b.x1-b.x2)*(c*f-d*e))/h,g.y=((b.x1*b.y2-b.y1*b.x2)*(d-f)-(b.y1-b.y2)*(c*f-d*e))/h;var i=Math.max(c,e),j=Math.min(c,e),k=Math.max(d,f),l=Math.min(d,f);((g.x<=i&&g.x>=j)==!0||(g.y<=k&&g.y>=l)==!0)&&(g.result=!0)}return g},b.lineToRay=function(b,c,d){"undefined"==typeof d&&(d=new a.Geom.IntersectResult);var e=(b.x1-b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1-c.x2);return 0!==e&&(d.x=((b.x1*b.y2-b.y1*b.x2)*(c.x1-c.x2)-(b.x1-b.x2)*(c.x1*c.y2-c.y1*c.x2))/e,d.y=((b.x1*b.y2-b.y1*b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1*c.y2-c.y1*c.x2))/e,d.result=!0,!(c.x1>=c.x2)&&d.x<c.x1&&(d.result=!1),!(c.y1>=c.y2)&&d.y<c.y1&&(d.result=!1)),d},b.lineToCircle=function(b,c,d){return"undefined"==typeof d&&(d=new a.Geom.IntersectResult),b.perp(c.x,c.y).length<=c.radius&&(d.result=!0),d},b.lineToRectangle=function(c,d,e){return"undefined"==typeof e&&(e=new a.Geom.IntersectResult),b.lineToRawSegment(c,d.x,d.y,d.right,d.y,e),e.result===!0?e:(b.lineToRawSegment(c,d.x,d.y,d.x,d.bottom,e),e.result===!0?e:(b.lineToRawSegment(c,d.x,d.bottom,d.right,d.bottom,e),e.result===!0?e:(b.lineToRawSegment(c,d.right,d.y,d.right,d.bottom,e),e)))
+}return a.prototype.objType=function(){return"Key"},Object.defineProperty(a.prototype,"duration",{get:function(){return this.isDown&&(this.timeDown=this.game.time.now()),this.timeDown<this.timeUp?0:this.timeDown-this.timeUp},enumerable:!0,configurable:!0}),a.prototype.update=function(a){this.keyCode=a.keyCode,this.preventDefault&&a.preventDefault(),"keydown"===a.type?(this.altKey=a.altKey,this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.isDown===!0?(this.repeats++,this.timeDown=this.game.time.now()):(this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now(),this.repeats=0)):"keyup"===a.type&&(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now())},a.prototype.justPressed=function(a){return"undefined"==typeof a&&(a=this._manager.justPressedRate),this.isDown===!0&&this.timeDown+a>this.game.time.now()?!0:!1},a.prototype.justReleased=function(a){return"undefined"==typeof a&&(a=this._manager.justReleasedRate),this.isUp===!0&&this.timeUp+a>this.game.time.now()?!0:!1},a.prototype.reset=function(){this.isDown=!1,this.isUp=!0,this.timeUp=0,this.timeDown=0,this.repeats=0,this.altKey=!1,this.shiftKey=!1,this.ctrlKey=!1},a}();a.Key=b}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._keys=[],this.justPressedRate=200,this.justReleasedRate=200,this.game=a}return b.prototype.objType=function(){return"Keyboard"},Object.defineProperty(b.prototype,"keys",{get:function(){return this._keys},enumerable:!0,configurable:!0}),b.prototype.boot=function(){this.onKeyUp=new a.Signal,this.onKeyDown=new a.Signal,this.onKeyDownOnce=new a.Signal,this.start()},b.prototype.update=function(){},b.prototype.start=function(){var b=this;this.game.deviceTargetOption===a.TARGET_BROWSER&&(document.body.addEventListener("keydown",function(a){return b._keyPressed(a)},!1),document.body.addEventListener("keyup",function(a){return b._keyReleased(a)},!1))},b.prototype.stop=function(){var b=this;this.game.deviceTargetOption===a.TARGET_BROWSER&&(document.body.removeEventListener("keydown",function(a){return b._keyPressed(a)},!1),document.body.removeEventListener("keyup",function(a){return b._keyReleased(a)},!1))},b.prototype._keyPressed=function(b){this._keys[b.keyCode]?this._keys[b.keyCode].update(b):this._keys[b.keyCode]=new a.Input.Key(this,b.keyCode,b),0==this._keys[b.keyCode].repeats&&this.onKeyDownOnce.dispatch(b.keyCode,this._keys[b.keyCode]),this.onKeyDown.dispatch(b.keyCode,this._keys[b.keyCode])},b.prototype._keyReleased=function(b){this._keys[b.keyCode]?this._keys[b.keyCode].update(b):this._keys[b.keyCode]=new a.Input.Key(this,b.keyCode,b),this.onKeyUp.dispatch(b.keyCode,this._keys[b.keyCode])},b.prototype.addKey=function(b,c){"undefined"==typeof c&&(c=!1);var d=new a.Input.Key(this,b);return d.preventDefault=c,this._keys[b]=d},b.prototype.justPressed=function(a,b){return"undefined"==typeof b&&(b=this.justPressedRate),this._keys[a]?this._keys[a].justPressed(b):!1},b.prototype.justReleased=function(a,b){return"undefined"==typeof b&&(b=this.justReleasedRate),this._keys[a]?this._keys[a].justReleased(b):!1},b.prototype.isDown=function(a){return this._keys[a]?this._keys[a].isDown:!1},b.prototype.isUp=function(a){return this._keys[a]?this._keys[a].isUp:!1},b.prototype.reset=function(){for(var a in this._keys)this._keys[a].reset()},b}();b.Keyboard=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(){}return a.prototype.objType=function(){return"Keycodes"},a.A="A".charCodeAt(0),a.B="B".charCodeAt(0),a.C="C".charCodeAt(0),a.D="D".charCodeAt(0),a.E="E".charCodeAt(0),a.F="F".charCodeAt(0),a.G="G".charCodeAt(0),a.H="H".charCodeAt(0),a.I="I".charCodeAt(0),a.J="J".charCodeAt(0),a.K="K".charCodeAt(0),a.L="L".charCodeAt(0),a.M="M".charCodeAt(0),a.N="N".charCodeAt(0),a.O="O".charCodeAt(0),a.P="P".charCodeAt(0),a.Q="Q".charCodeAt(0),a.R="R".charCodeAt(0),a.S="S".charCodeAt(0),a.T="T".charCodeAt(0),a.U="U".charCodeAt(0),a.V="V".charCodeAt(0),a.W="W".charCodeAt(0),a.X="X".charCodeAt(0),a.Y="Y".charCodeAt(0),a.Z="Z".charCodeAt(0),a.ZERO="0".charCodeAt(0),a.ONE="1".charCodeAt(0),a.TWO="2".charCodeAt(0),a.THREE="3".charCodeAt(0),a.FOUR="4".charCodeAt(0),a.FIVE="5".charCodeAt(0),a.SIX="6".charCodeAt(0),a.SEVEN="7".charCodeAt(0),a.EIGHT="8".charCodeAt(0),a.NINE="9".charCodeAt(0),a.NUMPAD_0=96,a.NUMPAD_1=97,a.NUMPAD_2=98,a.NUMPAD_3=99,a.NUMPAD_4=100,a.NUMPAD_5=101,a.NUMPAD_6=102,a.NUMPAD_7=103,a.NUMPAD_8=104,a.NUMPAD_9=105,a.NUMPAD_MULTIPLY=106,a.NUMPAD_ADD=107,a.NUMPAD_ENTER=108,a.NUMPAD_SUBTRACT=109,a.NUMPAD_DECIMAL=110,a.NUMPAD_DIVIDE=111,a.F1=112,a.F2=113,a.F3=114,a.F4=115,a.F5=116,a.F6=117,a.F7=118,a.F8=119,a.F9=120,a.F10=121,a.F11=122,a.F12=123,a.F13=124,a.F14=125,a.F15=126,a.COLON=186,a.EQUALS=187,a.UNDERSCORE=189,a.QUESTION_MARK=191,a.TILDE=192,a.OPEN_BRACKET=219,a.BACKWARD_SLASH=220,a.CLOSED_BRACKET=221,a.QUOTES=222,a.BACKSPACE=8,a.TAB=9,a.CLEAR=12,a.ENTER=13,a.SHIFT=16,a.CONTROL=17,a.ALT=18,a.CAPS_LOCK=20,a.ESC=27,a.SPACEBAR=32,a.PAGE_UP=33,a.PAGE_DOWN=34,a.END=35,a.HOME=36,a.LEFT=37,a.UP=38,a.RIGHT=39,a.DOWN=40,a.INSERT=45,a.DELETE=46,a.HELP=47,a.NUM_LOCK=144,a}();a.Keycodes=b}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this.game=a}return b.prototype.objType=function(){return"InputManager"},Object.defineProperty(b.prototype,"pointers",{get:function(){return this._pointers},enumerable:!0,configurable:!0}),b.prototype.boot=function(){this._pointers=[],this.mouse=new a.Input.Mouse(this.game),this.mouse.boot(),this.mouse.onDown.add(this._onDownEvent,this),this.mouse.onUp.add(this._onUpEvent,this),this.keyboard=new a.Input.Keyboard(this.game),this.keyboard.boot(),this.touch=new a.Input.Touch(this.game),this.touch.boot(),this.touch.touchDown.add(this._onDownEvent,this),this.touch.touchUp.add(this._onUpEvent,this),this._pointers=this.touch.fingers,this._pointers.push(this.mouse.cursor),this.isDown=!1,this.position=new a.Geom.Point,this.onDown=new a.Signal,this.onUp=new a.Signal},b.prototype._onDownEvent=function(a,b,c,d,e,f){this.onDown.dispatch(a,b,c,d,e,f)},b.prototype._onUpEvent=function(a,b,c,d,e,f){this.onUp.dispatch(a,b,c,d,e,f)},Object.defineProperty(b.prototype,"onPressed",{get:function(){return this.onDown},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"onReleased",{get:function(){return this.onUp},enumerable:!0,configurable:!0}),b.prototype.update=function(){this.mouse.update(),this.keyboard.update(),this.touch.update(),this.touch.touchEnabled?this.position.setTo(this.touch.x,this.touch.y):this.position.setTo(this.mouse.x,this.mouse.y),this.isDown=this.mouse.isDown||this.touch.isDown},b.prototype.reset=function(){this.mouse.reset(),this.keyboard.reset(),this.touch.reset()},Object.defineProperty(b.prototype,"x",{get:function(){return this.position.x},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"y",{get:function(){return this.position.y},enumerable:!0,configurable:!0}),b}();b.InputManager=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._domElement=null,this._game=a}return b.prototype.objType=function(){return"Mouse"},Object.defineProperty(b.prototype,"cursor",{get:function(){return this._cursor},enumerable:!0,configurable:!0}),b.prototype.boot=function(){this._domElement=this._game.stage.container,this._cursor=new a.Input.MouseCursor(this._game),this._cursor.active=!0,this._cursor.id=1,this.onDown=new a.Signal,this.onUp=new a.Signal,this.onWheel=new a.Signal,this.start()},Object.defineProperty(b.prototype,"isDown",{get:function(){return this._cursor.isDown},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"isUp",{get:function(){return this._cursor.isUp},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"duration",{get:function(){return this._cursor.duration},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"x",{get:function(){return this._cursor.x},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"y",{get:function(){return this._cursor.y},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"wheelDeltaX",{get:function(){return this._cursor.wheelDeltaX},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"wheelDeltaY",{get:function(){return this._cursor.wheelDeltaY},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"ctrlKey",{get:function(){return this._cursor.ctrlKey},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"shiftKey",{get:function(){return this._cursor.shiftKey},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"altKey",{get:function(){return this._cursor.altKey},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"button",{get:function(){return this._cursor.button},enumerable:!0,configurable:!0}),b.prototype.update=function(){this._cursor.update()},b.prototype.start=function(){var b=this;this._game.deviceTargetOption===a.TARGET_BROWSER?a.DEVICE.ie&&a.DEVICE.ieVersion<9?(this._domElement.attachEvent("onmousedown",function(a){return b.onMouseDown(a)}),this._domElement.attachEvent("onmousemove",function(a){return b.onMouseMove(a)}),this._domElement.attachEvent("onmouseup",function(a){return b.onMouseUp(a)}),this._domElement.attachEvent("onmousewheel",function(a){return b.onMouseWheel(a)})):(this._domElement.addEventListener("mousedown",function(a){return b.onMouseDown(a)},!0),this._domElement.addEventListener("mousemove",function(a){return b.onMouseMove(a)},!0),this._domElement.addEventListener("mouseup",function(a){return b.onMouseUp(a)},!0),this._domElement.addEventListener("mousewheel",function(a){return b.onMouseWheel(a)},!0),this._domElement.addEventListener("DOMMouseScroll",function(a){return b.onMouseWheel(a)},!0)):this._game.deviceTargetOption===a.TARGET_COCOON&&(this._game.stage.canvas.addEventListener("mousedown",function(a){return b.onMouseDown(a)},!0),this._game.stage.canvas.addEventListener("mousemove",function(a){return b.onMouseMove(a)},!0),this._game.stage.canvas.addEventListener("mouseup",function(a){return b.onMouseUp(a)},!0),this._game.stage.canvas.addEventListener("mousewheel",function(a){return b.onMouseWheel(a)},!0),this._game.stage.canvas.addEventListener("DOMMouseScroll",function(a){return b.onMouseWheel(a)},!0))},b.prototype.stop=function(){var b=this;this._game.deviceTargetOption===a.TARGET_BROWSER&&(this._domElement.removeEventListener("mousedown",function(a){return b.onMouseDown(a)},!1),this._domElement.removeEventListener("mousedown",this.onMouseDown,!1),this._domElement.removeEventListener("mousemove",this.onMouseMove,!1),this._domElement.removeEventListener("mouseup",this.onMouseUp,!1),this._domElement.removeEventListener("mousewheel",this.onMouseWheel,!1),this._domElement.removeEventListener("DOMMouseScroll",this.onMouseWheel,!1))},b.prototype.onMouseDown=function(a){this._cursor.start(a),this.onDown.dispatch(this._cursor.x,this._cursor.y,this._cursor.timeDown,this._cursor.timeUp,this.duration,this._cursor)},b.prototype.onMouseMove=function(a){this._cursor.move(a)},b.prototype.onMouseUp=function(a){this._cursor.stop(a),this.onUp.dispatch(this._cursor.x,this._cursor.y,this._cursor.timeDown,this._cursor.timeUp,this.duration,this._cursor)},b.prototype.onMouseWheel=function(a){this._cursor.wheel(a),this.onWheel.dispatch(this._cursor.wheelDeltaX,this._cursor.wheelDeltaY,this._cursor)},b.prototype.justPressed=function(a){return"undefined"==typeof a&&(a=this._cursor.justPressedRate),this._cursor.justPressed(a)},b.prototype.justReleased=function(a){return"undefined"==typeof a&&(a=this._cursor.justReleasedRate),this._cursor.justReleased(a)},b.prototype.reset=function(){this._cursor.reset()},b.LEFT_BUTTON=0,b.MIDDLE_BUTTON=1,b.RIGHT_BUTTON=2,b}();b.Mouse=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._domElement=null,this.isDown=!1,this.isUp=!0,this._maxPointers=10,this._game=a}return b.prototype.objType=function(){return"TouchManager"},Object.defineProperty(b.prototype,"fingers",{get:function(){return this._fingers},enumerable:!0,configurable:!0}),b.prototype.boot=function(){this._domElement=this._game.stage.container,this.finger1=new a.Input.Finger(this._game),this.finger2=new a.Input.Finger(this._game),this.finger3=new a.Input.Finger(this._game),this.finger4=new a.Input.Finger(this._game),this.finger5=new a.Input.Finger(this._game),this.finger6=new a.Input.Finger(this._game),this.finger7=new a.Input.Finger(this._game),this.finger8=new a.Input.Finger(this._game),this.finger9=new a.Input.Finger(this._game),this.finger10=new a.Input.Finger(this._game),this._fingers=[this.finger1,this.finger2,this.finger3,this.finger4,this.finger5,this.finger6,this.finger7,this.finger8,this.finger9,this.finger10],this.latestFinger=this.finger1,this.touchDown=new a.Signal,this.touchUp=new a.Signal,this.touchCancel=new a.Signal,this.start()},b.prototype.start=function(){var b=this;if(a.DEVICE.touch)if(this.touchEnabled=!0,this._game.deviceTargetOption===a.TARGET_BROWSER)if(a.DEVICE.pointerEnabled){var c="pointerup",d="pointerdown",e="pointerenter",f="pointerleave",g="pointercancel",h="pointermove";if(window.navigator.msPointerEnabled)var c="MSPointerUp",d="MSPointerDown",e="MSPointerEnter",f="MSPointerLeave",g="MSPointerCancel",h="MSPointerMove";this._domElement.addEventListener(c,function(a){return b.onPointerStart(a)},!1),this._domElement.addEventListener(d,function(a){return b.onPointerEnd(a)},!1),this._domElement.addEventListener(e,function(a){return b.onPointerEnter(a)},!1),this._domElement.addEventListener(f,function(a){return b.onPointerLeave(a)},!1),this._domElement.addEventListener(g,function(a){return b.onPointerCancel(a)},!1),this._domElement.addEventListener(h,function(a){return b.onPointerMove(a)},!1)}else this._domElement.addEventListener("touchstart",function(a){return b.onTouchStart(a)},!1),this._domElement.addEventListener("touchmove",function(a){return b.onTouchMove(a)},!1),this._domElement.addEventListener("touchend",function(a){return b.onTouchEnd(a)},!1),this._domElement.addEventListener("touchenter",function(a){return b.onTouchEnter(a)},!1),this._domElement.addEventListener("touchleave",function(a){return b.onTouchLeave(a)},!1),this._domElement.addEventListener("touchcancel",function(a){return b.onTouchCancel(a)},!1),document.addEventListener("touchmove",function(a){return b.consumeTouchMove(a)},!1);else this._game.deviceTargetOption===a.TARGET_COCOON&&(this._game.stage.canvas.addEventListener("touchstart",function(a){return b.onTouchStart(a)},!1),this._game.stage.canvas.addEventListener("touchmove",function(a){return b.onTouchMove(a)},!1),this._game.stage.canvas.addEventListener("touchend",function(a){return b.onTouchEnd(a)},!1),this._game.stage.canvas.addEventListener("touchenter",function(a){return b.onTouchEnter(a)},!1),this._game.stage.canvas.addEventListener("touchleave",function(a){return b.onTouchLeave(a)},!1),this._game.stage.canvas.addEventListener("touchcancel",function(a){return b.onTouchCancel(a)},!1));else this.touchEnabled=!1},b.prototype.consumeTouchMove=function(a){a.preventDefault()},Object.defineProperty(b.prototype,"x",{get:function(){return this.latestFinger.x},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"y",{get:function(){return this.latestFinger.y},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"maximumPointers",{get:function(){return this._maxPointers},set:function(a){0>a&&(a=1),a>this._fingers.length&&(a=this._fingers.length),this._maxPointers=a},enumerable:!0,configurable:!0}),b.prototype._registerFinger=function(a,b){for(var c=0;c<this._maxPointers;c++)if(this._fingers[c].active===!1){this._fingers[c].id=b,this._fingers[c].start(a),this.latestFinger=this._fingers[c],this.touchDown.dispatch(this._fingers[c].x,this._fingers[c].y,this._fingers[c].timeDown,this._fingers[c].timeUp,this._fingers[c].duration,this._fingers[c]),this.isDown=!0,this.isUp=!1;break}},b.prototype._deregisterFinger=function(a,b){for(var c=0;c<this._fingers.length;c++)if(this._fingers[c].active&&this._fingers[c].id===b){this._fingers[c].stop(a),this.latestFinger=this._fingers[c],this.touchUp.dispatch(this._fingers[c].x,this._fingers[c].y,this._fingers[c].timeDown,this._fingers[c].timeUp,this._fingers[c].duration,this._fingers[c]),this.isDown=!1,this.isUp=!0;break}for(var d=0;d<this._fingers.length;d++)this._fingers[d].active&&(this.isDown=!0,this.isUp=!1)},b.prototype._cancelFinger=function(a,b){for(var c=0;c<this._fingers.length;c++)if(this._fingers[c].active&&this._fingers[c].id===b){this._fingers[c].stop(a),this.touchCancel.dispatch(this._fingers[c].x,this._fingers[c].y,this._fingers[c].timeDown,this._fingers[c].timeUp,this._fingers[c].duration,this._fingers[c]);break}for(var d=0;d<this._fingers.length;d++)this._fingers[d].active&&(this.isDown=!0,this.isUp=!1)},b.prototype._enterFinger=function(a,b){for(var c=0;c<this._maxPointers;c++)if(this._fingers[c].active===!1){this._fingers[c].id=b,this._fingers[c].start(a),this.latestFinger=this._fingers[c],this.isDown=!0,this.isUp=!1;break}},b.prototype._leaveFinger=function(a,b){for(var c=0;c<this._fingers.length;c++)if(this._fingers[c].active&&this._fingers[c].id===b){this._fingers[c].leave(a);break}},b.prototype._moveFinger=function(a,b){for(var c=0;c<this._fingers.length;c++)if(this._fingers[c].active&&this._fingers[c].id===b){this._fingers[c].move(a),this.latestFinger=this._fingers[c];break}},b.prototype.onTouchStart=function(a){for(var b=0;b<a.changedTouches.length;b++)this._registerFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onTouchCancel=function(a){for(var b=0;b<a.changedTouches.length;b++)this._cancelFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onTouchEnter=function(a){for(var b=0;b<a.changedTouches.length;b++)this._enterFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onTouchLeave=function(a){for(var b=0;b<a.changedTouches.length;b++)this._leaveFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onTouchMove=function(a){for(var b=0;b<a.changedTouches.length;b++)this._moveFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onTouchEnd=function(a){for(var b=0;b<a.changedTouches.length;b++)this._deregisterFinger(a.changedTouches[b],a.changedTouches[b].identifier)},b.prototype.onPointerStart=function(a){"touch"===a.type&&this._registerFinger(a,a.pointerId)},b.prototype.onPointerCancel=function(a){"touch"===a.type&&this._cancelFinger(a,a.pointerId)},b.prototype.onPointerEnter=function(a){"touch"===a.type&&this._enterFinger(a,a.pointerId)},b.prototype.onPointerLeave=function(a){"touch"===a.type&&this._leaveFinger(a,a.pointerId)},b.prototype.onPointerMove=function(a){"touch"===a.type&&this._moveFinger(a,a.pointerId)},b.prototype.onPointerEnd=function(a){"touch"===a.type&&this._deregisterFinger(a,a.pointerId)},b.prototype.update=function(){if(this.touchEnabled&&this.isDown)for(var a=0;a<this._fingers.length;a++)this._fingers[a].active&&this._fingers[a].update()},b.prototype.stop=function(){var b=this;this.touchEnabled&&(this._game.deviceTargetOption===a.TARGET_BROWSER?(this._domElement.removeEventListener("touchstart",function(a){return b.onTouchStart(a)},!1),this._domElement.removeEventListener("touchmove",function(a){return b.onTouchMove(a)},!1),this._domElement.removeEventListener("touchend",function(a){return b.onTouchEnd(a)},!1),this._domElement.removeEventListener("touchenter",function(a){return b.onTouchEnter(a)},!1),this._domElement.removeEventListener("touchleave",function(a){return b.onTouchLeave(a)},!1),this._domElement.removeEventListener("touchcancel",function(a){return b.onTouchCancel(a)},!1)):this._game.deviceTargetOption===a.TARGET_COCOON&&(this._game.stage.canvas.removeEventListener("touchstart",function(a){return b.onTouchStart(a)},!1),this._game.stage.canvas.removeEventListener("touchmove",function(a){return b.onTouchMove(a)},!1),this._game.stage.canvas.removeEventListener("touchend",function(a){return b.onTouchEnd(a)},!1),this._game.stage.canvas.removeEventListener("touchenter",function(a){return b.onTouchEnter(a)},!1),this._game.stage.canvas.removeEventListener("touchleave",function(a){return b.onTouchLeave(a)},!1),this._game.stage.canvas.removeEventListener("touchcancel",function(a){return b.onTouchCancel(a)},!1)))},b.prototype.reset=function(){for(var a=0;a<this._fingers.length;a++)this._fingers[a].reset()},b}();b.Touch=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(b){this.x=-1,this.y=-1,this.clientX=-1,this.clientY=-1,this.pageX=-1,this.pageY=-1,this.screenX=-1,this.screenY=-1,this.isDown=!1,this.isUp=!0,this.withinGame=!1,this.active=!1,this.timeDown=0,this.timeUp=0,this.duration=0,this.frameDuration=0,this.justPressedRate=200,this.justReleasedRate=200,this._game=b,this.point=new a.Geom.Point,this.circle=new a.Geom.Circle(0,0,1),this.startPoint=new a.Geom.Point,this.endPoint=new a.Geom.Point}return b.prototype.objType=function(){return"Pointer"},Object.defineProperty(b.prototype,"game",{get:function(){return this._game},enumerable:!0,configurable:!0}),b.prototype.start=function(a){this.move(a),this.startPoint.setTo(this.x,this.y),this.frameDuration=0,this.withinGame=!0,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now()},b.prototype.stop=function(){this.withinGame=!1,this.endPoint.setTo(this.x,this.y),this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now(),this.duration=this.timeUp-this.timeDown},b.prototype.move=function(a){this.clientX=a.clientX,this.clientY=a.clientY,this.pageX=a.pageX,this.pageY=a.pageY,this.screenX=a.screenX,this.screenY=a.screenY,this.x=(this.pageX-this.game.stage.offset.x)*this.game.stage.scaleX,this.y=(this.pageY-this.game.stage.offset.y)*this.game.stage.scaleY,this.point.setTo(this.x,this.y),this.circle.x=this.x,this.circle.y=this.y,this.duration=this.game.time.now()-this.timeDown},b.prototype.justPressed=function(a){return"undefined"==typeof a&&(a=this.justPressedRate),this.isDown===!0&&this.timeDown+a>this._game.time.now()?!0:!1},b.prototype.justReleased=function(a){return"undefined"==typeof a&&(a=this.justReleasedRate),this.isUp===!0&&this.timeUp+a>this._game.time.now()?!0:!1},b.prototype.reset=function(){this.isDown=!1,this.isUp=!0,this.timeDown=0,this.timeUp=0,this.duration=0,this.frameDuration=0},b.prototype.update=function(){this.isDown===!0&&(this.frameDuration++,this.duration=this._game.time.now()-this.timeDown)},b}();b.Pointer=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(a){function b(){a.apply(this,arguments),this.wheelDeltaX=0,this.wheelDeltaY=0}return __extends(b,a),b.prototype.objType=function(){return"MouseCursor"},b.prototype.start=function(b){this.ctrlKey=b.ctrlKey,this.shiftKey=b.shiftKey,this.altKey=b.altKey,this.button-b.button,a.prototype.start.call(this,b)},b.prototype.stop=function(b){this.move(b),a.prototype.stop.call(this,b)},b.prototype.wheel=function(a){this.wheelDeltaX=a.wheelDeltaX?a.wheelDeltaX:a.deltaX,this.wheelDeltaY=a.wheelDeltaY?a.wheelDeltaY:a.deltaY},b}(a.Input.Pointer);b.MouseCursor=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(a){function b(b){a.call(this,b),this.circle.diameter=44}return __extends(b,a),b.prototype.objType=function(){return"Finger"},b.prototype.start=function(b){this.active=!0,a.prototype.start.call(this,b)},b.prototype.stop=function(b){this.active=!1,a.prototype.stop.call(this,b)},b.prototype.leave=function(a){this.withinGame=!1,this.move(a)},b.prototype.reset=function(){this.active=!1,a.prototype.reset.call(this)},b}(a.Input.Pointer);b.Finger=c}(a.Input||(a.Input={}));a.Input}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d){this.cx=0,this.cy=0,this.halfWidth=0,this.halfHeight=0,this.cx=a||0,this.cy=b||0,this.halfWidth=c/2||0,this.halfHeight=d/2||0}return b.prototype.objType=function(){return"AABB"},Object.defineProperty(b.prototype,"height",{get:function(){return 2*this.halfHeight},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"width",{get:function(){return 2*this.halfWidth},enumerable:!0,configurable:!0}),b.prototype.draw=function(a){return a.beginPath(),a.moveTo(this.cx-this.halfWidth,this.cy),a.lineTo(this.cx+this.halfWidth,this.cy),a.moveTo(this.cx,this.cy-this.halfHeight),a.lineTo(this.cx,this.cy+this.halfHeight),a.stroke(),this},b.prototype.setPosition=function(a,b){return this.cx=a,this.cy=b,this},b.prototype.setPositionPoint=function(a){return this.cx=a.x,this.cy=a.y,this},b.prototype.toRect=function(){return new a.Geom.Rectangle(this.cx-this.halfWidth,this.cy-this.halfHeight,2*this.halfWidth,2*this.halfHeight)},b.prototype.fromRect=function(a){return this.halfWidth=a.width/2,this.halfHeight=a.height/2,this.cx=a.x+this.halfWidth,this.cy=a.y+this.halfHeight,this},b}();b.AABB=c}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c){"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),this._diameter=0,this._radius=0,this.x=0,this.y=0,this.setTo(a,b,c)}return b.prototype.objType=function(){return"Circle"},Object.defineProperty(b.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"circumference",{get:function(){return 2*Math.PI*this._radius},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"bottom",{get:function(){return this.y+this._radius},set:function(a){isNaN(a)||(a<this.y?(this._radius=0,this._diameter=0):this.radius=a-this.y)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"left",{get:function(){return this.x-this._radius},set:function(a){isNaN(a)||(a<this.x?this.radius=this.x-a:(this._radius=0,this._diameter=0))},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"right",{get:function(){return this.x+this._radius},set:function(a){a&&!isNaN(a)&&(a>this.x?this.radius=a-this.x:(this._radius=0,this._diameter=0))},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"top",{get:function(){return this.y-this._radius},set:function(a){a&&!isNaN(a)&&(a>this.y?(this._radius=0,this._diameter=0):this.radius=this.y-a)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"area",{get:function(){return this._radius>0?Math.PI*this._radius*this._radius:0},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"isEmpty",{get:function(){return this._diameter<=0?!0:!1},enumerable:!0,configurable:!0}),b.prototype.clone=function(a){return"undefined"==typeof a&&(a=new b),a.setTo(this.x,this.y,this._diameter)},b.prototype.copyFrom=function(a){return this.setTo(a.x,a.y,a.diameter)},b.prototype.copyTo=function(a){return a.copyFrom(this)},b.prototype.distanceTo=function(a,b){"undefined"==typeof b&&(b=!1);var c=this.x-a.x,d=this.y-a.y;return b===!0?Math.round(Math.sqrt(c*c+d*d)):Math.sqrt(c*c+d*d)},b.prototype.equals=function(a){return this.x===a.x&&this.y===a.y&&this.diameter===a.diameter?!0:!1},b.prototype.intersects=function(a){return this.distanceTo(a,!1)<this._radius+a._radius?!0:!1},b.prototype.circumferencePoint=function(b,c,d){return"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=new a.Geom.Point),c===!0&&(b*=Math.PI/180),d.x=this.x+this._radius*Math.cos(b),d.y=this.y+this._radius*Math.sin(b),d},b.prototype.offset=function(a,b){return isNaN(a)||isNaN(b)||(this.x+=a,this.y+=b),this},b.prototype.offsetPoint=function(a){return this.offset(a.x,a.y)},b.prototype.setTo=function(a,b,c){return this.x=a,this.y=b,this._diameter=c,this._radius=.5*c,this},b.prototype.toString=function(){return"[{Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"},b}();b.Circle=c}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a,b,c,d){"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.setTo(a,b,c,d)}return a.prototype.objType=function(){return"Ray"},a.prototype.clone=function(b){return"undefined"==typeof b&&(b=new a),b.setTo(this.x1,this.y1,this.x2,this.y2)},a.prototype.copyFrom=function(a){return this.setTo(a.x1,a.y1,a.x2,a.y2)},a.prototype.copyTo=function(a){return a.copyFrom(this)},a.prototype.setTo=function(a,b,c,d){return"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.x1=a,this.y1=b,this.x2=c,this.y2=d,this},Object.defineProperty(a.prototype,"angle",{get:function(){return Math.atan2(this.x2-this.x1,this.y2-this.y1)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"slope",{get:function(){return(this.y2-this.y1)/(this.x2-this.x1)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"yIntercept",{get:function(){return this.y1-this.slope*this.x1},enumerable:!0,configurable:!0}),a.prototype.isPointOnRay=function(a,b){return(a-this.x1)*(this.y2-this.y1)===(this.x2-this.x1)*(b-this.y1)&&Math.atan2(b-this.y1,a-this.x1)==Math.atan2(this.y2-this.y1,this.x2-this.x1)?!0:!1},a.prototype.toString=function(){return"[{Ray (x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+")}]"},a}();a.Ray=b}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(){}return b.prototype.objType=function(){return"Intersect"},b.distance=function(a,b,c,d){return Math.sqrt((c-a)*(c-a)+(d-b)*(d-b))},b.distanceSquared=function(a,b,c,d){return(c-a)*(c-a)+(d-b)*(d-b)},b.lineToLine=function(b,c,d){"undefined"==typeof d&&(d=new a.Geom.IntersectResult);var e=(b.x1-b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1-c.x2);return 0!==e&&(d.result=!0,d.x=((b.x1*b.y2-b.y1*b.x2)*(c.x1-c.x2)-(b.x1-b.x2)*(c.x1*c.y2-c.y1*c.x2))/e,d.y=((b.x1*b.y2-b.y1*b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1*c.y2-c.y1*c.x2))/e),d},b.lineToLineSegment=function(b,c,d){"undefined"==typeof d&&(d=new a.Geom.IntersectResult);var e=(b.x1-b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1-c.x2);if(0!==e){d.x=((b.x1*b.y2-b.y1*b.x2)*(c.x1-c.x2)-(b.x1-b.x2)*(c.x1*c.y2-c.y1*c.x2))/e,d.y=((b.x1*b.y2-b.y1*b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1*c.y2-c.y1*c.x2))/e;var f=Math.max(c.x1,c.x2),g=Math.min(c.x1,c.x2),h=Math.max(c.y1,c.y2),i=Math.min(c.y1,c.y2);((d.x<=f&&d.x>=g)==!0||(d.y<=h&&d.y>=i)==!0)&&(d.result=!0)}return d},b.lineToRawSegment=function(b,c,d,e,f,g){"undefined"==typeof g&&(g=new a.Geom.IntersectResult);var h=(b.x1-b.x2)*(d-f)-(b.y1-b.y2)*(c-e);if(0!==h){g.x=((b.x1*b.y2-b.y1*b.x2)*(c-e)-(b.x1-b.x2)*(c*f-d*e))/h,g.y=((b.x1*b.y2-b.y1*b.x2)*(d-f)-(b.y1-b.y2)*(c*f-d*e))/h;var i=Math.max(c,e),j=Math.min(c,e),k=Math.max(d,f),l=Math.min(d,f);((g.x<=i&&g.x>=j)==!0||(g.y<=k&&g.y>=l)==!0)&&(g.result=!0)}return g},b.lineToRay=function(b,c,d){"undefined"==typeof d&&(d=new a.Geom.IntersectResult);var e=(b.x1-b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1-c.x2);return 0!==e&&(d.x=((b.x1*b.y2-b.y1*b.x2)*(c.x1-c.x2)-(b.x1-b.x2)*(c.x1*c.y2-c.y1*c.x2))/e,d.y=((b.x1*b.y2-b.y1*b.x2)*(c.y1-c.y2)-(b.y1-b.y2)*(c.x1*c.y2-c.y1*c.x2))/e,d.result=!0,!(c.x1>=c.x2)&&d.x<c.x1&&(d.result=!1),!(c.y1>=c.y2)&&d.y<c.y1&&(d.result=!1)),d},b.lineToCircle=function(b,c,d){return"undefined"==typeof d&&(d=new a.Geom.IntersectResult),b.perp(c.x,c.y).length<=c.radius&&(d.result=!0),d},b.lineToRectangle=function(c,d,e){return"undefined"==typeof e&&(e=new a.Geom.IntersectResult),b.lineToRawSegment(c,d.x,d.y,d.right,d.y,e),e.result===!0?e:(b.lineToRawSegment(c,d.x,d.y,d.x,d.bottom,e),e.result===!0?e:(b.lineToRawSegment(c,d.x,d.bottom,d.right,d.bottom,e),e.result===!0?e:(b.lineToRawSegment(c,d.right,d.y,d.right,d.bottom,e),e)))
 },b.lineSegmentToLineSegment=function(c,d,e){return"undefined"==typeof e&&(e=new a.Geom.IntersectResult),b.lineToLineSegment(c,d,e),e.result===!0&&(e.x>=Math.min(c.x1,c.x2)&&e.x<=Math.max(c.x1,c.x2)&&e.y>=Math.min(c.y1,c.y2)&&e.y<=Math.max(c.y1,c.y2)||(e.result=!1)),e},b.lineSegmentToRay=function(c,d,e){return"undefined"==typeof e&&(e=new a.Geom.IntersectResult),b.lineToRay(c,d,e),e.result===!0&&(e.x>=Math.min(c.x1,c.x2)&&e.x<=Math.max(c.x1,c.x2)&&e.y>=Math.min(c.y1,c.y2)&&e.y<=Math.max(c.y1,c.y2)||(e.result=!1)),e},b.lineSegmentToCircle=function(c,d,e){"undefined"==typeof e&&(e=new a.Geom.IntersectResult);var f=c.perp(d.x,d.y);if(f.length<=d.radius){var g=Math.max(c.x1,c.x2),h=Math.min(c.x1,c.x2),i=Math.max(c.y1,c.y2),j=Math.min(c.y1,c.y2);f.x2<=g&&f.x2>=h&&f.y2<=i&&f.y2>=j?e.result=!0:(b.circleContainsPoint(d,{x:c.x1,y:c.y1})||b.circleContainsPoint(d,{x:c.x2,y:c.y2}))&&(e.result=!0)}return e},b.lineSegmentToRectangle=function(c,d,e){return"undefined"==typeof e&&(e=new a.Geom.IntersectResult),d.contains(c.x1,c.y1)&&d.contains(c.x2,c.y2)?(e.result=!0,e):(b.lineToRawSegment(c,d.x,d.y,d.right,d.bottom,e),e.result===!0?e:(b.lineToRawSegment(c,d.x,d.y,d.x,d.bottom,e),e.result===!0?e:(b.lineToRawSegment(c,d.x,d.bottom,d.right,d.bottom,e),e.result===!0?e:(b.lineToRawSegment(c,d.right,d.y,d.right,d.bottom,e),e))))},b.rayToRectangle=function(c,d,e){return"undefined"==typeof e&&(e=new a.Geom.IntersectResult),b.lineToRectangle(c,d,e),e},b.rayToLineSegment=function(b,c,d,e,f,g,h,i,j){"undefined"==typeof j&&(j=new a.Geom.IntersectResult);var k,l,m;return(e-c)/(d-b)!=(i-g)/(h-f)&&(m=(d-b)*(i-g)-(e-c)*(h-f),0!=m&&(k=((c-g)*(h-f)-(b-f)*(i-g))/m,l=((c-g)*(d-b)-(b-f)*(e-c))/m,k>=0&&l>=0&&1>=l&&(j.result=!0,j.x=b+k*(d-b),c+k*(e-c)))),j},b.circleToCircle=function(c,d,e){return"undefined"==typeof e&&(e=new a.Geom.IntersectResult),e.result=(c.radius+d.radius)*(c.radius+d.radius)>=b.distanceSquared(c.x,c.y,d.x,d.y),e},b.circleToRectangle=function(b,c,d){"undefined"==typeof d&&(d=new a.Geom.IntersectResult);var e=c.clone();return e.inflate(b.radius,b.radius),d.result=e.contains(b.x,b.y),d},b.circleContainsPoint=function(c,d,e){return"undefined"==typeof e&&(e=new a.Geom.IntersectResult),e.result=c.radius*c.radius>=b.distanceSquared(c.x,c.y,d.x,d.y),e},b.pointToRectangle=function(b,c,d){return"undefined"==typeof d&&(d=new a.Geom.IntersectResult),d.setTo(b.x,b.y),d.result=c.containsPoint(b),d},b.rectangleToRectangle=function(b,c,d){"undefined"==typeof d&&(d=new a.Geom.IntersectResult);var e=Math.max(b.x,c.x),f=Math.min(b.right,c.right),g=Math.max(b.y,c.y),h=Math.min(b.bottom,c.bottom);d.setTo(e,g,f-e,h-g,f-e,h-g);var i=d.x+.5*d.width,j=d.y+.5*d.height;return i>b.x&&i<b.right&&j>b.y&&j<b.bottom&&(d.result=!0),d},b}();b.Intersect=c}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(){this.result=!1}return a.prototype.objType=function(){return"IntersectResult"},a.prototype.setTo=function(a,b,c,d,e,f){"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.x=a,this.y=b,this.x1=a,this.y1=b,this.x2=c,this.y2=d,this.width=e,this.height=f},a}();a.IntersectResult=b}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d){"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.setTo(a,b,c,d)}return b.prototype.objType=function(){return"Line"},b.prototype.clone=function(a){return"undefined"==typeof a&&(a=new b),a.setTo(this.x1,this.y1,this.x2,this.y2)},b.prototype.copyFrom=function(a){return this.setTo(a.x1,a.y1,a.x2,a.y2)},b.prototype.copyTo=function(a){return a.copyFrom(this)},b.prototype.setTo=function(a,b,c,d){return"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.x1=a,this.y1=b,this.x2=c,this.y2=d,this},Object.defineProperty(b.prototype,"length",{get:function(){return Math.sqrt((this.x2-this.x1)*(this.x2-this.x1)+(this.y2-this.y1)*(this.y2-this.y1))},enumerable:!0,configurable:!0}),b.prototype.getY=function(a){return this.x1==this.x2?null:this.slope*a+this.yIntercept},Object.defineProperty(b.prototype,"angle",{get:function(){return Math.atan2(this.x2-this.x1,this.y2-this.y1)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"slope",{get:function(){return(this.y2-this.y1)/(this.x2-this.x1)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"perpSlope",{get:function(){return-((this.x2-this.x1)/(this.y2-this.y1))},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"yIntercept",{get:function(){return this.y1-this.slope*this.x1},enumerable:!0,configurable:!0}),b.prototype.isPointOnLine=function(a,b){return(a-this.x1)*(this.y2-this.y1)===(this.x2-this.x1)*(b-this.y1)?!0:!1},b.prototype.isPointOnLineSegment=function(a,b){var c=Math.min(this.x1,this.x2),d=Math.max(this.x1,this.x2),e=Math.min(this.y1,this.y2),f=Math.max(this.y1,this.y2);return this.isPointOnLine(a,b)&&a>=c&&d>=a&&b>=e&&f>=b?!0:!1},b.prototype.intersectLineLine=function(b){return a.Geom.Intersect.lineToLine(this,b)},b.prototype.perp=function(a,c,d){if(this.y1===this.y2){if(!d)return new b(a,c,a,this.y1);d.setTo(a,c,a,this.y1)}var e=c-this.perpSlope*a,f=this.intersectLineLine({x1:a,y1:c,x2:0,y2:e});return d?(d.setTo(a,c,f.x,f.y),void 0):new b(a,c,f.x,f.y)},b.prototype.toString=function(){return"[{Line (x1="+this.x1+" y1="+this.y1+" x2="+this.x2+" y2="+this.y2+")}]"},b}();b.Line=c}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d,e,f){"undefined"==typeof a&&(a=1),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this.setTo(a,b,c,d,e,f)}return b.prototype.objType=function(){return"Matrix"},b.prototype.setTo=function(a,b,c,d,e,f){return"undefined"==typeof a&&(a=1),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.a=a,this.b=b,this.c=c,this.d=d,this.tx=e,this.ty=f,this},b.prototype.setFromTransform=function(a,b,c,d,e){this.identity();var f=Math.cos(e),g=Math.sin(e);return this.append(f*c,g*c,-g*d,f*d,a,b),this},b.prototype.prepend=function(a,b,c,d,e,f){"undefined"==typeof a&&(a=1),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0);var g=this.tx,h=this.a,i=this.c;return this.a=h*a+this.b*c,this.b=h*b+this.b*d,this.c=i*a+this.d*c,this.d=i*b+this.d*d,this.tx=g*a+this.ty*c+e,this.ty=g*b+this.ty*d+f,this},b.prototype.prependMatrix=function(a){var b=this.tx,c=this.a,d=this.c;return this.a=c*a.a+this.b*a.c,this.b=c*a.b+this.b*a.d,this.c=d*a.a+this.d*a.c,this.d=d*a.b+this.d*a.d,this.tx=b*a.a+this.ty*a.c+a.tx,this.ty=b*a.b+this.ty*a.d+a.ty,this},b.prototype.append=function(a,b,c,d,e,f){"undefined"==typeof a&&(a=1),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0);var g=this.a,h=this.b,i=this.c,j=this.d;return this.a=a*g+b*i,this.b=a*h+b*j,this.c=c*g+d*i,this.d=c*h+d*j,this.tx=e*g+f*i+this.tx,this.ty=e*h+f*j+this.ty,this},b.prototype.appendMatrix=function(a){var b=this.a,c=this.b,d=this.c,e=this.d;return this.a=a.a*b+a.b*d,this.b=a.a*c+a.b*e,this.c=a.c*b+a.d*d,this.d=a.c*c+a.d*e,this.tx=a.tx*b+a.ty*d+this.tx,this.ty=a.tx*c+a.ty*e+this.ty,this},b.prototype.setPosition=function(a,b){return this.tx=a,this.ty=b,this},b.prototype.setPositionPoint=function(a){return this.tx=a.x,this.ty=a.y,this},b.prototype.getPosition=function(b){return"undefined"==typeof b&&(b=new a.Geom.Point),b.setTo(this.tx,this.ty)},b.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},b.prototype.rotate=function(a){var b=Math.cos(a),c=Math.sin(a),d=this.a,e=this.c,f=this.tx;return this.a=d*b-this.b*c,this.b=d*c+this.b*b,this.c=e*b-this.d*c,this.d=e*c+this.d*b,this.tx=f*b-this.ty*c,this.ty=f*c+this.ty*b,this},b.prototype.translate=function(a,b){return this.tx+=a,this.ty+=b,this},b.prototype.scale=function(a,b){return this.a*=a,this.d*=b,this},b.prototype.transformPoint=function(a){var b=a.x,c=a.y;return a.x=this.a*b+this.c*c+this.tx,a.y=this.b*b+this.d*c+this.ty,a},b.prototype.invert=function(){var a=this.a,b=this.b,c=this.c,d=this.d,e=this.tx,f=a*d-b*c;return this.a=d/f,this.b=-b/f,this.c=-c/f,this.d=a/f,this.tx=(c*this.ty-d*e)/f,this.ty=-(a*this.ty-b*e)/f,this},b.prototype.copyFrom=function(a){return this.a=a.a,this.b=a.b,this.c=a.c,this.d=a.d,this.tx=a.tx,this.ty=a.ty,this},b.prototype.copyTo=function(a){return a.a=this.a,a.b=this.b,a.c=this.c,a.d=this.d,a.tx=this.tx,a.ty=this.ty,this},b.prototype.clone=function(){return new a.Geom.Matrix(this.a,this.b,this.c,this.d,this.tx,this.ty)},Object.defineProperty(b.prototype,"toString",{get:function(){return"[{Matrix (a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+")}]"},enumerable:!0,configurable:!0}),b}();b.Matrix=c}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a,b){"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),this.setTo(a,b)}return a.prototype.objType=function(){return"Point"},a.prototype.polar=function(a,b){return this.x=a*Math.cos(b*Math.PI/180),this.y=a*Math.sin(b*Math.PI/180),this},a.prototype.add=function(b,c){return"undefined"==typeof c&&(c=new a),c.setTo(this.x+b.x,this.y+b.y)},a.prototype.addTo=function(a,b){return"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),this.setTo(this.x+a,this.y+b)},a.prototype.subtractFrom=function(a,b){return"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),this.setTo(this.x-a,this.y-b)},a.prototype.invert=function(){return this.setTo(this.y,this.x)},a.prototype.clamp=function(a,b){return this.clampX(a,b),this.clampY(a,b),this},a.prototype.clampX=function(a,b){return this.x=Math.max(Math.min(this.x,b),a),this},a.prototype.clampY=function(a,b){return this.x=Math.max(Math.min(this.x,b),a),this.y=Math.max(Math.min(this.y,b),a),this},a.prototype.clone=function(b){return"undefined"==typeof b&&(b=new a),b.setTo(this.x,this.y)},a.prototype.copyFrom=function(a){return this.setTo(a.x,a.y)},a.prototype.copyTo=function(a){return a.setTo(this.x,this.y)},a.prototype.angleTo=function(a){return Math.atan2(a.x-this.x,a.y-this.y)},a.prototype.angleToXY=function(a,b){return Math.atan2(a-this.x,b-this.y)},a.prototype.distanceTo=function(a,b){"undefined"==typeof b&&(b=!1);var c=this.x-a.x,d=this.y-a.y;return b===!0?Math.round(Math.sqrt(c*c+d*d)):Math.sqrt(c*c+d*d)},a.prototype.distanceToXY=function(a,b,c){"undefined"==typeof c&&(c=!1);var d=this.x-a,e=this.y-b;return c===!0?Math.round(Math.sqrt(d*d+e*e)):Math.sqrt(d*d+e*e)},a.distanceBetween=function(a,b,c){"undefined"==typeof c&&(c=!1);var d=a.x-b.x,e=a.y-b.y;return c===!0?Math.round(Math.sqrt(d*d+e*e)):Math.sqrt(d*d+e*e)},a.polar=function(b,c){return new a(b*Math.cos(c*Math.PI/180),b*Math.sin(c*Math.PI/180))},a.prototype.distanceCompare=function(a,b){return this.distanceTo(a)>=b?!0:!1},a.prototype.equals=function(a){return this.x===a.x&&this.y===a.y?!0:!1},a.interpolate=function(b,c,d){var e=c.x-b.x,f=c.y-b.y;return new a(c.x-e*d,c.y-f*d)},a.prototype.offset=function(a,b){return this.x+=a,this.y+=b,this},a.prototype.setTo=function(a,b){return this.x=a,this.y=b,this},a.prototype.subtract=function(b,c){return"undefined"==typeof c&&(c=new a),c.setTo(this.x-b.x,this.y-b.y)},a.prototype.getCSS=function(){return this.x+"px "+this.y+"px"},a.prototype.toString=function(){return"[{Point (x="+this.x+" y="+this.y+")}]"},a}();a.Point=b}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d){"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.x=0,this.y=0,this.width=0,this.height=0,this.setTo(a,b,c,d)}return b.prototype.objType=function(){return"Rectangle"},Object.defineProperty(b.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){a&&(this.height=a<this.y?0:a)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"center",{get:function(){var b=new a.Geom.Point;return b.setTo(Math.round(this.width/2),Math.round(this.height/2))},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"bottomRight",{get:function(){var b=new a.Geom.Point;return b.setTo(this.right,this.bottom)},set:function(a){a&&(this.right=a.x,this.bottom=a.y)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"left",{get:function(){return this.x},set:function(a){if(a){var b=this.x-a;this.width+b<0?(this.width=0,this.x=a):(this.width+=b,this.x=a)}},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"right",{get:function(){return this.x+this.width},set:function(a){a&&(this.width=a<this.x?0:a-this.x)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"size",{get:function(){var b=new a.Geom.Point;return b.setTo(this.width,this.height)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"volume",{get:function(){return this.width*this.height},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"top",{get:function(){return this.y},set:function(a){if(a){var b=this.y-a;this.height+b<0?(this.height=0,this.y=a):(this.height+=b,this.y=a)}},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"topLeft",{get:function(){var b=new a.Geom.Point;return b.setTo(this.x,this.y)},set:function(a){a&&(this.x=a.x,this.y=a.y)},enumerable:!0,configurable:!0}),b.prototype.clone=function(a){return"undefined"==typeof a&&(a=new b),a.setTo(this.x,this.y,this.width,this.height)},b.prototype.contains=function(a,b){return a>=this.x&&a<=this.right&&b>=this.y&&b<=this.bottom?!0:!1},b.prototype.containsPoint=function(a){return this.contains(a.x,a.y)},b.prototype.containsRect=function(a){return a.volume>this.volume?!1:a.x>=this.x&&a.y>=this.y&&a.right<=this.right&&a.bottom<=this.bottom?!0:!1},b.prototype.copyFrom=function(a){return this.setTo(a.x,a.y,a.width,a.height)},b.prototype.copyTo=function(a){return a.copyFrom(this)},b.prototype.equals=function(a){return this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height?!0:!1},b.prototype.inflate=function(a,b){return isNaN(a)||isNaN(b)||(this.x-=a,this.width+=2*a,this.y-=b,this.height+=2*b),this},b.prototype.inflatePoint=function(a){return this.inflate(a.x,a.y)},b.prototype.intersection=function(a,c){return"undefined"==typeof c&&(c=new b),this.intersects(a)===!0&&(c.x=Math.max(a.x,this.x),c.y=Math.max(a.y,this.y),c.width=Math.min(a.right,this.right)-c.x,c.height=Math.min(a.bottom,this.bottom)-c.y),c},b.prototype.intersects=function(a){return a.x>this.right-1?!1:a.right-1<this.x?!1:a.bottom-1<this.y?!1:a.y>this.bottom-1?!1:!0},b.prototype.overlap=function(a){var b={top:!1,bottom:!1,left:!1,right:!1,contains:!1,contained:!1},c=this.intersection(a);return c.isEmpty?b:(this.containsRect(a)&&(b.contains=!0),a.containsRect(this)&&(b.contained=!0),this.top<a.top&&(b.top=!0),this.bottom>a.bottom&&(b.bottom=!0),this.left<a.left&&(b.left=!0),this.right>a.right&&(b.right=!0),b)},b.prototype.isEmpty=function(){return this.width<1||this.height<1?!0:!1},b.prototype.offset=function(a,b){return isNaN(a)||isNaN(b)||(this.x+=a,this.y+=b),this},b.prototype.offsetPoint=function(a){return this.offset(a.x,a.y)},b.prototype.setEmpty=function(){return this.setTo(0,0,0,0)},b.prototype.setTo=function(a,b,c,d){return isNaN(a)||isNaN(b)||isNaN(c)||isNaN(d)||(this.x=a,this.y=b,c>=0&&(this.width=c),d>=0&&(this.height=d)),this},b.prototype.union=function(a,c){return"undefined"==typeof c&&(c=new b),c.setTo(Math.min(a.x,this.x),Math.min(a.y,this.y),Math.max(a.right,this.right),Math.max(a.bottom,this.bottom))},b.prototype.scale=function(b,c,d){var e=new a.Geom.Transform;e.scaleX=b,e.scaleY=c,e.x=d.x,e.y=d.y;var f=this.topLeft;return e.transformPoint(f),this.topLeft=f,this.width*=b,this.height*=c,this},b.prototype.toString=function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" isEmpty="+this.isEmpty()+")}]"},b}();b.Rectangle=c}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(b,c,d,e,f,g,h){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=1),"undefined"==typeof f&&(f=0),"undefined"==typeof g&&(g=0),"undefined"==typeof h&&(h=0),this._x=0,this._y=0,this._scaleX=1,this._scaleY=1,this._rotation=0,this._rotPointX=0,this._rotPointY=0,this.setTransform(b,c,d,e,f,g,h),this._matrix=new a.Geom.Matrix,this._matrix.setFromTransform(this._x,this._y,this._scaleX,this._scaleY,this._rotation),this._cachedConcatenatedMatrix=this.getConcatenatedMatrix()}return b.prototype.objType=function(){return"Transform"},Object.defineProperty(b.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"scaleX",{get:function(){return this._scaleX},set:function(a){this._scaleX=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"scaleY",{get:function(){return this._scaleY},set:function(a){this._scaleY=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"rotation",{get:function(){return this._rotation},set:function(a){this._rotation=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"rotPointX",{get:function(){return this._rotPointX},set:function(a){this._rotPointX=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"rotPointY",{get:function(){return this._rotPointY},set:function(a){this._rotPointY=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"matrix",{get:function(){return this._matrix},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"worldX",{get:function(){return this.getConcatenatedMatrix().tx},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"worldY",{get:function(){return this.getConcatenatedMatrix().ty},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"parent",{get:function(){return this._parent},set:function(a){this.checkAncestor(a)||(this._parent=a)},enumerable:!0,configurable:!0}),b.prototype.setPosition=function(a,b){return this._x=a,this._y=b,this},b.prototype.setPositionFromPoint=function(a){return this._x=a.x,this._y=a.y,this},b.prototype.translatePositionFromPoint=function(a){return this._x+=a.x,this._y+=a.y,this},b.prototype.getPositionPoint=function(b){return"undefined"==typeof b&&(b=new a.Geom.Point),b.setTo(this._x,this._y)},Object.defineProperty(b.prototype,"scale",{set:function(a){this._scaleX=a,this._scaleY=a},enumerable:!0,configurable:!0}),b.prototype.setTransform=function(a,b,c,d,e,f,g){return"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),"undefined"==typeof g&&(g=0),this._x=a,this._y=b,this._scaleX=c,this._scaleY=d,this._rotation=e,this._rotPointX=f,this._rotPointY=g,this},b.prototype.getParentMatrix=function(){return this._parent?this._parent.getConcatenatedMatrix():null},b.prototype.getConcatenatedMatrix=function(){this._matrix.setFromTransform(this._x,this._y,this._scaleX,this._scaleY,this._rotation);var a=this.getParentMatrix();if(a){var b=this._matrix.clone();return b.prependMatrix(a),this._cachedConcatenatedMatrix.copyFrom(b),b}return this._matrix},b.prototype.transformPoint=function(a){var b=this.getConcatenatedMatrix();return b.transformPoint(a)},b.prototype.copyFrom=function(a){return this.setTransform(a.x,a.y,a.scaleX,a.scaleY,a.rotation,a.rotPointX,a.rotPointY),this.parent=a.parent,this._matrix=a.matrix.clone(),this},b.prototype.copyTo=function(a){return a.copyFrom(this),this},b.prototype.clone=function(a){return"undefined"==typeof a&&(a=new b),a.copyFrom(this),a},b.prototype.checkAncestor=function(){return!1},Object.defineProperty(b.prototype,"toString",{get:function(){return"[{Transform (x="+this._x+" y="+this._y+" scaleX="+this._scaleX+" scaleY="+this._scaleY+" rotation="+this._rotation+" regX="+this._rotPointX+" regY="+this.rotPointY+" matrix="+this._matrix+")}]"},enumerable:!0,configurable:!0}),b}();b.Transform=c}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b){"undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),this.setTo(a,b)}return b.prototype.objType=function(){return"Vector2"},b.fromAngle=function(a){return new b(Math.cos(a),Math.sin(a))},b.randomRadius=function(a){return new b(2*Math.random()-1,2*Math.random()-1).multiplyScalar(a)},b.fromPoint=function(a){return new b(a.x,a.y)},b.prototype.add=function(a){return new b(this.x+a.x,this.y+a.y)},b.prototype.addX=function(a){return new b(this.x+a.x,this.y)},b.prototype.addY=function(a){return new b(this.x,this.y+a.y)},b.prototype.subtract=function(b){return new a.Geom.Vector2(this.x-b.x,this.y-b.y)},b.prototype.multiply=function(b){return new a.Geom.Vector2(this.x*b.x,this.y*b.y)},b.prototype.multiplyScalar=function(b){return new a.Geom.Vector2(this.x*b,this.y*b)},b.prototype.dot=function(a){return this.x*a.x+this.y*a.y},b.prototype.lenSqr=function(){return this.x*this.x+this.y*this.y},b.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},b.prototype.unit=function(){var a=1/this.len();return this.multiplyScalar(a)},b.prototype.floor=function(){return new b(Math.floor(this.x),Math.floor(this.y))},b.prototype.ceil=function(){return new b(Math.ceil(this.x),Math.ceil(this.y))},b.prototype.round=function(){return new b(Math.round(this.x),Math.round(this.y))},b.prototype.clamp=function(a,c){return new b(Math.max(Math.min(this.x,c.x),a.x),Math.max(Math.min(this.y,c.y),a.y))},b.prototype.perp=function(){return new b(-this.y,this.x)},b.prototype.neg=function(){return new b(-this.x,-this.y)},b.prototype.equal=function(a){return this.x===a.x&&this.y===a.y},b.prototype.point=function(){return new a.Geom.Point(this.x,this.y)},b.prototype.clear=function(){return this.x=0,this.y=0,this},b.prototype.clone=function(a){return a?a.setTo(this.x,this.y):new b(this.x,this.y)},b.prototype.copyFrom=function(a){return this.x=a.x,this.y=a.y,this},b.prototype.copyTo=function(a){return a.x=this.x,a.y=this.y,a},b.prototype.setTo=function(a,b){return this.x=a,this.y=b,this},b.prototype.toString=function(){return"[{Vector2 (x="+this.x+" y="+this.y+")}]"},b}();b.Vector2=c}(a.Geom||(a.Geom={}));a.Geom}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(b,c){if(this._game=b,this.name=c,this._manager=this._game.huds,this._device=this._game.deviceTargetOption,this._manager.supported){switch(this._device){case a.TARGET_BROWSER:this.container=document.createElement("div"),this.container.id="HUD-layer-"+b.rnd.uuid(),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="absolute",this._widgets=new Array}this.class="kiwi-display"}}return b.prototype.objType=function(){return"HUDDisplay"},b.prototype.addWidget=function(b){return this._manager.supported&&(this._widgets.push(b),this._device==a.TARGET_BROWSER)?(this.container.appendChild(b.container),!0):!1},b.prototype.removeWidget=function(a){if(this._manager.supported&&this.removeFromContainer(a)){var b=this._widgets.indexOf(a);if(-1!==b)return this._widgets.splice(b,1),!0}return!1},b.prototype.removeAllWidgets=function(){for(var a=0;a<this._widgets.length;a++)this.removeFromContainer(this._widgets[a]);this._widgets=[]},b.prototype.removeFromContainer=function(b){return this._manager.supported&&this._device==a.TARGET_BROWSER&&this.container.contains(b.container)?(this.container.removeChild(b.container),!0):!1},b.prototype.update=function(){for(var a=0;a<this._widgets.length;a++)this._widgets[a].update()},b.prototype.show=function(){this.container.style.display="block"},b.prototype.hide=function(){this.container.style.display="none"},Object.defineProperty(b.prototype,"class",{get:function(){return this._device==a.TARGET_BROWSER?this.container.className:void 0},set:function(b){this._device==a.TARGET_BROWSER&&(this.container.className=b)},enumerable:!0,configurable:!0}),b}();b.HUDDisplay=c}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._game=a,this._device=this._game.deviceTargetOption}return Object.defineProperty(b.prototype,"supported",{get:function(){return this._supported},enumerable:!0,configurable:!0}),b.prototype.boot=function(){this._device===a.TARGET_BROWSER?(this._supported=!0,this._hudContainer=document.createElement("div"),this._hudContainer.id="HUDContainer",this._hudContainer.style.position="absolute",this._hudContainer.style.width="100%",this._hudContainer.style.height="100%",this._hudContainer.style.top="0",this._hudContainer.style.left="0",this._game.stage.container.appendChild(this._hudContainer),this._huds=new Array,this._defaultHUD=this.createHUD("defaultHUD"),this._currentHUD=this._defaultHUD,this.setHUD(this._defaultHUD)):this._supported=!1},b.prototype.objType=function(){return"HUDManager"},Object.defineProperty(b.prototype,"defaultHUD",{get:function(){return this._defaultHUD},set:function(a){this._currentHUD===this._defaultHUD&&(this._currentHUD=a,this.setHUD(this._currentHUD)),this._defaultHUD=a},enumerable:!0,configurable:!0}),b.prototype.setHUD=function(a){this.supported&&(this.hideHUD(),this._currentHUD=a,this.showHUD())},b.prototype.showHUD=function(a){"undefined"==typeof a&&(a=this._currentHUD),a.show()},b.prototype.hideHUD=function(a){"undefined"==typeof a&&(a=this._currentHUD),a.hide()},b.prototype.createHUD=function(b,c){if("undefined"==typeof c&&(c=!1),this.supported){var d=new a.HUD.HUDDisplay(this._game,b);return d.hide(),this.addToContainer(d),this._huds.push(d),c===!0&&this.setHUD(d),d}},b.prototype.removeHUD=function(a){if(this.supported){if(a===this._defaultHUD)return!1;this._currentHUD===a&&this.setHUD(this._defaultHUD),this.removeFromContainer(a);var b=this._huds.indexOf(a);return-1!==b&&this._huds.splice(b,1),!0}},b.prototype.addToContainer=function(b){this._device==a.TARGET_BROWSER&&this._hudContainer.appendChild(b.container)},b.prototype.removeFromContainer=function(b){this._device==a.TARGET_BROWSER&&this._hudContainer.contains(b.container)&&this._hudContainer.removeChild(b.container)},b.prototype.update=function(){if(this._supported)for(var a=0;a<this._huds.length;a++)this._huds[a].update()},b}();b.HUDManager=c}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(b,c,d,e){this.name=c,this.game=b,this._manager=this.game.huds,this._device=this.game.deviceTargetOption,this.components=new a.ComponentManager(a.HUD_WIDGET,this),this._manager.supported&&(this._device===a.TARGET_BROWSER&&(this.container=document.createElement("div"),this.container.id="HUD-widget-"+this.game.rnd.uuid(),this.container.className="HUD-widget",this.container.style.position="absolute"),this.onCoordsUpdate=new a.Signal,this.x=d,this.y=e)}return b.prototype.objType=function(){return"HUDWidget"},Object.defineProperty(b.prototype,"style",{get:function(){return this._device===a.TARGET_BROWSER?this.container.style:void 0},set:function(b){this._device===a.TARGET_BROWSER&&(this.container.style=b)},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"x",{get:function(){return this._x},set:function(b){this._manager.supported&&(this._x=b,this._device==a.TARGET_BROWSER&&(this.container.style.left=this.x+"px"),this.onCoordsUpdate.dispatch(this.x,this.y))},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"y",{get:function(){return this._y},set:function(b){this._manager.supported&&(this._y=b,this._device==a.TARGET_BROWSER&&(this.container.style.top=this.y+"px"),this.onCoordsUpdate.dispatch(this.x,this.y))},enumerable:!0,configurable:!0}),b.prototype.setTemplate=function(b,c){for(var d=[],e=0;e<arguments.length-2;e++)d[e]=arguments[e+2];if(this._device==a.TARGET_BROWSER){var f=document.getElementById(b);if(void 0===f)return;if(void 0===c)var g=f;else{var g=document.getElementById(c);if(void 0===g||f.contains(g)===!1)return}this.tempElement=g,this._tempContainer=f,this._tempParent=f.parentElement,this._tempParent.removeChild(f),this.container.appendChild(f)}},b.prototype.removeTemplate=function(){this._device==a.TARGET_BROWSER&&void 0!==this.tempElement&&(this.container.removeChild(this._tempContainer),this._tempParent.appendChild(this._tempContainer),this.tempElement=null,this._tempParent=null,this._tempContainer=null)},Object.defineProperty(b.prototype,"class",{get:function(){return this._device==a.TARGET_BROWSER?this.container.className:void 0},set:function(b){this._device==a.TARGET_BROWSER&&(this.container.className=b)},enumerable:!0,configurable:!0}),b.prototype.update=function(){this.components.update()},b.prototype.destroy=function(){delete this.game,delete this._manager,delete this._device,this.onCoordsUpdate&&this.onCoordsUpdate.dispose(),delete this.onCoordsUpdate},b}();b.HUDWidget=c}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(b){function c(c,d,e,f){b.call(this,c,"textField",e,f),this._prefix="",this._suffix="",this.class="kiwi-textfield-widget kiwi-widget",this._manager.supported&&this._device===a.TARGET_BROWSER&&(this._textField=this.container,this._textField.innerHTML=d)}return __extends(c,b),c.prototype.objType=function(){return"TextFieldWidget"},c.prototype.setTemplate=function(c,d){this._device===a.TARGET_BROWSER&&(this._textField.innerText="",b.prototype.setTemplate.call(this,c,d),void 0!==this.tempElement&&(this._textField=this.tempElement),this._textField.innerHTML=this._text)},c.prototype.removeTemplate=function(){this._device===a.TARGET_BROWSER&&(b.prototype.removeTemplate.call(this),this._device===a.TARGET_BROWSER&&(this._textField=this.container,this._textField.innerHTML=this._text))},Object.defineProperty(c.prototype,"text",{get:function(){return this._text},set:function(b){this._manager.supported&&this._device===a.TARGET_BROWSER&&(""!==this._prefix&&(b=this._prefix+b),""!==this._suffix&&(b+=this._suffix),this._text=b,this._textField.innerHTML=this._text)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"suffix",{get:function(){return this._suffix},set:function(a){this._suffix=a,this._updateText()},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"prefix",{get:function(){return this._prefix},set:function(a){this._prefix=a,this._updateText()},enumerable:!0,configurable:!0}),c.prototype._updateText=function(){this.text=this._text},c}(a.HUD.HUDWidget);b.TextField=c}(b.Widget||(b.Widget={}));b.Widget}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(b){function c(c,d,e,f,g,h,i,j){"undefined"==typeof h&&(h=120),"undefined"==typeof i&&(i=20),"undefined"==typeof j&&(j="#000"),b.call(this,c,"bar",f,g),this._horizontal=!0,this.class="kiwi-bar-widget kiwi-widget",this._manager.supported&&(this._device==a.TARGET_BROWSER&&(this._bar=document.createElement("div"),this._bar.className="kiwi-innerbar-widget",this._bar.style.backgroundColor=j,this.bar=this._bar,this.container.appendChild(this.bar)),this.counter=this.components.add(new a.HUD.HUDComponents.Counter(this,d,e,0)),this.counter.updated.add(this.updateCSS,this),this.width=h,this.height=i,this._bar.style.height="100%",this._bar.style.width="100%",this.updateCSS())
 }return __extends(c,b),c.prototype.objType=function(){return"BarWidget"},Object.defineProperty(c.prototype,"width",{get:function(){return this._width},set:function(b){this._device==a.TARGET_BROWSER&&(this.container.style.width=b+"px"),this._width=b},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"height",{get:function(){return this._height},set:function(b){this._device==a.TARGET_BROWSER&&(this.container.style.height=b+"px"),this._height=b},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"horizontal",{get:function(){return this._horizontal},set:function(a){this._horizontal=a,this.updateCSS()},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"vertical",{get:function(){return!this._horizontal},set:function(a){this._horizontal=!a,this.updateCSS()},enumerable:!0,configurable:!0}),c.prototype.setTemplate=function(c,d){this._device==a.TARGET_BROWSER&&(b.prototype.setTemplate.call(this,c,d),void 0!==this.tempElement&&(this.bar=this.tempElement))},c.prototype.removeTemplate=function(){this._device==a.TARGET_BROWSER&&(b.prototype.removeTemplate.call(this),this.bar=this._bar,this.container.appendChild(this.bar),this.updateCSS())},c.prototype.updateCSS=function(){this.horizontal===!0?(this.bar.style.width=String(this.counter.currentPercent())+"%",this.bar.style.height="100%"):(this.bar.style.height=String(this.counter.currentPercent())+"%",this.bar.style.width="100%")},c}(a.HUD.HUDWidget);b.Bar=c}(b.Widget||(b.Widget={}));b.Widget}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(b){function c(a,c,d,e){b.call(this,a,"Icon",d,e),this._cellIndex=0,this.class="kiwi-icon-widget kiwi-widget",this.atlas=c,this.icon=this.container,this._applyCSS()}return __extends(c,b),Object.defineProperty(c.prototype,"cellIndex",{get:function(){return this._cellIndex},set:function(a){this._cellIndex=a,this.width=this.atlas.cells[this.cellIndex].w,this.height=this.atlas.cells[this.cellIndex].h,this._applyCSS()},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"width",{get:function(){return this.atlas.cells[this.cellIndex].w},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"height",{get:function(){return this.atlas.cells[this.cellIndex].h},enumerable:!0,configurable:!0}),c.prototype._removeCSS=function(){this.icon.style.width="",this.icon.style.height="",this.icon.style.backgroundImage="",this.icon.style.backgroundRepeat="",this.icon.style.backgroundSize=""},c.prototype._applyCSS=function(){this.icon.style.width=this.width+"px",this.icon.style.height=this.height+"px",this.icon.style.backgroundSize="100%",this.icon.style.backgroundPositionX=-this.atlas.cells[this.cellIndex].x+"px",this.icon.style.backgroundPositionY=-this.atlas.cells[this.cellIndex].y+"px",this.icon.style.backgroundImage='url("'+this.atlas.image.src+'")'},c.prototype.setTemplate=function(c,d){this._device==a.TARGET_BROWSER&&(this._removeCSS(),b.prototype.setTemplate.call(this,c,d),void 0!==this.tempElement&&(this.icon=this.tempElement),this._applyCSS())},c.prototype.removeTemplate=function(){this._device==a.TARGET_BROWSER&&(b.prototype.removeTemplate.call(this),this._removeCSS(),this.icon=this.container,this._applyCSS())},c}(a.HUD.HUDWidget);b.Icon=c}(b.Widget||(b.Widget={}));b.Widget}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(b){function c(c,d,e,f,g,h){b.call(this,c,"IconBar",g,h),this.iconGap=0,this.class="kiwi-iconbar-widget kiwi-widget",this.atlas=d,this.width=this.atlas.cells[0].w,this.height=this.atlas.cells[0].h,this._horizontal=!0,this.counter=this.components.add(new a.HUD.HUDComponents.Counter(this,e,f,0)),this.counter.updated.add(this._amountChanged,this),this._icons=[],this._amountChanged()}return __extends(c,b),c.prototype.objType=function(){return"IconBarWidget"},c.prototype._amountChanged=function(){if(this.counter.max!==this._icons.length)if(this.counter.max>this._icons.length)for(var a=this.counter.max-this._icons.length,b=0;a>b;b++)this._addIcon();else for(var b=this.counter.max;b<this._icons.length;b++)this._removeIcon(this._icons[b]),this._icons[b].destroy(),this._icons.splice(b,1),b--;for(var b=0;b<this._icons.length;b++)this._icons[b].style.display=b>this.counter.current-1?"none":"block"},c.prototype._addIcon=function(){if(this.horizontal)var b=new a.HUD.Widget.Icon(this.game,this.atlas,this.x+(this.width+this.iconGap)*(this._icons.length-1),this.y);else var b=new a.HUD.Widget.Icon(this.game,this.atlas,this.x,(this.height+this.iconGap)*(this._icons.length-1)+this.y);this._icons.push(b),this._device==a.TARGET_BROWSER&&this.container.appendChild(b.container)},c.prototype._removeIcon=function(b){this._device==a.TARGET_BROWSER&&this.container.removeChild(b.container)},Object.defineProperty(c.prototype,"horizontal",{get:function(){return this._horizontal},set:function(a){this._horizontal=a,this._amountChanged()},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"vertical",{get:function(){return!this._horizontal},set:function(a){this._horizontal=!a,this._amountChanged()},enumerable:!0,configurable:!0}),c}(a.HUD.HUDWidget);b.IconBar=c}(b.Widget||(b.Widget={}));b.Widget}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(b){function c(c,d,e,f){"undefined"==typeof f&&(f=0),b.call(this,c,"basicScore",d,e),this.name="basicScore",this.class="kiwi-basicscore-widget kiwi-widget",this.counter=this.components.add(new a.HUD.HUDComponents.Counter(this,f)),this.counter.updated.add(this._updateText,this),this._updateText()}return __extends(c,b),c.prototype.objType=function(){return"BasicScoreWidget"},c.prototype._updateText=function(){this.text=String(this.counter.current)},c}(a.HUD.Widget.TextField);b.BasicScore=c}(b.Widget||(b.Widget={}));b.Widget}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(b){function c(c,d,e,f){b.call(this,c,d,e,f),this.name="button",this.class="kiwi-button-widget kiwi-widget",this.input=this.components.add(new a.HUD.HUDComponents.WidgetInput(this,this.container))}return __extends(c,b),c.prototype.objType=function(){return"ButtonWidget"},c}(a.HUD.Widget.TextField);b.Button=c}(b.Widget||(b.Widget={}));b.Widget}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(b){function c(c,d,e,f){b.call(this,c,"time",e,f),this.name="time",this.class="kiwi-time-widget kiwi-widget",this.time=this.components.add(new a.HUD.HUDComponents.Time(this,d))}return __extends(c,b),c.prototype.objType=function(){return"TimeWidget"},c.prototype.pause=function(){this.time.pause()},c.prototype.stop=function(){this.time.stop()},c.prototype.start=function(){this.time.start()},c.prototype.resume=function(){this.time.resume()},c.prototype.update=function(){b.prototype.update.call(this),this.time.isRunning&&(this.text=this.time.getTime())},c}(a.HUD.Widget.TextField);b.Time=c}(b.Widget||(b.Widget={}));b.Widget}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(b){function c(a,c,d){b.call(this,a,"menu",c,d),this._menuItems=[],this._styles=[],this.class="kiwi-menu-widget kiwi-widget"}return __extends(c,b),c.prototype.objType=function(){return"MenuWidget"},c.prototype.setIconStyle=function(a,b){this._styles.push({index:a,value:b});for(var c=0;c<this._menuItems.length;c++)this._menuItems[c].style[a]=b},Object.defineProperty(c.prototype,"menuItems",{get:function(){return this._menuItems},enumerable:!0,configurable:!0}),c.prototype.createMenuItem=function(b,c,d){return this.addMenuItem(new a.HUD.Widget.MenuItem(this.game,b,c,d))},c.prototype.addMenuItem=function(b){this._menuItems.push(b),b.menu=this;for(var c=0;c<this._styles.length;c++)b.style[this._styles[c].index]=this._styles[c].value;return this._device==a.TARGET_BROWSER&&this.container.appendChild(b.container),b},c.prototype.addMenuItems=function(a){for(var b=0;b<a.length;b++)this.addMenuItem(a[b])},c.prototype.getMenuItem=function(a){return this._menuItems[a]},c.prototype.setTemplate=function(a,b){},c.prototype.removeTemplate=function(){},c.prototype.update=function(){for(var a=0;a<this._menuItems.length;a++)this._menuItems[a].update();b.prototype.update.call(this)},c}(a.HUD.HUDWidget);b.Menu=c}(b.Widget||(b.Widget={}));b.Widget}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(a){function b(b,c,d,e){a.call(this,b,c,d,e),this.name="menuItem",this.class="kiwi-menuitem-widget kiwi-widget"}return __extends(b,a),b.prototype.objType=function(){return"MenuItem"},b}(a.HUD.Widget.Button);b.MenuItem=c}(b.Widget||(b.Widget={}));b.Widget}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(b){function c(c,d,e,f){"undefined"==typeof e&&(e=null),"undefined"==typeof f&&(f=null),b.call(this,c,"counter"),this._current=d,this._max=e,this._min=f,this.updated=new a.Signal}return __extends(c,b),c.prototype.objType=function(){return"CounterComponent"},Object.defineProperty(c.prototype,"max",{get:function(){return this._max},set:function(a){this._max=a,this.updated.dispatch(this._current,this._max,this._min)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"min",{get:function(){return this._min},set:function(a){this._min=a,this.updated.dispatch(this._current,this._max,this._min)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"current",{get:function(){return this._current},set:function(a){this._current=null!==this._max&&a>this._max?this._max:null!==this._min&&a<this._min?this._min:a,this.updated.dispatch(this._current,this._max,this._min)},enumerable:!0,configurable:!0}),c.prototype.decrease=function(a){return"undefined"==typeof a&&(a=1),(null===this._min||this._current>this._min)&&(null!==this._min&&this._current-a<this._min?this._current=this._min:this._current-=a,this.updated.dispatch(this._current,this._max,this._min)),this._current},c.prototype.increase=function(a){return"undefined"==typeof a&&(a=1),(null===this._max||this._current<this._max)&&(null!==this._max&&this._current+a>this._max?this._current=this._max:this._current+=a,this.updated.dispatch(this._current,this._max,this._min)),this._current},c.prototype.currentPercent=function(){return null!==this.max?this.current/this.max*100:void 0},c}(a.Component);b.Counter=c}(b.HUDComponents||(b.HUDComponents={}));b.HUDComponents}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(b){function c(c,d){b.call(this,c,"WidgetInput"),this._active=!1,this._container=d,this.onUp=new a.Signal,this.onDown=new a.Signal,this.onOver=new a.Signal,this.onOut=new a.Signal,this._addEvents()}return __extends(c,b),c.prototype.objType=function(){return"WidgetInputComponent"},c.prototype.setElement=function(a){this._removeEvents(),this._container=a,this._addEvents()},c.prototype._addEvents=function(){if(!this._active){this._binds=[],this._binds.push({event:"mouseup","function":this._up.bind(this)}),this._binds.push({event:"mousedown","function":this._down.bind(this)}),this._binds.push({event:"mouseover","function":this._over.bind(this)}),this._binds.push({event:"mouseout","function":this._out.bind(this)});for(var a=0;a<this._binds.length;a++)this._container.addEventListener(this._binds[a].event,this._binds[a].function,!1);this._active=!0}},c.prototype._removeEvents=function(){if(this._active){for(var a=0;a<this._binds.length;a++)this._container.removeEventListener(this._binds[a].event,this._binds[a].function,!1);this._binds=[],this._active=!1}},c.prototype._up=function(a){this.onUp.dispatch(a)},c.prototype._down=function(a){this.onDown.dispatch(a)},c.prototype._over=function(a){this.onOver.dispatch(a)},c.prototype._out=function(a){this.onOut.dispatch(a)},c}(a.Component);b.WidgetInput=c}(b.HUDComponents||(b.HUDComponents={}));b.HUDComponents}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){!function(b){var c=function(a){function b(b,c){"undefined"==typeof c&&(c=""),a.call(this,b,"time"),this.countDown=!1,this._displayString="",this._currentTime=0,this._timeBefore=0,this.speed=1,this.clock=this.game.time.addClock(name+"-clock",1e3),this.format=c}return __extends(b,a),b.prototype.objType=function(){return"TimeComponent"},Object.defineProperty(b.prototype,"isRunning",{get:function(){return this.clock.isRunning()},enumerable:!0,configurable:!0}),b.prototype.pause=function(){this.clock.pause()},b.prototype.stop=function(){this.clock.stop()},b.prototype.start=function(){this.clock.start(),this._timeBefore=this.clock.elapsed()},b.prototype.resume=function(){this.clock.resume()},Object.defineProperty(b.prototype,"format",{get:function(){return this._format},set:function(a){this._format=a},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"currentTime",{get:function(){return this._currentTime},enumerable:!0,configurable:!0}),b.prototype.setTime=function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),this._currentTime=a,0!=b&&(this._currentTime+=1e3*b),0!=c&&(this._currentTime+=60*c*1e3)},b.prototype.addTime=function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),this._currentTime+=a,0!=b&&(this._currentTime+=1e3*b),0!=c&&(this._currentTime+=60*c*1e3)},b.prototype.removeTime=function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),this._currentTime-=a,0!=b&&(this._currentTime-=1e3*b),0!=c&&(this._currentTime-=60*c*1e3)},b.prototype.getTime=function(){if(this.countDown?this._currentTime-=(this.clock.elapsed()-this._timeBefore)*this.speed:this._currentTime+=(this.clock.elapsed()-this._timeBefore)*this.speed,this._timeBefore=this.clock.elapsed(),""!==this._format){if(this._displayString=this._format,-1!==this._displayString.indexOf("ms")){var a=String(Math.floor(1e3*this._currentTime)%1e3);this._displayString=this._displayString.replace("ms",a)}if(-1!=this._displayString.indexOf("ss")){var a=String(Math.floor(this._currentTime)%60);a.length<2&&(a="0"+a),this._displayString=this._displayString.replace("ss",a)}if(-1!==this._displayString.indexOf("mm")){var a=String(Math.floor(this._currentTime/60)%60);a.length<2&&(a="0"+a),this._displayString=this._displayString.replace("mm",a)}if(-1!=this._displayString.indexOf("s")){var a=String(Math.floor(this._currentTime)%60);this._displayString=this._displayString.replace("s",a)}if(-1!==this._displayString.indexOf("m")){var a=String(Math.floor(this._currentTime/60)%60);this._displayString=this._displayString.replace("m",a)}return this._displayString}return String(this._currentTime.toFixed(2))},b}(a.Component);b.Time=c}(b.HUDComponents||(b.HUDComponents={}));b.HUDComponents}(a.HUD||(a.HUD={}));a.HUD}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this.noAudio=!1,this.usingWebAudio=!1,this.usingAudioTag=!1,this.context=null,this.masterGain=null,this._unlockedSource=null,this._game=a}return b.prototype.objType=function(){return"AudioManager"},Object.defineProperty(b.prototype,"locked",{get:function(){return this._locked},enumerable:!0,configurable:!0}),b.prototype.boot=function(){this._volume=1,this._muted=!1,this._sounds=[],a.DEVICE.iOS&&0==a.DEVICE.webaudio&&(this.channels=1),a.DEVICE.iOS&&this._game.deviceTargetOption!==a.TARGET_COCOON?(this._locked=!0,this._game.input.onUp.addOnce(this._unlocked,this),console.log("Kiwi.AudioManager: Audio is currently Locked until at touch event.")):this._locked=!1,this.usingWebAudio=!0,this.usingAudioTag=!1,window.AudioContext?this.context=new window.AudioContext:window.webkitAudioContext?this.context=new window.webkitAudioContext:window.Audio?(this.usingWebAudio=!1,this.usingAudioTag=!0):(this.usingWebAudio=!1,this.noAudio=!0),null!==this.context&&(this.masterGain=void 0===this.context.createGain?this.context.createGainNode():this.context.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this.context.destination))},b.prototype._unlocked=function(){if(console.log("Kiwi.AudioManager: Audio now Unlocked"),this.usingAudioTag){this._locked=!1;for(var a=0;a<this._sounds.length;a++)this._sounds[a].playable=!0}else{var b=this.context.createBuffer(1,1,22050);this._unlockedSource=this.context.createBufferSource(),this._unlockedSource.buffer=b,this._unlockedSource.connect(this.context.destination),this._unlockedSource.noteOn(0)}},Object.defineProperty(b.prototype,"mute",{get:function(){return this._muted},set:function(a){if(a===!0){if(this._muted)return;if(this._muted=!0,this.usingWebAudio)this._muteVolume=this.masterGain.gain.value,this.masterGain.gain.value=0;else if(this.usingAudioTag)for(var b=0;b<this._sounds.length;b++)this._sounds[b].mute=!0}else{if(0==this._muted)return;if(this._muted=!1,this.usingWebAudio)this.masterGain.gain.value=this._muteVolume;else if(this.usingAudioTag)for(var b=0;b<this._sounds.length;b++)this._sounds[b].mute=!1}},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"volume",{get:function(){return this._volume},set:function(b){if(void 0!==b)if(b=a.Utils.GameMath.clamp(b,1,0),this._volume=b,this._muted&&(this._muteVolume=this._volume),this.usingWebAudio)this.masterGain.gain.value=b;else if(this.usingAudioTag)for(var c=0;c<this._sounds.length;c++)this._sounds[c].volume=this._sounds[c].volume},enumerable:!0,configurable:!0}),b.prototype.isRegistered=function(a){return this.noAudio?void 0:-1!==this._sounds.indexOf(a)?!0:!1},b.prototype.registerSound=function(a){return this.isRegistered(a)===!1?(a.id=this._game.rnd.uuid(),this._sounds.push(a),!0):!1},b.prototype.add=function(b,c,d){if("undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=!1),!this.noAudio){var e=new a.Sound.Audio(this._game,b,c,d);return e}},b.prototype.remove=function(a,b){"undefined"==typeof b&&(b=!0);for(var c=0;c<this._sounds.length;c++)if(a.id==this._sounds[c].id)return this.usingWebAudio&&this._sounds[c].gainNode.disconnect(),1==b&&this._sounds[c].destroy(),this._sounds.splice(c,1,0),void 0},b.prototype.playAll=function(){for(var a=0;a<this._sounds.length;a++)this._sounds[a]&&this._sounds[a].play()},b.prototype.stopAll=function(){for(var a=0;a<this._sounds.length;a++)this._sounds[a]&&this._sounds[a].stop()},b.prototype.pauseAll=function(){for(var a=0;a<this._sounds.length;a++)this._sounds[a]&&this._sounds[a].pause()},b.prototype.resumeAll=function(){for(var a=0;a<this._sounds.length;a++)this._sounds[a]&&this._sounds[a].resume()},b.prototype.update=function(){if(this._locked&&this.usingWebAudio&&null!==this._unlockedSource&&(this._unlockedSource.playbackState===this._unlockedSource.PLAYING_STATE||this._unlockedSource.playbackState===this._unlockedSource.FINISHED_STATE)){this._locked=!1,this._unlockedSource=null;for(var a=0;a<this._sounds.length;a++)this._sounds[a].playable=!0}if(!this.noAudio)for(var a=0;a<this._sounds.length;a++)this._sounds[a].update()},b}();b.AudioManager=c}(a.Sound||(a.Sound={}));a.Sound}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(b,c,d,e){return this._muted=!1,this.totalDuration=0,this._buffer=null,this._decoded=!1,this._markers=[],this._currentMarker="default",this.ready=!1,this._game=b,this._game.audio.registerSound(this),this._usingAudioTag=this._game.audio.usingAudioTag,this._usingWebAudio=this._game.audio.usingWebAudio,this._playable=1==this._game.audio.locked?!1:!0,this.duration=0,this._volume=d,this._muteVolume=d,this._muted=this._game.audio.mute,this._loop=e,this.key=c,this._game.audio.noAudio||this._game.fileStore.exists(this.key)===!1?(this._game.debugOption&&console.log("Could not play Audio. Either the browser doesn't support audio or the Audio file was not found on the filestore"),void 0):(this._usingWebAudio?(this._setAudio(),this.ready&&(this.context=this._game.audio.context,this.masterGainNode=this._game.audio.masterGain,this.gainNode="undefined"==typeof this.context.createGain?this.context.createGainNode():this.context.createGain(),this._decode(),this.gainNode.gain.value=this.volume*this._game.audio.volume,this.gainNode.connect(this.masterGainNode))):this._usingAudioTag&&this._playable===!0&&(this._setAudio(),this.ready&&(this.totalDuration=this._sound.duration,this._sound.volume=this.volume*this._game.audio.volume,(isNaN(this.totalDuration)||0==this.totalDuration)&&(this._pending=!0))),this.addMarker("default",0,this.totalDuration,this._loop),this._currentMarker="default",this.onPlay=new a.Signal,this.onStop=new a.Signal,this.onPause=new a.Signal,this.onResume=new a.Signal,this.onLoop=new a.Signal,this.onMute=new a.Signal,void 0)}return Object.defineProperty(b.prototype,"playable",{get:function(){return this._playable},set:function(a){this._playable!==!0&&1==a&&(this._playable=a,this._setAudio(),this.ready&&this._usingAudioTag&&(this.totalDuration=this._sound.duration,this._sound.volume=this.volume*this._game.audio.volume))},enumerable:!0,configurable:!0}),b.prototype.objType=function(){return"Audio"},b.prototype._setAudio=function(){this._file=this._game.fileStore.getFile(this.key),"undefined"!=typeof this._file.data&&(this._usingAudioTag?(this._sound=this._file.data.cloneNode(!0),this._sound.play(),this._sound.pause()):this._sound=this._file.data,this.ready=!0)},b.prototype._decode=function(){if(0!=this.ready&&!this._usingAudioTag){if(this._file.data.decoded===!0&&null!==this._file.data.buffer)return this._buffer=this._file.data.buffer,this._decoded=!0,void 0;var a=this;this.context.decodeAudioData(this._file.data.raw,function(b){a._buffer=b,a._decoded=!0})}},Object.defineProperty(b.prototype,"volume",{get:function(){return this._volume},set:function(b){this._game.audio.noAudio||this.ready===!1||(b=a.Utils.GameMath.clamp(b,1,0),this._volume=b,this._muted&&(this._muteVolume=this._volume),this._playable&&(this._usingWebAudio?this.gainNode.gain.value=this._volume*this._game.audio.volume:this._usingAudioTag&&(this._sound.volume=this._volume*this._game.audio.volume)))},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"mute",{get:function(){return this._muted},set:function(a){this._game.audio.noAudio||void 0!==a&&this._muted!==a&&(a===!0?(this._muteVolume=this._volume,this.volume=0,this._muted=!0):(this._muted=!1,this.volume=this._muteVolume),this.onMute.dispatch(this._muted))},enumerable:!0,configurable:!0}),b.prototype.addMarker=function(a,b,c,d){"undefined"==typeof d&&(d=!1),this._markers[a]={start:b,stop:c,duration:c-b,loop:d}},b.prototype.removeMarker=function(a){"default"!==a&&(this.isPlaying&&this._currentMarker==a&&(this.stop(),this._currentMarker="default"),delete this._markers[a])},b.prototype.play=function(b,c){return"undefined"==typeof b&&(b=this._currentMarker),"undefined"==typeof c&&(c=!1),this.isPlaying&&0==c||this._game.audio.noAudio||(c===!0&&this._pending===!1&&this.stop(),"undefined"==typeof this._markers[b]||this._currentMarker===b&&this.isPlaying&&0==c)?void 0:(this.paused=!1,this._currentMarker=b,this.duration=1e3*this._markers[this._currentMarker].duration,this._loop=this._markers[this._currentMarker].loop,this._playable===!1?(this._pending=!0,void 0):(this._usingWebAudio?this._decoded===!0?(null==this._buffer&&(this._buffer=this._file.data.buffer),this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.gainNode),this.totalDuration=this._sound.buffer.duration,0==this.duration&&(this.duration=1e3*this.totalDuration),this._loop&&(this._sound.loop=!0),void 0===this._sound.start?this._sound.noteGrainOn(0,this._markers[this._currentMarker].start,this.duration/1e3):this._sound.start(0,this._markers[this._currentMarker].start,this.duration/1e3),this.isPlaying=!0,this._startTime=this._game.time.now(),this._currentTime=0,this._stopTime=this._startTime+this.duration,this.onPlay.dispatch()):(this._pending=!0,this._decode()):this._usingAudioTag&&(this._sound&&4==this._sound.readyState||this._game.deviceTargetOption==a.TARGET_COCOON?((0==this.duration||isNaN(this.duration))&&(this.duration=1e3*this.totalDuration),this._sound.volume=this._muted?0:this._volume,this._sound.currentTime=this._markers[this._currentMarker].start,this._sound.play(),this.isPlaying=!0,this._startTime=this._game.time.now(),this._currentTime=0,this._stopTime=this._startTime+this.duration,this.paused||this.onPlay.dispatch()):this._pending=!0),void 0))},b.prototype.stop=function(){this.isPlaying&&this._sound&&(this._usingWebAudio?void 0===this._sound.stop?this._sound.noteOff(0):this._sound.stop(0):this._usingAudioTag&&(this._sound.pause(),this._sound.currentTime=0),this.isPlaying=!1,0==this.paused&&this.onStop.dispatch())},b.prototype.pause=function(){this.isPlaying&&(this.paused=!0,this.stop(),this.onPause.dispatch())},b.prototype.resume=function(){this.paused&&0==this.isPlaying&&(this._usingWebAudio?(null==this._buffer&&(this._buffer=this._file.data.buffer),this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.gainNode),void 0===this._sound.start?this._sound.noteGrainOn(0,this._markers[this._currentMarker].start+this._currentTime/1e3,this.duration/1e3):this._sound.start(0,this._markers[this._currentMarker].start+this._currentTime/1e3,this.duration/1e3)):(this._sound.currentTime=this._markers[this._currentMarker].start+this._currentTime/1e3,this._sound.play()),this.paused=!1,this.isPlaying=!0,this.onResume.dispatch())},b.prototype.update=function(){this.ready&&(this._playable&&this._pending&&(this._decoded===!0||this._file.data&&this._file.data.decoded?(this._pending=!1,this.play()):(this._usingAudioTag&&!isNaN(this._sound.duration)||this._game.deviceTargetOption==a.TARGET_COCOON&&0!==this._sound.duration)&&(this.totalDuration=this._sound.duration,this._markers["default"].duration=this.totalDuration,this._pending=!1,this.isPlaying&&"default"==this._currentMarker&&(this.duration=this.totalDuration))),this.isPlaying&&(this._currentTime=this._game.time.now()-this._startTime,this._currentTime>=this.duration&&(this._usingWebAudio?this._loop?("default"==this._currentMarker?(this._currentTime=0,this._startTime=this._game.time.now()):this.play(this._currentMarker,!0),this.onLoop.dispatch()):this.stop():this._usingAudioTag&&(this._loop?(this.play(this._currentMarker,!0),this.onLoop.dispatch()):this.stop()))))},b.prototype.destroy=function(){this._game&&this._game.audio.remove(this),this.onLoop&&this.onLoop.dispose(),this.onStop&&this.onStop.dispose(),this.onPlay&&this.onPlay.dispose(),this.onMute&&this.onMute.dispose(),this.onPause&&this.onPause.dispose(),this.onResume&&this.onResume.dispose(),delete this.onLoop,delete this.onStop,delete this.onPause,delete this.onMute,delete this.onPlay,delete this.onResume,delete this._game,delete this._sound,delete this._currentTime,delete this._startTime,delete this._stopTime,delete this._pending,delete this.masterGainNode,delete this.gainNode,delete this.totalDuration,delete this.duration,delete this._file,delete this._buffer,delete this._decoded},b}();b.Audio=c}(a.Sound||(a.Sound={}));a.Sound}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._game=a,this.audio={}}return b.prototype.objType=function(){return"AudioLibrary"},b.prototype.clear=function(){for(var a in this.audio)delete this.audio[a]},b.prototype.rebuild=function(a,b){this.clear(),this._game.debug&&console.log("Kiwi.AudioLibrary: Rebuilding Audio Library");for(var c=a.keys,d=0;d<c.length;d++){var e=this._game.fileStore.getFile(c[d]);e.isAudio&&(this._game.debug&&console.log("  Kiwi.AudioLibrary: Adding Audio: "+e.fileName),b.audioLibrary.add(e))}},b.prototype.add=function(b){switch(b.dataType){case a.Files.File.AUDIO:this.audio[b.key]=b}},b}();b.AudioLibrary=c}(a.Sound||(a.Sound={}));a.Sound}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d){"undefined"==typeof d&&(d=1e3),this._timeFirstStarted=null,this._timeLastStarted=null,this._timeLastStopped=null,this._timeLastPaused=null,this._timeLastUnpaused=null,this._totalPaused=0,this._isRunning=!1,this._isStopped=!0,this._isPaused=!1,this._elapsedState=0,this.manager=null,this.master=null,this.name=null,this.units=0,this.manager=a,this.master=b,this.name=c,this.units=d,this.timers=[],this.units<1&&(this.units=1)}return b.prototype.objType=function(){return"Clock"},b.prototype.elapsedSinceFirstStarted=function(){return this._timeLastStarted?(this.master.elapsed()-this._timeFirstStarted)/this.units:null},b.prototype.started=function(){return this._timeLastStarted},b.prototype.elapsed=function(){return 0===this._elapsedState?this._timeLastStarted?(this.master.elapsed()-this._timeLastStarted-this._totalPaused)/this.units:null:1===this._elapsedState?(this._timeLastPaused-this._timeLastStarted-this._totalPaused)/this.units:2===this._elapsedState?this._timeLastStarted?(this.master.elapsed()-this._timeLastStarted-this._totalPaused)/this.units:null:3===this._elapsedState?(this._timeLastStopped-this._timeLastStarted-this._totalPaused)/this.units:void 0},b.prototype.elapsedSinceLastStopped=function(){return this._timeLastStarted?(this.master.elapsed()-this._timeLastStopped)/this.units:null},b.prototype.elapsedSinceLastPaused=function(){return this._timeLastStarted?(this.master.elapsed()-this._timeLastPaused)/this.units:null},b.prototype.elapsedSinceLastUnpaused=function(){return this._timeLastStarted?(this.master.elapsed()-this._timeLastUnpaused)/this.units:null},b.prototype.isRunning=function(){return this._isRunning},b.prototype.isStopped=function(){return this._isStopped},b.prototype.isPaused=function(){return this._isPaused},b.prototype.addTimer=function(a){return this.timers.push(a),this},b.prototype.createTimer=function(b,c,d,e){return"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=!0),this.timers.push(new a.Time.Timer(b,this,c,d)),e===!0&&this.timers[this.timers.length-1].start(),this.timers[this.timers.length-1]},b.prototype.removeTimer=function(a,b){return"undefined"==typeof a&&(a=null),"undefined"==typeof b&&(b=""),null!==a?this.timers[a.name]?(delete this.timers[a.name],!0):!1:""!==b?this.timers[b]?(delete this.timers[b],!0):!1:!1},b.prototype.checkExists=function(a){return this.timers[a]?!0:!1},b.prototype.stopAllTimers=function(){for(var a=0;a<this.timers.length;a++)this.timers[a].stop();return this},b.prototype.convertToMilliseconds=function(a){return a*this.units},b.prototype.update=function(){for(var a=0;a<this.timers.length;a++)this.timers[a].update()},b.prototype.start=function(){return this._timeLastStarted=this.master.elapsed(),this._totalPaused=0,this._timeFirstStarted||(this._timeFirstStarted=this._timeLastStarted),this._isRunning=!0,this._isPaused=!1,this._isStopped=!1,this._elapsedState=0,this},b.prototype.pause=function(){return this._isRunning===!0&&(this._timeLastPaused=this.master.elapsed(),this._isRunning=!1,this._isPaused=!0,this._isStopped=!1,this._elapsedState=1),this},b.prototype.resume=function(){return this._isPaused===!0&&(this._timeLastUnpaused=this.master.elapsed(),this._totalPaused+=this._timeLastUnpaused-this._timeLastPaused,this._isRunning=!0,this._isPaused=!1,this._isStopped=!1,this._elapsedState=2),this},b.prototype.stop=function(){return this._isStopped===!1&&(this._timeLastStopped=this.master.elapsed(),this._isPaused===!0&&(this._totalPaused+=this._timeLastStopped-this._timeLastPaused),this._isRunning=!1,this._isPaused=!1,this._isStopped=!0,this._elapsedState=3),this},b.prototype.toString=function(){return"[{Clock (name="+this.name+" units="+this.units+" running="+this._isRunning+")}]"},b}();b.Clock=c}(a.Time||(a.Time={}));a.Time}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a){this._clocks=[],this._game=a}return b.prototype.objType=function(){return"ClockManager"},b.prototype.boot=function(){this.master=new a.Time.MasterClock,this.clock=new a.Time.Clock(this,this.master,"default",1e3),this.clock.start()},b.prototype.addClock=function(b,c){return"undefined"==typeof c&&(c=1e3),this._clocks.push(new a.Time.Clock(this,this.master,b,c)),this._clocks[this._clocks.length-1]
-},b.prototype.getClock=function(a){for(var b=0;b<this._clocks.length;b++)if(this._clocks[b].name===a)return this._clocks[b]},b.prototype.update=function(){this.master.update(),this.clock.update();for(var a=0;a<this._clocks.length;a++)this._clocks[a].update()},b.prototype.now=function(){return this.master.now},b.prototype.delta=function(){return this.master.delta},b}();b.ClockManager=c}(a.Time||(a.Time={}));a.Time}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(){this.time=0,this.now=0,this.delta=0,this._started=Date.now(),this.time=this._started}return a.prototype.objType=function(){return"MasterClock"},a.prototype.elapsed=function(){return this.now-this._started},a.prototype.totalElapsedSeconds=function(){return.001*(this.now-this._started)},a.prototype.update=function(){this.now=Date.now(),this.delta=this.now-this.time,this.time=this.now,this.delta>.1&&(this.delta=.1)},a.prototype.elapsedSince=function(a){return this.now-a},a.prototype.elapsedSecondsSince=function(a){return.001*(this.now-a)},a.prototype.reset=function(){this._started=this.now},a}();a.MasterClock=b}(a.Time||(a.Time={}));a.Time}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d){"undefined"==typeof d&&(d=0),this._currentCount=0,this._startEvents=null,this._countEvents=null,this._stopEvents=null,this._clock=null,this._timeLastCount=null,this._isRunning=!1,this._isStopped=!0,this._isPaused=!1,this.name=null,this.delay=0,this.repeatCount=0,this._clock=b,this._startEvents=[],this._countEvents=[],this._stopEvents=[],this.name=a,this.delay=c,this.repeatCount=d}return b.prototype.objType=function(){return"Timer"},b.prototype.currentCount=function(){return this._currentCount},b.prototype.isRunning=function(){return this._isRunning},b.prototype.isStopped=function(){return this._isStopped},b.prototype.isPaused=function(){return this._isPaused},b.prototype.processEvents=function(b){if(b===a.Time.TimerEvent.TIMER_START)for(var c=0;c<this._startEvents.length;c++)this._startEvents[c].run();else if(b===a.Time.TimerEvent.TIMER_COUNT)for(var c=0;c<this._countEvents.length;c++)this._countEvents[c].run();else if(b===a.Time.TimerEvent.TIMER_STOP)for(var c=0;c<this._stopEvents.length;c++)this._stopEvents[c].run()},b.prototype.update=function(){this._isRunning&&this._clock.elapsed()-this._timeLastCount>=this.delay&&this._isPaused===!1&&(this._currentCount++,this.processEvents(a.Time.TimerEvent.TIMER_COUNT),this._timeLastCount=this._clock.elapsed()||0,-1!==this.repeatCount&&this._currentCount>=this.repeatCount&&this.stop())},b.prototype.start=function(){return this._isStopped===!0&&(this._isRunning=!0,this._isPaused=!1,this._isStopped=!1,this._currentCount=0,this._timeLastCount=this._clock.elapsed()||0,this.processEvents(a.Time.TimerEvent.TIMER_START)),this},b.prototype.stop=function(){return(this._isRunning===!0||this._isPaused===!0)&&(this._isRunning=!1,this._isPaused=!1,this._isStopped=!0,this.processEvents(a.Time.TimerEvent.TIMER_STOP)),this},b.prototype.pause=function(){return this._isRunning===!0&&(this._isRunning=!1,this._isPaused=!0),this},b.prototype.resume=function(){return this._isPaused===!0&&(this._isRunning=!0,this._isPaused=!1),this},b.prototype.addTimerEvent=function(b){return b.type===a.Time.TimerEvent.TIMER_START?this._startEvents.push(b):b.type===a.Time.TimerEvent.TIMER_COUNT?this._countEvents.push(b):b.type===a.Time.TimerEvent.TIMER_STOP&&this._stopEvents.push(b),b},b.prototype.createTimerEvent=function(b,c,d){return b===a.Time.TimerEvent.TIMER_START?(this._startEvents.push(new a.Time.TimerEvent(b,c,d)),this._startEvents[this._startEvents.length-1]):b===a.Time.TimerEvent.TIMER_COUNT?(this._countEvents.push(new a.Time.TimerEvent(b,c,d)),this._countEvents[this._countEvents.length-1]):b===a.Time.TimerEvent.TIMER_STOP?(this._stopEvents.push(new a.Time.TimerEvent(b,c,d)),this._stopEvents[this._stopEvents.length-1]):null},b.prototype.removeTimerEvent=function(b){var c=[];return b.type===a.Time.TimerEvent.TIMER_START?c=this._startEvents.splice(this._startEvents.indexOf(b),1):b.type===a.Time.TimerEvent.TIMER_COUNT?c=this._countEvents.splice(this._countEvents.indexOf(b),1):b.type===a.Time.TimerEvent.TIMER_STOP&&(c=this._stopEvents.splice(this._stopEvents.indexOf(b),1)),1===c.length?!0:!1},b.prototype.clear=function(b){"undefined"==typeof b&&(b=0),0===b?(this._startEvents.length=0,this._countEvents.length=0,this._stopEvents.length=0):b===a.Time.TimerEvent.TIMER_START?this._startEvents.length=0:b===a.Time.TimerEvent.TIMER_COUNT?this._countEvents.length=0:b===a.Time.TimerEvent.TIMER_STOP&&(this._stopEvents.length=0)},b.prototype.toString=function(){return"[{Timer (name="+this.name+" delay="+this.delay+" repeatCount="+this.repeatCount+" running="+this._isRunning+")}]"},b}();b.Timer=c}(a.Time||(a.Time={}));a.Time}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a,b,c){this._callback=null,this.type=0,this.type=a,this._callback=b,this._callbackContext=c}return a.prototype.objType=function(){return"TimerEvent"},a.prototype.run=function(){this._callback&&this._callback.apply(this._callbackContext)},a.TIMER_START=1,a.TIMER_COUNT=2,a.TIMER_STOP=3,a}();a.TimerEvent=b}(a.Time||(a.Time={}));a.Time}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d){"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!1),this.domElement=null,this.context=null,this._visible=!0,this._offScreen=!1,this._clearMode=1,this.bgColor="rgb(0, 0, 0)",this.domElement=document.createElement("canvas"),this.domElement.width=a,this.domElement.height=b,this._width=a,this._height=b,this.context=this.domElement.getContext("2d"),this._offScreen=d,this._visible=c,c===!1&&(this.domElement.style.display="none")}return Object.defineProperty(b.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a,this._updatedSize()},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"height",{get:function(){return this._height},set:function(a){this._height=a,this._updatedSize()},enumerable:!0,configurable:!0}),b.prototype.objType=function(){return"Canvas"},b.prototype._updatedSize=function(){this.domElement.width=this._width,this.domElement.height=this._height},b.prototype.destroy=function(){this._offScreen===!1&&(this.domElement.style.display="none")},Object.defineProperty(b.prototype,"visible",{get:function(){return this._visible},set:function(a){null!==a&&a!==this._visible&&(this._visible=a,this.domElement.style.display=a===!0?"block":"none")},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"clearMode",{get:function(){return this._clearMode},set:function(b){null!==b&&b!==this._clearMode&&b>=a.Utils.Canvas.CLEARMODE_NONE&&b<=a.Utils.Canvas.CLEARMODE_FILLRECT_ALPHA&&(this._clearMode=b)},enumerable:!0,configurable:!0}),b.prototype.clear=function(){this._clearMode===b.CLEARMODE_NONE||(this._clearMode===b.CLEARMODE_CLEARRECT?this.context.clearRect(0,0,this.domElement.width,this.domElement.height):this._clearMode===b.CLEARMODE_FILLRECT?(this.context.fillStyle=this.bgColor,this.context.fillRect(0,0,this.domElement.width,this.domElement.height)):this._clearMode===b.CLEARMODE_FILLRECT_ALPHA&&(this.context.clearRect(0,0,this.domElement.width,this.domElement.height),this.context.fillStyle=this.bgColor,this.context.fillRect(0,0,this.domElement.width,this.domElement.height)))},b.prototype.saveAsPNG=function(){return this.domElement.toDataURL()},b.prototype.toString=function(){return"[{Canvas (width="+this.width+" height="+this.height+" visible="+this.visible+" offScreen="+this._offScreen+" clearMode="+this.clearMode+")}]"},b.CLEARMODE_NONE=0,b.CLEARMODE_CLEARRECT=1,b.CLEARMODE_FILLRECT=2,b.CLEARMODE_FILLRECT_ALPHA=3,b}();b.Canvas=c}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(){}return b.defaultCompare=function(a,b){return b>a?-1:a===b?0:1},b.prototype.objType=function(){return"Common"},b.defaultEquals=function(a,b){return a===b},b.defaultTostring=function(b){return null===b?"KIWI_NULL":a.Utils.Common.isUndefined(b)?"KIWI_UNDEFINED":a.Utils.Common.isString(b)?b:b.toString()},b.isFunction=function(a){return"function"==typeof a},b.isNumeric=function(a){return!isNaN(a)},b.isUndefined=function(a){return"undefined"==typeof a},b.isString=function(a){return"[object String]"===Object.prototype.toString.call(a)},b.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)},b.reverseCompareFunction=function(b){return a.Utils.Common.isFunction(b)?function(a,c){return-1*b(a,c)}:function(a,b){return b>a?1:a===b?0:-1}},b.compareToEquals=function(a){return function(b,c){return 0===a(b,c)}},b.shuffleArray=function(a){for(var b=a.length-1;b>0;b--){var c=Math.floor(Math.random()*(b+1)),d=a[b];a[b]=a[c],a[c]=d}return a},b.convertToBase2=function(a){var b=a.width,c=a.height;if(-1==this.base2Sizes.indexOf(b)){for(var d=0;b>this.base2Sizes[d];)d++;b=this.base2Sizes[d]}if(-1==this.base2Sizes.indexOf(c)){for(var d=0;c>this.base2Sizes[d];)d++;c=this.base2Sizes[d]}if(a.width!==b||a.height!==c){var e=document.createElement("canvas");return e.width=b,e.height=c,e.getContext("2d").drawImage(a,0,0),e}return a},b.base2Sizes=[2,4,16,32,64,128,256,512,1024,2048,4096],b}();b.Common=c}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(){}return b.prototype.objType=function(){return"GameMath"},b.computeMachineEpsilon=function(){var a=4/3,b=a-1,c=b+b+b;return Math.abs(1-c)},b.fuzzyEqual=function(a,b,c){return"undefined"==typeof c&&(c=1e-4),Math.abs(a-b)<c},b.fuzzyLessThan=function(a,b,c){return"undefined"==typeof c&&(c=1e-4),b+c>a},b.fuzzyGreaterThan=function(a,b,c){return"undefined"==typeof c&&(c=1e-4),a>b-c},b.fuzzyCeil=function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.ceil(a-b)},b.fuzzyFloor=function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.floor(a+b)},b.average=function(){for(var a=[],b=0;b<arguments.length-0;b++)a[b]=arguments[b+0];for(var c=0,d=0;d<a.length;d++)c+=a[d];return c/a.length},b.slam=function(a,b,c){return"undefined"==typeof c&&(c=1e-4),Math.abs(a-b)<c?b:a},b.percentageMinMax=function(a,b,c){return"undefined"==typeof c&&(c=0),a-=c,b-=c,b?a/b:0},b.sign=function(a){return a?a/Math.abs(a):0},b.truncate=function(a){return a>0?Math.floor(a):Math.ceil(a)},b.shear=function(a){return a%1},b.wrap=function(a,b,c){if("undefined"==typeof c&&(c=0),a-=c,b-=c,0==b)return c;for(a%=b,a+=c;c>a;)a+=b;return a},b.arithWrap=function(a,b,c){return"undefined"==typeof c&&(c=0),b-=c,0==b?c:a-b*Math.floor((a-c)/b)},b.clamp=function(a,b,c){return"undefined"==typeof c&&(c=0),Math.max(c,Math.min(b,a))},b.snapTo=function(a,b,c){return"undefined"==typeof c&&(c=0),0==b?a:(a-=c,a=b*Math.round(a/b),c+a)},b.snapToFloor=function(a,b,c){return"undefined"==typeof c&&(c=0),0==b?a:(a-=c,a=b*Math.floor(a/b),c+a)},b.snapToCeil=function(a,b,c){return"undefined"==typeof c&&(c=0),0==b?a:(a-=c,a=b*Math.ceil(a/b),c+a)},b.snapToInArray=function(a,b,c){if("undefined"==typeof c&&(c=!0),c&&b.sort(),a<b[0])return b[0];for(var d=1;b[d]<a;)d++;var e=b[d-1],f=d<b.length?b[d]:Number.POSITIVE_INFINITY;return a-e>=f-a?f:e},b.roundTo=function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.round(a*d)/d},b.floorTo=function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.floor(a*d)/d},b.ceilTo=function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.ceil(a*d)/d},b.interpolateFloat=function(a,b,c){return(b-a)*c+a},b.radiansToDegrees=function(a){return a*b.RAD_TO_DEG},b.degreesToRadians=function(a){return a*b.DEG_TO_RAD},b.angleBetween=function(a,b,c,d){return Math.atan2(d-b,c-a)},b.normalizeAngle=function(a,c){"undefined"==typeof c&&(c=!0);var d=c?b.PI:180;return b.wrap(a,d,-d)},b.nearestAngleBetween=function(a,c,d){"undefined"==typeof d&&(d=!0);var e=d?b.PI:180;return a=b.normalizeAngle(a,d),c=b.normalizeAngle(c,d),-e/2>a&&c>e/2&&(a+=2*e),-e/2>c&&a>e/2&&(c+=2*e),c-a},b.normalizeAngleToAnother=function(b,c,d){return"undefined"==typeof d&&(d=!0),c+a.Utils.GameMath.nearestAngleBetween(c,b,d)},b.normalizeAngleAfterAnother=function(b,c,d){return"undefined"==typeof d&&(d=!0),b=a.Utils.GameMath.normalizeAngle(b-c,d),c+b},b.normalizeAngleBeforeAnother=function(b,c,d){return"undefined"==typeof d&&(d=!0),b=a.Utils.GameMath.normalizeAngle(c-b,d),c-b},b.interpolateAngles=function(b,c,d,e,f){return"undefined"==typeof e&&(e=!0),"undefined"==typeof f&&(f=null),b=a.Utils.GameMath.normalizeAngle(b,e),c=a.Utils.GameMath.normalizeAngleToAnother(c,b,e),"function"==typeof f?f(d,b,c-b,1):a.Utils.GameMath.interpolateFloat(b,c,d)},b.logBaseOf=function(a,b){return Math.log(a)/Math.log(b)},b.GCD=function(a,b){var c;for(a=Math.abs(a),b=Math.abs(b),b>a&&(c=a,a=b,b=c);;){if(c=a%b,!c)return b;a=b,b=c}return 1},b.LCM=function(b,c){return b*c/a.Utils.GameMath.GCD(b,c)},b.factorial=function(a){if(0==a)return 1;for(var b=a;--a;)b*=a;return b},b.gammaFunction=function(b){return a.Utils.GameMath.factorial(b-1)},b.fallingFactorial=function(b,c){return a.Utils.GameMath.factorial(b)/a.Utils.GameMath.factorial(b-c)},b.risingFactorial=function(b,c){return a.Utils.GameMath.factorial(b+c-1)/a.Utils.GameMath.factorial(b-1)},b.binCoef=function(b,c){return a.Utils.GameMath.fallingFactorial(b,c)/a.Utils.GameMath.factorial(c)},b.risingBinCoef=function(b,c){return a.Utils.GameMath.risingFactorial(b,c)/a.Utils.GameMath.factorial(c)},b.chanceRoll=function(a){return"undefined"==typeof a&&(a=50),0>=a?!1:a>=100?!0:100*Math.random()>=a?!1:!0},b.maxAdd=function(a,b,c){return a+=b,a>c&&(a=c),a},b.minSub=function(a,b,c){return a-=b,c>a&&(a=c),a},b.wrapValue=function(a,b,c){var d;return a=Math.abs(a),b=Math.abs(b),c=Math.abs(c),d=(a+b)%c},b.randomSign=function(){return Math.random()>.5?1:-1},b.isOdd=function(a){return 1&a?!0:!1},b.isEven=function(a){return 1&a?!1:!0},b.wrapAngle=function(a){var b=a;return a>=-180&&180>=a?a:(b=(a+180)%360,0>b&&(b+=360),b-180)},b.angleLimit=function(a,b,c){var d=a;return a>c?d=c:b>a&&(d=b),d},b.linearInterpolation=function(b,c){var d=b.length-1,e=d*c,f=Math.floor(e);return 0>c?a.Utils.GameMath.linear(b[0],b[1],e):c>1?a.Utils.GameMath.linear(b[d],b[d-1],d-e):a.Utils.GameMath.linear(b[f],b[f+1>d?d:f+1],e-f)},b.bezierInterpolation=function(b,c){for(var d=0,e=b.length-1,f=0;e>=f;f++)d+=Math.pow(1-c,e-f)*Math.pow(c,f)*b[f]*a.Utils.GameMath.bernstein(e,f);return d},b.catmullRomInterpolation=function(b,c){var d=b.length-1,e=d*c,f=Math.floor(e);return b[0]===b[d]?(0>c&&(f=Math.floor(e=d*(1+c))),a.Utils.GameMath.catmullRom(b[(f-1+d)%d],b[f],b[(f+1)%d],b[(f+2)%d],e-f)):0>c?b[0]-(a.Utils.GameMath.catmullRom(b[0],b[0],b[1],b[1],-e)-b[0]):c>1?b[d]-(a.Utils.GameMath.catmullRom(b[d],b[d],b[d-1],b[d-1],e-d)-b[d]):a.Utils.GameMath.catmullRom(b[f?f-1:0],b[f],b[f+1>d?d:f+1],b[f+2>d?d:f+2],e-f)},b.linear=function(a,b,c){return(b-a)*c+a},b.bernstein=function(b,c){return a.Utils.GameMath.factorial(b)/a.Utils.GameMath.factorial(c)/a.Utils.GameMath.factorial(b-c)},b.catmullRom=function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e,i=e*h;return(2*b-2*c+f+g)*i+(-3*b+3*c-2*f-g)*h+f*e+b},b.difference=function(a,b){return Math.abs(a-b)},b.PI=3.141592653589793,b.PI_2=1.5707963267948966,b.PI_4=.7853981633974483,b.PI_8=.39269908169872414,b.PI_16=.19634954084936207,b.TWO_PI=6.283185307179586,b.THREE_PI_2=4.71238898038469,b.E=2.71828182845905,b.LN10=2.302585092994046,b.LN2=.6931471805599453,b.LOG10E=.4342944819032518,b.LOG2E=1.4426950408889634,b.SQRT1_2=.7071067811865476,b.SQRT2=1.4142135623730951,b.DEG_TO_RAD=.017453292519943295,b.RAD_TO_DEG=57.29577951308232,b.B_16=65536,b.B_31=2147483648,b.B_32=4294967296,b.B_48=281474976710656,b.B_53=9007199254740992,b.B_64=0x10000000000000000,b.ONE_THIRD=.3333333333333333,b.TWO_THIRDS=.6666666666666666,b.ONE_SIXTH=.16666666666666666,b.COS_PI_3=.8660254037844386,b.SIN_2PI_3=.03654595,b.CIRCLE_ALPHA=.5522847498307935,b.ON=!0,b.OFF=!1,b.SHORT_EPSILON=.1,b.PERC_EPSILON=.001,b.EPSILON=1e-4,b.LONG_EPSILON=1e-8,b}();b.GameMath=c}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a){"undefined"==typeof a&&(a=[]),this.c=1,this._data={lipsum:["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit","nunc","sagittis","tortor","ac","mi","pretium","sed","convallis","massa","pulvinar","curabitur","non","turpis","velit","vitae","rutrum","odio","aliquam","sapien","orci","tempor","sed","elementum","sit","amet","tincidunt","sed","risus","etiam","nec","lacus","id","ante","hendrerit","malesuada","donec","porttitor","magna","eget","libero","pharetra","sollicitudin","aliquam","mattis","mattis","massa","et","porta","morbi","vitae","magna","augue","vestibulum","at","lectus","sed","tellus","facilisis","tincidunt","suspendisse","eros","magna","consequat","at","sollicitudin","ac","vestibulum","vel","dolor","in","egestas","lacus","quis","lacus","placerat","et","molestie","ipsum","scelerisque","nullam","sit","amet","tortor","dui","aenean","pulvinar","odio","nec","placerat","fringilla","neque","dolor"]},this.sow(a)}return a.prototype.objType=function(){return"RandomDataGenerator"},a.prototype.uint32=function(){return 4294967296*this.rnd.apply(this)},a.prototype.fract32=function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},a.prototype.rnd=function(){var a=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|a,this.s0=this.s1,this.s1=this.s2,this.s2=a-this.c,this.s2},a.prototype.hash=function(a){var b,c,d;for(d=4022871197,a=a.toString(),c=0;c<a.length;c++)d+=a.charCodeAt(c),b=.02519603282416938*d,d=b>>>0,b-=d,b*=d,d=b>>>0,b-=d,d+=4294967296*b;return 2.3283064365386963e-10*(d>>>0)},a.prototype.sow=function(a){"undefined"==typeof a&&(a=[]),this.s0=this.hash(" "),this.s1=this.hash(this.s0),this.s2=this.hash(this.s1);for(var b,c=0;b=a[c++];)this.s0-=this.hash(b),this.s0+=~~(this.s0<0),this.s1-=this.hash(b),this.s1+=~~(this.s1<0),this.s2-=this.hash(b),this.s2+=~~(this.s2<0)},a.prototype.integer=function(){return this.uint32()},a.prototype.frac=function(){return this.fract32()},a.prototype.real=function(){return this.uint32()+this.fract32()},a.prototype.integerInRange=function(a,b){return Math.floor(this.realInRange(a,b))},a.prototype.realInRange=function(a,b){return a=a||0,b=b||0,this.frac()*(b-a)+a},a.prototype.normal=function(){return 1-2*this.frac()},a.prototype.uuid=function(){var a,b;for(b=a="";a++<36;b+=~a%5|3*a&4?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},a.prototype.pick=function(a){return a[this.integerInRange(0,a.length)]},a.prototype.weightedPick=function(a){return a[~~(Math.pow(this.frac(),2)*a.length)]},a.prototype.word=function(){return this.pick(this._data.lipsum)},a.prototype.words=function(a){"undefined"==typeof a&&(a=3);for(var b=[],c=0;a>c;c++)b.push(this.pick(this._data.lipsum));return b.join(" ")},a.prototype.sentence=function(){var a;return a=this.words(this.integerInRange(2,16)).replace(/[a-z]/,function(a){return a.toUpperCase()}),a+"."},a.prototype.sentences=function(a){"undefined"==typeof a&&(a=3);for(var b=[],c=0;a>c;c++)b.push(this.sentence());return b.join(" ")},a.prototype.timestamp=function(a,b){return"undefined"==typeof a&&(a=9466848e5),"undefined"==typeof b&&(b=1577862e6),this.realInRange(a,b)},a.prototype.angle=function(){return this.integerInRange(-180,180)},a}();a.RandomDataGenerator=b}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a){this._isSetTimeOut=!1,this.lastTime=0,this.currentTime=0,this.isRunning=!1,this._callback=a;for(var b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;c++)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]}return a.prototype.objType=function(){return"RequestAnimationFrame"},a.prototype.setCallback=function(a){this._callback=a},a.prototype.isUsingSetTimeOut=function(){return this._isSetTimeOut},a.prototype.isUsingRAF=function(){return this._isSetTimeOut===!0?!1:!0},a.prototype.start=function(a){"undefined"==typeof a&&(a=null);var b=this;a&&(this._callback=a),window.requestAnimationFrame?(this._isSetTimeOut=!1,window.requestAnimationFrame(function(){return b.RAFUpdate()})):(this._isSetTimeOut=!0,this._timeOutID=window.setTimeout(function(){return b.SetTimeoutUpdate()},0)),this.isRunning=!0},a.prototype.stop=function(){this._isSetTimeOut?clearTimeout(this._timeOutID):window.cancelAnimationFrame,this.isRunning=!1},a.prototype.RAFUpdate=function(){var a=this;this.currentTime=Date.now(),this._callback&&this._callback();var b=Math.max(0,16-(this.currentTime-this.lastTime));window.requestAnimationFrame(function(){return a.RAFUpdate()}),this.lastTime=this.currentTime+b},a.prototype.SetTimeoutUpdate=function(){var a=this;this.currentTime=Date.now(),this._callback&&this._callback();var b=Math.max(0,16-(this.currentTime-this.lastTime));this._timeOutID=window.setTimeout(function(){return a.SetTimeoutUpdate()},b),this.lastTime=this.currentTime+b},a}();a.RequestAnimationFrame=b}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(){}return a.parseVersion=function(a){var b=a.split(".");return{majorVersion:parseInt(b[0]),minorVersion:parseInt(b[1]),patchVersion:parseInt(b[2])}},a.compareVersions=function(b,c){var d=a.parseVersion(b),e=a.parseVersion(c);return d.majorVersion>e.majorVersion?"greater":d.majorVersion<e.majorVersion?"less":d.minorVersion>e.minorVersion?"greater":d.minorVersion<e.minorVersion?"less":d.patchVersion>e.patchVersion?"greater":d.patchVersion<e.patchVersion?"less":"equal"},a.greaterOrEqual=function(b,c){var d=a.compareVersions(b,c);return"greater"==d||"equal"==d},a}();a.Version=b}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){a.VERSION="0.7.0",a.RENDERER_CANVAS=0,a.RENDERER_WEBGL=1,a.TARGET_BROWSER=0,a.TARGET_COCOON=1,a.DEBUG_ON=0,a.DEBUG_OFF=1,a.DEVICE=null,a.STATE=0,a.GROUP=2,a.ENTITY=3,a.CAMERA=4,a.HUD_WIDGET=5,a.TILE_LAYER=6;var b=function(){function b(){}return b.prototype.objType=function(){return"GameManager"},b.register=function(b){return a.GameManager._games.push(b)},b.total=function(){return a.GameManager._games.length},b._games=[],b}();a.GameManager=b,a.Plugins={},a.extend=function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c}}(Kiwi||(Kiwi={})),function(a){"use strict";var b={};"undefined"==typeof exports?"function"==typeof define&&"object"==typeof define.amd&&define.amd?(b.exports={},define(function(){return b.exports})):b.exports="undefined"!=typeof window?window:a:b.exports=exports,function(a){if(!b)var b=1e-6;if(!c)var c="undefined"!=typeof Float32Array?Float32Array:Array;if(!d)var d=Math.random;var e={};e.setMatrixArrayType=function(a){c=a},"undefined"!=typeof a&&(a.glMatrix=e);var f={};f.create=function(){var a=new c(2);return a[0]=0,a[1]=0,a},f.clone=function(a){var b=new c(2);return b[0]=a[0],b[1]=a[1],b},f.fromValues=function(a,b){var d=new c(2);return d[0]=a,d[1]=b,d},f.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a},f.set=function(a,b,c){return a[0]=b,a[1]=c,a},f.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a},f.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a},f.sub=f.subtract,f.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a},f.mul=f.multiply,f.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a},f.div=f.divide,f.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a},f.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a},f.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a},f.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a},f.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)},f.dist=f.distance,f.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return c*c+d*d},f.sqrDist=f.squaredDistance,f.length=function(a){var b=a[0],c=a[1];return Math.sqrt(b*b+c*c)},f.len=f.length,f.squaredLength=function(a){var b=a[0],c=a[1];return b*b+c*c},f.sqrLen=f.squaredLength,f.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a},f.normalize=function(a,b){var c=b[0],d=b[1],e=c*c+d*d;return e>0&&(e=1/Math.sqrt(e),a[0]=b[0]*e,a[1]=b[1]*e),a},f.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]},f.cross=function(a,b,c){var d=b[0]*c[1]-b[1]*c[0];return a[0]=a[1]=0,a[2]=d,a},f.lerp=function(a,b,c,d){var e=b[0],f=b[1];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a},f.random=function(a,b){b=b||1;var c=2*d()*Math.PI;return a[0]=Math.cos(c)*b,a[1]=Math.sin(c)*b,a},f.transformMat2=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[2]*e,a[1]=c[1]*d+c[3]*e,a},f.transformMat2d=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[2]*e+c[4],a[1]=c[1]*d+c[3]*e+c[5],a},f.transformMat3=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[3]*e+c[6],a[1]=c[1]*d+c[4]*e+c[7],a},f.transformMat4=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[4]*e+c[12],a[1]=c[1]*d+c[5]*e+c[13],a},f.forEach=function(){var a=f.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=2),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],f(a,a,g),b[h]=a[0],b[h+1]=a[1];return b}}(),f.str=function(a){return"vec2("+a[0]+", "+a[1]+")"},"undefined"!=typeof a&&(a.vec2=f);var g={};g.create=function(){var a=new c(3);return a[0]=0,a[1]=0,a[2]=0,a},g.clone=function(a){var b=new c(3);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b},g.fromValues=function(a,b,d){var e=new c(3);return e[0]=a,e[1]=b,e[2]=d,e},g.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a},g.set=function(a,b,c,d){return a[0]=b,a[1]=c,a[2]=d,a},g.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a[2]=b[2]+c[2],a},g.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a[2]=b[2]-c[2],a},g.sub=g.subtract,g.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a[2]=b[2]*c[2],a},g.mul=g.multiply,g.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a[2]=b[2]/c[2],a},g.div=g.divide,g.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a[2]=Math.min(b[2],c[2]),a},g.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a[2]=Math.max(b[2],c[2]),a},g.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c,a},g.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a[2]=b[2]+c[2]*d,a},g.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return Math.sqrt(c*c+d*d+e*e)},g.dist=g.distance,g.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return c*c+d*d+e*e},g.sqrDist=g.squaredDistance,g.length=function(a){var b=a[0],c=a[1],d=a[2];return Math.sqrt(b*b+c*c+d*d)},g.len=g.length,g.squaredLength=function(a){var b=a[0],c=a[1],d=a[2];return b*b+c*c+d*d},g.sqrLen=g.squaredLength,g.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a},g.normalize=function(a,b){var c=b[0],d=b[1],e=b[2],f=c*c+d*d+e*e;return f>0&&(f=1/Math.sqrt(f),a[0]=b[0]*f,a[1]=b[1]*f,a[2]=b[2]*f),a},g.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},g.cross=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2];return a[0]=e*i-f*h,a[1]=f*g-d*i,a[2]=d*h-e*g,a},g.lerp=function(a,b,c,d){var e=b[0],f=b[1],g=b[2];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a[2]=g+d*(c[2]-g),a},g.random=function(a,b){b=b||1;var c=2*d()*Math.PI,e=2*d()-1,f=Math.sqrt(1-e*e)*b;return a[0]=Math.cos(c)*f,a[1]=Math.sin(c)*f,a[2]=e*b,a},g.transformMat4=function(a,b,c){var d=b[0],e=b[1],f=b[2];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12],a[1]=c[1]*d+c[5]*e+c[9]*f+c[13],a[2]=c[2]*d+c[6]*e+c[10]*f+c[14],a},g.transformMat3=function(a,b,c){var d=b[0],e=b[1],f=b[2];return a[0]=d*c[0]+e*c[3]+f*c[6],a[1]=d*c[1]+e*c[4]+f*c[7],a[2]=d*c[2]+e*c[5]+f*c[8],a},g.transformQuat=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2],j=c[3],k=j*d+h*f-i*e,l=j*e+i*d-g*f,m=j*f+g*e-h*d,n=-g*d-h*e-i*f;return a[0]=k*j+n*-g+l*-i-m*-h,a[1]=l*j+n*-h+m*-g-k*-i,a[2]=m*j+n*-i+k*-h-l*-g,a},g.forEach=function(){var a=g.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=3),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],a[2]=b[h+2],f(a,a,g),b[h]=a[0],b[h+1]=a[1],b[h+2]=a[2];return b}}(),g.str=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"},"undefined"!=typeof a&&(a.vec3=g);var h={};h.create=function(){var a=new c(4);return a[0]=0,a[1]=0,a[2]=0,a[3]=0,a},h.clone=function(a){var b=new c(4);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},h.fromValues=function(a,b,d,e){var f=new c(4);return f[0]=a,f[1]=b,f[2]=d,f[3]=e,f},h.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a},h.set=function(a,b,c,d,e){return a[0]=b,a[1]=c,a[2]=d,a[3]=e,a},h.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a[2]=b[2]+c[2],a[3]=b[3]+c[3],a},h.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a[2]=b[2]-c[2],a[3]=b[3]-c[3],a},h.sub=h.subtract,h.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a[2]=b[2]*c[2],a[3]=b[3]*c[3],a},h.mul=h.multiply,h.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a[2]=b[2]/c[2],a[3]=b[3]/c[3],a},h.div=h.divide,h.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a[2]=Math.min(b[2],c[2]),a[3]=Math.min(b[3],c[3]),a},h.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a[2]=Math.max(b[2],c[2]),a[3]=Math.max(b[3],c[3]),a},h.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c,a[3]=b[3]*c,a},h.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a[2]=b[2]+c[2]*d,a[3]=b[3]+c[3]*d,a},h.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2],f=b[3]-a[3];return Math.sqrt(c*c+d*d+e*e+f*f)},h.dist=h.distance,h.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2],f=b[3]-a[3];return c*c+d*d+e*e+f*f},h.sqrDist=h.squaredDistance,h.length=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return Math.sqrt(b*b+c*c+d*d+e*e)},h.len=h.length,h.squaredLength=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return b*b+c*c+d*d+e*e},h.sqrLen=h.squaredLength,h.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a[3]=-b[3],a},h.normalize=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*c+d*d+e*e+f*f;return g>0&&(g=1/Math.sqrt(g),a[0]=b[0]*g,a[1]=b[1]*g,a[2]=b[2]*g,a[3]=b[3]*g),a},h.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},h.lerp=function(a,b,c,d){var e=b[0],f=b[1],g=b[2],h=b[3];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a[2]=g+d*(c[2]-g),a[3]=h+d*(c[3]-h),a},h.random=function(a,b){return b=b||1,a[0]=d(),a[1]=d(),a[2]=d(),a[3]=d(),h.normalize(a,a),h.scale(a,a,b),a},h.transformMat4=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12]*g,a[1]=c[1]*d+c[5]*e+c[9]*f+c[13]*g,a[2]=c[2]*d+c[6]*e+c[10]*f+c[14]*g,a[3]=c[3]*d+c[7]*e+c[11]*f+c[15]*g,a},h.transformQuat=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2],j=c[3],k=j*d+h*f-i*e,l=j*e+i*d-g*f,m=j*f+g*e-h*d,n=-g*d-h*e-i*f;return a[0]=k*j+n*-g+l*-i-m*-h,a[1]=l*j+n*-h+m*-g-k*-i,a[2]=m*j+n*-i+k*-h-l*-g,a},h.forEach=function(){var a=h.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=4),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],a[2]=b[h+2],a[3]=b[h+3],f(a,a,g),b[h]=a[0],b[h+1]=a[1],b[h+2]=a[2],b[h+3]=a[3];return b}}(),h.str=function(a){return"vec4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},"undefined"!=typeof a&&(a.vec4=h);var i={};i.create=function(){var a=new c(4);return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a},i.clone=function(a){var b=new c(4);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},i.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a},i.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a},i.transpose=function(a,b){if(a===b){var c=b[1];a[1]=b[2],a[2]=c}else a[0]=b[0],a[1]=b[2],a[2]=b[1],a[3]=b[3];
+},b.prototype.getClock=function(a){for(var b=0;b<this._clocks.length;b++)if(this._clocks[b].name===a)return this._clocks[b]},b.prototype.update=function(){this.master.update(),this.clock.update();for(var a=0;a<this._clocks.length;a++)this._clocks[a].update()},b.prototype.now=function(){return this.master.now},b.prototype.delta=function(){return this.master.delta},b}();b.ClockManager=c}(a.Time||(a.Time={}));a.Time}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(){this.time=0,this.now=0,this.delta=0,this._started=Date.now(),this.time=this._started}return a.prototype.objType=function(){return"MasterClock"},a.prototype.elapsed=function(){return this.now-this._started},a.prototype.totalElapsedSeconds=function(){return.001*(this.now-this._started)},a.prototype.update=function(){this.now=Date.now(),this.delta=this.now-this.time,this.time=this.now,this.delta>.1&&(this.delta=.1)},a.prototype.elapsedSince=function(a){return this.now-a},a.prototype.elapsedSecondsSince=function(a){return.001*(this.now-a)},a.prototype.reset=function(){this._started=this.now},a}();a.MasterClock=b}(a.Time||(a.Time={}));a.Time}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d){"undefined"==typeof d&&(d=0),this._currentCount=0,this._startEvents=null,this._countEvents=null,this._stopEvents=null,this._clock=null,this._timeLastCount=null,this._isRunning=!1,this._isStopped=!0,this._isPaused=!1,this.name=null,this.delay=0,this.repeatCount=0,this._clock=b,this._startEvents=[],this._countEvents=[],this._stopEvents=[],this.name=a,this.delay=c,this.repeatCount=d}return b.prototype.objType=function(){return"Timer"},b.prototype.currentCount=function(){return this._currentCount},b.prototype.isRunning=function(){return this._isRunning},b.prototype.isStopped=function(){return this._isStopped},b.prototype.isPaused=function(){return this._isPaused},b.prototype.processEvents=function(b){if(b===a.Time.TimerEvent.TIMER_START)for(var c=0;c<this._startEvents.length;c++)this._startEvents[c].run();else if(b===a.Time.TimerEvent.TIMER_COUNT)for(var c=0;c<this._countEvents.length;c++)this._countEvents[c].run();else if(b===a.Time.TimerEvent.TIMER_STOP)for(var c=0;c<this._stopEvents.length;c++)this._stopEvents[c].run()},b.prototype.update=function(){this._isRunning&&this._clock.elapsed()-this._timeLastCount>=this.delay&&this._isPaused===!1&&(this._currentCount++,this.processEvents(a.Time.TimerEvent.TIMER_COUNT),this._timeLastCount=this._clock.elapsed()||0,-1!==this.repeatCount&&this._currentCount>=this.repeatCount&&this.stop())},b.prototype.start=function(){return this._isStopped===!0&&(this._isRunning=!0,this._isPaused=!1,this._isStopped=!1,this._currentCount=0,this._timeLastCount=this._clock.elapsed()||0,this.processEvents(a.Time.TimerEvent.TIMER_START)),this},b.prototype.stop=function(){return(this._isRunning===!0||this._isPaused===!0)&&(this._isRunning=!1,this._isPaused=!1,this._isStopped=!0,this.processEvents(a.Time.TimerEvent.TIMER_STOP)),this},b.prototype.pause=function(){return this._isRunning===!0&&(this._isRunning=!1,this._isPaused=!0),this},b.prototype.resume=function(){return this._isPaused===!0&&(this._isRunning=!0,this._isPaused=!1),this},b.prototype.addTimerEvent=function(b){return b.type===a.Time.TimerEvent.TIMER_START?this._startEvents.push(b):b.type===a.Time.TimerEvent.TIMER_COUNT?this._countEvents.push(b):b.type===a.Time.TimerEvent.TIMER_STOP&&this._stopEvents.push(b),b},b.prototype.createTimerEvent=function(b,c,d){return b===a.Time.TimerEvent.TIMER_START?(this._startEvents.push(new a.Time.TimerEvent(b,c,d)),this._startEvents[this._startEvents.length-1]):b===a.Time.TimerEvent.TIMER_COUNT?(this._countEvents.push(new a.Time.TimerEvent(b,c,d)),this._countEvents[this._countEvents.length-1]):b===a.Time.TimerEvent.TIMER_STOP?(this._stopEvents.push(new a.Time.TimerEvent(b,c,d)),this._stopEvents[this._stopEvents.length-1]):null},b.prototype.removeTimerEvent=function(b){var c=[];return b.type===a.Time.TimerEvent.TIMER_START?c=this._startEvents.splice(this._startEvents.indexOf(b),1):b.type===a.Time.TimerEvent.TIMER_COUNT?c=this._countEvents.splice(this._countEvents.indexOf(b),1):b.type===a.Time.TimerEvent.TIMER_STOP&&(c=this._stopEvents.splice(this._stopEvents.indexOf(b),1)),1===c.length?!0:!1},b.prototype.clear=function(b){"undefined"==typeof b&&(b=0),0===b?(this._startEvents.length=0,this._countEvents.length=0,this._stopEvents.length=0):b===a.Time.TimerEvent.TIMER_START?this._startEvents.length=0:b===a.Time.TimerEvent.TIMER_COUNT?this._countEvents.length=0:b===a.Time.TimerEvent.TIMER_STOP&&(this._stopEvents.length=0)},b.prototype.toString=function(){return"[{Timer (name="+this.name+" delay="+this.delay+" repeatCount="+this.repeatCount+" running="+this._isRunning+")}]"},b}();b.Timer=c}(a.Time||(a.Time={}));a.Time}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a,b,c){this._callback=null,this.type=0,this.type=a,this._callback=b,this._callbackContext=c}return a.prototype.objType=function(){return"TimerEvent"},a.prototype.run=function(){this._callback&&this._callback.apply(this._callbackContext)},a.TIMER_START=1,a.TIMER_COUNT=2,a.TIMER_STOP=3,a}();a.TimerEvent=b}(a.Time||(a.Time={}));a.Time}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(a,b,c,d){"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!1),this.domElement=null,this.context=null,this._visible=!0,this._offScreen=!1,this._clearMode=1,this.bgColor="rgb(0, 0, 0)",this.domElement=document.createElement("canvas"),this.domElement.width=a,this.domElement.height=b,this._width=a,this._height=b,this.context=this.domElement.getContext("2d"),this._offScreen=d,this._visible=c,c===!1&&(this.domElement.style.display="none")}return Object.defineProperty(b.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a,this._updatedSize()},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"height",{get:function(){return this._height},set:function(a){this._height=a,this._updatedSize()},enumerable:!0,configurable:!0}),b.prototype.objType=function(){return"Canvas"},b.prototype._updatedSize=function(){this.domElement.width=this._width,this.domElement.height=this._height},b.prototype.destroy=function(){this._offScreen===!1&&(this.domElement.style.display="none")},Object.defineProperty(b.prototype,"visible",{get:function(){return this._visible},set:function(a){null!==a&&a!==this._visible&&(this._visible=a,this.domElement.style.display=a===!0?"block":"none")},enumerable:!0,configurable:!0}),Object.defineProperty(b.prototype,"clearMode",{get:function(){return this._clearMode},set:function(b){null!==b&&b!==this._clearMode&&b>=a.Utils.Canvas.CLEARMODE_NONE&&b<=a.Utils.Canvas.CLEARMODE_FILLRECT_ALPHA&&(this._clearMode=b)},enumerable:!0,configurable:!0}),b.prototype.clear=function(){this._clearMode===b.CLEARMODE_NONE||(this._clearMode===b.CLEARMODE_CLEARRECT?this.context.clearRect(0,0,this.domElement.width,this.domElement.height):this._clearMode===b.CLEARMODE_FILLRECT?(this.context.fillStyle=this.bgColor,this.context.fillRect(0,0,this.domElement.width,this.domElement.height)):this._clearMode===b.CLEARMODE_FILLRECT_ALPHA&&(this.context.clearRect(0,0,this.domElement.width,this.domElement.height),this.context.fillStyle=this.bgColor,this.context.fillRect(0,0,this.domElement.width,this.domElement.height)))},b.prototype.saveAsPNG=function(){return this.domElement.toDataURL()},b.prototype.toString=function(){return"[{Canvas (width="+this.width+" height="+this.height+" visible="+this.visible+" offScreen="+this._offScreen+" clearMode="+this.clearMode+")}]"},b.CLEARMODE_NONE=0,b.CLEARMODE_CLEARRECT=1,b.CLEARMODE_FILLRECT=2,b.CLEARMODE_FILLRECT_ALPHA=3,b}();b.Canvas=c}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(){}return b.defaultCompare=function(a,b){return b>a?-1:a===b?0:1},b.prototype.objType=function(){return"Common"},b.defaultEquals=function(a,b){return a===b},b.defaultTostring=function(b){return null===b?"KIWI_NULL":a.Utils.Common.isUndefined(b)?"KIWI_UNDEFINED":a.Utils.Common.isString(b)?b:b.toString()},b.isFunction=function(a){return"function"==typeof a},b.isNumeric=function(a){return!isNaN(a)},b.isUndefined=function(a){return"undefined"==typeof a},b.isString=function(a){return"[object String]"===Object.prototype.toString.call(a)},b.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)},b.reverseCompareFunction=function(b){return a.Utils.Common.isFunction(b)?function(a,c){return-1*b(a,c)}:function(a,b){return b>a?1:a===b?0:-1}},b.compareToEquals=function(a){return function(b,c){return 0===a(b,c)}},b.shuffleArray=function(a){for(var b=a.length-1;b>0;b--){var c=Math.floor(Math.random()*(b+1)),d=a[b];a[b]=a[c],a[c]=d}return a},b.convertToBase2=function(a){var b=a.width,c=a.height;if(-1==this.base2Sizes.indexOf(b)){for(var d=0;b>this.base2Sizes[d];)d++;b=this.base2Sizes[d]}if(-1==this.base2Sizes.indexOf(c)){for(var d=0;c>this.base2Sizes[d];)d++;c=this.base2Sizes[d]}if(a.width!==b||a.height!==c){var e=document.createElement("canvas");return e.width=b,e.height=c,e.getContext("2d").drawImage(a,0,0),e}return a},b.base2Sizes=[2,4,16,32,64,128,256,512,1024,2048,4096],b}();b.Common=c}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(b){var c=function(){function b(){}return b.prototype.objType=function(){return"GameMath"},b.computeMachineEpsilon=function(){var a=4/3,b=a-1,c=b+b+b;return Math.abs(1-c)},b.fuzzyEqual=function(a,b,c){return"undefined"==typeof c&&(c=1e-4),Math.abs(a-b)<c},b.fuzzyLessThan=function(a,b,c){return"undefined"==typeof c&&(c=1e-4),b+c>a},b.fuzzyGreaterThan=function(a,b,c){return"undefined"==typeof c&&(c=1e-4),a>b-c},b.fuzzyCeil=function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.ceil(a-b)},b.fuzzyFloor=function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.floor(a+b)},b.average=function(){for(var a=[],b=0;b<arguments.length-0;b++)a[b]=arguments[b+0];for(var c=0,d=0;d<a.length;d++)c+=a[d];return c/a.length},b.slam=function(a,b,c){return"undefined"==typeof c&&(c=1e-4),Math.abs(a-b)<c?b:a},b.percentageMinMax=function(a,b,c){return"undefined"==typeof c&&(c=0),a-=c,b-=c,b?a/b:0},b.sign=function(a){return a?a/Math.abs(a):0},b.truncate=function(a){return a>0?Math.floor(a):Math.ceil(a)},b.shear=function(a){return a%1},b.wrap=function(a,b,c){if("undefined"==typeof c&&(c=0),a-=c,b-=c,0==b)return c;for(a%=b,a+=c;c>a;)a+=b;return a},b.arithWrap=function(a,b,c){return"undefined"==typeof c&&(c=0),b-=c,0==b?c:a-b*Math.floor((a-c)/b)},b.clamp=function(a,b,c){return"undefined"==typeof c&&(c=0),Math.max(c,Math.min(b,a))},b.snapTo=function(a,b,c){return"undefined"==typeof c&&(c=0),0==b?a:(a-=c,a=b*Math.round(a/b),c+a)},b.snapToFloor=function(a,b,c){return"undefined"==typeof c&&(c=0),0==b?a:(a-=c,a=b*Math.floor(a/b),c+a)},b.snapToCeil=function(a,b,c){return"undefined"==typeof c&&(c=0),0==b?a:(a-=c,a=b*Math.ceil(a/b),c+a)},b.snapToInArray=function(a,b,c){if("undefined"==typeof c&&(c=!0),c&&b.sort(),a<b[0])return b[0];for(var d=1;b[d]<a;)d++;var e=b[d-1],f=d<b.length?b[d]:Number.POSITIVE_INFINITY;return a-e>=f-a?f:e},b.roundTo=function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.round(a*d)/d},b.floorTo=function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.floor(a*d)/d},b.ceilTo=function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.ceil(a*d)/d},b.interpolateFloat=function(a,b,c){return(b-a)*c+a},b.radiansToDegrees=function(a){return a*b.RAD_TO_DEG},b.degreesToRadians=function(a){return a*b.DEG_TO_RAD},b.angleBetween=function(a,b,c,d){return Math.atan2(d-b,c-a)},b.normalizeAngle=function(a,c){"undefined"==typeof c&&(c=!0);var d=c?b.PI:180;return b.wrap(a,d,-d)},b.nearestAngleBetween=function(a,c,d){"undefined"==typeof d&&(d=!0);var e=d?b.PI:180;return a=b.normalizeAngle(a,d),c=b.normalizeAngle(c,d),-e/2>a&&c>e/2&&(a+=2*e),-e/2>c&&a>e/2&&(c+=2*e),c-a},b.normalizeAngleToAnother=function(b,c,d){return"undefined"==typeof d&&(d=!0),c+a.Utils.GameMath.nearestAngleBetween(c,b,d)},b.normalizeAngleAfterAnother=function(b,c,d){return"undefined"==typeof d&&(d=!0),b=a.Utils.GameMath.normalizeAngle(b-c,d),c+b},b.normalizeAngleBeforeAnother=function(b,c,d){return"undefined"==typeof d&&(d=!0),b=a.Utils.GameMath.normalizeAngle(c-b,d),c-b},b.interpolateAngles=function(b,c,d,e,f){return"undefined"==typeof e&&(e=!0),"undefined"==typeof f&&(f=null),b=a.Utils.GameMath.normalizeAngle(b,e),c=a.Utils.GameMath.normalizeAngleToAnother(c,b,e),"function"==typeof f?f(d,b,c-b,1):a.Utils.GameMath.interpolateFloat(b,c,d)},b.logBaseOf=function(a,b){return Math.log(a)/Math.log(b)},b.GCD=function(a,b){var c;for(a=Math.abs(a),b=Math.abs(b),b>a&&(c=a,a=b,b=c);;){if(c=a%b,!c)return b;a=b,b=c}return 1},b.LCM=function(b,c){return b*c/a.Utils.GameMath.GCD(b,c)},b.factorial=function(a){if(0==a)return 1;for(var b=a;--a;)b*=a;return b},b.gammaFunction=function(b){return a.Utils.GameMath.factorial(b-1)},b.fallingFactorial=function(b,c){return a.Utils.GameMath.factorial(b)/a.Utils.GameMath.factorial(b-c)},b.risingFactorial=function(b,c){return a.Utils.GameMath.factorial(b+c-1)/a.Utils.GameMath.factorial(b-1)},b.binCoef=function(b,c){return a.Utils.GameMath.fallingFactorial(b,c)/a.Utils.GameMath.factorial(c)},b.risingBinCoef=function(b,c){return a.Utils.GameMath.risingFactorial(b,c)/a.Utils.GameMath.factorial(c)},b.chanceRoll=function(a){return"undefined"==typeof a&&(a=50),0>=a?!1:a>=100?!0:100*Math.random()>=a?!1:!0},b.maxAdd=function(a,b,c){return a+=b,a>c&&(a=c),a},b.minSub=function(a,b,c){return a-=b,c>a&&(a=c),a},b.wrapValue=function(a,b,c){var d;return a=Math.abs(a),b=Math.abs(b),c=Math.abs(c),d=(a+b)%c},b.randomSign=function(){return Math.random()>.5?1:-1},b.isOdd=function(a){return 1&a?!0:!1},b.isEven=function(a){return 1&a?!1:!0},b.wrapAngle=function(a){var b=a;return a>=-180&&180>=a?a:(b=(a+180)%360,0>b&&(b+=360),b-180)},b.angleLimit=function(a,b,c){var d=a;return a>c?d=c:b>a&&(d=b),d},b.linearInterpolation=function(b,c){var d=b.length-1,e=d*c,f=Math.floor(e);return 0>c?a.Utils.GameMath.linear(b[0],b[1],e):c>1?a.Utils.GameMath.linear(b[d],b[d-1],d-e):a.Utils.GameMath.linear(b[f],b[f+1>d?d:f+1],e-f)},b.bezierInterpolation=function(b,c){for(var d=0,e=b.length-1,f=0;e>=f;f++)d+=Math.pow(1-c,e-f)*Math.pow(c,f)*b[f]*a.Utils.GameMath.bernstein(e,f);return d},b.catmullRomInterpolation=function(b,c){var d=b.length-1,e=d*c,f=Math.floor(e);return b[0]===b[d]?(0>c&&(f=Math.floor(e=d*(1+c))),a.Utils.GameMath.catmullRom(b[(f-1+d)%d],b[f],b[(f+1)%d],b[(f+2)%d],e-f)):0>c?b[0]-(a.Utils.GameMath.catmullRom(b[0],b[0],b[1],b[1],-e)-b[0]):c>1?b[d]-(a.Utils.GameMath.catmullRom(b[d],b[d],b[d-1],b[d-1],e-d)-b[d]):a.Utils.GameMath.catmullRom(b[f?f-1:0],b[f],b[f+1>d?d:f+1],b[f+2>d?d:f+2],e-f)},b.linear=function(a,b,c){return(b-a)*c+a},b.bernstein=function(b,c){return a.Utils.GameMath.factorial(b)/a.Utils.GameMath.factorial(c)/a.Utils.GameMath.factorial(b-c)},b.catmullRom=function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e,i=e*h;return(2*b-2*c+f+g)*i+(-3*b+3*c-2*f-g)*h+f*e+b},b.difference=function(a,b){return Math.abs(a-b)},b.PI=3.141592653589793,b.PI_2=1.5707963267948966,b.PI_4=.7853981633974483,b.PI_8=.39269908169872414,b.PI_16=.19634954084936207,b.TWO_PI=6.283185307179586,b.THREE_PI_2=4.71238898038469,b.E=2.71828182845905,b.LN10=2.302585092994046,b.LN2=.6931471805599453,b.LOG10E=.4342944819032518,b.LOG2E=1.4426950408889634,b.SQRT1_2=.7071067811865476,b.SQRT2=1.4142135623730951,b.DEG_TO_RAD=.017453292519943295,b.RAD_TO_DEG=57.29577951308232,b.B_16=65536,b.B_31=2147483648,b.B_32=4294967296,b.B_48=281474976710656,b.B_53=9007199254740992,b.B_64=0x10000000000000000,b.ONE_THIRD=.3333333333333333,b.TWO_THIRDS=.6666666666666666,b.ONE_SIXTH=.16666666666666666,b.COS_PI_3=.8660254037844386,b.SIN_2PI_3=.03654595,b.CIRCLE_ALPHA=.5522847498307935,b.ON=!0,b.OFF=!1,b.SHORT_EPSILON=.1,b.PERC_EPSILON=.001,b.EPSILON=1e-4,b.LONG_EPSILON=1e-8,b}();b.GameMath=c}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a){"undefined"==typeof a&&(a=[]),this.c=1,this._data={lipsum:["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit","nunc","sagittis","tortor","ac","mi","pretium","sed","convallis","massa","pulvinar","curabitur","non","turpis","velit","vitae","rutrum","odio","aliquam","sapien","orci","tempor","sed","elementum","sit","amet","tincidunt","sed","risus","etiam","nec","lacus","id","ante","hendrerit","malesuada","donec","porttitor","magna","eget","libero","pharetra","sollicitudin","aliquam","mattis","mattis","massa","et","porta","morbi","vitae","magna","augue","vestibulum","at","lectus","sed","tellus","facilisis","tincidunt","suspendisse","eros","magna","consequat","at","sollicitudin","ac","vestibulum","vel","dolor","in","egestas","lacus","quis","lacus","placerat","et","molestie","ipsum","scelerisque","nullam","sit","amet","tortor","dui","aenean","pulvinar","odio","nec","placerat","fringilla","neque","dolor"]},this.sow(a)}return a.prototype.objType=function(){return"RandomDataGenerator"},a.prototype.uint32=function(){return 4294967296*this.rnd.apply(this)},a.prototype.fract32=function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},a.prototype.rnd=function(){var a=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|a,this.s0=this.s1,this.s1=this.s2,this.s2=a-this.c,this.s2},a.prototype.hash=function(a){var b,c,d;for(d=4022871197,a=a.toString(),c=0;c<a.length;c++)d+=a.charCodeAt(c),b=.02519603282416938*d,d=b>>>0,b-=d,b*=d,d=b>>>0,b-=d,d+=4294967296*b;return 2.3283064365386963e-10*(d>>>0)},a.prototype.sow=function(a){"undefined"==typeof a&&(a=[]),this.s0=this.hash(" "),this.s1=this.hash(this.s0),this.s2=this.hash(this.s1);for(var b,c=0;b=a[c++];)this.s0-=this.hash(b),this.s0+=~~(this.s0<0),this.s1-=this.hash(b),this.s1+=~~(this.s1<0),this.s2-=this.hash(b),this.s2+=~~(this.s2<0)},a.prototype.integer=function(){return this.uint32()},a.prototype.frac=function(){return this.fract32()},a.prototype.real=function(){return this.uint32()+this.fract32()},a.prototype.integerInRange=function(a,b){return Math.floor(this.realInRange(a,b))},a.prototype.realInRange=function(a,b){return a=a||0,b=b||0,this.frac()*(b-a)+a},a.prototype.normal=function(){return 1-2*this.frac()},a.prototype.uuid=function(){var a,b;for(b=a="";a++<36;b+=~a%5|3*a&4?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},a.prototype.pick=function(a){return a[this.integerInRange(0,a.length)]},a.prototype.weightedPick=function(a){return a[~~(Math.pow(this.frac(),2)*a.length)]},a.prototype.word=function(){return this.pick(this._data.lipsum)},a.prototype.words=function(a){"undefined"==typeof a&&(a=3);for(var b=[],c=0;a>c;c++)b.push(this.pick(this._data.lipsum));return b.join(" ")},a.prototype.sentence=function(){var a;return a=this.words(this.integerInRange(2,16)).replace(/[a-z]/,function(a){return a.toUpperCase()}),a+"."},a.prototype.sentences=function(a){"undefined"==typeof a&&(a=3);for(var b=[],c=0;a>c;c++)b.push(this.sentence());return b.join(" ")},a.prototype.timestamp=function(a,b){return"undefined"==typeof a&&(a=9466848e5),"undefined"==typeof b&&(b=1577862e6),this.realInRange(a,b)},a.prototype.angle=function(){return this.integerInRange(-180,180)},a}();a.RandomDataGenerator=b}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(a){this._isSetTimeOut=!1,this.lastTime=0,this.currentTime=0,this.isRunning=!1,this._callback=a;for(var b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;c++)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]}return a.prototype.objType=function(){return"RequestAnimationFrame"},a.prototype.setCallback=function(a){this._callback=a},a.prototype.isUsingSetTimeOut=function(){return this._isSetTimeOut},a.prototype.isUsingRAF=function(){return this._isSetTimeOut===!0?!1:!0},a.prototype.start=function(a){"undefined"==typeof a&&(a=null);var b=this;a&&(this._callback=a),window.requestAnimationFrame?(this._isSetTimeOut=!1,window.requestAnimationFrame(function(){return b.RAFUpdate()})):(this._isSetTimeOut=!0,this._timeOutID=window.setTimeout(function(){return b.SetTimeoutUpdate()},0)),this.isRunning=!0},a.prototype.stop=function(){this._isSetTimeOut?clearTimeout(this._timeOutID):window.cancelAnimationFrame,this.isRunning=!1},a.prototype.RAFUpdate=function(){var a=this;this.currentTime=Date.now(),this._callback&&this._callback();var b=Math.max(0,16-(this.currentTime-this.lastTime));window.requestAnimationFrame(function(){return a.RAFUpdate()}),this.lastTime=this.currentTime+b},a.prototype.SetTimeoutUpdate=function(){var a=this;this.currentTime=Date.now(),this._callback&&this._callback();var b=Math.max(0,16-(this.currentTime-this.lastTime));this._timeOutID=window.setTimeout(function(){return a.SetTimeoutUpdate()},b),this.lastTime=this.currentTime+b},a}();a.RequestAnimationFrame=b}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){!function(a){var b=function(){function a(){}return a.parseVersion=function(a){var b=a.split(".");return{majorVersion:parseInt(b[0]),minorVersion:parseInt(b[1]),patchVersion:parseInt(b[2])}},a.compareVersions=function(b,c){var d=a.parseVersion(b),e=a.parseVersion(c);return d.majorVersion>e.majorVersion?"greater":d.majorVersion<e.majorVersion?"less":d.minorVersion>e.minorVersion?"greater":d.minorVersion<e.minorVersion?"less":d.patchVersion>e.patchVersion?"greater":d.patchVersion<e.patchVersion?"less":"equal"},a.greaterOrEqual=function(b,c){var d=a.compareVersions(b,c);return"greater"==d||"equal"==d},a}();a.Version=b}(a.Utils||(a.Utils={}));a.Utils}(Kiwi||(Kiwi={}));var Kiwi;!function(a){a.VERSION="1.0.0",a.RENDERER_CANVAS=0,a.RENDERER_WEBGL=1,a.TARGET_BROWSER=0,a.TARGET_COCOON=1,a.DEBUG_ON=0,a.DEBUG_OFF=1,a.DEVICE=null,a.STATE=0,a.GROUP=2,a.ENTITY=3,a.CAMERA=4,a.HUD_WIDGET=5,a.TILE_LAYER=6;var b=function(){function b(){}return b.prototype.objType=function(){return"GameManager"},b.register=function(b){return a.GameManager._games.push(b)},b.total=function(){return a.GameManager._games.length},b._games=[],b}();a.GameManager=b,a.Plugins={},a.extend=function(a,b){function c(){this.constructor=a}for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);c.prototype=b.prototype,a.prototype=new c}}(Kiwi||(Kiwi={})),function(a){"use strict";var b={};"undefined"==typeof exports?"function"==typeof define&&"object"==typeof define.amd&&define.amd?(b.exports={},define(function(){return b.exports})):b.exports="undefined"!=typeof window?window:a:b.exports=exports,function(a){if(!b)var b=1e-6;if(!c)var c="undefined"!=typeof Float32Array?Float32Array:Array;if(!d)var d=Math.random;var e={};e.setMatrixArrayType=function(a){c=a},"undefined"!=typeof a&&(a.glMatrix=e);var f={};f.create=function(){var a=new c(2);return a[0]=0,a[1]=0,a},f.clone=function(a){var b=new c(2);return b[0]=a[0],b[1]=a[1],b},f.fromValues=function(a,b){var d=new c(2);return d[0]=a,d[1]=b,d},f.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a},f.set=function(a,b,c){return a[0]=b,a[1]=c,a},f.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a},f.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a},f.sub=f.subtract,f.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a},f.mul=f.multiply,f.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a},f.div=f.divide,f.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a},f.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a},f.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a},f.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a},f.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)},f.dist=f.distance,f.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return c*c+d*d},f.sqrDist=f.squaredDistance,f.length=function(a){var b=a[0],c=a[1];return Math.sqrt(b*b+c*c)},f.len=f.length,f.squaredLength=function(a){var b=a[0],c=a[1];return b*b+c*c},f.sqrLen=f.squaredLength,f.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a},f.normalize=function(a,b){var c=b[0],d=b[1],e=c*c+d*d;return e>0&&(e=1/Math.sqrt(e),a[0]=b[0]*e,a[1]=b[1]*e),a},f.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]},f.cross=function(a,b,c){var d=b[0]*c[1]-b[1]*c[0];return a[0]=a[1]=0,a[2]=d,a},f.lerp=function(a,b,c,d){var e=b[0],f=b[1];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a},f.random=function(a,b){b=b||1;var c=2*d()*Math.PI;return a[0]=Math.cos(c)*b,a[1]=Math.sin(c)*b,a},f.transformMat2=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[2]*e,a[1]=c[1]*d+c[3]*e,a},f.transformMat2d=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[2]*e+c[4],a[1]=c[1]*d+c[3]*e+c[5],a},f.transformMat3=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[3]*e+c[6],a[1]=c[1]*d+c[4]*e+c[7],a},f.transformMat4=function(a,b,c){var d=b[0],e=b[1];return a[0]=c[0]*d+c[4]*e+c[12],a[1]=c[1]*d+c[5]*e+c[13],a},f.forEach=function(){var a=f.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=2),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],f(a,a,g),b[h]=a[0],b[h+1]=a[1];return b}}(),f.str=function(a){return"vec2("+a[0]+", "+a[1]+")"},"undefined"!=typeof a&&(a.vec2=f);var g={};g.create=function(){var a=new c(3);return a[0]=0,a[1]=0,a[2]=0,a},g.clone=function(a){var b=new c(3);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b},g.fromValues=function(a,b,d){var e=new c(3);return e[0]=a,e[1]=b,e[2]=d,e},g.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a},g.set=function(a,b,c,d){return a[0]=b,a[1]=c,a[2]=d,a},g.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a[2]=b[2]+c[2],a},g.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a[2]=b[2]-c[2],a},g.sub=g.subtract,g.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a[2]=b[2]*c[2],a},g.mul=g.multiply,g.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a[2]=b[2]/c[2],a},g.div=g.divide,g.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a[2]=Math.min(b[2],c[2]),a},g.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a[2]=Math.max(b[2],c[2]),a},g.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c,a},g.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a[2]=b[2]+c[2]*d,a},g.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return Math.sqrt(c*c+d*d+e*e)},g.dist=g.distance,g.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2];return c*c+d*d+e*e},g.sqrDist=g.squaredDistance,g.length=function(a){var b=a[0],c=a[1],d=a[2];return Math.sqrt(b*b+c*c+d*d)},g.len=g.length,g.squaredLength=function(a){var b=a[0],c=a[1],d=a[2];return b*b+c*c+d*d},g.sqrLen=g.squaredLength,g.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a},g.normalize=function(a,b){var c=b[0],d=b[1],e=b[2],f=c*c+d*d+e*e;return f>0&&(f=1/Math.sqrt(f),a[0]=b[0]*f,a[1]=b[1]*f,a[2]=b[2]*f),a},g.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]},g.cross=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2];return a[0]=e*i-f*h,a[1]=f*g-d*i,a[2]=d*h-e*g,a},g.lerp=function(a,b,c,d){var e=b[0],f=b[1],g=b[2];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a[2]=g+d*(c[2]-g),a},g.random=function(a,b){b=b||1;var c=2*d()*Math.PI,e=2*d()-1,f=Math.sqrt(1-e*e)*b;return a[0]=Math.cos(c)*f,a[1]=Math.sin(c)*f,a[2]=e*b,a},g.transformMat4=function(a,b,c){var d=b[0],e=b[1],f=b[2];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12],a[1]=c[1]*d+c[5]*e+c[9]*f+c[13],a[2]=c[2]*d+c[6]*e+c[10]*f+c[14],a},g.transformMat3=function(a,b,c){var d=b[0],e=b[1],f=b[2];return a[0]=d*c[0]+e*c[3]+f*c[6],a[1]=d*c[1]+e*c[4]+f*c[7],a[2]=d*c[2]+e*c[5]+f*c[8],a},g.transformQuat=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2],j=c[3],k=j*d+h*f-i*e,l=j*e+i*d-g*f,m=j*f+g*e-h*d,n=-g*d-h*e-i*f;return a[0]=k*j+n*-g+l*-i-m*-h,a[1]=l*j+n*-h+m*-g-k*-i,a[2]=m*j+n*-i+k*-h-l*-g,a},g.forEach=function(){var a=g.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=3),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],a[2]=b[h+2],f(a,a,g),b[h]=a[0],b[h+1]=a[1],b[h+2]=a[2];return b}}(),g.str=function(a){return"vec3("+a[0]+", "+a[1]+", "+a[2]+")"},"undefined"!=typeof a&&(a.vec3=g);var h={};h.create=function(){var a=new c(4);return a[0]=0,a[1]=0,a[2]=0,a[3]=0,a},h.clone=function(a){var b=new c(4);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},h.fromValues=function(a,b,d,e){var f=new c(4);return f[0]=a,f[1]=b,f[2]=d,f[3]=e,f},h.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a},h.set=function(a,b,c,d,e){return a[0]=b,a[1]=c,a[2]=d,a[3]=e,a},h.add=function(a,b,c){return a[0]=b[0]+c[0],a[1]=b[1]+c[1],a[2]=b[2]+c[2],a[3]=b[3]+c[3],a},h.subtract=function(a,b,c){return a[0]=b[0]-c[0],a[1]=b[1]-c[1],a[2]=b[2]-c[2],a[3]=b[3]-c[3],a},h.sub=h.subtract,h.multiply=function(a,b,c){return a[0]=b[0]*c[0],a[1]=b[1]*c[1],a[2]=b[2]*c[2],a[3]=b[3]*c[3],a},h.mul=h.multiply,h.divide=function(a,b,c){return a[0]=b[0]/c[0],a[1]=b[1]/c[1],a[2]=b[2]/c[2],a[3]=b[3]/c[3],a},h.div=h.divide,h.min=function(a,b,c){return a[0]=Math.min(b[0],c[0]),a[1]=Math.min(b[1],c[1]),a[2]=Math.min(b[2],c[2]),a[3]=Math.min(b[3],c[3]),a},h.max=function(a,b,c){return a[0]=Math.max(b[0],c[0]),a[1]=Math.max(b[1],c[1]),a[2]=Math.max(b[2],c[2]),a[3]=Math.max(b[3],c[3]),a},h.scale=function(a,b,c){return a[0]=b[0]*c,a[1]=b[1]*c,a[2]=b[2]*c,a[3]=b[3]*c,a},h.scaleAndAdd=function(a,b,c,d){return a[0]=b[0]+c[0]*d,a[1]=b[1]+c[1]*d,a[2]=b[2]+c[2]*d,a[3]=b[3]+c[3]*d,a},h.distance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2],f=b[3]-a[3];return Math.sqrt(c*c+d*d+e*e+f*f)},h.dist=h.distance,h.squaredDistance=function(a,b){var c=b[0]-a[0],d=b[1]-a[1],e=b[2]-a[2],f=b[3]-a[3];return c*c+d*d+e*e+f*f},h.sqrDist=h.squaredDistance,h.length=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return Math.sqrt(b*b+c*c+d*d+e*e)},h.len=h.length,h.squaredLength=function(a){var b=a[0],c=a[1],d=a[2],e=a[3];return b*b+c*c+d*d+e*e},h.sqrLen=h.squaredLength,h.negate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a[3]=-b[3],a},h.normalize=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*c+d*d+e*e+f*f;return g>0&&(g=1/Math.sqrt(g),a[0]=b[0]*g,a[1]=b[1]*g,a[2]=b[2]*g,a[3]=b[3]*g),a},h.dot=function(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]},h.lerp=function(a,b,c,d){var e=b[0],f=b[1],g=b[2],h=b[3];return a[0]=e+d*(c[0]-e),a[1]=f+d*(c[1]-f),a[2]=g+d*(c[2]-g),a[3]=h+d*(c[3]-h),a},h.random=function(a,b){return b=b||1,a[0]=d(),a[1]=d(),a[2]=d(),a[3]=d(),h.normalize(a,a),h.scale(a,a,b),a},h.transformMat4=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3];return a[0]=c[0]*d+c[4]*e+c[8]*f+c[12]*g,a[1]=c[1]*d+c[5]*e+c[9]*f+c[13]*g,a[2]=c[2]*d+c[6]*e+c[10]*f+c[14]*g,a[3]=c[3]*d+c[7]*e+c[11]*f+c[15]*g,a},h.transformQuat=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=c[0],h=c[1],i=c[2],j=c[3],k=j*d+h*f-i*e,l=j*e+i*d-g*f,m=j*f+g*e-h*d,n=-g*d-h*e-i*f;return a[0]=k*j+n*-g+l*-i-m*-h,a[1]=l*j+n*-h+m*-g-k*-i,a[2]=m*j+n*-i+k*-h-l*-g,a},h.forEach=function(){var a=h.create();return function(b,c,d,e,f,g){var h,i;for(c||(c=4),d||(d=0),i=e?Math.min(e*c+d,b.length):b.length,h=d;i>h;h+=c)a[0]=b[h],a[1]=b[h+1],a[2]=b[h+2],a[3]=b[h+3],f(a,a,g),b[h]=a[0],b[h+1]=a[1],b[h+2]=a[2],b[h+3]=a[3];return b}}(),h.str=function(a){return"vec4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},"undefined"!=typeof a&&(a.vec4=h);var i={};i.create=function(){var a=new c(4);return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a},i.clone=function(a){var b=new c(4);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b},i.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a},i.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a},i.transpose=function(a,b){if(a===b){var c=b[1];a[1]=b[2],a[2]=c}else a[0]=b[0],a[1]=b[2],a[2]=b[1],a[3]=b[3];
 return a},i.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*f-e*d;return g?(g=1/g,a[0]=f*g,a[1]=-d*g,a[2]=-e*g,a[3]=c*g,a):null},i.adjoint=function(a,b){var c=b[0];return a[0]=b[3],a[1]=-b[1],a[2]=-b[2],a[3]=c,a},i.determinant=function(a){return a[0]*a[3]-a[2]*a[1]},i.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=c[0],i=c[1],j=c[2],k=c[3];return a[0]=d*h+e*j,a[1]=d*i+e*k,a[2]=f*h+g*j,a[3]=f*i+g*k,a},i.mul=i.multiply,i.rotate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i+e*h,a[1]=d*-h+e*i,a[2]=f*i+g*h,a[3]=f*-h+g*i,a},i.scale=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=c[0],i=c[1];return a[0]=d*h,a[1]=e*i,a[2]=f*h,a[3]=g*i,a},i.str=function(a){return"mat2("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},"undefined"!=typeof a&&(a.mat2=i);var j={};j.create=function(){var a=new c(6);return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=0,a[5]=0,a},j.clone=function(a){var b=new c(6);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b},j.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[4]=b[4],a[5]=b[5],a},j.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=1,a[4]=0,a[5]=0,a},j.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=c*f-d*e;return i?(i=1/i,a[0]=f*i,a[1]=-d*i,a[2]=-e*i,a[3]=c*i,a[4]=(e*h-f*g)*i,a[5]=(d*g-c*h)*i,a):null},j.determinant=function(a){return a[0]*a[3]-a[1]*a[2]},j.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=c[0],k=c[1],l=c[2],m=c[3],n=c[4],o=c[5];return a[0]=d*j+e*l,a[1]=d*k+e*m,a[2]=f*j+g*l,a[3]=f*k+g*m,a[4]=j*h+l*i+n,a[5]=k*h+m*i+o,a},j.mul=j.multiply,j.rotate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=Math.sin(c),k=Math.cos(c);return a[0]=d*k+e*j,a[1]=-d*j+e*k,a[2]=f*k+g*j,a[3]=-f*j+k*g,a[4]=k*h+j*i,a[5]=k*i-j*h,a},j.scale=function(a,b,c){var d=c[0],e=c[1];return a[0]=b[0]*d,a[1]=b[1]*e,a[2]=b[2]*d,a[3]=b[3]*e,a[4]=b[4]*d,a[5]=b[5]*e,a},j.translate=function(a,b,c){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[4]=b[4]+c[0],a[5]=b[5]+c[1],a},j.str=function(a){return"mat2d("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"},"undefined"!=typeof a&&(a.mat2d=j);var k={};k.create=function(){var a=new c(9);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},k.fromMat4=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[4],a[4]=b[5],a[5]=b[6],a[6]=b[8],a[7]=b[9],a[8]=b[10],a},k.clone=function(a){var b=new c(9);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b},k.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[4]=b[4],a[5]=b[5],a[6]=b[6],a[7]=b[7],a[8]=b[8],a},k.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},k.transpose=function(a,b){if(a===b){var c=b[1],d=b[2],e=b[5];a[1]=b[3],a[2]=b[6],a[3]=c,a[5]=b[7],a[6]=d,a[7]=e}else a[0]=b[0],a[1]=b[3],a[2]=b[6],a[3]=b[1],a[4]=b[4],a[5]=b[7],a[6]=b[2],a[7]=b[5],a[8]=b[8];return a},k.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=k*g-h*j,m=-k*f+h*i,n=j*f-g*i,o=c*l+d*m+e*n;return o?(o=1/o,a[0]=l*o,a[1]=(-k*d+e*j)*o,a[2]=(h*d-e*g)*o,a[3]=m*o,a[4]=(k*c-e*i)*o,a[5]=(-h*c+e*f)*o,a[6]=n*o,a[7]=(-j*c+d*i)*o,a[8]=(g*c-d*f)*o,a):null},k.adjoint=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8];return a[0]=g*k-h*j,a[1]=e*j-d*k,a[2]=d*h-e*g,a[3]=h*i-f*k,a[4]=c*k-e*i,a[5]=e*f-c*h,a[6]=f*j-g*i,a[7]=d*i-c*j,a[8]=c*g-d*f,a},k.determinant=function(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8];return b*(j*f-g*i)+c*(-j*e+g*h)+d*(i*e-f*h)},k.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=c[0],n=c[1],o=c[2],p=c[3],q=c[4],r=c[5],s=c[6],t=c[7],u=c[8];return a[0]=m*d+n*g+o*j,a[1]=m*e+n*h+o*k,a[2]=m*f+n*i+o*l,a[3]=p*d+q*g+r*j,a[4]=p*e+q*h+r*k,a[5]=p*f+q*i+r*l,a[6]=s*d+t*g+u*j,a[7]=s*e+t*h+u*k,a[8]=s*f+t*i+u*l,a},k.mul=k.multiply,k.translate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=c[0],n=c[1];return a[0]=d,a[1]=e,a[2]=f,a[3]=g,a[4]=h,a[5]=i,a[6]=m*d+n*g+j,a[7]=m*e+n*h+k,a[8]=m*f+n*i+l,a},k.rotate=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=Math.sin(c),n=Math.cos(c);return a[0]=n*d+m*g,a[1]=n*e+m*h,a[2]=n*f+m*i,a[3]=n*g-m*d,a[4]=n*h-m*e,a[5]=n*i-m*f,a[6]=j,a[7]=k,a[8]=l,a},k.scale=function(a,b,c){var d=c[0],e=c[1];return a[0]=d*b[0],a[1]=d*b[1],a[2]=d*b[2],a[3]=e*b[3],a[4]=e*b[4],a[5]=e*b[5],a[6]=b[6],a[7]=b[7],a[8]=b[8],a},k.fromMat2d=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=0,a[3]=b[2],a[4]=b[3],a[5]=0,a[6]=b[4],a[7]=b[5],a[8]=1,a},k.fromQuat=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c+c,h=d+d,i=e+e,j=c*g,k=c*h,l=c*i,m=d*h,n=d*i,o=e*i,p=f*g,q=f*h,r=f*i;return a[0]=1-(m+o),a[3]=k+r,a[6]=l-q,a[1]=k-r,a[4]=1-(j+o),a[7]=n+p,a[2]=l+q,a[5]=n-p,a[8]=1-(j+m),a},k.normalFromMat4=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=b[9],m=b[10],n=b[11],o=b[12],p=b[13],q=b[14],r=b[15],s=c*h-d*g,t=c*i-e*g,u=c*j-f*g,v=d*i-e*h,w=d*j-f*h,x=e*j-f*i,y=k*p-l*o,z=k*q-m*o,A=k*r-n*o,B=l*q-m*p,C=l*r-n*p,D=m*r-n*q,E=s*D-t*C+u*B+v*A-w*z+x*y;return E?(E=1/E,a[0]=(h*D-i*C+j*B)*E,a[1]=(i*A-g*D-j*z)*E,a[2]=(g*C-h*A+j*y)*E,a[3]=(e*C-d*D-f*B)*E,a[4]=(c*D-e*A+f*z)*E,a[5]=(d*A-c*C-f*y)*E,a[6]=(p*x-q*w+r*v)*E,a[7]=(q*u-o*x-r*t)*E,a[8]=(o*w-p*u+r*s)*E,a):null},k.str=function(a){return"mat3("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+")"},"undefined"!=typeof a&&(a.mat3=k);var l={};l.create=function(){var a=new c(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},l.clone=function(a){var b=new c(16);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b[9]=a[9],b[10]=a[10],b[11]=a[11],b[12]=a[12],b[13]=a[13],b[14]=a[14],b[15]=a[15],b},l.copy=function(a,b){return a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[4]=b[4],a[5]=b[5],a[6]=b[6],a[7]=b[7],a[8]=b[8],a[9]=b[9],a[10]=b[10],a[11]=b[11],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15],a},l.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},l.transpose=function(a,b){if(a===b){var c=b[1],d=b[2],e=b[3],f=b[6],g=b[7],h=b[11];a[1]=b[4],a[2]=b[8],a[3]=b[12],a[4]=c,a[6]=b[9],a[7]=b[13],a[8]=d,a[9]=f,a[11]=b[14],a[12]=e,a[13]=g,a[14]=h}else a[0]=b[0],a[1]=b[4],a[2]=b[8],a[3]=b[12],a[4]=b[1],a[5]=b[5],a[6]=b[9],a[7]=b[13],a[8]=b[2],a[9]=b[6],a[10]=b[10],a[11]=b[14],a[12]=b[3],a[13]=b[7],a[14]=b[11],a[15]=b[15];return a},l.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=b[9],m=b[10],n=b[11],o=b[12],p=b[13],q=b[14],r=b[15],s=c*h-d*g,t=c*i-e*g,u=c*j-f*g,v=d*i-e*h,w=d*j-f*h,x=e*j-f*i,y=k*p-l*o,z=k*q-m*o,A=k*r-n*o,B=l*q-m*p,C=l*r-n*p,D=m*r-n*q,E=s*D-t*C+u*B+v*A-w*z+x*y;return E?(E=1/E,a[0]=(h*D-i*C+j*B)*E,a[1]=(e*C-d*D-f*B)*E,a[2]=(p*x-q*w+r*v)*E,a[3]=(m*w-l*x-n*v)*E,a[4]=(i*A-g*D-j*z)*E,a[5]=(c*D-e*A+f*z)*E,a[6]=(q*u-o*x-r*t)*E,a[7]=(k*x-m*u+n*t)*E,a[8]=(g*C-h*A+j*y)*E,a[9]=(d*A-c*C-f*y)*E,a[10]=(o*w-p*u+r*s)*E,a[11]=(l*u-k*w-n*s)*E,a[12]=(h*z-g*B-i*y)*E,a[13]=(c*B-d*z+e*y)*E,a[14]=(p*t-o*v-q*s)*E,a[15]=(k*v-l*t+m*s)*E,a):null},l.adjoint=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=b[4],h=b[5],i=b[6],j=b[7],k=b[8],l=b[9],m=b[10],n=b[11],o=b[12],p=b[13],q=b[14],r=b[15];return a[0]=h*(m*r-n*q)-l*(i*r-j*q)+p*(i*n-j*m),a[1]=-(d*(m*r-n*q)-l*(e*r-f*q)+p*(e*n-f*m)),a[2]=d*(i*r-j*q)-h*(e*r-f*q)+p*(e*j-f*i),a[3]=-(d*(i*n-j*m)-h*(e*n-f*m)+l*(e*j-f*i)),a[4]=-(g*(m*r-n*q)-k*(i*r-j*q)+o*(i*n-j*m)),a[5]=c*(m*r-n*q)-k*(e*r-f*q)+o*(e*n-f*m),a[6]=-(c*(i*r-j*q)-g*(e*r-f*q)+o*(e*j-f*i)),a[7]=c*(i*n-j*m)-g*(e*n-f*m)+k*(e*j-f*i),a[8]=g*(l*r-n*p)-k*(h*r-j*p)+o*(h*n-j*l),a[9]=-(c*(l*r-n*p)-k*(d*r-f*p)+o*(d*n-f*l)),a[10]=c*(h*r-j*p)-g*(d*r-f*p)+o*(d*j-f*h),a[11]=-(c*(h*n-j*l)-g*(d*n-f*l)+k*(d*j-f*h)),a[12]=-(g*(l*q-m*p)-k*(h*q-i*p)+o*(h*m-i*l)),a[13]=c*(l*q-m*p)-k*(d*q-e*p)+o*(d*m-e*l),a[14]=-(c*(h*q-i*p)-g*(d*q-e*p)+o*(d*i-e*h)),a[15]=c*(h*m-i*l)-g*(d*m-e*l)+k*(d*i-e*h),a},l.determinant=function(a){var b=a[0],c=a[1],d=a[2],e=a[3],f=a[4],g=a[5],h=a[6],i=a[7],j=a[8],k=a[9],l=a[10],m=a[11],n=a[12],o=a[13],p=a[14],q=a[15],r=b*g-c*f,s=b*h-d*f,t=b*i-e*f,u=c*h-d*g,v=c*i-e*g,w=d*i-e*h,x=j*o-k*n,y=j*p-l*n,z=j*q-m*n,A=k*p-l*o,B=k*q-m*o,C=l*q-m*p;return r*C-s*B+t*A+u*z-v*y+w*x},l.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=b[9],n=b[10],o=b[11],p=b[12],q=b[13],r=b[14],s=b[15],t=c[0],u=c[1],v=c[2],w=c[3];return a[0]=t*d+u*h+v*l+w*p,a[1]=t*e+u*i+v*m+w*q,a[2]=t*f+u*j+v*n+w*r,a[3]=t*g+u*k+v*o+w*s,t=c[4],u=c[5],v=c[6],w=c[7],a[4]=t*d+u*h+v*l+w*p,a[5]=t*e+u*i+v*m+w*q,a[6]=t*f+u*j+v*n+w*r,a[7]=t*g+u*k+v*o+w*s,t=c[8],u=c[9],v=c[10],w=c[11],a[8]=t*d+u*h+v*l+w*p,a[9]=t*e+u*i+v*m+w*q,a[10]=t*f+u*j+v*n+w*r,a[11]=t*g+u*k+v*o+w*s,t=c[12],u=c[13],v=c[14],w=c[15],a[12]=t*d+u*h+v*l+w*p,a[13]=t*e+u*i+v*m+w*q,a[14]=t*f+u*j+v*n+w*r,a[15]=t*g+u*k+v*o+w*s,a},l.mul=l.multiply,l.translate=function(a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p=c[0],q=c[1],r=c[2];return b===a?(a[12]=b[0]*p+b[4]*q+b[8]*r+b[12],a[13]=b[1]*p+b[5]*q+b[9]*r+b[13],a[14]=b[2]*p+b[6]*q+b[10]*r+b[14],a[15]=b[3]*p+b[7]*q+b[11]*r+b[15]):(d=b[0],e=b[1],f=b[2],g=b[3],h=b[4],i=b[5],j=b[6],k=b[7],l=b[8],m=b[9],n=b[10],o=b[11],a[0]=d,a[1]=e,a[2]=f,a[3]=g,a[4]=h,a[5]=i,a[6]=j,a[7]=k,a[8]=l,a[9]=m,a[10]=n,a[11]=o,a[12]=d*p+h*q+l*r+b[12],a[13]=e*p+i*q+m*r+b[13],a[14]=f*p+j*q+n*r+b[14],a[15]=g*p+k*q+o*r+b[15]),a},l.scale=function(a,b,c){var d=c[0],e=c[1],f=c[2];return a[0]=b[0]*d,a[1]=b[1]*d,a[2]=b[2]*d,a[3]=b[3]*d,a[4]=b[4]*e,a[5]=b[5]*e,a[6]=b[6]*e,a[7]=b[7]*e,a[8]=b[8]*f,a[9]=b[9]*f,a[10]=b[10]*f,a[11]=b[11]*f,a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15],a},l.rotate=function(a,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D=e[0],E=e[1],F=e[2],G=Math.sqrt(D*D+E*E+F*F);return Math.abs(G)<b?null:(G=1/G,D*=G,E*=G,F*=G,f=Math.sin(d),g=Math.cos(d),h=1-g,i=c[0],j=c[1],k=c[2],l=c[3],m=c[4],n=c[5],o=c[6],p=c[7],q=c[8],r=c[9],s=c[10],t=c[11],u=D*D*h+g,v=E*D*h+F*f,w=F*D*h-E*f,x=D*E*h-F*f,y=E*E*h+g,z=F*E*h+D*f,A=D*F*h+E*f,B=E*F*h-D*f,C=F*F*h+g,a[0]=i*u+m*v+q*w,a[1]=j*u+n*v+r*w,a[2]=k*u+o*v+s*w,a[3]=l*u+p*v+t*w,a[4]=i*x+m*y+q*z,a[5]=j*x+n*y+r*z,a[6]=k*x+o*y+s*z,a[7]=l*x+p*y+t*z,a[8]=i*A+m*B+q*C,a[9]=j*A+n*B+r*C,a[10]=k*A+o*B+s*C,a[11]=l*A+p*B+t*C,c!==a&&(a[12]=c[12],a[13]=c[13],a[14]=c[14],a[15]=c[15]),a)},l.rotateX=function(a,b,c){var d=Math.sin(c),e=Math.cos(c),f=b[4],g=b[5],h=b[6],i=b[7],j=b[8],k=b[9],l=b[10],m=b[11];return b!==a&&(a[0]=b[0],a[1]=b[1],a[2]=b[2],a[3]=b[3],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a[4]=f*e+j*d,a[5]=g*e+k*d,a[6]=h*e+l*d,a[7]=i*e+m*d,a[8]=j*e-f*d,a[9]=k*e-g*d,a[10]=l*e-h*d,a[11]=m*e-i*d,a},l.rotateY=function(a,b,c){var d=Math.sin(c),e=Math.cos(c),f=b[0],g=b[1],h=b[2],i=b[3],j=b[8],k=b[9],l=b[10],m=b[11];return b!==a&&(a[4]=b[4],a[5]=b[5],a[6]=b[6],a[7]=b[7],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a[0]=f*e-j*d,a[1]=g*e-k*d,a[2]=h*e-l*d,a[3]=i*e-m*d,a[8]=f*d+j*e,a[9]=g*d+k*e,a[10]=h*d+l*e,a[11]=i*d+m*e,a},l.rotateZ=function(a,b,c){var d=Math.sin(c),e=Math.cos(c),f=b[0],g=b[1],h=b[2],i=b[3],j=b[4],k=b[5],l=b[6],m=b[7];return b!==a&&(a[8]=b[8],a[9]=b[9],a[10]=b[10],a[11]=b[11],a[12]=b[12],a[13]=b[13],a[14]=b[14],a[15]=b[15]),a[0]=f*e+j*d,a[1]=g*e+k*d,a[2]=h*e+l*d,a[3]=i*e+m*d,a[4]=j*e-f*d,a[5]=k*e-g*d,a[6]=l*e-h*d,a[7]=m*e-i*d,a},l.fromRotationTranslation=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=d+d,i=e+e,j=f+f,k=d*h,l=d*i,m=d*j,n=e*i,o=e*j,p=f*j,q=g*h,r=g*i,s=g*j;return a[0]=1-(n+p),a[1]=l+s,a[2]=m-r,a[3]=0,a[4]=l-s,a[5]=1-(k+p),a[6]=o+q,a[7]=0,a[8]=m+r,a[9]=o-q,a[10]=1-(k+n),a[11]=0,a[12]=c[0],a[13]=c[1],a[14]=c[2],a[15]=1,a},l.fromQuat=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c+c,h=d+d,i=e+e,j=c*g,k=c*h,l=c*i,m=d*h,n=d*i,o=e*i,p=f*g,q=f*h,r=f*i;return a[0]=1-(m+o),a[1]=k+r,a[2]=l-q,a[3]=0,a[4]=k-r,a[5]=1-(j+o),a[6]=n+p,a[7]=0,a[8]=l+q,a[9]=n-p,a[10]=1-(j+m),a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},l.frustum=function(a,b,c,d,e,f,g){var h=1/(c-b),i=1/(e-d),j=1/(f-g);return a[0]=2*f*h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=2*f*i,a[6]=0,a[7]=0,a[8]=(c+b)*h,a[9]=(e+d)*i,a[10]=(g+f)*j,a[11]=-1,a[12]=0,a[13]=0,a[14]=g*f*2*j,a[15]=0,a},l.perspective=function(a,b,c,d,e){var f=1/Math.tan(b/2),g=1/(d-e);return a[0]=f/c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=f,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=(e+d)*g,a[11]=-1,a[12]=0,a[13]=0,a[14]=2*e*d*g,a[15]=0,a},l.ortho=function(a,b,c,d,e,f,g){var h=1/(b-c),i=1/(d-e),j=1/(f-g);return a[0]=-2*h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=-2*i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=2*j,a[11]=0,a[12]=(b+c)*h,a[13]=(e+d)*i,a[14]=(g+f)*j,a[15]=1,a},l.lookAt=function(a,c,d,e){var f,g,h,i,j,k,m,n,o,p,q=c[0],r=c[1],s=c[2],t=e[0],u=e[1],v=e[2],w=d[0],x=d[1],y=d[2];return Math.abs(q-w)<b&&Math.abs(r-x)<b&&Math.abs(s-y)<b?l.identity(a):(m=q-w,n=r-x,o=s-y,p=1/Math.sqrt(m*m+n*n+o*o),m*=p,n*=p,o*=p,f=u*o-v*n,g=v*m-t*o,h=t*n-u*m,p=Math.sqrt(f*f+g*g+h*h),p?(p=1/p,f*=p,g*=p,h*=p):(f=0,g=0,h=0),i=n*h-o*g,j=o*f-m*h,k=m*g-n*f,p=Math.sqrt(i*i+j*j+k*k),p?(p=1/p,i*=p,j*=p,k*=p):(i=0,j=0,k=0),a[0]=f,a[1]=i,a[2]=m,a[3]=0,a[4]=g,a[5]=j,a[6]=n,a[7]=0,a[8]=h,a[9]=k,a[10]=o,a[11]=0,a[12]=-(f*q+g*r+h*s),a[13]=-(i*q+j*r+k*s),a[14]=-(m*q+n*r+o*s),a[15]=1,a)},l.str=function(a){return"mat4("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+", "+a[6]+", "+a[7]+", "+a[8]+", "+a[9]+", "+a[10]+", "+a[11]+", "+a[12]+", "+a[13]+", "+a[14]+", "+a[15]+")"},"undefined"!=typeof a&&(a.mat4=l);var m={};m.create=function(){var a=new c(4);return a[0]=0,a[1]=0,a[2]=0,a[3]=1,a},m.rotationTo=function(){var a=g.create(),b=g.fromValues(1,0,0),c=g.fromValues(0,1,0);return function(d,e,f){var h=g.dot(e,f);return-.999999>h?(g.cross(a,b,e),g.length(a)<1e-6&&g.cross(a,c,e),g.normalize(a,a),m.setAxisAngle(d,a,Math.PI),d):h>.999999?(d[0]=0,d[1]=0,d[2]=0,d[3]=1,d):(g.cross(a,e,f),d[0]=a[0],d[1]=a[1],d[2]=a[2],d[3]=1+h,m.normalize(d,d))}}(),m.setAxes=function(){var a=k.create();return function(b,c,d,e){return a[0]=d[0],a[3]=d[1],a[6]=d[2],a[1]=e[0],a[4]=e[1],a[7]=e[2],a[2]=c[0],a[5]=c[1],a[8]=c[2],m.normalize(b,m.fromMat3(b,a))}}(),m.clone=h.clone,m.fromValues=h.fromValues,m.copy=h.copy,m.set=h.set,m.identity=function(a){return a[0]=0,a[1]=0,a[2]=0,a[3]=1,a},m.setAxisAngle=function(a,b,c){c*=.5;var d=Math.sin(c);return a[0]=d*b[0],a[1]=d*b[1],a[2]=d*b[2],a[3]=Math.cos(c),a},m.add=h.add,m.multiply=function(a,b,c){var d=b[0],e=b[1],f=b[2],g=b[3],h=c[0],i=c[1],j=c[2],k=c[3];return a[0]=d*k+g*h+e*j-f*i,a[1]=e*k+g*i+f*h-d*j,a[2]=f*k+g*j+d*i-e*h,a[3]=g*k-d*h-e*i-f*j,a},m.mul=m.multiply,m.scale=h.scale,m.rotateX=function(a,b,c){c*=.5;var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i+g*h,a[1]=e*i+f*h,a[2]=f*i-e*h,a[3]=g*i-d*h,a},m.rotateY=function(a,b,c){c*=.5;var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i-f*h,a[1]=e*i+g*h,a[2]=f*i+d*h,a[3]=g*i-e*h,a},m.rotateZ=function(a,b,c){c*=.5;var d=b[0],e=b[1],f=b[2],g=b[3],h=Math.sin(c),i=Math.cos(c);return a[0]=d*i+e*h,a[1]=e*i-d*h,a[2]=f*i+g*h,a[3]=g*i-f*h,a},m.calculateW=function(a,b){var c=b[0],d=b[1],e=b[2];return a[0]=c,a[1]=d,a[2]=e,a[3]=-Math.sqrt(Math.abs(1-c*c-d*d-e*e)),a},m.dot=h.dot,m.lerp=h.lerp,m.slerp=function(a,b,c,d){var e,f,g,h,i,j=b[0],k=b[1],l=b[2],m=b[3],n=c[0],o=c[1],p=c[2],q=c[3];return f=j*n+k*o+l*p+m*q,0>f&&(f=-f,n=-n,o=-o,p=-p,q=-q),1-f>1e-6?(e=Math.acos(f),g=Math.sin(e),h=Math.sin((1-d)*e)/g,i=Math.sin(d*e)/g):(h=1-d,i=d),a[0]=h*j+i*n,a[1]=h*k+i*o,a[2]=h*l+i*p,a[3]=h*m+i*q,a},m.invert=function(a,b){var c=b[0],d=b[1],e=b[2],f=b[3],g=c*c+d*d+e*e+f*f,h=g?1/g:0;return a[0]=-c*h,a[1]=-d*h,a[2]=-e*h,a[3]=f*h,a},m.conjugate=function(a,b){return a[0]=-b[0],a[1]=-b[1],a[2]=-b[2],a[3]=b[3],a},m.length=h.length,m.len=m.length,m.squaredLength=h.squaredLength,m.sqrLen=m.squaredLength,m.normalize=h.normalize,m.fromMat3=function(){var a="undefined"!=typeof Int8Array?new Int8Array([1,2,0]):[1,2,0];return function(b,c){var d,e=c[0]+c[4]+c[8];if(e>0)d=Math.sqrt(e+1),b[3]=.5*d,d=.5/d,b[0]=(c[7]-c[5])*d,b[1]=(c[2]-c[6])*d,b[2]=(c[3]-c[1])*d;else{var f=0;c[4]>c[0]&&(f=1),c[8]>c[3*f+f]&&(f=2);var g=a[f],h=a[g];d=Math.sqrt(c[3*f+f]-c[3*g+g]-c[3*h+h]+1),b[f]=.5*d,d=.5/d,b[3]=(c[3*h+g]-c[3*g+h])*d,b[g]=(c[3*g+f]+c[3*f+g])*d,b[h]=(c[3*h+f]+c[3*f+h])*d}return b}}(),m.str=function(a){return"quat("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+")"},"undefined"!=typeof a&&(a.quat=m)}(b.exports)}(this);
\ No newline at end of file
diff --git a/docs/classes/Kiwi.Animations.Animation.html b/docs/classes/Kiwi.Animations.Animation.html
index 0b11ab7..91ce482 100644
--- a/docs/classes/Kiwi.Animations.Animation.html
+++ b/docs/classes/Kiwi.Animations.Animation.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Sequence.html b/docs/classes/Kiwi.Animations.Sequence.html
index c28adee..116565f 100644
--- a/docs/classes/Kiwi.Animations.Sequence.html
+++ b/docs/classes/Kiwi.Animations.Sequence.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tween.html b/docs/classes/Kiwi.Animations.Tween.html
index e4380ab..a159778 100644
--- a/docs/classes/Kiwi.Animations.Tween.html
+++ b/docs/classes/Kiwi.Animations.Tween.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Back.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Back.html
index e3351a3..d53cf62 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Back.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Back.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Bounce.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Bounce.html
index 6bcb5c8..ed669ef 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Bounce.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Bounce.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Circular.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Circular.html
index f299ab4..1c10618 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Circular.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Circular.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Cubic.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Cubic.html
index c07894d..e179ec0 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Cubic.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Cubic.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Elastic.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Elastic.html
index 787c919..d94df97 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Elastic.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Elastic.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Exponential.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Exponential.html
index da3833f..c149a83 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Exponential.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Exponential.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Linear.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Linear.html
index d878cb1..617ebbc 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Linear.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Linear.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Quadratic.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Quadratic.html
index bac54d1..85aefa7 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Quadratic.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Quadratic.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Quartic.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Quartic.html
index 4495b36..b762ce1 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Quartic.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Quartic.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Quintic.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Quintic.html
index 0bc2263..abf02ca 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Quintic.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Quintic.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.Easing.Sinusoidal.html b/docs/classes/Kiwi.Animations.Tweens.Easing.Sinusoidal.html
index 8df66c6..cd0c1f3 100644
--- a/docs/classes/Kiwi.Animations.Tweens.Easing.Sinusoidal.html
+++ b/docs/classes/Kiwi.Animations.Tweens.Easing.Sinusoidal.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Animations.Tweens.TweenManager.html b/docs/classes/Kiwi.Animations.Tweens.TweenManager.html
index 5ed5ade..232873b 100644
--- a/docs/classes/Kiwi.Animations.Tweens.TweenManager.html
+++ b/docs/classes/Kiwi.Animations.Tweens.TweenManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Camera.html b/docs/classes/Kiwi.Camera.html
index 7c1d2e2..bc0ef55 100644
--- a/docs/classes/Kiwi.Camera.html
+++ b/docs/classes/Kiwi.Camera.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.CameraManager.html b/docs/classes/Kiwi.CameraManager.html
index e21a445..d343540 100644
--- a/docs/classes/Kiwi.CameraManager.html
+++ b/docs/classes/Kiwi.CameraManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Component.html b/docs/classes/Kiwi.Component.html
index 68d4e58..cb2ce65 100644
--- a/docs/classes/Kiwi.Component.html
+++ b/docs/classes/Kiwi.Component.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.ComponentManager.html b/docs/classes/Kiwi.ComponentManager.html
index 752c1d8..1691a3b 100644
--- a/docs/classes/Kiwi.ComponentManager.html
+++ b/docs/classes/Kiwi.ComponentManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Components.AnimationManager.html b/docs/classes/Kiwi.Components.AnimationManager.html
index 4a4f443..86128e6 100644
--- a/docs/classes/Kiwi.Components.AnimationManager.html
+++ b/docs/classes/Kiwi.Components.AnimationManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Components.ArcadePhysics.html b/docs/classes/Kiwi.Components.ArcadePhysics.html
index 709ebe9..9fbb56a 100644
--- a/docs/classes/Kiwi.Components.ArcadePhysics.html
+++ b/docs/classes/Kiwi.Components.ArcadePhysics.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Components.Box.html b/docs/classes/Kiwi.Components.Box.html
index 50fdb88..a314227 100644
--- a/docs/classes/Kiwi.Components.Box.html
+++ b/docs/classes/Kiwi.Components.Box.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Components.Input.html b/docs/classes/Kiwi.Components.Input.html
index 894e047..368c2a3 100644
--- a/docs/classes/Kiwi.Components.Input.html
+++ b/docs/classes/Kiwi.Components.Input.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Components.Sound.html b/docs/classes/Kiwi.Components.Sound.html
index b7b3749..7dc9a2a 100644
--- a/docs/classes/Kiwi.Components.Sound.html
+++ b/docs/classes/Kiwi.Components.Sound.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Entity.html b/docs/classes/Kiwi.Entity.html
index 4031639..adec3b0 100644
--- a/docs/classes/Kiwi.Entity.html
+++ b/docs/classes/Kiwi.Entity.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Files.DataLibrary.html b/docs/classes/Kiwi.Files.DataLibrary.html
index 3d674f5..ce6d23b 100644
--- a/docs/classes/Kiwi.Files.DataLibrary.html
+++ b/docs/classes/Kiwi.Files.DataLibrary.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Files.File.html b/docs/classes/Kiwi.Files.File.html
index 3f697b7..1a2e63f 100644
--- a/docs/classes/Kiwi.Files.File.html
+++ b/docs/classes/Kiwi.Files.File.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Files.FileStore.html b/docs/classes/Kiwi.Files.FileStore.html
index cf4a571..0178511 100644
--- a/docs/classes/Kiwi.Files.FileStore.html
+++ b/docs/classes/Kiwi.Files.FileStore.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Files.Loader.html b/docs/classes/Kiwi.Files.Loader.html
index f43a34f..fe0800a 100644
--- a/docs/classes/Kiwi.Files.Loader.html
+++ b/docs/classes/Kiwi.Files.Loader.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Game.html b/docs/classes/Kiwi.Game.html
index b674f2d..cb71675 100644
--- a/docs/classes/Kiwi.Game.html
+++ b/docs/classes/Kiwi.Game.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.GameManager.html b/docs/classes/Kiwi.GameManager.html
index 9df62f3..c13debd 100644
--- a/docs/classes/Kiwi.GameManager.html
+++ b/docs/classes/Kiwi.GameManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.GameObjects.Sprite.html b/docs/classes/Kiwi.GameObjects.Sprite.html
index 2a1af73..a4987dd 100644
--- a/docs/classes/Kiwi.GameObjects.Sprite.html
+++ b/docs/classes/Kiwi.GameObjects.Sprite.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.GameObjects.StaticImage.html b/docs/classes/Kiwi.GameObjects.StaticImage.html
index 2d49eec..20d219b 100644
--- a/docs/classes/Kiwi.GameObjects.StaticImage.html
+++ b/docs/classes/Kiwi.GameObjects.StaticImage.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.GameObjects.Textfield.html b/docs/classes/Kiwi.GameObjects.Textfield.html
index a4f8f17..df1e6d6 100644
--- a/docs/classes/Kiwi.GameObjects.Textfield.html
+++ b/docs/classes/Kiwi.GameObjects.Textfield.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.GameObjects.Tilemap.TileMap.html b/docs/classes/Kiwi.GameObjects.Tilemap.TileMap.html
index d80481d..ba7a15b 100644
--- a/docs/classes/Kiwi.GameObjects.Tilemap.TileMap.html
+++ b/docs/classes/Kiwi.GameObjects.Tilemap.TileMap.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.GameObjects.Tilemap.TileMapLayer.html b/docs/classes/Kiwi.GameObjects.Tilemap.TileMapLayer.html
index e5650fe..bfb3770 100644
--- a/docs/classes/Kiwi.GameObjects.Tilemap.TileMapLayer.html
+++ b/docs/classes/Kiwi.GameObjects.Tilemap.TileMapLayer.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.GameObjects.Tilemap.TileType.html b/docs/classes/Kiwi.GameObjects.Tilemap.TileType.html
index 261f033..adcc976 100644
--- a/docs/classes/Kiwi.GameObjects.Tilemap.TileType.html
+++ b/docs/classes/Kiwi.GameObjects.Tilemap.TileType.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.AABB.html b/docs/classes/Kiwi.Geom.AABB.html
index 7065b3c..b7d4c65 100644
--- a/docs/classes/Kiwi.Geom.AABB.html
+++ b/docs/classes/Kiwi.Geom.AABB.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.Circle.html b/docs/classes/Kiwi.Geom.Circle.html
index c2c2f1c..e847fcd 100644
--- a/docs/classes/Kiwi.Geom.Circle.html
+++ b/docs/classes/Kiwi.Geom.Circle.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.Intersect.html b/docs/classes/Kiwi.Geom.Intersect.html
index d3a4b85..d8686ed 100644
--- a/docs/classes/Kiwi.Geom.Intersect.html
+++ b/docs/classes/Kiwi.Geom.Intersect.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.IntersectResult.html b/docs/classes/Kiwi.Geom.IntersectResult.html
index ac7bd49..538f585 100644
--- a/docs/classes/Kiwi.Geom.IntersectResult.html
+++ b/docs/classes/Kiwi.Geom.IntersectResult.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.Line.html b/docs/classes/Kiwi.Geom.Line.html
index d201597..95778c4 100644
--- a/docs/classes/Kiwi.Geom.Line.html
+++ b/docs/classes/Kiwi.Geom.Line.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.Matrix.html b/docs/classes/Kiwi.Geom.Matrix.html
index c988e62..a2239be 100644
--- a/docs/classes/Kiwi.Geom.Matrix.html
+++ b/docs/classes/Kiwi.Geom.Matrix.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.Point.html b/docs/classes/Kiwi.Geom.Point.html
index fbff01b..6e1f595 100644
--- a/docs/classes/Kiwi.Geom.Point.html
+++ b/docs/classes/Kiwi.Geom.Point.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.Ray.html b/docs/classes/Kiwi.Geom.Ray.html
index cc7bd35..2b1b4f3 100644
--- a/docs/classes/Kiwi.Geom.Ray.html
+++ b/docs/classes/Kiwi.Geom.Ray.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.Rectangle.html b/docs/classes/Kiwi.Geom.Rectangle.html
index 4ead1ec..89e1121 100644
--- a/docs/classes/Kiwi.Geom.Rectangle.html
+++ b/docs/classes/Kiwi.Geom.Rectangle.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.Transform.html b/docs/classes/Kiwi.Geom.Transform.html
index 7553ef5..9c740b5 100644
--- a/docs/classes/Kiwi.Geom.Transform.html
+++ b/docs/classes/Kiwi.Geom.Transform.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Geom.Vector2.html b/docs/classes/Kiwi.Geom.Vector2.html
index e0322fb..66871de 100644
--- a/docs/classes/Kiwi.Geom.Vector2.html
+++ b/docs/classes/Kiwi.Geom.Vector2.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Group.html b/docs/classes/Kiwi.Group.html
index df3ce92..e6f5874 100644
--- a/docs/classes/Kiwi.Group.html
+++ b/docs/classes/Kiwi.Group.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.HUDComponents.Counter.html b/docs/classes/Kiwi.HUD.HUDComponents.Counter.html
index e494c46..069e70b 100644
--- a/docs/classes/Kiwi.HUD.HUDComponents.Counter.html
+++ b/docs/classes/Kiwi.HUD.HUDComponents.Counter.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.HUDComponents.Time.html b/docs/classes/Kiwi.HUD.HUDComponents.Time.html
index 856906c..0cf2b21 100644
--- a/docs/classes/Kiwi.HUD.HUDComponents.Time.html
+++ b/docs/classes/Kiwi.HUD.HUDComponents.Time.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.HUDComponents.WidgetInput.html b/docs/classes/Kiwi.HUD.HUDComponents.WidgetInput.html
index 0e02152..65489f1 100644
--- a/docs/classes/Kiwi.HUD.HUDComponents.WidgetInput.html
+++ b/docs/classes/Kiwi.HUD.HUDComponents.WidgetInput.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.HUDDisplay.html b/docs/classes/Kiwi.HUD.HUDDisplay.html
index 3f81c7c..859c63b 100644
--- a/docs/classes/Kiwi.HUD.HUDDisplay.html
+++ b/docs/classes/Kiwi.HUD.HUDDisplay.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.HUDManager.html b/docs/classes/Kiwi.HUD.HUDManager.html
index 5ab7cf0..6d44b12 100644
--- a/docs/classes/Kiwi.HUD.HUDManager.html
+++ b/docs/classes/Kiwi.HUD.HUDManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.HUDWidget.html b/docs/classes/Kiwi.HUD.HUDWidget.html
index eecec5d..c38a5f7 100644
--- a/docs/classes/Kiwi.HUD.HUDWidget.html
+++ b/docs/classes/Kiwi.HUD.HUDWidget.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.Widget.Bar.html b/docs/classes/Kiwi.HUD.Widget.Bar.html
index 701fb12..e1bad81 100644
--- a/docs/classes/Kiwi.HUD.Widget.Bar.html
+++ b/docs/classes/Kiwi.HUD.Widget.Bar.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.Widget.BasicScore.html b/docs/classes/Kiwi.HUD.Widget.BasicScore.html
index bbeda32..20b728d 100644
--- a/docs/classes/Kiwi.HUD.Widget.BasicScore.html
+++ b/docs/classes/Kiwi.HUD.Widget.BasicScore.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.Widget.Button.html b/docs/classes/Kiwi.HUD.Widget.Button.html
index 34a8a22..24c387a 100644
--- a/docs/classes/Kiwi.HUD.Widget.Button.html
+++ b/docs/classes/Kiwi.HUD.Widget.Button.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.Widget.Icon.html b/docs/classes/Kiwi.HUD.Widget.Icon.html
index 3576985..c42c434 100644
--- a/docs/classes/Kiwi.HUD.Widget.Icon.html
+++ b/docs/classes/Kiwi.HUD.Widget.Icon.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.Widget.IconBar.html b/docs/classes/Kiwi.HUD.Widget.IconBar.html
index 7c6874d..09413e4 100644
--- a/docs/classes/Kiwi.HUD.Widget.IconBar.html
+++ b/docs/classes/Kiwi.HUD.Widget.IconBar.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.Widget.Menu.html b/docs/classes/Kiwi.HUD.Widget.Menu.html
index 1d1254b..01cede9 100644
--- a/docs/classes/Kiwi.HUD.Widget.Menu.html
+++ b/docs/classes/Kiwi.HUD.Widget.Menu.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.Widget.MenuItem.html b/docs/classes/Kiwi.HUD.Widget.MenuItem.html
index b0767bd..967822f 100644
--- a/docs/classes/Kiwi.HUD.Widget.MenuItem.html
+++ b/docs/classes/Kiwi.HUD.Widget.MenuItem.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.Widget.TextField.html b/docs/classes/Kiwi.HUD.Widget.TextField.html
index 39d7901..4b3610a 100644
--- a/docs/classes/Kiwi.HUD.Widget.TextField.html
+++ b/docs/classes/Kiwi.HUD.Widget.TextField.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.HUD.Widget.Time.html b/docs/classes/Kiwi.HUD.Widget.Time.html
index 473efcd..28d88ef 100644
--- a/docs/classes/Kiwi.HUD.Widget.Time.html
+++ b/docs/classes/Kiwi.HUD.Widget.Time.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.IChild.html b/docs/classes/Kiwi.IChild.html
index bb47f50..e0d5ac0 100644
--- a/docs/classes/Kiwi.IChild.html
+++ b/docs/classes/Kiwi.IChild.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Input.Finger.html b/docs/classes/Kiwi.Input.Finger.html
index 1b4ee7c..30c7539 100644
--- a/docs/classes/Kiwi.Input.Finger.html
+++ b/docs/classes/Kiwi.Input.Finger.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Input.InputManager.html b/docs/classes/Kiwi.Input.InputManager.html
index 71057b2..2d7fdd5 100644
--- a/docs/classes/Kiwi.Input.InputManager.html
+++ b/docs/classes/Kiwi.Input.InputManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
@@ -740,7 +740,7 @@ <h3 class="name"><code>_onDownEvent</code></h3>
             
         
         
-        <a href="../files/src_input_InputManager.ts.html#l144"><code>src\input\InputManager.ts:144</code></a>
+        <a href="../files/src_input_InputManager.ts.html#l141"><code>src\input\InputManager.ts:141</code></a>
         
         </p>
 
@@ -940,7 +940,7 @@ <h3 class="name"><code>_onUpEvent</code></h3>
             
         
         
-        <a href="../files/src_input_InputManager.ts.html#l160"><code>src\input\InputManager.ts:160</code></a>
+        <a href="../files/src_input_InputManager.ts.html#l157"><code>src\input\InputManager.ts:157</code></a>
         
         </p>
 
@@ -1228,7 +1228,7 @@ <h3 class="name"><code>reset</code></h3>
             
         
         
-        <a href="../files/src_input_InputManager.ts.html#l217"><code>src\input\InputManager.ts:217</code></a>
+        <a href="../files/src_input_InputManager.ts.html#l214"><code>src\input\InputManager.ts:214</code></a>
         
         </p>
 
@@ -1285,7 +1285,7 @@ <h3 class="name"><code>update</code></h3>
             
         
         
-        <a href="../files/src_input_InputManager.ts.html#l195"><code>src\input\InputManager.ts:195</code></a>
+        <a href="../files/src_input_InputManager.ts.html#l192"><code>src\input\InputManager.ts:192</code></a>
         
         </p>
 
@@ -1435,7 +1435,7 @@ <h3 class="name"><code>isDown</code></h3>
             
         
         
-        <a href="../files/src_input_InputManager.ts.html#l236"><code>src\input\InputManager.ts:236</code></a>
+        <a href="../files/src_input_InputManager.ts.html#l233"><code>src\input\InputManager.ts:233</code></a>
         
         </p>
 
@@ -1623,7 +1623,7 @@ <h3 class="name"><code>onReleased</code></h3>
             
         
         
-        <a href="../files/src_input_InputManager.ts.html#l185"><code>src\input\InputManager.ts:185</code></a>
+        <a href="../files/src_input_InputManager.ts.html#l182"><code>src\input\InputManager.ts:182</code></a>
         
         </p>
 
@@ -1764,7 +1764,7 @@ <h3 class="name"><code>position</code></h3>
             
         
         
-        <a href="../files/src_input_InputManager.ts.html#l228"><code>src\input\InputManager.ts:228</code></a>
+        <a href="../files/src_input_InputManager.ts.html#l225"><code>src\input\InputManager.ts:225</code></a>
         
         </p>
 
@@ -1858,7 +1858,7 @@ <h3 class="name"><code>x</code></h3>
             
         
         
-        <a href="../files/src_input_InputManager.ts.html#l244"><code>src\input\InputManager.ts:244</code></a>
+        <a href="../files/src_input_InputManager.ts.html#l241"><code>src\input\InputManager.ts:241</code></a>
         
         </p>
 
@@ -1905,7 +1905,7 @@ <h3 class="name"><code>y</code></h3>
             
         
         
-        <a href="../files/src_input_InputManager.ts.html#l255"><code>src\input\InputManager.ts:255</code></a>
+        <a href="../files/src_input_InputManager.ts.html#l252"><code>src\input\InputManager.ts:252</code></a>
         
         </p>
 
diff --git a/docs/classes/Kiwi.Input.Key.html b/docs/classes/Kiwi.Input.Key.html
index 7eefa45..9425b9c 100644
--- a/docs/classes/Kiwi.Input.Key.html
+++ b/docs/classes/Kiwi.Input.Key.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Input.Keyboard.html b/docs/classes/Kiwi.Input.Keyboard.html
index d97693b..9ba73c5 100644
--- a/docs/classes/Kiwi.Input.Keyboard.html
+++ b/docs/classes/Kiwi.Input.Keyboard.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Input.Keycodes.html b/docs/classes/Kiwi.Input.Keycodes.html
index 9849418..80d62c9 100644
--- a/docs/classes/Kiwi.Input.Keycodes.html
+++ b/docs/classes/Kiwi.Input.Keycodes.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Input.Mouse.html b/docs/classes/Kiwi.Input.Mouse.html
index 4d961ce..2c228e0 100644
--- a/docs/classes/Kiwi.Input.Mouse.html
+++ b/docs/classes/Kiwi.Input.Mouse.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Input.MouseCursor.html b/docs/classes/Kiwi.Input.MouseCursor.html
index bd4b9a6..42009c5 100644
--- a/docs/classes/Kiwi.Input.MouseCursor.html
+++ b/docs/classes/Kiwi.Input.MouseCursor.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Input.Pointer.html b/docs/classes/Kiwi.Input.Pointer.html
index 38c8751..9b60464 100644
--- a/docs/classes/Kiwi.Input.Pointer.html
+++ b/docs/classes/Kiwi.Input.Pointer.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Input.Touch.html b/docs/classes/Kiwi.Input.Touch.html
index 0b82dfb..67b55ce 100644
--- a/docs/classes/Kiwi.Input.Touch.html
+++ b/docs/classes/Kiwi.Input.Touch.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.PluginManager.html b/docs/classes/Kiwi.PluginManager.html
index e75ecc6..c7a8f91 100644
--- a/docs/classes/Kiwi.PluginManager.html
+++ b/docs/classes/Kiwi.PluginManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Renderers.CanvasRenderer.html b/docs/classes/Kiwi.Renderers.CanvasRenderer.html
index 138e91d..735c44b 100644
--- a/docs/classes/Kiwi.Renderers.CanvasRenderer.html
+++ b/docs/classes/Kiwi.Renderers.CanvasRenderer.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Renderers.GLArrayBuffer.html b/docs/classes/Kiwi.Renderers.GLArrayBuffer.html
index 70a4ab8..c7ce87b 100644
--- a/docs/classes/Kiwi.Renderers.GLArrayBuffer.html
+++ b/docs/classes/Kiwi.Renderers.GLArrayBuffer.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Renderers.GLElementArrayBuffer.html b/docs/classes/Kiwi.Renderers.GLElementArrayBuffer.html
index 26966bf..6e2b668 100644
--- a/docs/classes/Kiwi.Renderers.GLElementArrayBuffer.html
+++ b/docs/classes/Kiwi.Renderers.GLElementArrayBuffer.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Renderers.GLRenderManager.html b/docs/classes/Kiwi.Renderers.GLRenderManager.html
index 6551cf1..fef4501 100644
--- a/docs/classes/Kiwi.Renderers.GLRenderManager.html
+++ b/docs/classes/Kiwi.Renderers.GLRenderManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Renderers.GLTextureManager.html b/docs/classes/Kiwi.Renderers.GLTextureManager.html
index 3599585..ce7d6ce 100644
--- a/docs/classes/Kiwi.Renderers.GLTextureManager.html
+++ b/docs/classes/Kiwi.Renderers.GLTextureManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Renderers.GLTextureWrapper.html b/docs/classes/Kiwi.Renderers.GLTextureWrapper.html
index a963a2f..3005daa 100644
--- a/docs/classes/Kiwi.Renderers.GLTextureWrapper.html
+++ b/docs/classes/Kiwi.Renderers.GLTextureWrapper.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Renderers.Renderer.html b/docs/classes/Kiwi.Renderers.Renderer.html
index f0c511f..11faae3 100644
--- a/docs/classes/Kiwi.Renderers.Renderer.html
+++ b/docs/classes/Kiwi.Renderers.Renderer.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Renderers.TextureAtlasRenderer.html b/docs/classes/Kiwi.Renderers.TextureAtlasRenderer.html
index 52bdfbf..f75a92a 100644
--- a/docs/classes/Kiwi.Renderers.TextureAtlasRenderer.html
+++ b/docs/classes/Kiwi.Renderers.TextureAtlasRenderer.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Shaders.ShaderManager.html b/docs/classes/Kiwi.Shaders.ShaderManager.html
index 02744bf..2e17236 100644
--- a/docs/classes/Kiwi.Shaders.ShaderManager.html
+++ b/docs/classes/Kiwi.Shaders.ShaderManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Shaders.ShaderPair.html b/docs/classes/Kiwi.Shaders.ShaderPair.html
index 7c085d6..5d22017 100644
--- a/docs/classes/Kiwi.Shaders.ShaderPair.html
+++ b/docs/classes/Kiwi.Shaders.ShaderPair.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Shaders.TextureAtlasShader.html b/docs/classes/Kiwi.Shaders.TextureAtlasShader.html
index 15a989f..3b67720 100644
--- a/docs/classes/Kiwi.Shaders.TextureAtlasShader.html
+++ b/docs/classes/Kiwi.Shaders.TextureAtlasShader.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Signal.html b/docs/classes/Kiwi.Signal.html
index fc3841e..b7b7b98 100644
--- a/docs/classes/Kiwi.Signal.html
+++ b/docs/classes/Kiwi.Signal.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.SignalBinding.html b/docs/classes/Kiwi.SignalBinding.html
index 0addb5f..0c93f77 100644
--- a/docs/classes/Kiwi.SignalBinding.html
+++ b/docs/classes/Kiwi.SignalBinding.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Sound.Audio.html b/docs/classes/Kiwi.Sound.Audio.html
index fc79dd1..5d93db8 100644
--- a/docs/classes/Kiwi.Sound.Audio.html
+++ b/docs/classes/Kiwi.Sound.Audio.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Sound.AudioLibrary.html b/docs/classes/Kiwi.Sound.AudioLibrary.html
index 50eb158..986390e 100644
--- a/docs/classes/Kiwi.Sound.AudioLibrary.html
+++ b/docs/classes/Kiwi.Sound.AudioLibrary.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Sound.AudioManager.html b/docs/classes/Kiwi.Sound.AudioManager.html
index edfb4fb..994614a 100644
--- a/docs/classes/Kiwi.Sound.AudioManager.html
+++ b/docs/classes/Kiwi.Sound.AudioManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Stage.html b/docs/classes/Kiwi.Stage.html
index 1934141..b952ba1 100644
--- a/docs/classes/Kiwi.Stage.html
+++ b/docs/classes/Kiwi.Stage.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.State.html b/docs/classes/Kiwi.State.html
index 5564bdf..f99e470 100644
--- a/docs/classes/Kiwi.State.html
+++ b/docs/classes/Kiwi.State.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.StateConfig.html b/docs/classes/Kiwi.StateConfig.html
index 062c7d5..37a857c 100644
--- a/docs/classes/Kiwi.StateConfig.html
+++ b/docs/classes/Kiwi.StateConfig.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.StateManager.html b/docs/classes/Kiwi.StateManager.html
index 5367ace..fc3c9a9 100644
--- a/docs/classes/Kiwi.StateManager.html
+++ b/docs/classes/Kiwi.StateManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.System.Bootstrap.html b/docs/classes/Kiwi.System.Bootstrap.html
index f24f8fd..3b008a1 100644
--- a/docs/classes/Kiwi.System.Bootstrap.html
+++ b/docs/classes/Kiwi.System.Bootstrap.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.System.Device.html b/docs/classes/Kiwi.System.Device.html
index 3bf671d..72752d3 100644
--- a/docs/classes/Kiwi.System.Device.html
+++ b/docs/classes/Kiwi.System.Device.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Textures.SingleImage.html b/docs/classes/Kiwi.Textures.SingleImage.html
index 330f5b4..365cbcf 100644
--- a/docs/classes/Kiwi.Textures.SingleImage.html
+++ b/docs/classes/Kiwi.Textures.SingleImage.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Textures.SpriteSheet.html b/docs/classes/Kiwi.Textures.SpriteSheet.html
index 9809f40..c28b927 100644
--- a/docs/classes/Kiwi.Textures.SpriteSheet.html
+++ b/docs/classes/Kiwi.Textures.SpriteSheet.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Textures.TextureAtlas.html b/docs/classes/Kiwi.Textures.TextureAtlas.html
index e217780..d037b40 100644
--- a/docs/classes/Kiwi.Textures.TextureAtlas.html
+++ b/docs/classes/Kiwi.Textures.TextureAtlas.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Textures.TextureLibrary.html b/docs/classes/Kiwi.Textures.TextureLibrary.html
index 0d2f34b..98da18b 100644
--- a/docs/classes/Kiwi.Textures.TextureLibrary.html
+++ b/docs/classes/Kiwi.Textures.TextureLibrary.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Time.Clock.html b/docs/classes/Kiwi.Time.Clock.html
index d659698..dc6c143 100644
--- a/docs/classes/Kiwi.Time.Clock.html
+++ b/docs/classes/Kiwi.Time.Clock.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Time.ClockManager.html b/docs/classes/Kiwi.Time.ClockManager.html
index 7c2ff10..afd62a6 100644
--- a/docs/classes/Kiwi.Time.ClockManager.html
+++ b/docs/classes/Kiwi.Time.ClockManager.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Time.MasterClock.html b/docs/classes/Kiwi.Time.MasterClock.html
index 23e38e1..5495dd7 100644
--- a/docs/classes/Kiwi.Time.MasterClock.html
+++ b/docs/classes/Kiwi.Time.MasterClock.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Time.Timer.html b/docs/classes/Kiwi.Time.Timer.html
index fce5800..c54d063 100644
--- a/docs/classes/Kiwi.Time.Timer.html
+++ b/docs/classes/Kiwi.Time.Timer.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Time.TimerEvent.html b/docs/classes/Kiwi.Time.TimerEvent.html
index 6b4604d..6f6af63 100644
--- a/docs/classes/Kiwi.Time.TimerEvent.html
+++ b/docs/classes/Kiwi.Time.TimerEvent.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Utils.Canvas.html b/docs/classes/Kiwi.Utils.Canvas.html
index 957caba..74c8437 100644
--- a/docs/classes/Kiwi.Utils.Canvas.html
+++ b/docs/classes/Kiwi.Utils.Canvas.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Utils.Common.html b/docs/classes/Kiwi.Utils.Common.html
index fdc1ed0..27abe98 100644
--- a/docs/classes/Kiwi.Utils.Common.html
+++ b/docs/classes/Kiwi.Utils.Common.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Utils.GameMath.html b/docs/classes/Kiwi.Utils.GameMath.html
index bdfe4c7..b05e1f8 100644
--- a/docs/classes/Kiwi.Utils.GameMath.html
+++ b/docs/classes/Kiwi.Utils.GameMath.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Utils.RandomDataGenerator.html b/docs/classes/Kiwi.Utils.RandomDataGenerator.html
index f47479b..8d8ce40 100644
--- a/docs/classes/Kiwi.Utils.RandomDataGenerator.html
+++ b/docs/classes/Kiwi.Utils.RandomDataGenerator.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Utils.RequestAnimationFrame.html b/docs/classes/Kiwi.Utils.RequestAnimationFrame.html
index d5c66aa..2e79565 100644
--- a/docs/classes/Kiwi.Utils.RequestAnimationFrame.html
+++ b/docs/classes/Kiwi.Utils.RequestAnimationFrame.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/classes/Kiwi.Utils.Version.html b/docs/classes/Kiwi.Utils.Version.html
index 95dabc5..388c2e7 100644
--- a/docs/classes/Kiwi.Utils.Version.html
+++ b/docs/classes/Kiwi.Utils.Version.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/data.json b/docs/data.json
index 6f441d6..72b1c54 100644
--- a/docs/data.json
+++ b/docs/data.json
@@ -2,7 +2,7 @@
     "project": {
         "name": "Kiwi.js",
         "description": "Kiwi.js is a Javascript/Typescript library for creating HTML5 games.",
-        "version": "0.7.0",
+        "version": "1.0.0",
         "url": "http://kiwijs.org/"
     },
     "files": {
@@ -30236,7 +30236,7 @@
         },
         {
             "file": "src\\input\\InputManager.ts",
-            "line": 144,
+            "line": 141,
             "description": "A private method that gets dispatched when either the mouse or touch manager dispatches a down event",
             "itemtype": "method",
             "name": "_onDownEvent",
@@ -30281,7 +30281,7 @@
         },
         {
             "file": "src\\input\\InputManager.ts",
-            "line": 160,
+            "line": 157,
             "description": "A private method that gets dispatched when either the mouse or touch manager dispatches a up event",
             "itemtype": "method",
             "name": "_onUpEvent",
@@ -30326,7 +30326,7 @@
         },
         {
             "file": "src\\input\\InputManager.ts",
-            "line": 185,
+            "line": 182,
             "description": "An alias for the onRelease signal that goes straight to the onUp",
             "itemtype": "property",
             "name": "onReleased",
@@ -30340,7 +30340,7 @@
         },
         {
             "file": "src\\input\\InputManager.ts",
-            "line": 195,
+            "line": 192,
             "description": "The update loop that gets executed every frame.",
             "itemtype": "method",
             "name": "update",
@@ -30353,7 +30353,7 @@
         },
         {
             "file": "src\\input\\InputManager.ts",
-            "line": 217,
+            "line": 214,
             "description": "Runs the reset method on the managers.",
             "itemtype": "method",
             "name": "reset",
@@ -30364,7 +30364,7 @@
         },
         {
             "file": "src\\input\\InputManager.ts",
-            "line": 228,
+            "line": 225,
             "description": "The position of the last pointer that was/is active on the stage.",
             "itemtype": "property",
             "name": "position",
@@ -30378,7 +30378,7 @@
         },
         {
             "file": "src\\input\\InputManager.ts",
-            "line": 236,
+            "line": 233,
             "description": "If an input (either touch or the mouse cursor) is currently down. Not an accurate representation, should use the individual managers.",
             "itemtype": "property",
             "name": "isDown",
@@ -30392,7 +30392,7 @@
         },
         {
             "file": "src\\input\\InputManager.ts",
-            "line": 244,
+            "line": 241,
             "description": "Populated x coordinate based on the most recent click/touch event",
             "itemtype": "property",
             "name": "x",
@@ -30406,7 +30406,7 @@
         },
         {
             "file": "src\\input\\InputManager.ts",
-            "line": 255,
+            "line": 252,
             "description": "Populated y coordinate based on the most recent click/touch event",
             "itemtype": "property",
             "name": "y",
diff --git a/docs/files/src_Kiwi.ts.html b/docs/files/src_Kiwi.ts.html
index 31e31e0..2984bb7 100644
--- a/docs/files/src_Kiwi.ts.html
+++ b/docs/files/src_Kiwi.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
@@ -496,7 +496,7 @@ <h1 class="file-heading">File: src\Kiwi.ts</h1>
     * @type string
     * @public
     */
-    export var VERSION: string = &quot;0.7.0&quot;;
+    export var VERSION: string = &quot;1.0.0&quot;;
     
     //DIFFERENT RENDERER STATIC VARIABLES
     /**
diff --git a/docs/files/src_animations_Animation.ts.html b/docs/files/src_animations_Animation.ts.html
index 3fc4ab7..4181070 100644
--- a/docs/files/src_animations_Animation.ts.html
+++ b/docs/files/src_animations_Animation.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_Sequence.ts.html b/docs/files/src_animations_Sequence.ts.html
index fac843c..14b3090 100644
--- a/docs/files/src_animations_Sequence.ts.html
+++ b/docs/files/src_animations_Sequence.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_Tween.ts.html b/docs/files/src_animations_tweens_Tween.ts.html
index 94f1c51..9ace0ed 100644
--- a/docs/files/src_animations_tweens_Tween.ts.html
+++ b/docs/files/src_animations_tweens_Tween.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_TweenManager.ts.html b/docs/files/src_animations_tweens_TweenManager.ts.html
index e4194c7..894299b 100644
--- a/docs/files/src_animations_tweens_TweenManager.ts.html
+++ b/docs/files/src_animations_tweens_TweenManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Back.ts.html b/docs/files/src_animations_tweens_easing_Back.ts.html
index 62d0509..454aab5 100644
--- a/docs/files/src_animations_tweens_easing_Back.ts.html
+++ b/docs/files/src_animations_tweens_easing_Back.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Bounce.ts.html b/docs/files/src_animations_tweens_easing_Bounce.ts.html
index ad6bc5f..3832e98 100644
--- a/docs/files/src_animations_tweens_easing_Bounce.ts.html
+++ b/docs/files/src_animations_tweens_easing_Bounce.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Circular.ts.html b/docs/files/src_animations_tweens_easing_Circular.ts.html
index bee08a2..700c2cc 100644
--- a/docs/files/src_animations_tweens_easing_Circular.ts.html
+++ b/docs/files/src_animations_tweens_easing_Circular.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Cubic.ts.html b/docs/files/src_animations_tweens_easing_Cubic.ts.html
index 7db4963..993f568 100644
--- a/docs/files/src_animations_tweens_easing_Cubic.ts.html
+++ b/docs/files/src_animations_tweens_easing_Cubic.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Elastic.ts.html b/docs/files/src_animations_tweens_easing_Elastic.ts.html
index 06299d3..5c57091 100644
--- a/docs/files/src_animations_tweens_easing_Elastic.ts.html
+++ b/docs/files/src_animations_tweens_easing_Elastic.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Exponential.ts.html b/docs/files/src_animations_tweens_easing_Exponential.ts.html
index d79869a..89c8327 100644
--- a/docs/files/src_animations_tweens_easing_Exponential.ts.html
+++ b/docs/files/src_animations_tweens_easing_Exponential.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Linear.ts.html b/docs/files/src_animations_tweens_easing_Linear.ts.html
index 36b5166..2f27675 100644
--- a/docs/files/src_animations_tweens_easing_Linear.ts.html
+++ b/docs/files/src_animations_tweens_easing_Linear.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Quadratic.ts.html b/docs/files/src_animations_tweens_easing_Quadratic.ts.html
index 98ed3a0..3a91c82 100644
--- a/docs/files/src_animations_tweens_easing_Quadratic.ts.html
+++ b/docs/files/src_animations_tweens_easing_Quadratic.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Quartic.ts.html b/docs/files/src_animations_tweens_easing_Quartic.ts.html
index c0fcfdc..23552e2 100644
--- a/docs/files/src_animations_tweens_easing_Quartic.ts.html
+++ b/docs/files/src_animations_tweens_easing_Quartic.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Quintic.ts.html b/docs/files/src_animations_tweens_easing_Quintic.ts.html
index 9747ae5..1482786 100644
--- a/docs/files/src_animations_tweens_easing_Quintic.ts.html
+++ b/docs/files/src_animations_tweens_easing_Quintic.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_animations_tweens_easing_Sinusoidal.ts.html b/docs/files/src_animations_tweens_easing_Sinusoidal.ts.html
index d6322b9..2e0ce3d 100644
--- a/docs/files/src_animations_tweens_easing_Sinusoidal.ts.html
+++ b/docs/files/src_animations_tweens_easing_Sinusoidal.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_components_AnimationManager.ts.html b/docs/files/src_components_AnimationManager.ts.html
index 8295c25..17a51cc 100644
--- a/docs/files/src_components_AnimationManager.ts.html
+++ b/docs/files/src_components_AnimationManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_components_ArcadePhysics.ts.html b/docs/files/src_components_ArcadePhysics.ts.html
index 30555ba..a537509 100644
--- a/docs/files/src_components_ArcadePhysics.ts.html
+++ b/docs/files/src_components_ArcadePhysics.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_components_Box.ts.html b/docs/files/src_components_Box.ts.html
index db3fc5a..649fecc 100644
--- a/docs/files/src_components_Box.ts.html
+++ b/docs/files/src_components_Box.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_components_Input.ts.html b/docs/files/src_components_Input.ts.html
index aa2e9d5..38e1953 100644
--- a/docs/files/src_components_Input.ts.html
+++ b/docs/files/src_components_Input.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_components_Sound.ts.html b/docs/files/src_components_Sound.ts.html
index e4e34f8..fe34c18 100644
--- a/docs/files/src_components_Sound.ts.html
+++ b/docs/files/src_components_Sound.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_Camera.ts.html b/docs/files/src_core_Camera.ts.html
index 6f18c09..33b01ff 100644
--- a/docs/files/src_core_Camera.ts.html
+++ b/docs/files/src_core_Camera.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_CameraManager.ts.html b/docs/files/src_core_CameraManager.ts.html
index 81f8010..5b5c2bf 100644
--- a/docs/files/src_core_CameraManager.ts.html
+++ b/docs/files/src_core_CameraManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_Component.ts.html b/docs/files/src_core_Component.ts.html
index b148624..42be722 100644
--- a/docs/files/src_core_Component.ts.html
+++ b/docs/files/src_core_Component.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_ComponentManager.ts.html b/docs/files/src_core_ComponentManager.ts.html
index a8fffc3..dfb4898 100644
--- a/docs/files/src_core_ComponentManager.ts.html
+++ b/docs/files/src_core_ComponentManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_Entity.ts.html b/docs/files/src_core_Entity.ts.html
index 7e222fc..e85a45a 100644
--- a/docs/files/src_core_Entity.ts.html
+++ b/docs/files/src_core_Entity.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_Game.ts.html b/docs/files/src_core_Game.ts.html
index 6f9db23..d544057 100644
--- a/docs/files/src_core_Game.ts.html
+++ b/docs/files/src_core_Game.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_Group.ts.html b/docs/files/src_core_Group.ts.html
index 8d76d2d..26ed107 100644
--- a/docs/files/src_core_Group.ts.html
+++ b/docs/files/src_core_Group.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_IChild.ts.html b/docs/files/src_core_IChild.ts.html
index bc0404c..df42c1c 100644
--- a/docs/files/src_core_IChild.ts.html
+++ b/docs/files/src_core_IChild.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_PluginManager.ts.html b/docs/files/src_core_PluginManager.ts.html
index 1ece5bd..cca58e2 100644
--- a/docs/files/src_core_PluginManager.ts.html
+++ b/docs/files/src_core_PluginManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_Signal.ts.html b/docs/files/src_core_Signal.ts.html
index 60e3a80..c320ab2 100644
--- a/docs/files/src_core_Signal.ts.html
+++ b/docs/files/src_core_Signal.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_SignalBinding.ts.html b/docs/files/src_core_SignalBinding.ts.html
index 14b9c7b..60e08ce 100644
--- a/docs/files/src_core_SignalBinding.ts.html
+++ b/docs/files/src_core_SignalBinding.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_Stage.ts.html b/docs/files/src_core_Stage.ts.html
index a731cee..baf42e7 100644
--- a/docs/files/src_core_Stage.ts.html
+++ b/docs/files/src_core_Stage.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_State.ts.html b/docs/files/src_core_State.ts.html
index c32f232..757b610 100644
--- a/docs/files/src_core_State.ts.html
+++ b/docs/files/src_core_State.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_StateConfig.ts.html b/docs/files/src_core_StateConfig.ts.html
index c101dcf..58753d8 100644
--- a/docs/files/src_core_StateConfig.ts.html
+++ b/docs/files/src_core_StateConfig.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_core_StateManager.ts.html b/docs/files/src_core_StateManager.ts.html
index eff0991..782a304 100644
--- a/docs/files/src_core_StateManager.ts.html
+++ b/docs/files/src_core_StateManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_file_DataLibrary.ts.html b/docs/files/src_file_DataLibrary.ts.html
index b60ca30..97b5b0c 100644
--- a/docs/files/src_file_DataLibrary.ts.html
+++ b/docs/files/src_file_DataLibrary.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_file_File.ts.html b/docs/files/src_file_File.ts.html
index 393c606..d26e0b4 100644
--- a/docs/files/src_file_File.ts.html
+++ b/docs/files/src_file_File.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_file_FileStore.ts.html b/docs/files/src_file_FileStore.ts.html
index 0dbbfe7..878cc18 100644
--- a/docs/files/src_file_FileStore.ts.html
+++ b/docs/files/src_file_FileStore.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_file_Loader.ts.html b/docs/files/src_file_Loader.ts.html
index 0605ef0..e949bce 100644
--- a/docs/files/src_file_Loader.ts.html
+++ b/docs/files/src_file_Loader.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_gameobjects_Sprite.ts.html b/docs/files/src_gameobjects_Sprite.ts.html
index 1aa0bc7..6892b49 100644
--- a/docs/files/src_gameobjects_Sprite.ts.html
+++ b/docs/files/src_gameobjects_Sprite.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_gameobjects_StaticImage.ts.html b/docs/files/src_gameobjects_StaticImage.ts.html
index 8d26565..529ba80 100644
--- a/docs/files/src_gameobjects_StaticImage.ts.html
+++ b/docs/files/src_gameobjects_StaticImage.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_gameobjects_Textfield.ts.html b/docs/files/src_gameobjects_Textfield.ts.html
index 3f5c061..c4fde54 100644
--- a/docs/files/src_gameobjects_Textfield.ts.html
+++ b/docs/files/src_gameobjects_Textfield.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_gameobjects_tilemap_TileMap.ts.html b/docs/files/src_gameobjects_tilemap_TileMap.ts.html
index 39ad05a..68c4f91 100644
--- a/docs/files/src_gameobjects_tilemap_TileMap.ts.html
+++ b/docs/files/src_gameobjects_tilemap_TileMap.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_gameobjects_tilemap_TileMapLayer.ts.html b/docs/files/src_gameobjects_tilemap_TileMapLayer.ts.html
index 2ccb63e..86d55f6 100644
--- a/docs/files/src_gameobjects_tilemap_TileMapLayer.ts.html
+++ b/docs/files/src_gameobjects_tilemap_TileMapLayer.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_gameobjects_tilemap_TileType.ts.html b/docs/files/src_gameobjects_tilemap_TileType.ts.html
index c86d3fd..b99991b 100644
--- a/docs/files/src_gameobjects_tilemap_TileType.ts.html
+++ b/docs/files/src_gameobjects_tilemap_TileType.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_AABB.ts.html b/docs/files/src_geom_AABB.ts.html
index 894572a..cd09c1e 100644
--- a/docs/files/src_geom_AABB.ts.html
+++ b/docs/files/src_geom_AABB.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_Circle.ts.html b/docs/files/src_geom_Circle.ts.html
index 1bdfa53..69b3e61 100644
--- a/docs/files/src_geom_Circle.ts.html
+++ b/docs/files/src_geom_Circle.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_Intersect.ts.html b/docs/files/src_geom_Intersect.ts.html
index 178979f..206b7bf 100644
--- a/docs/files/src_geom_Intersect.ts.html
+++ b/docs/files/src_geom_Intersect.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_IntersectResult.ts.html b/docs/files/src_geom_IntersectResult.ts.html
index 39ed25f..af46d73 100644
--- a/docs/files/src_geom_IntersectResult.ts.html
+++ b/docs/files/src_geom_IntersectResult.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_Line.ts.html b/docs/files/src_geom_Line.ts.html
index f565d0f..d840a21 100644
--- a/docs/files/src_geom_Line.ts.html
+++ b/docs/files/src_geom_Line.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_Matrix.ts.html b/docs/files/src_geom_Matrix.ts.html
index 14f382c..0b8783a 100644
--- a/docs/files/src_geom_Matrix.ts.html
+++ b/docs/files/src_geom_Matrix.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_Point.ts.html b/docs/files/src_geom_Point.ts.html
index c192f07..93aef6d 100644
--- a/docs/files/src_geom_Point.ts.html
+++ b/docs/files/src_geom_Point.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_Ray.ts.html b/docs/files/src_geom_Ray.ts.html
index 3a6b4e1..6d2aefe 100644
--- a/docs/files/src_geom_Ray.ts.html
+++ b/docs/files/src_geom_Ray.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_Rectangle.ts.html b/docs/files/src_geom_Rectangle.ts.html
index 3937349..d516cc2 100644
--- a/docs/files/src_geom_Rectangle.ts.html
+++ b/docs/files/src_geom_Rectangle.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_Transform.ts.html b/docs/files/src_geom_Transform.ts.html
index 3c569d8..8b1d628 100644
--- a/docs/files/src_geom_Transform.ts.html
+++ b/docs/files/src_geom_Transform.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_geom_Vector2.ts.html b/docs/files/src_geom_Vector2.ts.html
index aeccac4..7949ccd 100644
--- a/docs/files/src_geom_Vector2.ts.html
+++ b/docs/files/src_geom_Vector2.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_HUDDisplay.ts.html b/docs/files/src_hud_HUDDisplay.ts.html
index 96abfc9..1cc559a 100644
--- a/docs/files/src_hud_HUDDisplay.ts.html
+++ b/docs/files/src_hud_HUDDisplay.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_HUDManager.ts.html b/docs/files/src_hud_HUDManager.ts.html
index d892ca3..8255564 100644
--- a/docs/files/src_hud_HUDManager.ts.html
+++ b/docs/files/src_hud_HUDManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_HUDWidget.ts.html b/docs/files/src_hud_HUDWidget.ts.html
index c748079..1ebdefd 100644
--- a/docs/files/src_hud_HUDWidget.ts.html
+++ b/docs/files/src_hud_HUDWidget.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_components_Counter.ts.html b/docs/files/src_hud_components_Counter.ts.html
index eb1066a..da37cba 100644
--- a/docs/files/src_hud_components_Counter.ts.html
+++ b/docs/files/src_hud_components_Counter.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_components_Time.ts.html b/docs/files/src_hud_components_Time.ts.html
index 0ddc894..38b41a2 100644
--- a/docs/files/src_hud_components_Time.ts.html
+++ b/docs/files/src_hud_components_Time.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_components_WidgetInput.ts.html b/docs/files/src_hud_components_WidgetInput.ts.html
index 96d1b14..02d3c64 100644
--- a/docs/files/src_hud_components_WidgetInput.ts.html
+++ b/docs/files/src_hud_components_WidgetInput.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_widgets_Bar.ts.html b/docs/files/src_hud_widgets_Bar.ts.html
index 4846e3b..9ff6158 100644
--- a/docs/files/src_hud_widgets_Bar.ts.html
+++ b/docs/files/src_hud_widgets_Bar.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_widgets_BasicScore.ts.html b/docs/files/src_hud_widgets_BasicScore.ts.html
index 83a9b27..3608df7 100644
--- a/docs/files/src_hud_widgets_BasicScore.ts.html
+++ b/docs/files/src_hud_widgets_BasicScore.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_widgets_Button.ts.html b/docs/files/src_hud_widgets_Button.ts.html
index c4f1f4f..c8d538f 100644
--- a/docs/files/src_hud_widgets_Button.ts.html
+++ b/docs/files/src_hud_widgets_Button.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_widgets_Icon.ts.html b/docs/files/src_hud_widgets_Icon.ts.html
index 747b211..be07f4f 100644
--- a/docs/files/src_hud_widgets_Icon.ts.html
+++ b/docs/files/src_hud_widgets_Icon.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_widgets_IconBar.ts.html b/docs/files/src_hud_widgets_IconBar.ts.html
index f1c7d58..60030fd 100644
--- a/docs/files/src_hud_widgets_IconBar.ts.html
+++ b/docs/files/src_hud_widgets_IconBar.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_widgets_Menu.ts.html b/docs/files/src_hud_widgets_Menu.ts.html
index be30305..d3ad618 100644
--- a/docs/files/src_hud_widgets_Menu.ts.html
+++ b/docs/files/src_hud_widgets_Menu.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_widgets_MenuItem.ts.html b/docs/files/src_hud_widgets_MenuItem.ts.html
index 5814542..70105b9 100644
--- a/docs/files/src_hud_widgets_MenuItem.ts.html
+++ b/docs/files/src_hud_widgets_MenuItem.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_widgets_TextField.ts.html b/docs/files/src_hud_widgets_TextField.ts.html
index e8ee999..9c64f9b 100644
--- a/docs/files/src_hud_widgets_TextField.ts.html
+++ b/docs/files/src_hud_widgets_TextField.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_hud_widgets_Time.ts.html b/docs/files/src_hud_widgets_Time.ts.html
index 2c87032..6e50f28 100644
--- a/docs/files/src_hud_widgets_Time.ts.html
+++ b/docs/files/src_hud_widgets_Time.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_input_Finger.ts.html b/docs/files/src_input_Finger.ts.html
index 30f0b3a..bd82e9c 100644
--- a/docs/files/src_input_Finger.ts.html
+++ b/docs/files/src_input_Finger.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_input_InputManager.ts.html b/docs/files/src_input_InputManager.ts.html
index e394005..4ff681c 100644
--- a/docs/files/src_input_InputManager.ts.html
+++ b/docs/files/src_input_InputManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
@@ -463,25 +463,22 @@ <h1 class="file-heading">File: src\input\InputManager.ts</h1>
 
             this.mouse = new Kiwi.Input.Mouse(this.game);
             this.mouse.boot();
+            this.mouse.onDown.add(this._onDownEvent, this);
+            this.mouse.onUp.add(this._onUpEvent, this);
 
             this.keyboard = new Kiwi.Input.Keyboard(this.game);
             this.keyboard.boot();
 
             this.touch = new Kiwi.Input.Touch(this.game);
             this.touch.boot();
-
-            //Decided which inputs to map to the up/down events.
-            if (Kiwi.DEVICE.touch == true ) {
-                this.touch.touchDown.add(this._onDownEvent, this);
-                this.touch.touchUp.add(this._onUpEvent, this);
-                this._pointers = this.touch.fingers;
-
-            } else {
-                this.mouse.onDown.add(this._onDownEvent, this);
-                this.mouse.onUp.add(this._onUpEvent, this);
-                this._pointers.push(this.mouse.cursor);
-
-            }
+            this.touch.touchDown.add(this._onDownEvent, this);
+            this.touch.touchUp.add(this._onUpEvent, this);
+
+            /*
+            * Add the fingers/cursors to the list of &#x27;pointers&#x27;
+            */
+            this._pointers = this.touch.fingers;
+            this._pointers.push(this.mouse.cursor);
 
 
             this.isDown = false;
diff --git a/docs/files/src_input_Key.ts.html b/docs/files/src_input_Key.ts.html
index 2698f11..55220d9 100644
--- a/docs/files/src_input_Key.ts.html
+++ b/docs/files/src_input_Key.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_input_Keyboard.ts.html b/docs/files/src_input_Keyboard.ts.html
index 426ca99..501e616 100644
--- a/docs/files/src_input_Keyboard.ts.html
+++ b/docs/files/src_input_Keyboard.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_input_Keycodes.ts.html b/docs/files/src_input_Keycodes.ts.html
index f8626c0..c46311b 100644
--- a/docs/files/src_input_Keycodes.ts.html
+++ b/docs/files/src_input_Keycodes.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_input_Mouse.ts.html b/docs/files/src_input_Mouse.ts.html
index cf774f8..126f002 100644
--- a/docs/files/src_input_Mouse.ts.html
+++ b/docs/files/src_input_Mouse.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_input_MouseCursor.ts.html b/docs/files/src_input_MouseCursor.ts.html
index 0f051a6..22eab88 100644
--- a/docs/files/src_input_MouseCursor.ts.html
+++ b/docs/files/src_input_MouseCursor.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_input_Pointer.ts.html b/docs/files/src_input_Pointer.ts.html
index 42240a0..684a46d 100644
--- a/docs/files/src_input_Pointer.ts.html
+++ b/docs/files/src_input_Pointer.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_input_Touch.ts.html b/docs/files/src_input_Touch.ts.html
index 9187ad6..326be2b 100644
--- a/docs/files/src_input_Touch.ts.html
+++ b/docs/files/src_input_Touch.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_CanvasRenderer.ts.html b/docs/files/src_render_CanvasRenderer.ts.html
index aaca67e..a5b7684 100644
--- a/docs/files/src_render_CanvasRenderer.ts.html
+++ b/docs/files/src_render_CanvasRenderer.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_GLArrayBuffer.ts.html b/docs/files/src_render_GLArrayBuffer.ts.html
index 4ac2dc4..4d34a10 100644
--- a/docs/files/src_render_GLArrayBuffer.ts.html
+++ b/docs/files/src_render_GLArrayBuffer.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_GLElementArrayBuffer.ts.html b/docs/files/src_render_GLElementArrayBuffer.ts.html
index 223f1e4..6ba3d07 100644
--- a/docs/files/src_render_GLElementArrayBuffer.ts.html
+++ b/docs/files/src_render_GLElementArrayBuffer.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_GLRenderManager.ts.html b/docs/files/src_render_GLRenderManager.ts.html
index 3db67aa..b7b2c1f 100644
--- a/docs/files/src_render_GLRenderManager.ts.html
+++ b/docs/files/src_render_GLRenderManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_GLShaderManager.ts.html b/docs/files/src_render_GLShaderManager.ts.html
index 4645743..e98ec2a 100644
--- a/docs/files/src_render_GLShaderManager.ts.html
+++ b/docs/files/src_render_GLShaderManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_GLTextureManager.ts.html b/docs/files/src_render_GLTextureManager.ts.html
index bd03b7e..6835bca 100644
--- a/docs/files/src_render_GLTextureManager.ts.html
+++ b/docs/files/src_render_GLTextureManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_GLTextureWrapper.ts.html b/docs/files/src_render_GLTextureWrapper.ts.html
index fbcb58e..cf477c4 100644
--- a/docs/files/src_render_GLTextureWrapper.ts.html
+++ b/docs/files/src_render_GLTextureWrapper.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_renderers_Renderer.ts.html b/docs/files/src_render_renderers_Renderer.ts.html
index fea2025..07cf929 100644
--- a/docs/files/src_render_renderers_Renderer.ts.html
+++ b/docs/files/src_render_renderers_Renderer.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_renderers_TextureAtlasRenderer.ts.html b/docs/files/src_render_renderers_TextureAtlasRenderer.ts.html
index ef7bdb7..c677533 100644
--- a/docs/files/src_render_renderers_TextureAtlasRenderer.ts.html
+++ b/docs/files/src_render_renderers_TextureAtlasRenderer.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_shaders_ShaderPair.ts.html b/docs/files/src_render_shaders_ShaderPair.ts.html
index 7c6ee1f..79090e2 100644
--- a/docs/files/src_render_shaders_ShaderPair.ts.html
+++ b/docs/files/src_render_shaders_ShaderPair.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_render_shaders_TextureAtlasShader.ts.html b/docs/files/src_render_shaders_TextureAtlasShader.ts.html
index ef1d591..04ee034 100644
--- a/docs/files/src_render_shaders_TextureAtlasShader.ts.html
+++ b/docs/files/src_render_shaders_TextureAtlasShader.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_sound_Audio.ts.html b/docs/files/src_sound_Audio.ts.html
index 1ec5bb8..2f4eba2 100644
--- a/docs/files/src_sound_Audio.ts.html
+++ b/docs/files/src_sound_Audio.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_sound_AudioLibrary.ts.html b/docs/files/src_sound_AudioLibrary.ts.html
index 8fdd08e..4b8032a 100644
--- a/docs/files/src_sound_AudioLibrary.ts.html
+++ b/docs/files/src_sound_AudioLibrary.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_sound_AudioManager.ts.html b/docs/files/src_sound_AudioManager.ts.html
index d1bbec9..39e59fe 100644
--- a/docs/files/src_sound_AudioManager.ts.html
+++ b/docs/files/src_sound_AudioManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_system_Bootstrap.ts.html b/docs/files/src_system_Bootstrap.ts.html
index 0ffc17b..0d2ba0d 100644
--- a/docs/files/src_system_Bootstrap.ts.html
+++ b/docs/files/src_system_Bootstrap.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_system_Device.ts.html b/docs/files/src_system_Device.ts.html
index e3b0bf4..030ebdc 100644
--- a/docs/files/src_system_Device.ts.html
+++ b/docs/files/src_system_Device.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_textures_SingleImage.ts.html b/docs/files/src_textures_SingleImage.ts.html
index 5dfe144..5967c11 100644
--- a/docs/files/src_textures_SingleImage.ts.html
+++ b/docs/files/src_textures_SingleImage.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_textures_SpriteSheet.ts.html b/docs/files/src_textures_SpriteSheet.ts.html
index 66bc5c9..24ebdb1 100644
--- a/docs/files/src_textures_SpriteSheet.ts.html
+++ b/docs/files/src_textures_SpriteSheet.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_textures_TextureAtlas.ts.html b/docs/files/src_textures_TextureAtlas.ts.html
index 1619955..8eb6369 100644
--- a/docs/files/src_textures_TextureAtlas.ts.html
+++ b/docs/files/src_textures_TextureAtlas.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_textures_TextureLibrary.ts.html b/docs/files/src_textures_TextureLibrary.ts.html
index 2c15424..d689a9b 100644
--- a/docs/files/src_textures_TextureLibrary.ts.html
+++ b/docs/files/src_textures_TextureLibrary.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_time_Clock.ts.html b/docs/files/src_time_Clock.ts.html
index 67e4c5e..1cf3164 100644
--- a/docs/files/src_time_Clock.ts.html
+++ b/docs/files/src_time_Clock.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_time_ClockManager.ts.html b/docs/files/src_time_ClockManager.ts.html
index db100e9..6687c8e 100644
--- a/docs/files/src_time_ClockManager.ts.html
+++ b/docs/files/src_time_ClockManager.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_time_MasterClock.ts.html b/docs/files/src_time_MasterClock.ts.html
index 8f3f4f4..c6d094b 100644
--- a/docs/files/src_time_MasterClock.ts.html
+++ b/docs/files/src_time_MasterClock.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_time_Timer.ts.html b/docs/files/src_time_Timer.ts.html
index a56d889..b81f0b0 100644
--- a/docs/files/src_time_Timer.ts.html
+++ b/docs/files/src_time_Timer.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_time_TimerEvent.ts.html b/docs/files/src_time_TimerEvent.ts.html
index cdc1083..0059a06 100644
--- a/docs/files/src_time_TimerEvent.ts.html
+++ b/docs/files/src_time_TimerEvent.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_utils_Canvas.ts.html b/docs/files/src_utils_Canvas.ts.html
index e99d018..cb6cecd 100644
--- a/docs/files/src_utils_Canvas.ts.html
+++ b/docs/files/src_utils_Canvas.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_utils_Common.ts.html b/docs/files/src_utils_Common.ts.html
index d8f1a02..c7ba32a 100644
--- a/docs/files/src_utils_Common.ts.html
+++ b/docs/files/src_utils_Common.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_utils_GameMath.ts.html b/docs/files/src_utils_GameMath.ts.html
index 26e3a9b..7984388 100644
--- a/docs/files/src_utils_GameMath.ts.html
+++ b/docs/files/src_utils_GameMath.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_utils_RandomDataGenerator.ts.html b/docs/files/src_utils_RandomDataGenerator.ts.html
index 7900886..23ffebd 100644
--- a/docs/files/src_utils_RandomDataGenerator.ts.html
+++ b/docs/files/src_utils_RandomDataGenerator.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_utils_RequestAnimationFrame.ts.html b/docs/files/src_utils_RequestAnimationFrame.ts.html
index d968770..e627cf3 100644
--- a/docs/files/src_utils_RequestAnimationFrame.ts.html
+++ b/docs/files/src_utils_RequestAnimationFrame.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/files/src_utils_Version.ts.html b/docs/files/src_utils_Version.ts.html
index 932b0ae..16c5d2b 100644
--- a/docs/files/src_utils_Version.ts.html
+++ b/docs/files/src_utils_Version.ts.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/index.html b/docs/index.html
index fbce4cc..29f2d02 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Animations.html b/docs/modules/Animations.html
index 60aa784..7d8ac37 100644
--- a/docs/modules/Animations.html
+++ b/docs/modules/Animations.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Components.html b/docs/modules/Components.html
index f08591b..c97e3b8 100644
--- a/docs/modules/Components.html
+++ b/docs/modules/Components.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Easing.html b/docs/modules/Easing.html
index 48d519a..92e8ab2 100644
--- a/docs/modules/Easing.html
+++ b/docs/modules/Easing.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Files.html b/docs/modules/Files.html
index 92ff8a8..98ed563 100644
--- a/docs/modules/Files.html
+++ b/docs/modules/Files.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/GameObjects.html b/docs/modules/GameObjects.html
index d760fb0..3f2c9a0 100644
--- a/docs/modules/GameObjects.html
+++ b/docs/modules/GameObjects.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Geom.html b/docs/modules/Geom.html
index 0424580..e0d9dc5 100644
--- a/docs/modules/Geom.html
+++ b/docs/modules/Geom.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/HUD.html b/docs/modules/HUD.html
index c4d0133..ac3ea55 100644
--- a/docs/modules/HUD.html
+++ b/docs/modules/HUD.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/HUDComponents.html b/docs/modules/HUDComponents.html
index a86d9a4..de75a0d 100644
--- a/docs/modules/HUDComponents.html
+++ b/docs/modules/HUDComponents.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Input.html b/docs/modules/Input.html
index c5c15a5..341de08 100644
--- a/docs/modules/Input.html
+++ b/docs/modules/Input.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Kiwi.html b/docs/modules/Kiwi.html
index 9b7eaf3..77ae21e 100644
--- a/docs/modules/Kiwi.html
+++ b/docs/modules/Kiwi.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Renderers.html b/docs/modules/Renderers.html
index 012482b..719a332 100644
--- a/docs/modules/Renderers.html
+++ b/docs/modules/Renderers.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Shaders.html b/docs/modules/Shaders.html
index 91db004..0c7de8b 100644
--- a/docs/modules/Shaders.html
+++ b/docs/modules/Shaders.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Sound.html b/docs/modules/Sound.html
index c745ea1..3aa3a8b 100644
--- a/docs/modules/Sound.html
+++ b/docs/modules/Sound.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/System.html b/docs/modules/System.html
index 0ff3f94..fe68b29 100644
--- a/docs/modules/System.html
+++ b/docs/modules/System.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Textures.html b/docs/modules/Textures.html
index f4747d5..a490d0b 100644
--- a/docs/modules/Textures.html
+++ b/docs/modules/Textures.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Tilemap.html b/docs/modules/Tilemap.html
index df282df..cc8b2c2 100644
--- a/docs/modules/Tilemap.html
+++ b/docs/modules/Tilemap.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Time.html b/docs/modules/Time.html
index 867a64b..dc27009 100644
--- a/docs/modules/Time.html
+++ b/docs/modules/Time.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Tweens.html b/docs/modules/Tweens.html
index 07b93c7..37aa5ea 100644
--- a/docs/modules/Tweens.html
+++ b/docs/modules/Tweens.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Utils.html b/docs/modules/Utils.html
index 12594aa..c61eb78 100644
--- a/docs/modules/Utils.html
+++ b/docs/modules/Utils.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/docs/modules/Widget.html b/docs/modules/Widget.html
index 421b7c7..7e3931b 100644
--- a/docs/modules/Widget.html
+++ b/docs/modules/Widget.html
@@ -19,7 +19,7 @@
             
         </div>
         <div class="yui3-u-1-4 version">
-            <em>API Docs for: 0.7.0</em>
+            <em>API Docs for: 1.0.0</em>
         </div>
     </div>
     <div id="bd" class="yui3-g">
diff --git a/examples/kiwi.js b/examples/kiwi.js
index db840dd..c3249e5 100644
--- a/examples/kiwi.js
+++ b/examples/kiwi.js
@@ -1,4 +1,4 @@
-﻿/**
+/**
 *
 * @module Kiwi
 *
@@ -29811,7 +29811,7 @@ var Kiwi;
     * @type string
     * @public
     */
-    Kiwi.VERSION = "0.7.0";
+    Kiwi.VERSION = "1.0.0";
 
     //DIFFERENT RENDERER STATIC VARIABLES
     /**
@@ -30004,3 +30004,32 @@ var Kiwi;
         d.prototype = new __();
     };
 })(Kiwi || (Kiwi = {}));
+
+/**
+ * @fileoverview gl-matrix - High performance matrix and vector operations
+ * @author Brandon Jones
+ * @author Colin MacKenzie IV
+ * @version 2.2.0
+ */
+/* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+  * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+  * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation 
+    and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
+(function(e){"use strict";var t={};typeof exports=="undefined"?typeof define=="function"&&typeof define.amd=="object"&&define.amd?(t.exports={},define(function(){return t.exports})):t.exports=typeof window!="undefined"?window:e:t.exports=exports,function(e){if(!t)var t=1e-6;if(!n)var n=typeof Float32Array!="undefined"?Float32Array:Array;if(!r)var r=Math.random;var i={};i.setMatrixArrayType=function(e){n=e},typeof e!="undefined"&&(e.glMatrix=i);var s={};s.create=function(){var e=new n(2);return e[0]=0,e[1]=0,e},s.clone=function(e){var t=new n(2);return t[0]=e[0],t[1]=e[1],t},s.fromValues=function(e,t){var r=new n(2);return r[0]=e,r[1]=t,r},s.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},s.set=function(e,t,n){return e[0]=t,e[1]=n,e},s.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},s.subtract=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},s.sub=s.subtract,s.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},s.mul=s.multiply,s.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},s.div=s.divide,s.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},s.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e},s.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},s.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},s.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},s.dist=s.distance,s.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r},s.sqrDist=s.squaredDistance,s.length=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},s.len=s.length,s.squaredLength=function(e){var t=e[0],n=e[1];return t*t+n*n},s.sqrLen=s.squaredLength,s.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},s.normalize=function(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},s.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},s.cross=function(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e},s.lerp=function(e,t,n,r){var i=t[0],s=t[1];return e[0]=i+r*(n[0]-i),e[1]=s+r*(n[1]-s),e},s.random=function(e,t){t=t||1;var n=r()*2*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e},s.transformMat2=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e},s.transformMat2d=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e},s.transformMat3=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e},s.transformMat4=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e},s.forEach=function(){var e=s.create();return function(t,n,r,i,s,o){var u,a;n||(n=2),r||(r=0),i?a=Math.min(i*n+r,t.length):a=t.length;for(u=r;u<a;u+=n)e[0]=t[u],e[1]=t[u+1],s(e,e,o),t[u]=e[0],t[u+1]=e[1];return t}}(),s.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},typeof e!="undefined"&&(e.vec2=s);var o={};o.create=function(){var e=new n(3);return e[0]=0,e[1]=0,e[2]=0,e},o.clone=function(e){var t=new n(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},o.fromValues=function(e,t,r){var i=new n(3);return i[0]=e,i[1]=t,i[2]=r,i},o.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},o.set=function(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e},o.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e},o.subtract=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},o.sub=o.subtract,o.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e},o.mul=o.multiply,o.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e},o.div=o.divide,o.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e},o.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e},o.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e},o.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e},o.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(n*n+r*r+i*i)},o.dist=o.distance,o.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i},o.sqrDist=o.squaredDistance,o.length=function(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)},o.len=o.length,o.squaredLength=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r},o.sqrLen=o.squaredLength,o.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},o.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],s=n*n+r*r+i*i;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s),e},o.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},o.cross=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=n[0],u=n[1],a=n[2];return e[0]=i*a-s*u,e[1]=s*o-r*a,e[2]=r*u-i*o,e},o.lerp=function(e,t,n,r){var i=t[0],s=t[1],o=t[2];return e[0]=i+r*(n[0]-i),e[1]=s+r*(n[1]-s),e[2]=o+r*(n[2]-o),e},o.random=function(e,t){t=t||1;var n=r()*2*Math.PI,i=r()*2-1,s=Math.sqrt(1-i*i)*t;return e[0]=Math.cos(n)*s,e[1]=Math.sin(n)*s,e[2]=i*t,e},o.transformMat4=function(e,t,n){var r=t[0],i=t[1],s=t[2];return e[0]=n[0]*r+n[4]*i+n[8]*s+n[12],e[1]=n[1]*r+n[5]*i+n[9]*s+n[13],e[2]=n[2]*r+n[6]*i+n[10]*s+n[14],e},o.transformMat3=function(e,t,n){var r=t[0],i=t[1],s=t[2];return e[0]=r*n[0]+i*n[3]+s*n[6],e[1]=r*n[1]+i*n[4]+s*n[7],e[2]=r*n[2]+i*n[5]+s*n[8],e},o.transformQuat=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=n[0],u=n[1],a=n[2],f=n[3],l=f*r+u*s-a*i,c=f*i+a*r-o*s,h=f*s+o*i-u*r,p=-o*r-u*i-a*s;return e[0]=l*f+p*-o+c*-a-h*-u,e[1]=c*f+p*-u+h*-o-l*-a,e[2]=h*f+p*-a+l*-u-c*-o,e},o.forEach=function(){var e=o.create();return function(t,n,r,i,s,o){var u,a;n||(n=3),r||(r=0),i?a=Math.min(i*n+r,t.length):a=t.length;for(u=r;u<a;u+=n)e[0]=t[u],e[1]=t[u+1],e[2]=t[u+2],s(e,e,o),t[u]=e[0],t[u+1]=e[1],t[u+2]=e[2];return t}}(),o.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},typeof e!="undefined"&&(e.vec3=o);var u={};u.create=function(){var e=new n(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},u.clone=function(e){var t=new n(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},u.fromValues=function(e,t,r,i){var s=new n(4);return s[0]=e,s[1]=t,s[2]=r,s[3]=i,s},u.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},u.set=function(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e},u.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e},u.subtract=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e},u.sub=u.subtract,u.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e},u.mul=u.multiply,u.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e},u.div=u.divide,u.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e},u.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e},u.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e},u.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e},u.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],s=t[3]-e[3];return Math.sqrt(n*n+r*r+i*i+s*s)},u.dist=u.distance,u.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],s=t[3]-e[3];return n*n+r*r+i*i+s*s},u.sqrDist=u.squaredDistance,u.length=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return Math.sqrt(t*t+n*n+r*r+i*i)},u.len=u.length,u.squaredLength=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i},u.sqrLen=u.squaredLength,u.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},u.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=n*n+r*r+i*i+s*s;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o),e},u.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},u.lerp=function(e,t,n,r){var i=t[0],s=t[1],o=t[2],u=t[3];return e[0]=i+r*(n[0]-i),e[1]=s+r*(n[1]-s),e[2]=o+r*(n[2]-o),e[3]=u+r*(n[3]-u),e},u.random=function(e,t){return t=t||1,e[0]=r(),e[1]=r(),e[2]=r(),e[3]=r(),u.normalize(e,e),u.scale(e,e,t),e},u.transformMat4=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*s+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*s+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*s+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*s+n[15]*o,e},u.transformQuat=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=n[0],u=n[1],a=n[2],f=n[3],l=f*r+u*s-a*i,c=f*i+a*r-o*s,h=f*s+o*i-u*r,p=-o*r-u*i-a*s;return e[0]=l*f+p*-o+c*-a-h*-u,e[1]=c*f+p*-u+h*-o-l*-a,e[2]=h*f+p*-a+l*-u-c*-o,e},u.forEach=function(){var e=u.create();return function(t,n,r,i,s,o){var u,a;n||(n=4),r||(r=0),i?a=Math.min(i*n+r,t.length):a=t.length;for(u=r;u<a;u+=n)e[0]=t[u],e[1]=t[u+1],e[2]=t[u+2],e[3]=t[u+3],s(e,e,o),t[u]=e[0],t[u+1]=e[1],t[u+2]=e[2],t[u+3]=e[3];return t}}(),u.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},typeof e!="undefined"&&(e.vec4=u);var a={};a.create=function(){var e=new n(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},a.clone=function(e){var t=new n(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},a.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},a.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},a.transpose=function(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},a.invert=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=n*s-i*r;return o?(o=1/o,e[0]=s*o,e[1]=-r*o,e[2]=-i*o,e[3]=n*o,e):null},a.adjoint=function(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e},a.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},a.multiply=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=n[0],a=n[1],f=n[2],l=n[3];return e[0]=r*u+i*f,e[1]=r*a+i*l,e[2]=s*u+o*f,e[3]=s*a+o*l,e},a.mul=a.multiply,a.rotate=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=Math.sin(n),a=Math.cos(n);return e[0]=r*a+i*u,e[1]=r*-u+i*a,e[2]=s*a+o*u,e[3]=s*-u+o*a,e},a.scale=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=n[0],a=n[1];return e[0]=r*u,e[1]=i*a,e[2]=s*u,e[3]=o*a,e},a.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},typeof e!="undefined"&&(e.mat2=a);var f={};f.create=function(){var e=new n(6);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},f.clone=function(e){var t=new n(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},f.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},f.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},f.invert=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=n*s-r*i;return a?(a=1/a,e[0]=s*a,e[1]=-r*a,e[2]=-i*a,e[3]=n*a,e[4]=(i*u-s*o)*a,e[5]=(r*o-n*u)*a,e):null},f.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},f.multiply=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=n[0],l=n[1],c=n[2],h=n[3],p=n[4],d=n[5];return e[0]=r*f+i*c,e[1]=r*l+i*h,e[2]=s*f+o*c,e[3]=s*l+o*h,e[4]=f*u+c*a+p,e[5]=l*u+h*a+d,e},f.mul=f.multiply,f.rotate=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=Math.sin(n),l=Math.cos(n);return e[0]=r*l+i*f,e[1]=-r*f+i*l,e[2]=s*l+o*f,e[3]=-s*f+l*o,e[4]=l*u+f*a,e[5]=l*a-f*u,e},f.scale=function(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e},f.translate=function(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e},f.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},typeof e!="undefined"&&(e.mat2d=f);var l={};l.create=function(){var e=new n(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},l.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},l.clone=function(e){var t=new n(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},l.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},l.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},l.transpose=function(e,t){if(e===t){var n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},l.invert=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=t[6],f=t[7],l=t[8],c=l*o-u*f,h=-l*s+u*a,p=f*s-o*a,d=n*c+r*h+i*p;return d?(d=1/d,e[0]=c*d,e[1]=(-l*r+i*f)*d,e[2]=(u*r-i*o)*d,e[3]=h*d,e[4]=(l*n-i*a)*d,e[5]=(-u*n+i*s)*d,e[6]=p*d,e[7]=(-f*n+r*a)*d,e[8]=(o*n-r*s)*d,e):null},l.adjoint=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=t[6],f=t[7],l=t[8];return e[0]=o*l-u*f,e[1]=i*f-r*l,e[2]=r*u-i*o,e[3]=u*a-s*l,e[4]=n*l-i*a,e[5]=i*s-n*u,e[6]=s*f-o*a,e[7]=r*a-n*f,e[8]=n*o-r*s,e},l.determinant=function(e){var t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],o=e[5],u=e[6],a=e[7],f=e[8];return t*(f*s-o*a)+n*(-f*i+o*u)+r*(a*i-s*u)},l.multiply=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=t[6],l=t[7],c=t[8],h=n[0],p=n[1],d=n[2],v=n[3],m=n[4],g=n[5],y=n[6],b=n[7],w=n[8];return e[0]=h*r+p*o+d*f,e[1]=h*i+p*u+d*l,e[2]=h*s+p*a+d*c,e[3]=v*r+m*o+g*f,e[4]=v*i+m*u+g*l,e[5]=v*s+m*a+g*c,e[6]=y*r+b*o+w*f,e[7]=y*i+b*u+w*l,e[8]=y*s+b*a+w*c,e},l.mul=l.multiply,l.translate=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=t[6],l=t[7],c=t[8],h=n[0],p=n[1];return e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=u,e[5]=a,e[6]=h*r+p*o+f,e[7]=h*i+p*u+l,e[8]=h*s+p*a+c,e},l.rotate=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=t[6],l=t[7],c=t[8],h=Math.sin(n),p=Math.cos(n);return e[0]=p*r+h*o,e[1]=p*i+h*u,e[2]=p*s+h*a,e[3]=p*o-h*r,e[4]=p*u-h*i,e[5]=p*a-h*s,e[6]=f,e[7]=l,e[8]=c,e},l.scale=function(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},l.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},l.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=n+n,u=r+r,a=i+i,f=n*o,l=n*u,c=n*a,h=r*u,p=r*a,d=i*a,v=s*o,m=s*u,g=s*a;return e[0]=1-(h+d),e[3]=l+g,e[6]=c-m,e[1]=l-g,e[4]=1-(f+d),e[7]=p+v,e[2]=c+m,e[5]=p-v,e[8]=1-(f+h),e},l.normalFromMat4=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=t[6],f=t[7],l=t[8],c=t[9],h=t[10],p=t[11],d=t[12],v=t[13],m=t[14],g=t[15],y=n*u-r*o,b=n*a-i*o,w=n*f-s*o,E=r*a-i*u,S=r*f-s*u,x=i*f-s*a,T=l*v-c*d,N=l*m-h*d,C=l*g-p*d,k=c*m-h*v,L=c*g-p*v,A=h*g-p*m,O=y*A-b*L+w*k+E*C-S*N+x*T;return O?(O=1/O,e[0]=(u*A-a*L+f*k)*O,e[1]=(a*C-o*A-f*N)*O,e[2]=(o*L-u*C+f*T)*O,e[3]=(i*L-r*A-s*k)*O,e[4]=(n*A-i*C+s*N)*O,e[5]=(r*C-n*L-s*T)*O,e[6]=(v*x-m*S+g*E)*O,e[7]=(m*w-d*x-g*b)*O,e[8]=(d*S-v*w+g*y)*O,e):null},l.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},typeof e!="undefined"&&(e.mat3=l);var c={};c.create=function(){var e=new n(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},c.clone=function(e){var t=new n(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},c.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},c.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},c.transpose=function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],s=t[6],o=t[7],u=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=s,e[11]=t[14],e[12]=i,e[13]=o,e[14]=u}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},c.invert=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=t[6],f=t[7],l=t[8],c=t[9],h=t[10],p=t[11],d=t[12],v=t[13],m=t[14],g=t[15],y=n*u-r*o,b=n*a-i*o,w=n*f-s*o,E=r*a-i*u,S=r*f-s*u,x=i*f-s*a,T=l*v-c*d,N=l*m-h*d,C=l*g-p*d,k=c*m-h*v,L=c*g-p*v,A=h*g-p*m,O=y*A-b*L+w*k+E*C-S*N+x*T;return O?(O=1/O,e[0]=(u*A-a*L+f*k)*O,e[1]=(i*L-r*A-s*k)*O,e[2]=(v*x-m*S+g*E)*O,e[3]=(h*S-c*x-p*E)*O,e[4]=(a*C-o*A-f*N)*O,e[5]=(n*A-i*C+s*N)*O,e[6]=(m*w-d*x-g*b)*O,e[7]=(l*x-h*w+p*b)*O,e[8]=(o*L-u*C+f*T)*O,e[9]=(r*C-n*L-s*T)*O,e[10]=(d*S-v*w+g*y)*O,e[11]=(c*w-l*S-p*y)*O,e[12]=(u*N-o*k-a*T)*O,e[13]=(n*k-r*N+i*T)*O,e[14]=(v*b-d*E-m*y)*O,e[15]=(l*E-c*b+h*y)*O,e):null},c.adjoint=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=t[6],f=t[7],l=t[8],c=t[9],h=t[10],p=t[11],d=t[12],v=t[13],m=t[14],g=t[15];return e[0]=u*(h*g-p*m)-c*(a*g-f*m)+v*(a*p-f*h),e[1]=-(r*(h*g-p*m)-c*(i*g-s*m)+v*(i*p-s*h)),e[2]=r*(a*g-f*m)-u*(i*g-s*m)+v*(i*f-s*a),e[3]=-(r*(a*p-f*h)-u*(i*p-s*h)+c*(i*f-s*a)),e[4]=-(o*(h*g-p*m)-l*(a*g-f*m)+d*(a*p-f*h)),e[5]=n*(h*g-p*m)-l*(i*g-s*m)+d*(i*p-s*h),e[6]=-(n*(a*g-f*m)-o*(i*g-s*m)+d*(i*f-s*a)),e[7]=n*(a*p-f*h)-o*(i*p-s*h)+l*(i*f-s*a),e[8]=o*(c*g-p*v)-l*(u*g-f*v)+d*(u*p-f*c),e[9]=-(n*(c*g-p*v)-l*(r*g-s*v)+d*(r*p-s*c)),e[10]=n*(u*g-f*v)-o*(r*g-s*v)+d*(r*f-s*u),e[11]=-(n*(u*p-f*c)-o*(r*p-s*c)+l*(r*f-s*u)),e[12]=-(o*(c*m-h*v)-l*(u*m-a*v)+d*(u*h-a*c)),e[13]=n*(c*m-h*v)-l*(r*m-i*v)+d*(r*h-i*c),e[14]=-(n*(u*m-a*v)-o*(r*m-i*v)+d*(r*a-i*u)),e[15]=n*(u*h-a*c)-o*(r*h-i*c)+l*(r*a-i*u),e},c.determinant=function(e){var t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],o=e[5],u=e[6],a=e[7],f=e[8],l=e[9],c=e[10],h=e[11],p=e[12],d=e[13],v=e[14],m=e[15],g=t*o-n*s,y=t*u-r*s,b=t*a-i*s,w=n*u-r*o,E=n*a-i*o,S=r*a-i*u,x=f*d-l*p,T=f*v-c*p,N=f*m-h*p,C=l*v-c*d,k=l*m-h*d,L=c*m-h*v;return g*L-y*k+b*C+w*N-E*T+S*x},c.multiply=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=t[6],l=t[7],c=t[8],h=t[9],p=t[10],d=t[11],v=t[12],m=t[13],g=t[14],y=t[15],b=n[0],w=n[1],E=n[2],S=n[3];return e[0]=b*r+w*u+E*c+S*v,e[1]=b*i+w*a+E*h+S*m,e[2]=b*s+w*f+E*p+S*g,e[3]=b*o+w*l+E*d+S*y,b=n[4],w=n[5],E=n[6],S=n[7],e[4]=b*r+w*u+E*c+S*v,e[5]=b*i+w*a+E*h+S*m,e[6]=b*s+w*f+E*p+S*g,e[7]=b*o+w*l+E*d+S*y,b=n[8],w=n[9],E=n[10],S=n[11],e[8]=b*r+w*u+E*c+S*v,e[9]=b*i+w*a+E*h+S*m,e[10]=b*s+w*f+E*p+S*g,e[11]=b*o+w*l+E*d+S*y,b=n[12],w=n[13],E=n[14],S=n[15],e[12]=b*r+w*u+E*c+S*v,e[13]=b*i+w*a+E*h+S*m,e[14]=b*s+w*f+E*p+S*g,e[15]=b*o+w*l+E*d+S*y,e},c.mul=c.multiply,c.translate=function(e,t,n){var r=n[0],i=n[1],s=n[2],o,u,a,f,l,c,h,p,d,v,m,g;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*s+t[12],e[13]=t[1]*r+t[5]*i+t[9]*s+t[13],e[14]=t[2]*r+t[6]*i+t[10]*s+t[14],e[15]=t[3]*r+t[7]*i+t[11]*s+t[15]):(o=t[0],u=t[1],a=t[2],f=t[3],l=t[4],c=t[5],h=t[6],p=t[7],d=t[8],v=t[9],m=t[10],g=t[11],e[0]=o,e[1]=u,e[2]=a,e[3]=f,e[4]=l,e[5]=c,e[6]=h,e[7]=p,e[8]=d,e[9]=v,e[10]=m,e[11]=g,e[12]=o*r+l*i+d*s+t[12],e[13]=u*r+c*i+v*s+t[13],e[14]=a*r+h*i+m*s+t[14],e[15]=f*r+p*i+g*s+t[15]),e},c.scale=function(e,t,n){var r=n[0],i=n[1],s=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11]*s,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},c.rotate=function(e,n,r,i){var s=i[0],o=i[1],u=i[2],a=Math.sqrt(s*s+o*o+u*u),f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_;return Math.abs(a)<t?null:(a=1/a,s*=a,o*=a,u*=a,f=Math.sin(r),l=Math.cos(r),c=1-l,h=n[0],p=n[1],d=n[2],v=n[3],m=n[4],g=n[5],y=n[6],b=n[7],w=n[8],E=n[9],S=n[10],x=n[11],T=s*s*c+l,N=o*s*c+u*f,C=u*s*c-o*f,k=s*o*c-u*f,L=o*o*c+l,A=u*o*c+s*f,O=s*u*c+o*f,M=o*u*c-s*f,_=u*u*c+l,e[0]=h*T+m*N+w*C,e[1]=p*T+g*N+E*C,e[2]=d*T+y*N+S*C,e[3]=v*T+b*N+x*C,e[4]=h*k+m*L+w*A,e[5]=p*k+g*L+E*A,e[6]=d*k+y*L+S*A,e[7]=v*k+b*L+x*A,e[8]=h*O+m*M+w*_,e[9]=p*O+g*M+E*_,e[10]=d*O+y*M+S*_,e[11]=v*O+b*M+x*_,n!==e&&(e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15]),e)},c.rotateX=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),s=t[4],o=t[5],u=t[6],a=t[7],f=t[8],l=t[9],c=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=s*i+f*r,e[5]=o*i+l*r,e[6]=u*i+c*r,e[7]=a*i+h*r,e[8]=f*i-s*r,e[9]=l*i-o*r,e[10]=c*i-u*r,e[11]=h*i-a*r,e},c.rotateY=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),s=t[0],o=t[1],u=t[2],a=t[3],f=t[8],l=t[9],c=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*i-f*r,e[1]=o*i-l*r,e[2]=u*i-c*r,e[3]=a*i-h*r,e[8]=s*r+f*i,e[9]=o*r+l*i,e[10]=u*r+c*i,e[11]=a*r+h*i,e},c.rotateZ=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),s=t[0],o=t[1],u=t[2],a=t[3],f=t[4],l=t[5],c=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*i+f*r,e[1]=o*i+l*r,e[2]=u*i+c*r,e[3]=a*i+h*r,e[4]=f*i-s*r,e[5]=l*i-o*r,e[6]=c*i-u*r,e[7]=h*i-a*r,e},c.fromRotationTranslation=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=r+r,a=i+i,f=s+s,l=r*u,c=r*a,h=r*f,p=i*a,d=i*f,v=s*f,m=o*u,g=o*a,y=o*f;return e[0]=1-(p+v),e[1]=c+y,e[2]=h-g,e[3]=0,e[4]=c-y,e[5]=1-(l+v),e[6]=d+m,e[7]=0,e[8]=h+g,e[9]=d-m,e[10]=1-(l+p),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e},c.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=n+n,u=r+r,a=i+i,f=n*o,l=n*u,c=n*a,h=r*u,p=r*a,d=i*a,v=s*o,m=s*u,g=s*a;return e[0]=1-(h+d),e[1]=l+g,e[2]=c-m,e[3]=0,e[4]=l-g,e[5]=1-(f+d),e[6]=p+v,e[7]=0,e[8]=c+m,e[9]=p-v,e[10]=1-(f+h),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},c.frustum=function(e,t,n,r,i,s,o){var u=1/(n-t),a=1/(i-r),f=1/(s-o);return e[0]=s*2*u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s*2*a,e[6]=0,e[7]=0,e[8]=(n+t)*u,e[9]=(i+r)*a,e[10]=(o+s)*f,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*s*2*f,e[15]=0,e},c.perspective=function(e,t,n,r,i){var s=1/Math.tan(t/2),o=1/(r-i);return e[0]=s/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+r)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*r*o,e[15]=0,e},c.ortho=function(e,t,n,r,i,s,o){var u=1/(t-n),a=1/(r-i),f=1/(s-o);return e[0]=-2*u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*f,e[11]=0,e[12]=(t+n)*u,e[13]=(i+r)*a,e[14]=(o+s)*f,e[15]=1,e},c.lookAt=function(e,n,r,i){var s,o,u,a,f,l,h,p,d,v,m=n[0],g=n[1],y=n[2],b=i[0],w=i[1],E=i[2],S=r[0],x=r[1],T=r[2];return Math.abs(m-S)<t&&Math.abs(g-x)<t&&Math.abs(y-T)<t?c.identity(e):(h=m-S,p=g-x,d=y-T,v=1/Math.sqrt(h*h+p*p+d*d),h*=v,p*=v,d*=v,s=w*d-E*p,o=E*h-b*d,u=b*p-w*h,v=Math.sqrt(s*s+o*o+u*u),v?(v=1/v,s*=v,o*=v,u*=v):(s=0,o=0,u=0),a=p*u-d*o,f=d*s-h*u,l=h*o-p*s,v=Math.sqrt(a*a+f*f+l*l),v?(v=1/v,a*=v,f*=v,l*=v):(a=0,f=0,l=0),e[0]=s,e[1]=a,e[2]=h,e[3]=0,e[4]=o,e[5]=f,e[6]=p,e[7]=0,e[8]=u,e[9]=l,e[10]=d,e[11]=0,e[12]=-(s*m+o*g+u*y),e[13]=-(a*m+f*g+l*y),e[14]=-(h*m+p*g+d*y),e[15]=1,e)},c.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},typeof e!="undefined"&&(e.mat4=c);var h={};h.create=function(){var e=new n(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},h.rotationTo=function(){var e=o.create(),t=o.fromValues(1,0,0),n=o.fromValues(0,1,0);return function(r,i,s){var u=o.dot(i,s);return u<-0.999999?(o.cross(e,t,i),o.length(e)<1e-6&&o.cross(e,n,i),o.normalize(e,e),h.setAxisAngle(r,e,Math.PI),r):u>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(o.cross(e,i,s),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+u,h.normalize(r,r))}}(),h.setAxes=function(){var e=l.create();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=n[0],e[5]=n[1],e[8]=n[2],h.normalize(t,h.fromMat3(t,e))}}(),h.clone=u.clone,h.fromValues=u.fromValues,h.copy=u.copy,h.set=u.set,h.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},h.setAxisAngle=function(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e},h.add=u.add,h.multiply=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=n[0],a=n[1],f=n[2],l=n[3];return e[0]=r*l+o*u+i*f-s*a,e[1]=i*l+o*a+s*u-r*f,e[2]=s*l+o*f+r*a-i*u,e[3]=o*l-r*u-i*a-s*f,e},h.mul=h.multiply,h.scale=u.scale,h.rotateX=function(e,t,n){n*=.5;var r=t[0],i=t[1],s=t[2],o=t[3],u=Math.sin(n),a=Math.cos(n);return e[0]=r*a+o*u,e[1]=i*a+s*u,e[2]=s*a-i*u,e[3]=o*a-r*u,e},h.rotateY=function(e,t,n){n*=.5;var r=t[0],i=t[1],s=t[2],o=t[3],u=Math.sin(n),a=Math.cos(n);return e[0]=r*a-s*u,e[1]=i*a+o*u,e[2]=s*a+r*u,e[3]=o*a-i*u,e},h.rotateZ=function(e,t,n){n*=.5;var r=t[0],i=t[1],s=t[2],o=t[3],u=Math.sin(n),a=Math.cos(n);return e[0]=r*a+i*u,e[1]=i*a-r*u,e[2]=s*a+o*u,e[3]=o*a-s*u,e},h.calculateW=function(e,t){var n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=-Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e},h.dot=u.dot,h.lerp=u.lerp,h.slerp=function(e,t,n,r){var i=t[0],s=t[1],o=t[2],u=t[3],a=n[0],f=n[1],l=n[2],c=n[3],h,p,d,v,m;return p=i*a+s*f+o*l+u*c,p<0&&(p=-p,a=-a,f=-f,l=-l,c=-c),1-p>1e-6?(h=Math.acos(p),d=Math.sin(h),v=Math.sin((1-r)*h)/d,m=Math.sin(r*h)/d):(v=1-r,m=r),e[0]=v*i+m*a,e[1]=v*s+m*f,e[2]=v*o+m*l,e[3]=v*u+m*c,e},h.invert=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=n*n+r*r+i*i+s*s,u=o?1/o:0;return e[0]=-n*u,e[1]=-r*u,e[2]=-i*u,e[3]=s*u,e},h.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},h.length=u.length,h.len=h.length,h.squaredLength=u.squaredLength,h.sqrLen=h.squaredLength,h.normalize=u.normalize,h.fromMat3=function(){var e=typeof Int8Array!="undefined"?new Int8Array([1,2,0]):[1,2,0];return function(t,n){var r=n[0]+n[4]+n[8],i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(n[7]-n[5])*i,t[1]=(n[2]-n[6])*i,t[2]=(n[3]-n[1])*i;else{var s=0;n[4]>n[0]&&(s=1),n[8]>n[s*3+s]&&(s=2);var o=e[s],u=e[o];i=Math.sqrt(n[s*3+s]-n[o*3+o]-n[u*3+u]+1),t[s]=.5*i,i=.5/i,t[3]=(n[u*3+o]-n[o*3+u])*i,t[o]=(n[o*3+s]+n[s*3+o])*i,t[u]=(n[u*3+s]+n[s*3+u])*i}return t}}(),h.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},typeof e!="undefined"&&(e.quat=h)}(t.exports)})(this);
diff --git a/templateGame/lib/kiwi.js b/templateGame/lib/kiwi.js
index db840dd..c3249e5 100644
--- a/templateGame/lib/kiwi.js
+++ b/templateGame/lib/kiwi.js
@@ -1,4 +1,4 @@
-﻿/**
+/**
 *
 * @module Kiwi
 *
@@ -29811,7 +29811,7 @@ var Kiwi;
     * @type string
     * @public
     */
-    Kiwi.VERSION = "0.7.0";
+    Kiwi.VERSION = "1.0.0";
 
     //DIFFERENT RENDERER STATIC VARIABLES
     /**
@@ -30004,3 +30004,32 @@ var Kiwi;
         d.prototype = new __();
     };
 })(Kiwi || (Kiwi = {}));
+
+/**
+ * @fileoverview gl-matrix - High performance matrix and vector operations
+ * @author Brandon Jones
+ * @author Colin MacKenzie IV
+ * @version 2.2.0
+ */
+/* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+  * Redistributions of source code must retain the above copyright notice, this
+    list of conditions and the following disclaimer.
+  * Redistributions in binary form must reproduce the above copyright notice,
+    this list of conditions and the following disclaimer in the documentation 
+    and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
+(function(e){"use strict";var t={};typeof exports=="undefined"?typeof define=="function"&&typeof define.amd=="object"&&define.amd?(t.exports={},define(function(){return t.exports})):t.exports=typeof window!="undefined"?window:e:t.exports=exports,function(e){if(!t)var t=1e-6;if(!n)var n=typeof Float32Array!="undefined"?Float32Array:Array;if(!r)var r=Math.random;var i={};i.setMatrixArrayType=function(e){n=e},typeof e!="undefined"&&(e.glMatrix=i);var s={};s.create=function(){var e=new n(2);return e[0]=0,e[1]=0,e},s.clone=function(e){var t=new n(2);return t[0]=e[0],t[1]=e[1],t},s.fromValues=function(e,t){var r=new n(2);return r[0]=e,r[1]=t,r},s.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},s.set=function(e,t,n){return e[0]=t,e[1]=n,e},s.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},s.subtract=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},s.sub=s.subtract,s.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},s.mul=s.multiply,s.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},s.div=s.divide,s.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},s.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e},s.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},s.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e},s.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},s.dist=s.distance,s.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r},s.sqrDist=s.squaredDistance,s.length=function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},s.len=s.length,s.squaredLength=function(e){var t=e[0],n=e[1];return t*t+n*n},s.sqrLen=s.squaredLength,s.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},s.normalize=function(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i),e[0]=t[0]*i,e[1]=t[1]*i),e},s.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},s.cross=function(e,t,n){var r=t[0]*n[1]-t[1]*n[0];return e[0]=e[1]=0,e[2]=r,e},s.lerp=function(e,t,n,r){var i=t[0],s=t[1];return e[0]=i+r*(n[0]-i),e[1]=s+r*(n[1]-s),e},s.random=function(e,t){t=t||1;var n=r()*2*Math.PI;return e[0]=Math.cos(n)*t,e[1]=Math.sin(n)*t,e},s.transformMat2=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e},s.transformMat2d=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i+n[4],e[1]=n[1]*r+n[3]*i+n[5],e},s.transformMat3=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[3]*i+n[6],e[1]=n[1]*r+n[4]*i+n[7],e},s.transformMat4=function(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[4]*i+n[12],e[1]=n[1]*r+n[5]*i+n[13],e},s.forEach=function(){var e=s.create();return function(t,n,r,i,s,o){var u,a;n||(n=2),r||(r=0),i?a=Math.min(i*n+r,t.length):a=t.length;for(u=r;u<a;u+=n)e[0]=t[u],e[1]=t[u+1],s(e,e,o),t[u]=e[0],t[u+1]=e[1];return t}}(),s.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},typeof e!="undefined"&&(e.vec2=s);var o={};o.create=function(){var e=new n(3);return e[0]=0,e[1]=0,e[2]=0,e},o.clone=function(e){var t=new n(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},o.fromValues=function(e,t,r){var i=new n(3);return i[0]=e,i[1]=t,i[2]=r,i},o.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},o.set=function(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e},o.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e},o.subtract=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e},o.sub=o.subtract,o.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e},o.mul=o.multiply,o.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e},o.div=o.divide,o.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e},o.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e},o.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e},o.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e},o.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(n*n+r*r+i*i)},o.dist=o.distance,o.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return n*n+r*r+i*i},o.sqrDist=o.squaredDistance,o.length=function(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)},o.len=o.length,o.squaredLength=function(e){var t=e[0],n=e[1],r=e[2];return t*t+n*n+r*r},o.sqrLen=o.squaredLength,o.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},o.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],s=n*n+r*r+i*i;return s>0&&(s=1/Math.sqrt(s),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s),e},o.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},o.cross=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=n[0],u=n[1],a=n[2];return e[0]=i*a-s*u,e[1]=s*o-r*a,e[2]=r*u-i*o,e},o.lerp=function(e,t,n,r){var i=t[0],s=t[1],o=t[2];return e[0]=i+r*(n[0]-i),e[1]=s+r*(n[1]-s),e[2]=o+r*(n[2]-o),e},o.random=function(e,t){t=t||1;var n=r()*2*Math.PI,i=r()*2-1,s=Math.sqrt(1-i*i)*t;return e[0]=Math.cos(n)*s,e[1]=Math.sin(n)*s,e[2]=i*t,e},o.transformMat4=function(e,t,n){var r=t[0],i=t[1],s=t[2];return e[0]=n[0]*r+n[4]*i+n[8]*s+n[12],e[1]=n[1]*r+n[5]*i+n[9]*s+n[13],e[2]=n[2]*r+n[6]*i+n[10]*s+n[14],e},o.transformMat3=function(e,t,n){var r=t[0],i=t[1],s=t[2];return e[0]=r*n[0]+i*n[3]+s*n[6],e[1]=r*n[1]+i*n[4]+s*n[7],e[2]=r*n[2]+i*n[5]+s*n[8],e},o.transformQuat=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=n[0],u=n[1],a=n[2],f=n[3],l=f*r+u*s-a*i,c=f*i+a*r-o*s,h=f*s+o*i-u*r,p=-o*r-u*i-a*s;return e[0]=l*f+p*-o+c*-a-h*-u,e[1]=c*f+p*-u+h*-o-l*-a,e[2]=h*f+p*-a+l*-u-c*-o,e},o.forEach=function(){var e=o.create();return function(t,n,r,i,s,o){var u,a;n||(n=3),r||(r=0),i?a=Math.min(i*n+r,t.length):a=t.length;for(u=r;u<a;u+=n)e[0]=t[u],e[1]=t[u+1],e[2]=t[u+2],s(e,e,o),t[u]=e[0],t[u+1]=e[1],t[u+2]=e[2];return t}}(),o.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},typeof e!="undefined"&&(e.vec3=o);var u={};u.create=function(){var e=new n(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},u.clone=function(e){var t=new n(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},u.fromValues=function(e,t,r,i){var s=new n(4);return s[0]=e,s[1]=t,s[2]=r,s[3]=i,s},u.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},u.set=function(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e},u.add=function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e},u.subtract=function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e},u.sub=u.subtract,u.multiply=function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e[3]=t[3]*n[3],e},u.mul=u.multiply,u.divide=function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e[2]=t[2]/n[2],e[3]=t[3]/n[3],e},u.div=u.divide,u.min=function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e[3]=Math.min(t[3],n[3]),e},u.max=function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e[3]=Math.max(t[3],n[3]),e},u.scale=function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e},u.scaleAndAdd=function(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e},u.distance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],s=t[3]-e[3];return Math.sqrt(n*n+r*r+i*i+s*s)},u.dist=u.distance,u.squaredDistance=function(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],s=t[3]-e[3];return n*n+r*r+i*i+s*s},u.sqrDist=u.squaredDistance,u.length=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return Math.sqrt(t*t+n*n+r*r+i*i)},u.len=u.length,u.squaredLength=function(e){var t=e[0],n=e[1],r=e[2],i=e[3];return t*t+n*n+r*r+i*i},u.sqrLen=u.squaredLength,u.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e},u.normalize=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=n*n+r*r+i*i+s*s;return o>0&&(o=1/Math.sqrt(o),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e[3]=t[3]*o),e},u.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},u.lerp=function(e,t,n,r){var i=t[0],s=t[1],o=t[2],u=t[3];return e[0]=i+r*(n[0]-i),e[1]=s+r*(n[1]-s),e[2]=o+r*(n[2]-o),e[3]=u+r*(n[3]-u),e},u.random=function(e,t){return t=t||1,e[0]=r(),e[1]=r(),e[2]=r(),e[3]=r(),u.normalize(e,e),u.scale(e,e,t),e},u.transformMat4=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*s+n[12]*o,e[1]=n[1]*r+n[5]*i+n[9]*s+n[13]*o,e[2]=n[2]*r+n[6]*i+n[10]*s+n[14]*o,e[3]=n[3]*r+n[7]*i+n[11]*s+n[15]*o,e},u.transformQuat=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=n[0],u=n[1],a=n[2],f=n[3],l=f*r+u*s-a*i,c=f*i+a*r-o*s,h=f*s+o*i-u*r,p=-o*r-u*i-a*s;return e[0]=l*f+p*-o+c*-a-h*-u,e[1]=c*f+p*-u+h*-o-l*-a,e[2]=h*f+p*-a+l*-u-c*-o,e},u.forEach=function(){var e=u.create();return function(t,n,r,i,s,o){var u,a;n||(n=4),r||(r=0),i?a=Math.min(i*n+r,t.length):a=t.length;for(u=r;u<a;u+=n)e[0]=t[u],e[1]=t[u+1],e[2]=t[u+2],e[3]=t[u+3],s(e,e,o),t[u]=e[0],t[u+1]=e[1],t[u+2]=e[2],t[u+3]=e[3];return t}}(),u.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},typeof e!="undefined"&&(e.vec4=u);var a={};a.create=function(){var e=new n(4);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},a.clone=function(e){var t=new n(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},a.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},a.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},a.transpose=function(e,t){if(e===t){var n=t[1];e[1]=t[2],e[2]=n}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},a.invert=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=n*s-i*r;return o?(o=1/o,e[0]=s*o,e[1]=-r*o,e[2]=-i*o,e[3]=n*o,e):null},a.adjoint=function(e,t){var n=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=n,e},a.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},a.multiply=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=n[0],a=n[1],f=n[2],l=n[3];return e[0]=r*u+i*f,e[1]=r*a+i*l,e[2]=s*u+o*f,e[3]=s*a+o*l,e},a.mul=a.multiply,a.rotate=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=Math.sin(n),a=Math.cos(n);return e[0]=r*a+i*u,e[1]=r*-u+i*a,e[2]=s*a+o*u,e[3]=s*-u+o*a,e},a.scale=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=n[0],a=n[1];return e[0]=r*u,e[1]=i*a,e[2]=s*u,e[3]=o*a,e},a.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},typeof e!="undefined"&&(e.mat2=a);var f={};f.create=function(){var e=new n(6);return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},f.clone=function(e){var t=new n(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},f.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},f.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},f.invert=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=n*s-r*i;return a?(a=1/a,e[0]=s*a,e[1]=-r*a,e[2]=-i*a,e[3]=n*a,e[4]=(i*u-s*o)*a,e[5]=(r*o-n*u)*a,e):null},f.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},f.multiply=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=n[0],l=n[1],c=n[2],h=n[3],p=n[4],d=n[5];return e[0]=r*f+i*c,e[1]=r*l+i*h,e[2]=s*f+o*c,e[3]=s*l+o*h,e[4]=f*u+c*a+p,e[5]=l*u+h*a+d,e},f.mul=f.multiply,f.rotate=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=Math.sin(n),l=Math.cos(n);return e[0]=r*l+i*f,e[1]=-r*f+i*l,e[2]=s*l+o*f,e[3]=-s*f+l*o,e[4]=l*u+f*a,e[5]=l*a-f*u,e},f.scale=function(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e},f.translate=function(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e},f.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},typeof e!="undefined"&&(e.mat2d=f);var l={};l.create=function(){var e=new n(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},l.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},l.clone=function(e){var t=new n(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},l.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},l.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},l.transpose=function(e,t){if(e===t){var n=t[1],r=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},l.invert=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=t[6],f=t[7],l=t[8],c=l*o-u*f,h=-l*s+u*a,p=f*s-o*a,d=n*c+r*h+i*p;return d?(d=1/d,e[0]=c*d,e[1]=(-l*r+i*f)*d,e[2]=(u*r-i*o)*d,e[3]=h*d,e[4]=(l*n-i*a)*d,e[5]=(-u*n+i*s)*d,e[6]=p*d,e[7]=(-f*n+r*a)*d,e[8]=(o*n-r*s)*d,e):null},l.adjoint=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=t[6],f=t[7],l=t[8];return e[0]=o*l-u*f,e[1]=i*f-r*l,e[2]=r*u-i*o,e[3]=u*a-s*l,e[4]=n*l-i*a,e[5]=i*s-n*u,e[6]=s*f-o*a,e[7]=r*a-n*f,e[8]=n*o-r*s,e},l.determinant=function(e){var t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],o=e[5],u=e[6],a=e[7],f=e[8];return t*(f*s-o*a)+n*(-f*i+o*u)+r*(a*i-s*u)},l.multiply=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=t[6],l=t[7],c=t[8],h=n[0],p=n[1],d=n[2],v=n[3],m=n[4],g=n[5],y=n[6],b=n[7],w=n[8];return e[0]=h*r+p*o+d*f,e[1]=h*i+p*u+d*l,e[2]=h*s+p*a+d*c,e[3]=v*r+m*o+g*f,e[4]=v*i+m*u+g*l,e[5]=v*s+m*a+g*c,e[6]=y*r+b*o+w*f,e[7]=y*i+b*u+w*l,e[8]=y*s+b*a+w*c,e},l.mul=l.multiply,l.translate=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=t[6],l=t[7],c=t[8],h=n[0],p=n[1];return e[0]=r,e[1]=i,e[2]=s,e[3]=o,e[4]=u,e[5]=a,e[6]=h*r+p*o+f,e[7]=h*i+p*u+l,e[8]=h*s+p*a+c,e},l.rotate=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=t[6],l=t[7],c=t[8],h=Math.sin(n),p=Math.cos(n);return e[0]=p*r+h*o,e[1]=p*i+h*u,e[2]=p*s+h*a,e[3]=p*o-h*r,e[4]=p*u-h*i,e[5]=p*a-h*s,e[6]=f,e[7]=l,e[8]=c,e},l.scale=function(e,t,n){var r=n[0],i=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},l.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},l.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=n+n,u=r+r,a=i+i,f=n*o,l=n*u,c=n*a,h=r*u,p=r*a,d=i*a,v=s*o,m=s*u,g=s*a;return e[0]=1-(h+d),e[3]=l+g,e[6]=c-m,e[1]=l-g,e[4]=1-(f+d),e[7]=p+v,e[2]=c+m,e[5]=p-v,e[8]=1-(f+h),e},l.normalFromMat4=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=t[6],f=t[7],l=t[8],c=t[9],h=t[10],p=t[11],d=t[12],v=t[13],m=t[14],g=t[15],y=n*u-r*o,b=n*a-i*o,w=n*f-s*o,E=r*a-i*u,S=r*f-s*u,x=i*f-s*a,T=l*v-c*d,N=l*m-h*d,C=l*g-p*d,k=c*m-h*v,L=c*g-p*v,A=h*g-p*m,O=y*A-b*L+w*k+E*C-S*N+x*T;return O?(O=1/O,e[0]=(u*A-a*L+f*k)*O,e[1]=(a*C-o*A-f*N)*O,e[2]=(o*L-u*C+f*T)*O,e[3]=(i*L-r*A-s*k)*O,e[4]=(n*A-i*C+s*N)*O,e[5]=(r*C-n*L-s*T)*O,e[6]=(v*x-m*S+g*E)*O,e[7]=(m*w-d*x-g*b)*O,e[8]=(d*S-v*w+g*y)*O,e):null},l.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},typeof e!="undefined"&&(e.mat3=l);var c={};c.create=function(){var e=new n(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},c.clone=function(e){var t=new n(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},c.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},c.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},c.transpose=function(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],s=t[6],o=t[7],u=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=s,e[11]=t[14],e[12]=i,e[13]=o,e[14]=u}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},c.invert=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=t[6],f=t[7],l=t[8],c=t[9],h=t[10],p=t[11],d=t[12],v=t[13],m=t[14],g=t[15],y=n*u-r*o,b=n*a-i*o,w=n*f-s*o,E=r*a-i*u,S=r*f-s*u,x=i*f-s*a,T=l*v-c*d,N=l*m-h*d,C=l*g-p*d,k=c*m-h*v,L=c*g-p*v,A=h*g-p*m,O=y*A-b*L+w*k+E*C-S*N+x*T;return O?(O=1/O,e[0]=(u*A-a*L+f*k)*O,e[1]=(i*L-r*A-s*k)*O,e[2]=(v*x-m*S+g*E)*O,e[3]=(h*S-c*x-p*E)*O,e[4]=(a*C-o*A-f*N)*O,e[5]=(n*A-i*C+s*N)*O,e[6]=(m*w-d*x-g*b)*O,e[7]=(l*x-h*w+p*b)*O,e[8]=(o*L-u*C+f*T)*O,e[9]=(r*C-n*L-s*T)*O,e[10]=(d*S-v*w+g*y)*O,e[11]=(c*w-l*S-p*y)*O,e[12]=(u*N-o*k-a*T)*O,e[13]=(n*k-r*N+i*T)*O,e[14]=(v*b-d*E-m*y)*O,e[15]=(l*E-c*b+h*y)*O,e):null},c.adjoint=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=t[4],u=t[5],a=t[6],f=t[7],l=t[8],c=t[9],h=t[10],p=t[11],d=t[12],v=t[13],m=t[14],g=t[15];return e[0]=u*(h*g-p*m)-c*(a*g-f*m)+v*(a*p-f*h),e[1]=-(r*(h*g-p*m)-c*(i*g-s*m)+v*(i*p-s*h)),e[2]=r*(a*g-f*m)-u*(i*g-s*m)+v*(i*f-s*a),e[3]=-(r*(a*p-f*h)-u*(i*p-s*h)+c*(i*f-s*a)),e[4]=-(o*(h*g-p*m)-l*(a*g-f*m)+d*(a*p-f*h)),e[5]=n*(h*g-p*m)-l*(i*g-s*m)+d*(i*p-s*h),e[6]=-(n*(a*g-f*m)-o*(i*g-s*m)+d*(i*f-s*a)),e[7]=n*(a*p-f*h)-o*(i*p-s*h)+l*(i*f-s*a),e[8]=o*(c*g-p*v)-l*(u*g-f*v)+d*(u*p-f*c),e[9]=-(n*(c*g-p*v)-l*(r*g-s*v)+d*(r*p-s*c)),e[10]=n*(u*g-f*v)-o*(r*g-s*v)+d*(r*f-s*u),e[11]=-(n*(u*p-f*c)-o*(r*p-s*c)+l*(r*f-s*u)),e[12]=-(o*(c*m-h*v)-l*(u*m-a*v)+d*(u*h-a*c)),e[13]=n*(c*m-h*v)-l*(r*m-i*v)+d*(r*h-i*c),e[14]=-(n*(u*m-a*v)-o*(r*m-i*v)+d*(r*a-i*u)),e[15]=n*(u*h-a*c)-o*(r*h-i*c)+l*(r*a-i*u),e},c.determinant=function(e){var t=e[0],n=e[1],r=e[2],i=e[3],s=e[4],o=e[5],u=e[6],a=e[7],f=e[8],l=e[9],c=e[10],h=e[11],p=e[12],d=e[13],v=e[14],m=e[15],g=t*o-n*s,y=t*u-r*s,b=t*a-i*s,w=n*u-r*o,E=n*a-i*o,S=r*a-i*u,x=f*d-l*p,T=f*v-c*p,N=f*m-h*p,C=l*v-c*d,k=l*m-h*d,L=c*m-h*v;return g*L-y*k+b*C+w*N-E*T+S*x},c.multiply=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=t[4],a=t[5],f=t[6],l=t[7],c=t[8],h=t[9],p=t[10],d=t[11],v=t[12],m=t[13],g=t[14],y=t[15],b=n[0],w=n[1],E=n[2],S=n[3];return e[0]=b*r+w*u+E*c+S*v,e[1]=b*i+w*a+E*h+S*m,e[2]=b*s+w*f+E*p+S*g,e[3]=b*o+w*l+E*d+S*y,b=n[4],w=n[5],E=n[6],S=n[7],e[4]=b*r+w*u+E*c+S*v,e[5]=b*i+w*a+E*h+S*m,e[6]=b*s+w*f+E*p+S*g,e[7]=b*o+w*l+E*d+S*y,b=n[8],w=n[9],E=n[10],S=n[11],e[8]=b*r+w*u+E*c+S*v,e[9]=b*i+w*a+E*h+S*m,e[10]=b*s+w*f+E*p+S*g,e[11]=b*o+w*l+E*d+S*y,b=n[12],w=n[13],E=n[14],S=n[15],e[12]=b*r+w*u+E*c+S*v,e[13]=b*i+w*a+E*h+S*m,e[14]=b*s+w*f+E*p+S*g,e[15]=b*o+w*l+E*d+S*y,e},c.mul=c.multiply,c.translate=function(e,t,n){var r=n[0],i=n[1],s=n[2],o,u,a,f,l,c,h,p,d,v,m,g;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*s+t[12],e[13]=t[1]*r+t[5]*i+t[9]*s+t[13],e[14]=t[2]*r+t[6]*i+t[10]*s+t[14],e[15]=t[3]*r+t[7]*i+t[11]*s+t[15]):(o=t[0],u=t[1],a=t[2],f=t[3],l=t[4],c=t[5],h=t[6],p=t[7],d=t[8],v=t[9],m=t[10],g=t[11],e[0]=o,e[1]=u,e[2]=a,e[3]=f,e[4]=l,e[5]=c,e[6]=h,e[7]=p,e[8]=d,e[9]=v,e[10]=m,e[11]=g,e[12]=o*r+l*i+d*s+t[12],e[13]=u*r+c*i+v*s+t[13],e[14]=a*r+h*i+m*s+t[14],e[15]=f*r+p*i+g*s+t[15]),e},c.scale=function(e,t,n){var r=n[0],i=n[1],s=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11]*s,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},c.rotate=function(e,n,r,i){var s=i[0],o=i[1],u=i[2],a=Math.sqrt(s*s+o*o+u*u),f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_;return Math.abs(a)<t?null:(a=1/a,s*=a,o*=a,u*=a,f=Math.sin(r),l=Math.cos(r),c=1-l,h=n[0],p=n[1],d=n[2],v=n[3],m=n[4],g=n[5],y=n[6],b=n[7],w=n[8],E=n[9],S=n[10],x=n[11],T=s*s*c+l,N=o*s*c+u*f,C=u*s*c-o*f,k=s*o*c-u*f,L=o*o*c+l,A=u*o*c+s*f,O=s*u*c+o*f,M=o*u*c-s*f,_=u*u*c+l,e[0]=h*T+m*N+w*C,e[1]=p*T+g*N+E*C,e[2]=d*T+y*N+S*C,e[3]=v*T+b*N+x*C,e[4]=h*k+m*L+w*A,e[5]=p*k+g*L+E*A,e[6]=d*k+y*L+S*A,e[7]=v*k+b*L+x*A,e[8]=h*O+m*M+w*_,e[9]=p*O+g*M+E*_,e[10]=d*O+y*M+S*_,e[11]=v*O+b*M+x*_,n!==e&&(e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15]),e)},c.rotateX=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),s=t[4],o=t[5],u=t[6],a=t[7],f=t[8],l=t[9],c=t[10],h=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=s*i+f*r,e[5]=o*i+l*r,e[6]=u*i+c*r,e[7]=a*i+h*r,e[8]=f*i-s*r,e[9]=l*i-o*r,e[10]=c*i-u*r,e[11]=h*i-a*r,e},c.rotateY=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),s=t[0],o=t[1],u=t[2],a=t[3],f=t[8],l=t[9],c=t[10],h=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*i-f*r,e[1]=o*i-l*r,e[2]=u*i-c*r,e[3]=a*i-h*r,e[8]=s*r+f*i,e[9]=o*r+l*i,e[10]=u*r+c*i,e[11]=a*r+h*i,e},c.rotateZ=function(e,t,n){var r=Math.sin(n),i=Math.cos(n),s=t[0],o=t[1],u=t[2],a=t[3],f=t[4],l=t[5],c=t[6],h=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=s*i+f*r,e[1]=o*i+l*r,e[2]=u*i+c*r,e[3]=a*i+h*r,e[4]=f*i-s*r,e[5]=l*i-o*r,e[6]=c*i-u*r,e[7]=h*i-a*r,e},c.fromRotationTranslation=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=r+r,a=i+i,f=s+s,l=r*u,c=r*a,h=r*f,p=i*a,d=i*f,v=s*f,m=o*u,g=o*a,y=o*f;return e[0]=1-(p+v),e[1]=c+y,e[2]=h-g,e[3]=0,e[4]=c-y,e[5]=1-(l+v),e[6]=d+m,e[7]=0,e[8]=h+g,e[9]=d-m,e[10]=1-(l+p),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e},c.fromQuat=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=n+n,u=r+r,a=i+i,f=n*o,l=n*u,c=n*a,h=r*u,p=r*a,d=i*a,v=s*o,m=s*u,g=s*a;return e[0]=1-(h+d),e[1]=l+g,e[2]=c-m,e[3]=0,e[4]=l-g,e[5]=1-(f+d),e[6]=p+v,e[7]=0,e[8]=c+m,e[9]=p-v,e[10]=1-(f+h),e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},c.frustum=function(e,t,n,r,i,s,o){var u=1/(n-t),a=1/(i-r),f=1/(s-o);return e[0]=s*2*u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s*2*a,e[6]=0,e[7]=0,e[8]=(n+t)*u,e[9]=(i+r)*a,e[10]=(o+s)*f,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*s*2*f,e[15]=0,e},c.perspective=function(e,t,n,r,i){var s=1/Math.tan(t/2),o=1/(r-i);return e[0]=s/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+r)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*r*o,e[15]=0,e},c.ortho=function(e,t,n,r,i,s,o){var u=1/(t-n),a=1/(r-i),f=1/(s-o);return e[0]=-2*u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*f,e[11]=0,e[12]=(t+n)*u,e[13]=(i+r)*a,e[14]=(o+s)*f,e[15]=1,e},c.lookAt=function(e,n,r,i){var s,o,u,a,f,l,h,p,d,v,m=n[0],g=n[1],y=n[2],b=i[0],w=i[1],E=i[2],S=r[0],x=r[1],T=r[2];return Math.abs(m-S)<t&&Math.abs(g-x)<t&&Math.abs(y-T)<t?c.identity(e):(h=m-S,p=g-x,d=y-T,v=1/Math.sqrt(h*h+p*p+d*d),h*=v,p*=v,d*=v,s=w*d-E*p,o=E*h-b*d,u=b*p-w*h,v=Math.sqrt(s*s+o*o+u*u),v?(v=1/v,s*=v,o*=v,u*=v):(s=0,o=0,u=0),a=p*u-d*o,f=d*s-h*u,l=h*o-p*s,v=Math.sqrt(a*a+f*f+l*l),v?(v=1/v,a*=v,f*=v,l*=v):(a=0,f=0,l=0),e[0]=s,e[1]=a,e[2]=h,e[3]=0,e[4]=o,e[5]=f,e[6]=p,e[7]=0,e[8]=u,e[9]=l,e[10]=d,e[11]=0,e[12]=-(s*m+o*g+u*y),e[13]=-(a*m+f*g+l*y),e[14]=-(h*m+p*g+d*y),e[15]=1,e)},c.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},typeof e!="undefined"&&(e.mat4=c);var h={};h.create=function(){var e=new n(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},h.rotationTo=function(){var e=o.create(),t=o.fromValues(1,0,0),n=o.fromValues(0,1,0);return function(r,i,s){var u=o.dot(i,s);return u<-0.999999?(o.cross(e,t,i),o.length(e)<1e-6&&o.cross(e,n,i),o.normalize(e,e),h.setAxisAngle(r,e,Math.PI),r):u>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(o.cross(e,i,s),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+u,h.normalize(r,r))}}(),h.setAxes=function(){var e=l.create();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=n[0],e[5]=n[1],e[8]=n[2],h.normalize(t,h.fromMat3(t,e))}}(),h.clone=u.clone,h.fromValues=u.fromValues,h.copy=u.copy,h.set=u.set,h.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e},h.setAxisAngle=function(e,t,n){n*=.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e},h.add=u.add,h.multiply=function(e,t,n){var r=t[0],i=t[1],s=t[2],o=t[3],u=n[0],a=n[1],f=n[2],l=n[3];return e[0]=r*l+o*u+i*f-s*a,e[1]=i*l+o*a+s*u-r*f,e[2]=s*l+o*f+r*a-i*u,e[3]=o*l-r*u-i*a-s*f,e},h.mul=h.multiply,h.scale=u.scale,h.rotateX=function(e,t,n){n*=.5;var r=t[0],i=t[1],s=t[2],o=t[3],u=Math.sin(n),a=Math.cos(n);return e[0]=r*a+o*u,e[1]=i*a+s*u,e[2]=s*a-i*u,e[3]=o*a-r*u,e},h.rotateY=function(e,t,n){n*=.5;var r=t[0],i=t[1],s=t[2],o=t[3],u=Math.sin(n),a=Math.cos(n);return e[0]=r*a-s*u,e[1]=i*a+o*u,e[2]=s*a+r*u,e[3]=o*a-i*u,e},h.rotateZ=function(e,t,n){n*=.5;var r=t[0],i=t[1],s=t[2],o=t[3],u=Math.sin(n),a=Math.cos(n);return e[0]=r*a+i*u,e[1]=i*a-r*u,e[2]=s*a+o*u,e[3]=o*a-s*u,e},h.calculateW=function(e,t){var n=t[0],r=t[1],i=t[2];return e[0]=n,e[1]=r,e[2]=i,e[3]=-Math.sqrt(Math.abs(1-n*n-r*r-i*i)),e},h.dot=u.dot,h.lerp=u.lerp,h.slerp=function(e,t,n,r){var i=t[0],s=t[1],o=t[2],u=t[3],a=n[0],f=n[1],l=n[2],c=n[3],h,p,d,v,m;return p=i*a+s*f+o*l+u*c,p<0&&(p=-p,a=-a,f=-f,l=-l,c=-c),1-p>1e-6?(h=Math.acos(p),d=Math.sin(h),v=Math.sin((1-r)*h)/d,m=Math.sin(r*h)/d):(v=1-r,m=r),e[0]=v*i+m*a,e[1]=v*s+m*f,e[2]=v*o+m*l,e[3]=v*u+m*c,e},h.invert=function(e,t){var n=t[0],r=t[1],i=t[2],s=t[3],o=n*n+r*r+i*i+s*s,u=o?1/o:0;return e[0]=-n*u,e[1]=-r*u,e[2]=-i*u,e[3]=s*u,e},h.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},h.length=u.length,h.len=h.length,h.squaredLength=u.squaredLength,h.sqrLen=h.squaredLength,h.normalize=u.normalize,h.fromMat3=function(){var e=typeof Int8Array!="undefined"?new Int8Array([1,2,0]):[1,2,0];return function(t,n){var r=n[0]+n[4]+n[8],i;if(r>0)i=Math.sqrt(r+1),t[3]=.5*i,i=.5/i,t[0]=(n[7]-n[5])*i,t[1]=(n[2]-n[6])*i,t[2]=(n[3]-n[1])*i;else{var s=0;n[4]>n[0]&&(s=1),n[8]>n[s*3+s]&&(s=2);var o=e[s],u=e[o];i=Math.sqrt(n[s*3+s]-n[o*3+o]-n[u*3+u]+1),t[s]=.5*i,i=.5/i,t[3]=(n[u*3+o]-n[o*3+u])*i,t[o]=(n[o*3+s]+n[s*3+o])*i,t[u]=(n[u*3+s]+n[s*3+u])*i}return t}}(),h.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},typeof e!="undefined"&&(e.quat=h)}(t.exports)})(this);

From 47dcf64fc70d65d2be866909d117cd9f631e5403 Mon Sep 17 00:00:00 2001
From: Ross Kettle <ross.p.kettle@gmail.com>
Date: Wed, 28 May 2014 14:15:59 +1200
Subject: [PATCH 2/3] updated license

---
 license.txt | 389 ++++--------------------------------------------------------
 1 file changed, 21 insertions(+), 368 deletions(-)

diff --git a/license.txt b/license.txt
index f81b725..006f7fa 100644
--- a/license.txt
+++ b/license.txt
@@ -1,368 +1,21 @@
-Kiwi.js is releases under the GPL2 license
-
-Copyright 2013 by the contributors
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
-
-
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-
-                    GNU GENERAL PUBLIC LICENSE
-                       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                            Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                            NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                     END OF TERMS AND CONDITIONS
-
-            How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
-
-WRITTEN OFFER
-
-The source code for any program binaries or compressed scripts that are
-included with Kiwi.js can be freely obtained at the following URL:
-
-	https://github.com/gamelab/kiwi.js
+The MIT License (MIT)
+
+Copyright (c) 2014 Gamelab
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file

From 7c3d34bddf0dafb164447810806be3779bfbedd1 Mon Sep 17 00:00:00 2001
From: Hector Zarco <hezarco@gmail.com>
Date: Tue, 3 Jun 2014 11:43:35 +0200
Subject: [PATCH 3/3] Adding clarity to the Gruntfile

---
 gruntfile.js | 135 +++++++++++++++++++++++++++--------------------------------
 package.json |   3 +-
 2 files changed, 63 insertions(+), 75 deletions(-)

diff --git a/gruntfile.js b/gruntfile.js
index c7af692..cdbbd75 100644
--- a/gruntfile.js
+++ b/gruntfile.js
@@ -1,5 +1,7 @@
 module.exports = function(grunt) {
 
+  require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
+
   // Project configuration.
   grunt.initConfig({
     pkg: grunt.file.readJSON('package.json'),
@@ -7,53 +9,53 @@ module.exports = function(grunt) {
     BASE_PATH: '',
     DEVELOPMENT_PATH: '',
 
-    ts: {            
-        build: {                          
-            src: ["./src/**/*.ts"],    
-            out: './build/kiwi.js',    
-           
-            options: {                    
-                target: 'es5',            
-                module: 'commonjs',       
-                sourcemap: false,         
-                declaration: true,       
-                comments: true           
-            },
-        }
+    ts: {
+      build: {
+        src: ["./src/**/*.ts"],
+        out: './build/kiwi.js',
+
+        options: {
+          target: 'es5',
+          module: 'commonjs',
+          sourcemap: false,
+          declaration: true,
+          comments: true
+        },
+      }
     },
 
     yuidoc: {
-            compile: {
-                name: '<%= pkg.name %>',
-                description: '<%= pkg.description %>',
-                version: '<%= pkg.version %>',
-                url: '<%= pkg.homepage %>',
-                options: {
-                    extension: '.ts',                               
-                    paths: '<%= DEVELOPMENT_PATH %>' + 'src/',
-                    outdir: '<%= BASE_PATH %>' + 'docs/'
-                }
-            }
-        },
+      compile: {
+        name: '<%= pkg.name %>',
+        description: '<%= pkg.description %>',
+        version: '<%= pkg.version %>',
+        url: '<%= pkg.homepage %>',
+
+        options: {
+          extension: '.ts',
+          paths: '<%= DEVELOPMENT_PATH %>' + 'src/',
+          outdir: '<%= BASE_PATH %>' + 'docs/'
+        }
+      }
+    },
 
     uglify: {
-            build: {
-                files: {
-                'build/kiwi.min.js': ['build/kiwi.js']
-            }
+      build: {
+        files: {
+          'build/kiwi.min.js': ['build/kiwi.js']
         }
+      }
     },
 
     concat: {
-          build: {
-            src:['build/kiwi.js','src/gl-matrix-min.js'],
-            dest: 'build/kiwi.js'
-          },
-          buildmin: {
-            src:['build/kiwi.min.js','src/gl-matrix-min.js'],
-            dest: 'build/kiwi.min.js'
-          }
-          
+      build: {
+        src: ['build/kiwi.js', 'src/gl-matrix-min.js'],
+        dest: 'build/kiwi.js'
+      },
+      buildmin: {
+        src: ['build/kiwi.min.js', 'src/gl-matrix-min.js'],
+        dest: 'build/kiwi.min.js'
+      }
     },
 
     tslint: {
@@ -66,46 +68,31 @@ module.exports = function(grunt) {
     },
 
     copy: {
-        doclogo: {
-    		    src: 'docstyles/logo.png',
-            dest: 'docs/assets/css/logo.png'
-    	  },
-       	    
-        docstyles: {
-          src: 'docstyles/main.css',
-        	dest: 'docs/assets/css/main.css'
-    	  },
-
-        templateGame: {
-          src: './build/kiwi.js',
-          dest: './templateGame/lib/kiwi.js'
-        },
-
-        example: {
-          src: './build/kiwi.js',
-          dest: './examples/kiwi.js'
-        }
-
-    }
-
-
- });
-
-  grunt.loadNpmTasks("grunt-ts");
-
-  grunt.loadNpmTasks('grunt-contrib-uglify');
+      doclogo: {
+        src: 'docstyles/logo.png',
+        dest: 'docs/assets/css/logo.png'
+      },
 
-  grunt.loadNpmTasks('grunt-contrib-yuidoc');
+      docstyles: {
+        src: 'docstyles/main.css',
+        dest: 'docs/assets/css/main.css'
+      },
 
-  grunt.loadNpmTasks('grunt-contrib-copy');
+      templateGame: {
+        src: './build/kiwi.js',
+        dest: './templateGame/lib/kiwi.js'
+      },
 
-  grunt.loadNpmTasks('grunt-tslint'); 
-  
-  grunt.loadNpmTasks('grunt-contrib-concat');
+      example: {
+        src: './build/kiwi.js',
+        dest: './examples/kiwi.js'
+      }
+    }
+  });
 
-  grunt.registerTask("default", ["ts:build", "tslint","concat:build","uglify:build","copy:templateGame","copy:example"]);
-  grunt.registerTask("full", ["ts:build","concat:build","uglify:build","yuidoc:compile","copy:templateGame","copy:example","copy:doclogo","copy:docstyles"]);
-  grunt.registerTask("docs", ["yuidoc:compile","copy:doclogo","copy:docstyles"]);
+  grunt.registerTask("default", ["ts:build", "tslint", "concat:build", "uglify:build", "copy:templateGame", "copy:example"]);
+  grunt.registerTask("full", ["ts:build", "concat:build", "uglify:build", "yuidoc:compile", "copy:templateGame", "copy:example", "copy:doclogo", "copy:docstyles"]);
+  grunt.registerTask("docs", ["yuidoc:compile", "copy:doclogo", "copy:docstyles"]);
   grunt.registerTask("join", ["concat:build"]);
 
 };
\ No newline at end of file
diff --git a/package.json b/package.json
index efbf663..66759da 100644
--- a/package.json
+++ b/package.json
@@ -3,7 +3,7 @@
     "version": "1.0.0",
     "description": "Kiwi.js is a Javascript/Typescript library for creating HTML5 games.",
     "author": "GameLab",
-    
+
     "homepage": "http://kiwijs.org/",
     "bugs": "https://github.com/gamelab/kiwi.js/issues?state=open",
     "license": "MIT",
@@ -18,6 +18,7 @@
 
     "dependencies": {},
     "devDependencies": {
+        "matchdep": "~0.1.2",
         "grunt": "~0.4.x",
         "grunt-contrib-uglify": "0.2.x",
         "typescript": "0.9.5",
