【VA☆脚本】智能的八方向行走
rmva吧
全部回复
仅看楼主
level 11
zt菌 楼主
脚本:
#============================================================================== # ■ VXAce-RGSS3-26 8方向移动 [Ver.1.0.0] by Claimh #------------------------------------------------------------------------------ # 8方向の移动が可能となります。 # 斜め移动ができない时に縦or横に移动できる场合は縦or横に移动するようになります。 #============================================================================== class Game_Player < Game_Character #-------------------------------------------------------------------------- # ● 方向ボタン入力による移动処理 #-------------------------------------------------------------------------- def move_by_input return if !movable? || $game_map.interpreter.running? if [1, 3, 7, 9].include?(Input.dir8) case Input.dir8 when 1; move_diagonal(4, 2) when 3; move_diagonal(6, 2) when 7; move_diagonal(4, 8) when 9; move_diagonal(6, 8) end return if @move_succeed end move_straight(Input.dir4) if Input.dir4 > 0 end end class Game_CharacterBase #--------------------------------------------------------------------------
# ● 斜めに移动 #
horz : 横方向(4 or 6)
# vert : 縦方向(2 or 8) #
-------------------------------------------------------------------------- alias move_diagonal_8dir move_diagonal def move_diagonal(horz, vert) if !passable?(@x, @y, horz) and !passable?(@x, @y, vert) @move_succeed = false return end return move_straight(horz) if passable?(@x, @y, horz) and !passable?(@x, @y, vert) return move_straight(vert) if !passable?(@x, @y, horz) and passable?(@x, @y, vert) move_diagonal_8dir(horz, vert) end end
截图:
原网址:
http://www4.plala.or.jp/findias/codecrush/material/vxace_rgss3/26-8dir_walk/index.html
2013年05月01日 11点05分 1
level 11
zt菌 楼主
发现涂鸦好好玩
2013年05月21日 12点05分 3
level 10
怎么添加啊
2013年06月17日 07点06分 4
打开VA.按下F11.把脚本插进mian前.
2013年06月17日 14点06分
level 13
伪八方向?感觉很不爽……
2013年06月18日 00点06分 5
1