Project1

标题: 朝向问题 [打印本页]

作者: xuanming    时间: 2007-7-16 00:41
标题: 朝向问题
我用的是八方向人物图,我想在场所移动的时候人物的脸能朝左上或者右下之类的,有什么方法能做到吗? 场所移动那里只有上下左右而已,唉
作者: xuanming    时间: 2007-7-16 00:41
标题: 朝向问题
我用的是八方向人物图,我想在场所移动的时候人物的脸能朝左上或者右下之类的,有什么方法能做到吗? 场所移动那里只有上下左右而已,唉
作者: K’    时间: 2007-7-16 01:41
首先 Game_Character 1中

  attr_reader   :direction                # 朝向

改为
  attr_accessor   :direction                # 朝向

之后用 $game_player.direction = 1 就是面向左下了

3是右下 7是左上 9是右上
作者: xuanming    时间: 2007-7-16 01:50
之后用 $game_player.direction = 1 就是面向左下了

3是右下 7是左上 9是右上


你说的后面这句我还不太懂, $game_player.direction = 1 是说在脚本哪里改呢,还是说在游戏
的时候输入呢?还是说别的...
作者: doranikofu    时间: 2007-7-16 02:00
如果用得比较多 就改一下脚本

把这一段插到Game_Character 3里面
为了方便查看 建议放到400多行● 面向向上 的下面

然后在游戏中用事件“设置移动路线”控制的人物行动的时候:
选择 “脚本” 然后输入“turn_lower_left”(其他方向依次类推)

  1.   #--------------------------------------------------------------------------
  2.   # ● 面向八向斜方向
  3.   #--------------------------------------------------------------------------
  4.   def turn_lower_left
  5.     unless @direction_fix
  6.       @direction = 1
  7.       @stop_count = 0
  8.     end
  9.   end
  10.   def turn_lower_right
  11.     unless @direction_fix
  12.       @direction = 3
  13.       @stop_count = 0
  14.     end
  15.   end
  16.   def turn_upper_left
  17.     unless @direction_fix
  18.       @direction = 7
  19.       @stop_count = 0
  20.     end
  21.   end
  22.   def turn_upper_right
  23.     unless @direction_fix
  24.       @direction = 9
  25.       @stop_count = 0
  26.     end
  27.   end
复制代码

作者: 挖掉你的心    时间: 2007-7-16 02:00
很明显...脚本里改....




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1