@@ -2707,8 +2707,7 @@ var Kiwi;
2707
2707
if (this.deviceTargetOption === Kiwi.TARGET_BROWSER) {
2708
2708
if (domParent !== '') {
2709
2709
if (document.getElementById(domParent))
2710
- console.log('Game being created inside ' + domParent + '.');
2711
- else
2710
+ console.log('Game being created inside ' + domParent + '.'); else
2712
2711
console.log('The element "' + domParent + '" could not be found. Appending the game to the body.');
2713
2712
} else {
2714
2713
console.log('No DOM parent specified. Appending the game to the body.');
@@ -2977,7 +2976,6 @@ var Kiwi;
2977
2976
//if (this.containsDescendant(val) === false) {
2978
2977
this.transform.parent = (val !== null) ? val.transform : null;
2979
2978
this._parent = val;
2980
- //}
2981
2979
},
2982
2980
enumerable: true,
2983
2981
configurable: true
@@ -3972,17 +3970,17 @@ var Kiwi;
3972
3970
})();
3973
3971
Kiwi.PluginManager = PluginManager;
3974
3972
})(Kiwi || (Kiwi = {}));
3975
- /**
3976
- *
3977
- * @module Kiwi
3978
- *
3979
- */
3980
3973
var __extends = this.__extends || function (d, b) {
3981
3974
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3982
3975
function __() { this.constructor = d; }
3983
3976
__.prototype = b.prototype;
3984
3977
d.prototype = new __();
3985
3978
};
3979
+ /**
3980
+ *
3981
+ * @module Kiwi
3982
+ *
3983
+ */
3986
3984
var Kiwi;
3987
3985
(function (Kiwi) {
3988
3986
/**
@@ -4345,11 +4343,6 @@ var Kiwi;
4345
4343
* @module Kiwi
4346
4344
*
4347
4345
*/
4348
- /**
4349
- *
4350
- * @module Kiwi
4351
- *
4352
- */
4353
4346
var Kiwi;
4354
4347
(function (Kiwi) {
4355
4348
/**
@@ -5059,7 +5052,6 @@ var Kiwi;
5059
5052
Stage.prototype._createCompositeCanvas = function () {
5060
5053
if (this._game.deviceTargetOption == Kiwi.TARGET_COCOON) {
5061
5054
this.canvas = document.createElement(navigator['isCocoonJS'] ? 'screencanvas' : 'canvas');
5062
- //otherwise default to normal canvas
5063
5055
} else {
5064
5056
this.canvas = document.createElement("canvas");
5065
5057
}
@@ -5094,7 +5086,6 @@ var Kiwi;
5094
5086
*/
5095
5087
Stage.prototype._createDebugCanvas = function () {
5096
5088
if (this._game.deviceTargetOption === Kiwi.TARGET_COCOON) {
5097
- //debug canvas not supported in cocoon, creating canvas and context anyway.
5098
5089
}
5099
5090
this.debugCanvas = document.createElement("canvas");
5100
5091
this.debugCanvas.id = this._game.id + "debugCanvas";
@@ -5188,7 +5179,6 @@ var Kiwi;
5188
5179
5189
5180
if (this._animations['default']) {
5190
5181
this.currentAnimation = this._animations['default'];
5191
- //otherwise create one.
5192
5182
} else {
5193
5183
var defaultCells = [];
5194
5184
for (var i = 0; i < this._atlas.cells.length; i++) {
@@ -5301,8 +5291,7 @@ var Kiwi;
5301
5291
this._setCurrentAnimation(name);
5302
5292
5303
5293
if (index !== null)
5304
- this.currentAnimation.playAt(index);
5305
- else
5294
+ this.currentAnimation.playAt(index); else
5306
5295
this.currentAnimation.play();
5307
5296
5308
5297
this._setCellIndex();
@@ -6724,8 +6713,7 @@ var Kiwi;
6724
6713
ArcadePhysics.prototype.solid = function (value) {
6725
6714
if (value !== undefined) {
6726
6715
if (value)
6727
- this.allowCollisions = ArcadePhysics.ANY;
6728
- else
6716
+ this.allowCollisions = ArcadePhysics.ANY; else
6729
6717
this.allowCollisions = ArcadePhysics.NONE;
6730
6718
}
6731
6719
@@ -7059,20 +7047,16 @@ else
7059
7047
if (typeof drag === "undefined") { drag = 0; }
7060
7048
if (typeof max === "undefined") { max = 10000; }
7061
7049
if (acceleration != 0)
7062
- velocity += acceleration * ArcadePhysics.updateInterval;
7063
- else if (drag != 0) {
7050
+ velocity += acceleration * ArcadePhysics.updateInterval; else if (drag != 0) {
7064
7051
drag = drag * ArcadePhysics.updateInterval;
7065
7052
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
7070
7055
velocity = 0;
7071
7056
}
7072
7057
if ((velocity != 0) && (max != 10000)) {
7073
7058
if (velocity > max)
7074
- velocity = max;
7075
- else if (velocity < -max)
7059
+ velocity = max; else if (velocity < -max)
7076
7060
velocity = -max;
7077
7061
}
7078
7062
return velocity;
@@ -10531,7 +10515,6 @@ var Kiwi;
10531
10515
*/
10532
10516
TileMap.prototype.collideGroup = function (group) {
10533
10517
for (var i = 0; i < group.members.length; i++) {
10534
- //this.collideSingle(group.members[i]);
10535
10518
}
10536
10519
};
10537
10520
@@ -11559,7 +11542,6 @@ var Kiwi;
11559
11542
if (typeof output === "undefined") { output = new Geom.Point(); }
11560
11543
if (asDegrees === true) {
11561
11544
angle = angle * (Math.PI / 180);
11562
- //angle = angle * (180 / Math.PI); // Degrees to Radians
11563
11545
}
11564
11546
11565
11547
output.x = this.x + this._radius * Math.cos(angle);
@@ -11807,7 +11789,6 @@ var Kiwi;
11807
11789
if (Math.atan2(y - this.y1, x - this.x1) == Math.atan2(this.y2 - this.y1, this.x2 - this.x1)) {
11808
11790
return true;
11809
11791
}
11810
- // return true;
11811
11792
}
11812
11793
11813
11794
return false;
@@ -12554,8 +12535,7 @@ var Kiwi;
12554
12535
*/
12555
12536
Line.prototype.getY = function (x) {
12556
12537
if (this.x1 == this.x2)
12557
- return null;
12558
- else
12538
+ return null; else
12559
12539
return this.slope * x + this.yIntercept;
12560
12540
};
12561
12541
@@ -14442,7 +14422,6 @@ var Kiwi;
14442
14422
function (value) {
14443
14423
this._scaleX = value;
14444
14424
this._scaleY = value;
14445
- //this.owner.dirty = true;
14446
14425
},
14447
14426
enumerable: true,
14448
14427
configurable: true
@@ -15618,7 +15597,6 @@ var Kiwi;
15618
15597
if (this.onCoordsUpdate)
15619
15598
this.onCoordsUpdate.dispose();
15620
15599
delete this.onCoordsUpdate;
15621
- //remove the elements....
15622
15600
};
15623
15601
return HUDWidget;
15624
15602
})();
@@ -16702,7 +16680,6 @@ var Kiwi;
16702
16680
}
16703
16681
16704
16682
_super.prototype.setTemplate.call(this, main);
16705
- //do something with each item
16706
16683
}
16707
16684
};
16708
16685
@@ -17953,11 +17930,14 @@ var Kiwi;
17953
17930
*/
17954
17931
Audio.prototype._setAudio = function () {
17955
17932
this._file = this._game.fileStore.getFile(this.key);
17956
- this._sound = this._file.data;
17957
17933
17958
17934
if (this._usingAudioTag) {
17935
+ //clone the audio node
17936
+ this._sound = this._file.data.cloneNode(true);
17959
17937
this._sound.play();
17960
17938
this._sound.pause();
17939
+ } else {
17940
+ this._sound = this._file.data;
17961
17941
}
17962
17942
17963
17943
this.ready = true;
@@ -18155,8 +18135,7 @@ var Kiwi;
18155
18135
this.duration = this.totalDuration * 1000;
18156
18136
18157
18137
if (this._muted)
18158
- this._sound.volume = 0;
18159
- else
18138
+ this._sound.volume = 0; else
18160
18139
this._sound.volume = this._volume;
18161
18140
18162
18141
this._sound.currentTime = this._markers[this._currentMarker].start;
@@ -18672,8 +18651,7 @@ var Kiwi;
18672
18651
this._tick = this._clock.elapsed() + this._speed;
18673
18652
18674
18653
if (this._reverse)
18675
- this._frameIndex--;
18676
- else
18654
+ this._frameIndex--; else
18677
18655
this._frameIndex++;
18678
18656
18679
18657
this.onUpdate.dispatch();
@@ -19071,7 +19049,6 @@ var Kiwi;
19071
19049
* @public
19072
19050
*/
19073
19051
Keyboard.prototype.update = function () {
19074
- // Loop through all 'down' keys and update the timers on those still pressed
19075
19052
};
19076
19053
19077
19054
/**
@@ -22012,7 +21989,6 @@ var Kiwi;
22012
21989
* @method boot
22013
21990
*/
22014
21991
Browser.prototype.boot = function () {
22015
- //this._game.stage.offset = this.getOffsetPoint(this._game.stage.container);
22016
21992
};
22017
21993
22018
21994
/**
@@ -23733,7 +23709,6 @@ var Kiwi;
23733
23709
if (this.delta > 0.1) {
23734
23710
this.delta = 0.1;
23735
23711
}
23736
- // Apply time scaling
23737
23712
};
23738
23713
23739
23714
/**
@@ -24437,7 +24412,6 @@ var Kiwi;
24437
24412
*/
24438
24413
Canvas.prototype.clear = function () {
24439
24414
if (this._clearMode === Canvas.CLEARMODE_NONE) {
24440
- // Do nothing
24441
24415
} else if (this._clearMode === Canvas.CLEARMODE_CLEARRECT) {
24442
24416
// Clear Rect
24443
24417
this.context.clearRect(0, 0, this.domElement.width, this.domElement.height);
@@ -24853,8 +24827,7 @@ var Kiwi;
24853
24827
max -= min;
24854
24828
24855
24829
if (!max)
24856
- return 0;
24857
- else
24830
+ return 0; else
24858
24831
return val / max;
24859
24832
};
24860
24833
@@ -24869,8 +24842,7 @@ else
24869
24842
*/
24870
24843
function (n) {
24871
24844
if (n)
24872
- return n / Math.abs(n);
24873
- else
24845
+ return n / Math.abs(n); else
24874
24846
return 0;
24875
24847
};
24876
24848
@@ -26080,7 +26052,7 @@ var Kiwi;
26080
26052
26081
26053
var seed;
26082
26054
26083
- for (var i = 0; seed = seeds[i++];) {
26055
+ for (var i = 0; seed = seeds[i++]; ) {
26084
26056
this.s0 -= this.hash(seed);
26085
26057
this.s0 += ~~(this.s0 < 0);
26086
26058
@@ -26608,7 +26580,7 @@ var Kiwi;
26608
26580
* @default '1.0'
26609
26581
* @public
26610
26582
*/
26611
- Kiwi.VERSION = "0.4.9 ";
26583
+ Kiwi.VERSION = "0.5.1 ";
26612
26584
26613
26585
//DIFFERENT RENDERER STATIC VARIABLES
26614
26586
/**
0 commit comments