if (y2 > this.centerY()){ var distance = Math.abs(y2 - this.centerY()); var pixel_distance = distance * $gameMap.tileHeight() ; //像素距离 var pixel_speed = Math.min(pixel_distance/speedRatio_y,$gameSystem._drill_LCa_speedMax); //像素速度 if( pixel_speed < 0.25 ){ pixel_speed = 0.25; } //像素最小速度(1/4像素) if( pixel_distance < pixel_speed ){ //最小收敛间距 $gameTemp._drill_LCa_pixel_fix_y = 0; //(镜头停止移动后,所有像素必须吻合归位) $gameMap.scrollDown( distance ); // }else{ pixel_speed += $gameTemp._drill_LCa_pixel_fix_y; //速度小数位补正 $gameTemp._drill_LCa_pixel_fix_y = pixel_speed - Math.round(pixel_speed); //补正值 pixel_speed = Math.round(pixel_speed); //设置速度为固定像素速度 $gameMap.scrollDown( pixel_speed/$gameMap.tileHeight() ); // } }
Drill_up 发表于 2020-3-11 12:11
首先,感谢你提供的思路。
kuaile412 发表于 2020-3-11 10:38
tql!是大佬~两位都是大佬
似乎移动量还是会部分出现1像素的偏移.....
感觉...还是有哪里没同步上,似乎是 ...
Drill_up 发表于 2020-3-11 12:11
首先,感谢你提供的思路。
if (y2 > this.centerY()){ var distance = Math.abs(y2 - this.centerY()); var pixel_distance = distance * $gameMap.tileHeight() ; //像素距离 var pixel_speed = Math.min(pixel_distance/speedRatio_y,$gameSystem._drill_LCa_speedMax); //像素速度 if( pixel_speed < 0.25 ){ pixel_speed = 0.25; } //像素最小速度(1/4像素) if( pixel_distance < pixel_speed ){ //第一次收敛(最小收敛间距) $gameTemp._drill_LCa_pixel_fix_y = 0; //(镜头停止移动后,所有像素必须吻合归位) $gameMap.scrollDown( distance ); // }else{ pixel_speed += $gameTemp._drill_LCa_pixel_fix_y; //速度小数位补正 $gameTemp._drill_LCa_pixel_fix_y = pixel_speed - Math.round(pixel_speed); //补正值 pixel_speed = Math.round(pixel_speed); //设置速度为固定像素速度 if( pixel_distance < pixel_speed ){ //第二次收敛(round镜头墙bug) $gameTemp._drill_LCa_pixel_fix_y = 0; // $gameMap.scrollDown( distance ); // }else{ $gameMap.scrollDown( pixel_speed/$gameMap.tileHeight() ); } } }
11.27 KB, 下载次数: 65
Drill_up 发表于 2020-3-18 11:08
(´⊙ω⊙`) 镜头bug是我的代码造成的问题,我给你代码的时候,提供了分段的思路,
但是我没有注意到分段的 ...
Drill_up 发表于 2020-3-18 11:08
(´⊙ω⊙`) 镜头bug是我的代码造成的问题,我给你代码的时候,提供了分段的思路,
但是我没有注意到分段的 ...
开关关 发表于 2020-3-24 04:25
左图:1.7版 右图:1.6版改版
11.32 KB, 下载次数: 49
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |