8
方
向
移
動
★対応ツクール★
RPGツクールXP
概要
とりあえず斜め移動を可能にするスクリプトです。
(他の機能は何もありません)
スクリプト
スクリプトエディタを開き、以下のセクションの対応する箇所を書き換えてください。
RGSS
セクション:Game_Player
#-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update # ローカル変数に移動中かどうかを記憶 last_moving = moving? # 移動中、イベント実行中、移動ルート強制中、 # メッセージウィンドウ表示中のいずれでもない場合 unless moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing # 方向ボタンが押されていれば、その方向へプレイヤーを移動 # ★==========================================================================☆ # 向きを保存 direction = @direction case Input.dir8 when 1 # 左下 move_left move_down # 向き固定でない場合 unless @direction_fix # 右向きだった場合は左を、上向きだった場合は下を向く @direction = (direction == 6 ? 4 : direction == 8 ? 2 : direction) end when 2 # 下 move_down when 3 # 右下 move_down move_right # 向き固定でない場合 unless @direction_fix # 左向きだった場合は右を、上向きだった場合は下を向く @direction = (direction == 4 ? 6 : direction == 8 ? 2 : direction) end when 4 # 左 move_left when 6 # 右 move_right when 7 # 左上 move_up move_left # 向き固定でない場合 unless @direction_fix # 右向きだった場合は左を、下向きだった場合は上を向く @direction = (direction == 6 ? 4 : direction == 2 ? 8 : direction) end when 8 # 上 move_up when 9 # 右上 move_right move_up # 向き固定でない場合 unless @direction_fix # 左向きだった場合は右を、下向きだった場合は上を向く @direction = (direction == 4 ? 6 : direction == 2 ? 8 : direction) end end # ☆==========================================================================★ end # ローカル変数に座標を記憶 last_real_x = @real_x last_real_y = @real_y ……
これで完了です。
…もう…何もありません。