ツクールMVを始めてから3日目です。
プログラミングのブランクは5年あり,JavaScriptでの開発はほとんど未経験に近いです。
この度,10年前から開発予定だった新ローグライクを完成させるべく再開しました。
よろしくお願いします。
早速ですが,症状は以下の通りです。
コード: 全て選択
(function() {
'use strict';//厳格モード
Game_Player.prototype.moveByInput = function() {
if (!this.isMoving() && this.canMove()) {
var player = this.character(-1);//←エラー
var direction = this.getInputDirection();
if (direction > 0) {
$gameTemp.clearDestination();
}
else if ($gameTemp.isDestinationValid()) {
var x = $gameTemp.destinationX();
var y = $gameTemp.destinationY();
direction = this.findDirectionTo(x, y);
}
if (direction > 0) {
this.executeMove(direction);
}
}
};
/*
TypeError: undefined is not a function
at Game_Player.moveByInput (***.js:54)
at Game_Player.update (rpg_objects.js:7668)
at Scene_Map.updateMain (rpg_scenes.js:609)
at Scene_Map.updateMainMultiply (rpg_scenes.js:600)
at Scene_Map.update (rpg_scenes.js:589)
at Function.SceneManager.updateScene (rpg_managers.js:2024)
at Function.SceneManager.updateMain (rpg_managers.js:1983)
at Function.SceneManager.update (rpg_managers.js:1907)
*/
})();