本帖最后由 Cupidk爱呗茶 于 2021-5-8 23:00 编辑
感觉挺好玩的就稍微弄了一下
范例
范例.rar
(1.42 MB, 下载次数: 27, 售价: 3 星屑)
以下为实现思路
定义个判断角色是否朝向事件的方法
#============================================================================== # ■ Game_Event #------------------------------------------------------------------------------ # 处理事件的类。拥有条件判断、事件页的切换、并行处理、执行事件等功能。 #============================================================================== class Game_Event def player_direction? case $game_player.direction when 2 $game_player.y < self.y when 4 $game_player.x > self.x when 6 $game_player.x < self.x when 8 $game_player.y > self.y end end end
#==============================================================================
# ■ Game_Event
#------------------------------------------------------------------------------
# 处理事件的类。拥有条件判断、事件页的切换、并行处理、执行事件等功能。
#==============================================================================
class Game_Event
def player_direction?
case $game_player.direction
when 2
$game_player.y < self.y
when 4
$game_player.x > self.x
when 6
$game_player.x < self.x
when 8
$game_player.y > self.y
end
end
end
自主移动中调用移动方法 并用player_direction?方法判断
对了顺便一提 如果使用自动随机的那种移动 忽略障碍大概也是比较重要的 最好还是点上比较好 |