test
This commit is contained in:
parent
b8b5c0e1f5
commit
29cc7b8531
@ -178,10 +178,10 @@ control.prototype._animationFrame_heroMoving = function (timestamp) {
|
|||||||
if (core.status.heroMoving <= 0) return;
|
if (core.status.heroMoving <= 0) return;
|
||||||
// 换腿
|
// 换腿
|
||||||
if (timestamp - core.animateFrame.moveTime > (core.values.moveSpeed||100)) {
|
if (timestamp - core.animateFrame.moveTime > (core.values.moveSpeed||100)) {
|
||||||
core.animateFrame.leftLeg = !core.animateFrame.leftLeg;
|
core.animateFrame.leftLeg ++;
|
||||||
core.animateFrame.moveTime = timestamp;
|
core.animateFrame.moveTime = timestamp;
|
||||||
}
|
}
|
||||||
core.drawHero(core.animateFrame.leftLeg?'leftFoot':'rightFoot', 4*core.status.heroMoving);
|
core.drawHero(core.animateFrame.leftLeg, 4*core.status.heroMoving);
|
||||||
}
|
}
|
||||||
|
|
||||||
control.prototype._animationFrame_weather = function (timestamp) {
|
control.prototype._animationFrame_weather = function (timestamp) {
|
||||||
@ -798,7 +798,7 @@ control.prototype.tryMoveDirectly = function (destX, destY) {
|
|||||||
control.prototype.drawHero = function (status, offset) {
|
control.prototype.drawHero = function (status, offset) {
|
||||||
if (!core.isPlaying() || !core.status.floorId || core.status.gameOver) return;
|
if (!core.isPlaying() || !core.status.floorId || core.status.gameOver) return;
|
||||||
var x = core.getHeroLoc('x'), y = core.getHeroLoc('y'), direction = core.getHeroLoc('direction');
|
var x = core.getHeroLoc('x'), y = core.getHeroLoc('y'), direction = core.getHeroLoc('direction');
|
||||||
status = status || 'stop';
|
status = (status || 0)%4;
|
||||||
offset = offset || 0;
|
offset = offset || 0;
|
||||||
var way = core.utils.scan[direction];
|
var way = core.utils.scan[direction];
|
||||||
var dx = way.x, dy = way.y, offsetX = dx * offset, offsetY = dy * offset;
|
var dx = way.x, dy = way.y, offsetX = dx * offset, offsetY = dy * offset;
|
||||||
@ -809,7 +809,7 @@ control.prototype.drawHero = function (status, offset) {
|
|||||||
|
|
||||||
if (!core.hasFlag('hideHero')) {
|
if (!core.hasFlag('hideHero')) {
|
||||||
this._drawHero_getDrawObjs(direction, x, y, status, offset).forEach(function (block) {
|
this._drawHero_getDrawObjs(direction, x, y, status, offset).forEach(function (block) {
|
||||||
core.drawImage('hero', block.img, block.heroIcon[block.status]*block.width,
|
core.drawImage('hero', block.img, status * block.width,
|
||||||
block.heroIcon.loc * block.height, block.width, block.height,
|
block.heroIcon.loc * block.height, block.width, block.height,
|
||||||
block.posx+(32-block.width)/2, block.posy+32-block.height, block.width, block.height);
|
block.posx+(32-block.width)/2, block.posy+32-block.height, block.width, block.height);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -37,7 +37,7 @@ function core() {
|
|||||||
'animateTime': 0,
|
'animateTime': 0,
|
||||||
'moveTime': 0,
|
'moveTime': 0,
|
||||||
'lastLegTime': 0,
|
'lastLegTime': 0,
|
||||||
'leftLeg': true,
|
'leftLeg': 0,
|
||||||
'weather': {
|
'weather': {
|
||||||
'time': 0,
|
'time': 0,
|
||||||
'type': null,
|
'type': null,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user