Revert "Manual update"

This reverts commit 4b177e0a9b.
This commit is contained in:
Webeled
2013-09-30 19:18:33 +01:00
parent 933edb203f
commit 5afce4bf8e
11 changed files with 19 additions and 87 deletions
+2 -2
View File
@@ -223,7 +223,7 @@ Phaser.Animation.prototype = {
{
if (this.looped)
{
this._frameIndex %= this._frames.length;
this._frameIndex = this._frameIndex - this._frames.length;
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
if (this.currentFrame)
@@ -401,4 +401,4 @@ Phaser.Animation.generateFrameNames = function (prefix, min, max, suffix, zeroPa
return output;
}
}
-16
View File
@@ -305,22 +305,6 @@ Object.defineProperty(Phaser.AnimationManager.prototype, "frameTotal", {
});
Object.defineProperty(Phaser.AnimationManager.prototype, "paused", {
get: function () {
return this.currentAnim.isPaused;
},
set: function (value) {
this.currentAnim.paused = value;
}
});
Object.defineProperty(Phaser.AnimationManager.prototype, "frame", {
/**
+1 -3
View File
@@ -235,9 +235,7 @@ Phaser.StateManager.prototype = {
this.onShutDownCallback.call(this.callbackContext);
}
if (clearWorld)
{
this.game.tweens.removeAll();
if (clearWorld) {
this.game.world.destroy();
-1
View File
@@ -151,7 +151,6 @@ Phaser.Button.prototype.onInputOutHandler = function (pointer) {
{
this.onInputOut.dispatch(this, pointer);
}
};
Phaser.Button.prototype.onInputDownHandler = function (pointer) {
+2 -21
View File
@@ -363,8 +363,8 @@ Phaser.Sprite.prototype.reset = function(x, y) {
this.x = x;
this.y = y;
this.position.x = this.x - (this.game.world.camera.x * this.scrollFactor.x);
this.position.y = this.y - (this.game.world.camera.y * this.scrollFactor.y);
this.position.x = x;
this.position.y = y;
this.alive = true;
this.exists = true;
this.visible = true;
@@ -470,25 +470,6 @@ Phaser.Sprite.prototype.getBounds = function(rect) {
}
/**
* Play an animation based on the given key. The animation should previously have been added via sprite.animations.add()
* If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself.
*
* @method play
* @param {String} name The name of the animation to be played, e.g. "fire", "walk", "jump".
* @param {Number} [frameRate=null] The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
* @param {Boolean} [loop=null] Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.
* @return {Phaser.Animation} A reference to playing Animation instance.
*/
Phaser.Sprite.prototype.play = function (name, frameRate, loop) {
if (this.animations)
{
this.animations.play(name, frameRate, loop);
}
}
Object.defineProperty(Phaser.Sprite.prototype, 'angle', {
get: function() {
+1 -1
View File
@@ -358,7 +358,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function () {
if (this.width > 1 || this.height > 1)
{
particle.reset(this.game.rnd.integerInRange(this.left, this.right), this.game.rnd.integerInRange(this.top, this.bottom));
particle.reset(this.emiteX - this.game.rnd.integerInRange(this.left, this.right), this.emiteY - this.game.rnd.integerInRange(this.top, this.bottom));
}
else
{
+2 -2
View File
@@ -51,13 +51,13 @@ Phaser.Physics.Arcade.prototype = {
body.rotation += body.angularVelocity * this.game.time.physicsElapsed;
// Horizontal
this._velocityDelta = (this.computeVelocity(1, body, body.velocity.x, body.acceleration.x, body.drag.x, body.maxVelocity.x) - body.velocity.x) / 2;
this._velocityDelta = (this.computeVelocity(1, body, body.velocity.x, body.acceleration.x, body.drag.x) - body.velocity.x) / 2;
body.velocity.x += this._velocityDelta;
this._delta = body.velocity.x * this.game.time.physicsElapsed;
body.x += this._delta;
// Vertical
this._velocityDelta = (this.computeVelocity(2, body, body.velocity.y, body.acceleration.y, body.drag.y, body.maxVelocity.y) - body.velocity.y) / 2;
this._velocityDelta = (this.computeVelocity(2, body, body.velocity.y, body.acceleration.y, body.drag.y) - body.velocity.y) / 2;
body.velocity.y += this._velocityDelta;
this._delta = body.velocity.y * this.game.time.physicsElapsed;
body.y += this._delta;
+7 -34
View File
@@ -172,7 +172,6 @@ Phaser.Sound.prototype = {
// start and stop are in SECONDS.MS (2.5 = 2500ms, 0.5 = 500ms, etc)
// volume is between 0 and 1
/*
addMarker: function (name, start, stop, volume, loop) {
volume = volume || 1;
@@ -187,26 +186,6 @@ Phaser.Sound.prototype = {
loop: loop
};
},
*/
// start and stop are in SECONDS.MS (2.5 = 2500ms, 0.5 = 500ms, etc)
// volume is between 0 and 1
addMarker: function (name, start, duration, volume, loop) {
volume = volume || 1;
if (typeof loop == 'undefined') { loop = false; }
this.markers[name] = {
name: name,
start: start,
stop: start + duration,
volume: volume,
duration: duration,
durationMS: duration * 1000,
loop: loop
};
},
removeMarker: function (name) {
@@ -287,20 +266,19 @@ Phaser.Sound.prototype = {
position = position || 0;
volume = volume || 1;
if (typeof loop == 'undefined') { loop = false; }
if (typeof forceRestart == 'undefined') { forceRestart = true; }
if (typeof forceRestart == 'undefined') { forceRestart = false; }
console.log(this.name + ' play ' + marker + ' position ' + position + ' volume ' + volume + ' loop ' + loop, 'force', forceRestart);
// console.log(this.name + ' play ' + marker + ' position ' + position + ' volume ' + volume + ' loop ' + loop);
if (this.isPlaying == true && forceRestart == false && this.override == false)
{
// Use Restart instead
console.log('Use Restart instead');
return;
}
if (this.isPlaying && this.override)
{
console.log('asked to play ' + marker + ' but already playing ' + this.currentMarker);
// console.log('asked to play ' + marker + ' but already playing ' + this.currentMarker);
if (this.usingWebAudio)
{
@@ -327,10 +305,9 @@ Phaser.Sound.prototype = {
this.position = this.markers[marker].start;
this.volume = this.markers[marker].volume;
this.loop = this.markers[marker].loop;
this.duration = this.markers[marker].duration;
console.log('Marker Loaded: ', marker, 'start:', this.position, 'end: ', this.duration, 'loop', this.loop);
this.duration = this.markers[marker].duration * 1000;
// console.log('marker info loaded', this.loop, this.duration);
this._tempMarker = marker;
this._tempPosition = this.position;
this._tempVolume = this.volume;
@@ -338,8 +315,6 @@ Phaser.Sound.prototype = {
}
else
{
console.log('no marker info loaded', marker);
this.position = position;
this.volume = volume;
this.loop = loop;
@@ -380,14 +355,12 @@ Phaser.Sound.prototype = {
// Useful to cache this somewhere perhaps?
if (typeof this._sound.start === 'undefined')
{
this._sound.noteGrainOn(0, this.position, this.duration);
// this._sound.noteGrainOn(0, this.position, this.duration / 1000);
this._sound.noteGrainOn(0, this.position, this.duration / 1000);
//this._sound.noteOn(0); // the zero is vitally important, crashes iOS6 without it
}
else
{
// this._sound.start(0, this.position, this.duration / 1000);
this._sound.start(0, this.position, this.duration);
this._sound.start(0, this.position, this.duration / 1000);
}
this.isPlaying = true;
+2
View File
@@ -293,6 +293,8 @@ Phaser.SoundManager.prototype = {
volume = volume || 1;
if (typeof loop == 'undefined') { loop = false; }
var sound = new Phaser.Sound(this.game, key, volume, loop);
this._sounds.push(sound);
+1 -5
View File
@@ -246,15 +246,11 @@ Phaser.Tween.prototype = {
pause: function () {
this._paused = true;
this._pausedTime = this.game.time.now;
},
resume: function () {
this._paused = false;
this._startTime += (this.game.time.now - this._pausedTime);
this._startTime += this.game.time.pauseDuration;
},
update: function ( time ) {
+1 -2
View File
@@ -39,8 +39,7 @@ Phaser.TweenManager.prototype = {
*/
removeAll: function () {
this._add.length = 0;
this._tweens.length = 0;
this._tweens = [];
},