diff --git a/libs/control.js b/libs/control.js index 54bbfcd7..c2bb9f1d 100644 --- a/libs/control.js +++ b/libs/control.js @@ -740,7 +740,6 @@ control.prototype.setHeroMoveInterval = function (direction, x, y, callback) { ////// 实际每一步的行走过程 ////// control.prototype.moveAction = function (callback) { - if (core.interval.openDoorAnimate!=null) return; // 开门判断 if (core.status.heroMoving>0) return; var direction = core.getHeroLoc('direction'); var x = core.getHeroLoc('x'); diff --git a/libs/core.js b/libs/core.js index 079c52b0..1eca8c5f 100644 --- a/libs/core.js +++ b/libs/core.js @@ -24,7 +24,6 @@ function core() { this.interval = { 'heroMoveInterval': null, "tipAnimate": null, - 'openDoorAnimate': null, 'onDownInterval': null, } this.animateFrame = { @@ -357,7 +356,6 @@ core.prototype.init = function (coreData, callback) { core.initStatus.maps = core.maps.initMaps(core.floorIds); core.setRequestAnimationFrame(); - core.showStartAnimate(); if (main.mode=='play') core.events.initGame(); @@ -365,6 +363,8 @@ core.prototype.init = function (coreData, callback) { if (core.isset(functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.plugins)) core.plugin = new functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.plugins.plugin(); + core.showStartAnimate(); + if (core.isset(callback)) callback(); }); diff --git a/libs/events.js b/libs/events.js index 64d083aa..ed08fd13 100644 --- a/libs/events.js +++ b/libs/events.js @@ -838,6 +838,7 @@ events.prototype.doAction = function() { var floorId=data.floorId || core.status.floorId; if (floorId==core.status.floorId) core.openDoor(null, x, y, false, function() { + core.lockControl(); core.events.doAction(); }) else { @@ -845,8 +846,6 @@ events.prototype.doAction = function() { this.doAction(); } break; - this.doAction(); - break; } case "openShop": // 打开一个全局商店 if (core.status.replay.replaying) { // 正在播放录像,简单将visited置为true @@ -1268,9 +1267,6 @@ events.prototype.getItem = function (itemId, itemNum, itemX, itemY, callback) { ////// 开门 ////// events.prototype.openDoor = function (id, x, y, needKey, callback) { - - if (core.interval.openDoorAnimate!=null) return; - if (!core.isset(id)) id = core.getBlockId(x, y); // 是否存在门 @@ -1284,7 +1280,6 @@ events.prototype.openDoor = function (id, x, y, needKey, callback) { if (core.status.automaticRoute.moveStepBeforeStop.length>=1)core.status.automaticRoute.moveStepBeforeStop[0].step-=core.status.automaticRoute.movedStep; } - core.stopAutomaticRoute(); var speed = id.endsWith("Wall")?70:30; if (needKey && id.endsWith("Door")) { @@ -1304,14 +1299,18 @@ events.prototype.openDoor = function (id, x, y, needKey, callback) { core.playSound("door.mp3"); var state = 0; var door = core.material.icons.animates[id]; + + core.lockControl(); + core.stopHero(); + core.stopAutomaticRoute(); core.status.replay.animate=true; core.removeGlobalAnimate(x,y); - core.interval.openDoorAnimate = window.setInterval(function () { + var animate = window.setInterval(function () { state++; if (state == 4) { - clearInterval(core.interval.openDoorAnimate); - core.interval.openDoorAnimate=null; + clearInterval(animate); core.removeBlock(x, y); + core.unLockControl(); core.status.replay.animate=false; core.events.afterOpenDoor(id,x,y,callback); return;