#============================================================================== # # ■減速直線運動スクリプト■ # # 移動ルートの設定の「ジャンプ」の効果を減速直線運動に変えます。 # # 作成日:2017/2/19 # 作成者:かげろう # URL:http://cgpoldpersonteam.blog.fc2.com/ # #============================================================================== #============================================================================== # 自由に設定してください #============================================================================== module ReduceLinearMotion #このIDのスイッチがオンの時のみジャンプを減速直線運動に変える SWITCH_ID = 1 # 移動速度(0〜1の範囲で指定。0はダメ。大きいほど速くなる) SPEED = 0.1 # 移動中足踏みするかどうか(true:足踏みする false:足踏みしない) # 足踏みアニメのON/OFFには影響されません) WALK_ANIM = false end #============================================================================== # 以下はいじらないでください #============================================================================== class Game_Character #-------------------------------------------------------------------------- # ● 画面 Y 座標の取得 #-------------------------------------------------------------------------- def screen_y y = ($game_map.adjust_y(@real_y) + 8007) / 8 - 1000 + 32 y -= 4 unless object? if $game_switches[ReduceLinearMotion::SWITCH_ID] == false if @jump_count >= @jump_peak n = @jump_count - @jump_peak else n = @jump_peak - @jump_count end return y - (@jump_peak * @jump_peak - n * n) / 2 else return y end end #-------------------------------------------------------------------------- # ● ジャンプ時の更新 #-------------------------------------------------------------------------- def update_jump if $game_switches[ReduceLinearMotion::SWITCH_ID] == false @jump_count -= 1 else @jump_count -= (@jump_count * ReduceLinearMotion::SPEED) if @jump_count < ReduceLinearMotion::SPEED @jump_count = 0 end if ReduceLinearMotion::WALK_ANIM == true @anime_count += 1 end end @real_x = (@real_x * @jump_count + @x * 256) / (@jump_count + 1) @real_y = (@real_y * @jump_count + @y * 256) / (@jump_count + 1) update_bush_depth end end