executeMoveの機能を修正する
他のプラグインから学んだ後、自分で作成する。
正式なプラグインの書き方について学びました。
はじめに:
//==========================
/*:
* @plugindesc Flysword_8Move
* @author Flysword.
*
*/
//==========================
このようにヘッダーを書くと、Rpg Maker MVはそれを認識します!
8方向の移動について:
7 8 9
4 5 6
1 2 3
各方向はMVでこのように定義されます。
新人のような素朴なコードを書く:
if (direction == 1){
if (this.canPassDiagonally(this.x, this.y, 4 , 2)) {
this.moveDiagonally(4 , 2);
}else{
if (this.canPass(this.x, this.y, 2)){
this.moveStraight(2);
}else{
if (this.canPass(this.x, this.y, 4))
this.moveStraight(4);
}
}
}
このような、左上に移動したいとき、このような判定。
あと 3、7、9、別々に書く。
Game Test!
元の動きよりも滑らか ね > w<