#--------------------------------------------------------------------------
# ● 向下移动
# turn_ok : 允许当场转向
#--------------------------------------------------------------------------
def move_down(turn_ok = true)
if passable?(@x, @y+1) # 可通行的场合
Audio.se_play("Audio/SE/Miss")
turn_down
@y = $game_map.round_y(@y+1)
@real_y = (@y-1)*256
increase_steps
@move_failed = false
else # 不可通行的场合
turn_down if turn_ok
check_event_trigger_touch(@x, @y+1) # 是否触发接触事件
@move_failed = true
end
end
#--------------------------------------------------------------------------
# ● 向左移动
# turn_ok : 允许当场转向
#--------------------------------------------------------------------------
def move_left(turn_ok = true)
if passable?(@x-1, @y) # 可通行的场合
Audio.se_play("Audio/SE/Miss")
turn_left
@x = $game_map.round_x(@x-1)
@real_x = (@x+1)*256
increase_steps
@move_failed = false
else # 不可通行的场合
turn_left if turn_ok
check_event_trigger_touch(@x-1, @y) # 是否触发接触事件
@move_failed = true
end
end
#--------------------------------------------------------------------------
# ● 向右移动
# turn_ok : 允许当场转向
#--------------------------------------------------------------------------
def move_right(turn_ok = true)
if passable?(@x+1, @y) # 可通行的场合
Audio.se_play("Audio/SE/Miss")
turn_right
@x = $game_map.round_x(@x+1)
@real_x = (@x-1)*256
increase_steps
@move_failed = false
else # 不可通行的场合
turn_right if turn_ok
check_event_trigger_touch(@x+1, @y) # 是否触发接触事件
@move_failed = true
end
end
#--------------------------------------------------------------------------
# ● 向上移动
# turn_ok : 允许当场转向
#--------------------------------------------------------------------------
def move_up(turn_ok = true)
if passable?(@x, @y-1) # 可通行的场合
Audio.se_play("Audio/SE/Miss")
turn_up
@y = $game_map.round_y(@y-1)
@real_y = (@y+1)*256
increase_steps
@move_failed = false
else # 不可通行的场合
turn_up if turn_ok
check_event_trigger_touch(@x, @y-1) # 是否触发接触事件
@move_failed = true
end
end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |