【鸡肋Mini插件】弹性镜头移动
JAVASCRIPT 代码下载//=============================================================================
// Mount Blade Battle System Engine Plugins - Elastically Scroll
// MBBS_ElasticallyScroll.js
//=============================================================================
/*:
* @plugindesc v1.0 MBBS Plugins:
群战系统MV插件系列之 - 弹性镜头移动 【XP移植】
MBBS_ElasticallyScroll
* @author Chivalry Studio Plugins / Ivan
*/
var Imported = Imported || {};
Imported.MBBS_ElasticallyScroll = true;
var MBBS_MV = MBBS_MV || {};
MBBS_MV.ElasticallyScroll = MBBS_MV.MBBS_ElasticallyScroll || {};
//=============================================================================
// Game_Player
//=============================================================================
Game_Player.prototype.updateScroll = function(lastScrolledX, lastScrolledY){
var x1 = lastScrolledX;
var y1 = lastScrolledY;
var x2 = this.scrolledX();
var y2 = this.scrolledY();
var halfTileWidth = $gameMap.tileWidth()/2.0;
var halfTileHeight = $gameMap.tileHeight()/2.0;
var yGrid = this.centerY()*2;
var xGrid = this.centerX()*2;
if(y2 > this.centerY()){
$gameMap.scrollDown(this._realY > $gameMap.height() - this.centerY() ?
($gameMap.height() - yGrid - $gameMap.displayY())/halfTileHeight :
((y2 - yGrid + this.centerY())/halfTileHeight))
}
if(x2 < this.centerX()){
$gameMap.scrollLeft(this._realX < this.centerX() ? $gameMap.displayX()/halfTileWidth :
(($gameMap.displayX() + this.centerX() - this._realX)/halfTileWidth))
}
if(x2 > xGrid - this.centerX()){
$gameMap.scrollRight(this._realX > $gameMap.width - this.centerX()?
(($gameMap.width - xGrid) - $gameMap.displayX())/halfTileWidth :
(x2 - xGrid + this.centerX())/halfTileWidth)
}
if(y2 < this.centerY()){
$gameMap.scrollUp(this._realY < this.centerY() ?$gameMap.displayY()/halfTileHeight :
(($gameMap.displayY()+this.centerY()-this._realY)/halfTileHeight))
}
};
if(Imported.MBBS_MV){
Game_EFS_Hero.prototype.updateScroll = function(lastScrolledX, lastScrolledY){
var x1 = lastScrolledX;
var y1 = lastScrolledY;
var x2 = this.scrolledX();
var y2 = this.scrolledY();
var halfTileWidth = $gameMap.tileWidth()/2.0;
var halfTileHeight = $gameMap.tileHeight()/2.0;
var yGrid = this.centerY()*2;
var xGrid = this.centerX()*2;
if(y2 > this.centerY()){
$gameMap.scrollDown(this._realY > $gameMap.height() - this.centerY() ?
($gameMap.height() - yGrid - $gameMap.displayY())/halfTileHeight :
((y2 - yGrid + this.centerY())/halfTileHeight))
}
if(x2 < this.centerX()){
$gameMap.scrollLeft(this._realX < this.centerX() ? $gameMap.displayX()/halfTileWidth :
(($gameMap.displayX() + this.centerX() - this._realX)/halfTileWidth))
}
if(x2 > xGrid - this.centerX()){
$gameMap.scrollRight(this._realX > $gameMap.width - this.centerX()?
(($gameMap.width - xGrid) - $gameMap.displayX())/halfTileWidth :
(x2 - xGrid + this.centerX())/halfTileWidth)
}
if(y2 < this.centerY()){
$gameMap.scrollUp(this._realY < this.centerY() ?$gameMap.displayY()/halfTileHeight :
(($gameMap.displayY()+this.centerY()-this._realY)/halfTileHeight))
}
};
}
//=============================================================================
// End of File
//=============================================================================
这个插件本来是群战核心系统的一部分,我今天顺手给他拆了出来,=。=
具体功能很鸡肋,就是让主角移动的时候镜头有弹性地滚动。试试看就知道了
可以配合群战核心系统使用(然而并没有发布)
本帖来自P1论坛作者刺夜之枪,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=395907若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
页:
[1]