Create events.js

This commit is contained in:
qweasz687 2021-08-10 16:07:56 +08:00 committed by GitHub
parent 24af8595a6
commit e9fafb9504
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3540,14 +3540,13 @@ events.prototype._jumpHero_doJump = function (jumpInfo, callback) {
events.prototype._jumpHero_jumping = function (jumpInfo) {
core.clearMap('hero');
core.maps.__updateJumpInfo(jumpInfo);
var x = core.getHeroLoc('x'),
y = core.getHeroLoc('y');
var nowx = jumpInfo.px, nowy = jumpInfo.py, width = jumpInfo.width || 32, height = jumpInfo.height;
core.bigmap.offsetX = core.clamp(nowx - 32*core.__HALF_SIZE__, 0, 32*core.bigmap.width-core.__PIXELS__);
core.bigmap.offsetY = core.clamp(nowy - 32*core.__HALF_SIZE__, 0, 32*core.bigmap.height-core.__PIXELS__);
core.control.updateViewport();
core.drawImage('hero', core.material.images.hero, jumpInfo.icon.stop, jumpInfo.icon.loc * height, width, height,
nowx + (32 - width) / 2 - core.bigmap.offsetX, nowy + 32-height - core.bigmap.offsetY, width, height);
core.status.heroCenter.px = nowx + 16;
core.status.heroCenter.py = nowy + 32 - height / 2;
core.drawHero(null, {
x: nowx - 32 * x,
y: nowy - 32 * y
}, 0, true);
}
events.prototype._jumpHero_finished = function (animate, ex, ey, callback) {