Project1

标题: 如何设置玩家走一步某变量+1? [打印本页]

作者: shy    时间: 2014-3-2 12:10
标题: 如何设置玩家走一步某变量+1?
就是实现这样一个效果
“当玩家使用方向键让主角移动一步的时候,变量1会+1”
作者: 余烬之中    时间: 2014-3-2 12:21
本帖最后由 余烬之中 于 2014-3-2 12:22 编辑

RUBY 代码复制
  1. class Game_Party
  2.   alias :mo_57c30f6c785f6485882d028e032badfc_increase_steps :increase_steps
  3.   def increase_steps
  4.     mo_57c30f6c785f6485882d028e032badfc_increase_steps
  5.     $game_variables[变量ID] += 1
  6.   end
  7. end


如果需要开关就用
$game_variables[变量ID] += 1 if $game_switches[开关ID]
作者: fux2    时间: 2014-3-2 12:31
在你开始记录的时候使这个变量=步数
在你想获取这个变量的时候,用当前步数减去这个变量。
作者: taroxd    时间: 2014-3-2 13:28
本帖最后由 taroxd 于 2014-3-2 13:29 编辑

http://rpg.blue/thread-344203-1-1.html

10L,exactly what you want




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