Remove unnecessary core.status.replay.animate
This commit is contained in:
parent
755d2df9f9
commit
a297847b2e
@ -865,14 +865,14 @@ control.prototype.eventMoveHero = function(steps, time, callback) {
|
|||||||
'right': {'x': 1, 'y': 0}
|
'right': {'x': 1, 'y': 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
core.status.replay.animate=true;
|
// core.status.replay.animate=true;
|
||||||
|
|
||||||
var animate=window.setInterval(function() {
|
var animate=window.setInterval(function() {
|
||||||
var x=core.getHeroLoc('x'), y=core.getHeroLoc('y');
|
var x=core.getHeroLoc('x'), y=core.getHeroLoc('y');
|
||||||
if (moveSteps.length==0) {
|
if (moveSteps.length==0) {
|
||||||
clearInterval(animate);
|
clearInterval(animate);
|
||||||
core.drawHero(null, x, y);
|
core.drawHero(null, x, y);
|
||||||
core.status.replay.animate=false;
|
// core.status.replay.animate=false;
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -905,7 +905,7 @@ control.prototype.jumpHero = function (ex, ey, time, callback) {
|
|||||||
time = time || 500;
|
time = time || 500;
|
||||||
core.clearMap('ui');
|
core.clearMap('ui');
|
||||||
core.setAlpha('ui', 1.0);
|
core.setAlpha('ui', 1.0);
|
||||||
core.status.replay.animate=true;
|
// core.status.replay.animate=true;
|
||||||
|
|
||||||
core.playSound('jump.mp3');
|
core.playSound('jump.mp3');
|
||||||
|
|
||||||
@ -955,7 +955,7 @@ control.prototype.jumpHero = function (ex, ey, time, callback) {
|
|||||||
core.setHeroLoc('x', ex);
|
core.setHeroLoc('x', ex);
|
||||||
core.setHeroLoc('y', ey);
|
core.setHeroLoc('y', ey);
|
||||||
core.drawHero();
|
core.drawHero();
|
||||||
core.status.replay.animate=false;
|
// core.status.replay.animate=false;
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1491,7 +1491,7 @@ control.prototype.setFg = function(color, time, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var step=0;
|
var step=0;
|
||||||
core.status.replay.animate=true;
|
// core.status.replay.animate=true;
|
||||||
var changeAnimate = setInterval(function() {
|
var changeAnimate = setInterval(function() {
|
||||||
step++;
|
step++;
|
||||||
|
|
||||||
@ -1506,7 +1506,7 @@ control.prototype.setFg = function(color, time, callback) {
|
|||||||
if (step>=25) {
|
if (step>=25) {
|
||||||
clearInterval(changeAnimate);
|
clearInterval(changeAnimate);
|
||||||
core.status.curtainColor = color;
|
core.status.curtainColor = color;
|
||||||
core.status.replay.animate=false;
|
// core.status.replay.animate=false;
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
}, time/25/core.status.replay.speed);
|
}, time/25/core.status.replay.speed);
|
||||||
|
|||||||
@ -1456,7 +1456,7 @@ events.prototype.animateImage = function (type, image, loc, time, keep, callback
|
|||||||
core.setOpacity('data', opacityVal);
|
core.setOpacity('data', opacityVal);
|
||||||
var x = core.calValue(loc[0]), y = core.calValue(loc[1]);
|
var x = core.calValue(loc[0]), y = core.calValue(loc[1]);
|
||||||
core.canvas.data.drawImage(image, x, y);
|
core.canvas.data.drawImage(image, x, y);
|
||||||
core.status.replay.animate=true;
|
// core.status.replay.animate=true;
|
||||||
var animate = setInterval(function () {
|
var animate = setInterval(function () {
|
||||||
if (type=='show') opacityVal += 0.1;
|
if (type=='show') opacityVal += 0.1;
|
||||||
else opacityVal -= 0.1;
|
else opacityVal -= 0.1;
|
||||||
@ -1467,7 +1467,7 @@ events.prototype.animateImage = function (type, image, loc, time, keep, callback
|
|||||||
core.canvas.image.drawImage(image, x, y);
|
core.canvas.image.drawImage(image, x, y);
|
||||||
core.clearMap('data');
|
core.clearMap('data');
|
||||||
core.setOpacity('data', 1);
|
core.setOpacity('data', 1);
|
||||||
core.status.replay.animate=false;
|
// core.status.replay.animate=false;
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
}, time / 10);
|
}, time / 10);
|
||||||
@ -1482,7 +1482,7 @@ events.prototype.moveImage = function (image, from, to, time, keep, callback) {
|
|||||||
|
|
||||||
if (keep) core.clearMap('image');
|
if (keep) core.clearMap('image');
|
||||||
|
|
||||||
core.status.replay.animate=true;
|
// core.status.replay.animate=true;
|
||||||
var fromX = core.calValue(from[0]), fromY = core.calValue(from[1]),
|
var fromX = core.calValue(from[0]), fromY = core.calValue(from[1]),
|
||||||
toX = core.calValue(to[0]), toY = core.calValue(to[1]);
|
toX = core.calValue(to[0]), toY = core.calValue(to[1]);
|
||||||
var step = 0;
|
var step = 0;
|
||||||
@ -1501,8 +1501,8 @@ events.prototype.moveImage = function (image, from, to, time, keep, callback) {
|
|||||||
if (step>=steps) {
|
if (step>=steps) {
|
||||||
clearInterval(animate);
|
clearInterval(animate);
|
||||||
core.clearMap('data');
|
core.clearMap('data');
|
||||||
core.status.replay.animate=false;
|
// core.status.replay.animate=false;
|
||||||
if (keep) core.canvas.data.drawImage(image, toX, toY);
|
if (keep) core.canvas.image.drawImage(image, toX, toY);
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
}, per_time);
|
}, per_time);
|
||||||
@ -1524,7 +1524,7 @@ events.prototype.setVolume = function (value, time, callback) {
|
|||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
core.status.replay.animate=true;
|
// core.status.replay.animate=true;
|
||||||
var currVolume = core.musicStatus.volume;
|
var currVolume = core.musicStatus.volume;
|
||||||
var step = 0;
|
var step = 0;
|
||||||
var fade = setInterval(function () {
|
var fade = setInterval(function () {
|
||||||
@ -1533,7 +1533,7 @@ events.prototype.setVolume = function (value, time, callback) {
|
|||||||
set(nowVolume);
|
set(nowVolume);
|
||||||
if (step>=32) {
|
if (step>=32) {
|
||||||
clearInterval(fade);
|
clearInterval(fade);
|
||||||
core.status.replay.animate=false;
|
// core.status.replay.animate=false;
|
||||||
if (core.isset(callback))
|
if (core.isset(callback))
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
@ -1548,7 +1548,7 @@ events.prototype.vibrate = function(time, callback) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.status.replay.animate=true;
|
// core.status.replay.animate=true;
|
||||||
|
|
||||||
var addGameCanvasTranslate=function(x,y){
|
var addGameCanvasTranslate=function(x,y){
|
||||||
for(var ii=0,canvas;canvas=core.dom.gameCanvas[ii];ii++){
|
for(var ii=0,canvas;canvas=core.dom.gameCanvas[ii];ii++){
|
||||||
@ -1596,7 +1596,7 @@ events.prototype.vibrate = function(time, callback) {
|
|||||||
addGameCanvasTranslate(shake, 0);
|
addGameCanvasTranslate(shake, 0);
|
||||||
if(shake_duration===0) {
|
if(shake_duration===0) {
|
||||||
clearInterval(animate);
|
clearInterval(animate);
|
||||||
core.status.replay.animate=false;
|
// core.status.replay.animate=false;
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
}, 50/3);
|
}, 50/3);
|
||||||
|
|||||||
12
libs/maps.js
12
libs/maps.js
@ -730,7 +730,7 @@ maps.prototype.moveBlock = function(x,y,steps,time,keep,callback) {
|
|||||||
}
|
}
|
||||||
var id = block.block.id;
|
var id = block.block.id;
|
||||||
|
|
||||||
core.status.replay.animate=true;
|
// core.status.replay.animate=true;
|
||||||
|
|
||||||
// 需要删除该块
|
// 需要删除该块
|
||||||
core.removeBlock(x,y);
|
core.removeBlock(x,y);
|
||||||
@ -829,7 +829,7 @@ maps.prototype.moveBlock = function(x,y,steps,time,keep,callback) {
|
|||||||
core.setBlock(id, nowX/32, nowY/32);
|
core.setBlock(id, nowX/32, nowY/32);
|
||||||
core.showBlock(nowX/32, nowY/32);
|
core.showBlock(nowX/32, nowY/32);
|
||||||
}
|
}
|
||||||
core.status.replay.animate=false;
|
// core.status.replay.animate=false;
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -861,7 +861,7 @@ maps.prototype.jumpBlock = function(sx,sy,ex,ey,time,keep,callback) {
|
|||||||
}
|
}
|
||||||
var id = block.block.id;
|
var id = block.block.id;
|
||||||
|
|
||||||
core.status.replay.animate=true;
|
// core.status.replay.animate=true;
|
||||||
|
|
||||||
// 需要删除该块
|
// 需要删除该块
|
||||||
core.removeBlock(sx,sy);
|
core.removeBlock(sx,sy);
|
||||||
@ -960,7 +960,7 @@ maps.prototype.jumpBlock = function(sx,sy,ex,ey,time,keep,callback) {
|
|||||||
core.setBlock(id, ex, ey);
|
core.setBlock(id, ex, ey);
|
||||||
core.showBlock(ex, ey);
|
core.showBlock(ex, ey);
|
||||||
}
|
}
|
||||||
core.status.replay.animate=false;
|
// core.status.replay.animate=false;
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1015,7 +1015,7 @@ maps.prototype.animateBlock = function (loc,type,time,callback) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.status.replay.animate=true;
|
// core.status.replay.animate=true;
|
||||||
var draw = function () {
|
var draw = function () {
|
||||||
list.forEach(function (t) {
|
list.forEach(function (t) {
|
||||||
core.canvas.route.drawImage(t.image, t.bx*32, t.by*t.height, 32, t.height, t.x*32, t.y*32+32-t.height, 32, t.height);
|
core.canvas.route.drawImage(t.image, t.bx*32, t.by*t.height, 32, t.height, t.x*32, t.y*32+32-t.height, 32, t.height);
|
||||||
@ -1036,7 +1036,7 @@ maps.prototype.animateBlock = function (loc,type,time,callback) {
|
|||||||
clearInterval(animate);
|
clearInterval(animate);
|
||||||
core.clearMap('route');
|
core.clearMap('route');
|
||||||
core.setOpacity('route', 1);
|
core.setOpacity('route', 1);
|
||||||
core.status.replay.animate=false;
|
// core.status.replay.animate=false;
|
||||||
if (core.isset(callback)) callback();
|
if (core.isset(callback)) callback();
|
||||||
}
|
}
|
||||||
}, time / 10 / core.status.replay.speed);
|
}, time / 10 / core.status.replay.speed);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user