@@ -2707,8 +2707,7 @@ var Kiwi;
27072707 if (this.deviceTargetOption === Kiwi.TARGET_BROWSER) {
27082708 if (domParent !== '') {
27092709 if (document.getElementById(domParent))
2710- console.log('Game being created inside ' + domParent + '.');
2711- else
2710+ console.log('Game being created inside ' + domParent + '.'); else
27122711 console.log('The element "' + domParent + '" could not be found. Appending the game to the body.');
27132712 } else {
27142713 console.log('No DOM parent specified. Appending the game to the body.');
@@ -2977,7 +2976,6 @@ var Kiwi;
29772976 //if (this.containsDescendant(val) === false) {
29782977 this.transform.parent = (val !== null) ? val.transform : null;
29792978 this._parent = val;
2980- //}
29812979 },
29822980 enumerable: true,
29832981 configurable: true
@@ -3972,17 +3970,17 @@ var Kiwi;
39723970 })();
39733971 Kiwi.PluginManager = PluginManager;
39743972})(Kiwi || (Kiwi = {}));
3975- /**
3976- *
3977- * @module Kiwi
3978- *
3979- */
39803973var __extends = this.__extends || function (d, b) {
39813974 for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
39823975 function __() { this.constructor = d; }
39833976 __.prototype = b.prototype;
39843977 d.prototype = new __();
39853978};
3979+ /**
3980+ *
3981+ * @module Kiwi
3982+ *
3983+ */
39863984var Kiwi;
39873985(function (Kiwi) {
39883986 /**
@@ -4345,11 +4343,6 @@ var Kiwi;
43454343* @module Kiwi
43464344*
43474345*/
4348- /**
4349- *
4350- * @module Kiwi
4351- *
4352- */
43534346var Kiwi;
43544347(function (Kiwi) {
43554348 /**
@@ -5059,7 +5052,6 @@ var Kiwi;
50595052 Stage.prototype._createCompositeCanvas = function () {
50605053 if (this._game.deviceTargetOption == Kiwi.TARGET_COCOON) {
50615054 this.canvas = document.createElement(navigator['isCocoonJS'] ? 'screencanvas' : 'canvas');
5062- //otherwise default to normal canvas
50635055 } else {
50645056 this.canvas = document.createElement("canvas");
50655057 }
@@ -5094,7 +5086,6 @@ var Kiwi;
50945086 */
50955087 Stage.prototype._createDebugCanvas = function () {
50965088 if (this._game.deviceTargetOption === Kiwi.TARGET_COCOON) {
5097- //debug canvas not supported in cocoon, creating canvas and context anyway.
50985089 }
50995090 this.debugCanvas = document.createElement("canvas");
51005091 this.debugCanvas.id = this._game.id + "debugCanvas";
@@ -5188,7 +5179,6 @@ var Kiwi;
51885179
51895180 if (this._animations['default']) {
51905181 this.currentAnimation = this._animations['default'];
5191- //otherwise create one.
51925182 } else {
51935183 var defaultCells = [];
51945184 for (var i = 0; i < this._atlas.cells.length; i++) {
@@ -5301,8 +5291,7 @@ var Kiwi;
53015291 this._setCurrentAnimation(name);
53025292
53035293 if (index !== null)
5304- this.currentAnimation.playAt(index);
5305- else
5294+ this.currentAnimation.playAt(index); else
53065295 this.currentAnimation.play();
53075296
53085297 this._setCellIndex();
@@ -6724,8 +6713,7 @@ var Kiwi;
67246713 ArcadePhysics.prototype.solid = function (value) {
67256714 if (value !== undefined) {
67266715 if (value)
6727- this.allowCollisions = ArcadePhysics.ANY;
6728- else
6716+ this.allowCollisions = ArcadePhysics.ANY; else
67296717 this.allowCollisions = ArcadePhysics.NONE;
67306718 }
67316719
@@ -7059,20 +7047,16 @@ else
70597047 if (typeof drag === "undefined") { drag = 0; }
70607048 if (typeof max === "undefined") { max = 10000; }
70617049 if (acceleration != 0)
7062- velocity += acceleration * ArcadePhysics.updateInterval;
7063- else if (drag != 0) {
7050+ velocity += acceleration * ArcadePhysics.updateInterval; else if (drag != 0) {
70647051 drag = drag * ArcadePhysics.updateInterval;
70657052 if (velocity - drag > 0)
7066- velocity = velocity - drag;
7067- else if (velocity + drag < 0)
7068- velocity += drag;
7069- else
7053+ velocity = velocity - drag; else if (velocity + drag < 0)
7054+ velocity += drag; else
70707055 velocity = 0;
70717056 }
70727057 if ((velocity != 0) && (max != 10000)) {
70737058 if (velocity > max)
7074- velocity = max;
7075- else if (velocity < -max)
7059+ velocity = max; else if (velocity < -max)
70767060 velocity = -max;
70777061 }
70787062 return velocity;
@@ -10531,7 +10515,6 @@ var Kiwi;
1053110515 */
1053210516 TileMap.prototype.collideGroup = function (group) {
1053310517 for (var i = 0; i < group.members.length; i++) {
10534- //this.collideSingle(group.members[i]);
1053510518 }
1053610519 };
1053710520
@@ -11559,7 +11542,6 @@ var Kiwi;
1155911542 if (typeof output === "undefined") { output = new Geom.Point(); }
1156011543 if (asDegrees === true) {
1156111544 angle = angle * (Math.PI / 180);
11562- //angle = angle * (180 / Math.PI); // Degrees to Radians
1156311545 }
1156411546
1156511547 output.x = this.x + this._radius * Math.cos(angle);
@@ -11807,7 +11789,6 @@ var Kiwi;
1180711789 if (Math.atan2(y - this.y1, x - this.x1) == Math.atan2(this.y2 - this.y1, this.x2 - this.x1)) {
1180811790 return true;
1180911791 }
11810- // return true;
1181111792 }
1181211793
1181311794 return false;
@@ -12554,8 +12535,7 @@ var Kiwi;
1255412535 */
1255512536 Line.prototype.getY = function (x) {
1255612537 if (this.x1 == this.x2)
12557- return null;
12558- else
12538+ return null; else
1255912539 return this.slope * x + this.yIntercept;
1256012540 };
1256112541
@@ -14442,7 +14422,6 @@ var Kiwi;
1444214422 function (value) {
1444314423 this._scaleX = value;
1444414424 this._scaleY = value;
14445- //this.owner.dirty = true;
1444614425 },
1444714426 enumerable: true,
1444814427 configurable: true
@@ -15618,7 +15597,6 @@ var Kiwi;
1561815597 if (this.onCoordsUpdate)
1561915598 this.onCoordsUpdate.dispose();
1562015599 delete this.onCoordsUpdate;
15621- //remove the elements....
1562215600 };
1562315601 return HUDWidget;
1562415602 })();
@@ -16702,7 +16680,6 @@ var Kiwi;
1670216680 }
1670316681
1670416682 _super.prototype.setTemplate.call(this, main);
16705- //do something with each item
1670616683 }
1670716684 };
1670816685
@@ -17953,11 +17930,14 @@ var Kiwi;
1795317930 */
1795417931 Audio.prototype._setAudio = function () {
1795517932 this._file = this._game.fileStore.getFile(this.key);
17956- this._sound = this._file.data;
1795717933
1795817934 if (this._usingAudioTag) {
17935+ //clone the audio node
17936+ this._sound = this._file.data.cloneNode(true);
1795917937 this._sound.play();
1796017938 this._sound.pause();
17939+ } else {
17940+ this._sound = this._file.data;
1796117941 }
1796217942
1796317943 this.ready = true;
@@ -18155,8 +18135,7 @@ var Kiwi;
1815518135 this.duration = this.totalDuration * 1000;
1815618136
1815718137 if (this._muted)
18158- this._sound.volume = 0;
18159- else
18138+ this._sound.volume = 0; else
1816018139 this._sound.volume = this._volume;
1816118140
1816218141 this._sound.currentTime = this._markers[this._currentMarker].start;
@@ -18672,8 +18651,7 @@ var Kiwi;
1867218651 this._tick = this._clock.elapsed() + this._speed;
1867318652
1867418653 if (this._reverse)
18675- this._frameIndex--;
18676- else
18654+ this._frameIndex--; else
1867718655 this._frameIndex++;
1867818656
1867918657 this.onUpdate.dispatch();
@@ -19071,7 +19049,6 @@ var Kiwi;
1907119049 * @public
1907219050 */
1907319051 Keyboard.prototype.update = function () {
19074- // Loop through all 'down' keys and update the timers on those still pressed
1907519052 };
1907619053
1907719054 /**
@@ -22012,7 +21989,6 @@ var Kiwi;
2201221989 * @method boot
2201321990 */
2201421991 Browser.prototype.boot = function () {
22015- //this._game.stage.offset = this.getOffsetPoint(this._game.stage.container);
2201621992 };
2201721993
2201821994 /**
@@ -23733,7 +23709,6 @@ var Kiwi;
2373323709 if (this.delta > 0.1) {
2373423710 this.delta = 0.1;
2373523711 }
23736- // Apply time scaling
2373723712 };
2373823713
2373923714 /**
@@ -24437,7 +24412,6 @@ var Kiwi;
2443724412 */
2443824413 Canvas.prototype.clear = function () {
2443924414 if (this._clearMode === Canvas.CLEARMODE_NONE) {
24440- // Do nothing
2444124415 } else if (this._clearMode === Canvas.CLEARMODE_CLEARRECT) {
2444224416 // Clear Rect
2444324417 this.context.clearRect(0, 0, this.domElement.width, this.domElement.height);
@@ -24853,8 +24827,7 @@ var Kiwi;
2485324827 max -= min;
2485424828
2485524829 if (!max)
24856- return 0;
24857- else
24830+ return 0; else
2485824831 return val / max;
2485924832 };
2486024833
@@ -24869,8 +24842,7 @@ else
2486924842 */
2487024843 function (n) {
2487124844 if (n)
24872- return n / Math.abs(n);
24873- else
24845+ return n / Math.abs(n); else
2487424846 return 0;
2487524847 };
2487624848
@@ -26080,7 +26052,7 @@ var Kiwi;
2608026052
2608126053 var seed;
2608226054
26083- for (var i = 0; seed = seeds[i++];) {
26055+ for (var i = 0; seed = seeds[i++]; ) {
2608426056 this.s0 -= this.hash(seed);
2608526057 this.s0 += ~~(this.s0 < 0);
2608626058
@@ -26608,7 +26580,7 @@ var Kiwi;
2660826580 * @default '1.0'
2660926581 * @public
2661026582 */
26611- Kiwi.VERSION = "0.4.9 ";
26583+ Kiwi.VERSION = "0.5.1 ";
2661226584
2661326585 //DIFFERENT RENDERER STATIC VARIABLES
2661426586 /**
0 commit comments