From e9fafb9504d596c9253525015182ec88f2ddd444 Mon Sep 17 00:00:00 2001 From: qweasz687 <66411718+qweasz687@users.noreply.github.com> Date: Tue, 10 Aug 2021 16:07:56 +0800 Subject: [PATCH] Create events.js --- libs/events.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libs/events.js b/libs/events.js index e01801a3..5484e169 100644 --- a/libs/events.js +++ b/libs/events.js @@ -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) {