设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1549|回复: 0

[有事请教] 待机动画求助

[复制链接]

Lv2.观梦者

梦石
0
星屑
342
在线时间
113 小时
注册时间
2021-7-31
帖子
56
发表于 2021-8-8 13:13:58 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
vx博物馆的待机动画脚本,我想做主角眨眼,可是眨的太快了啊,求助QAQ。
#==============================================================================
# 本脚本来自www.66rpg.com,转载和使用请保留此信息
#==============================================================================

#==============================================================================
# ■ Game_Character
#------------------------------------------------------------------------------
# 处理角色的类。本类作为 Game_Player 类与 Game_Event
# 类的超级类使用。
#修改by やめて
#由xp修改而来,不保证无错误
#==============================================================================

class Game_Character
attr_accessor :time
#--------------------------------------------------------------------------
# ● 初始化对像
#--------------------------------------------------------------------------
alias old_ini initialize
def initialize
   old_ini
   @time = 0
end
end

#==============================================================================
# ■ Game_Player
#------------------------------------------------------------------------------
#  处理主角的类。事件启动的判定、以及地图的滚动等功能。
# 本类的实例请参考 $game_player。
#==============================================================================

class Game_Player < Game_Character
TIME_LIMIT = 300  # 抓耳挠腮前的等待时间 (好象也不是帧…不知道是什么单位了)
#--------------------------------------------------------------------------
# ● 画面更新
#--------------------------------------------------------------------------
def update
   # 本地变量记录移动信息
   last_moving = moving?
   if @time == TIME_LIMIT
     @character_name = @character_name + "_W"
     @scratch = true
     @step_anime = true
     @time = TIME_LIMIT + 1
   elsif @time < TIME_LIMIT
     @scratch = false
     @step_anime = false
   end
   if @scratch == false
     @old_pic = @character_name
   end
   # 移动中、事件执行中、强制移动路线中、
   # 信息窗口一个也不显示的时候
   unless moving? or $game_map.interpreter.running? or
          @move_route_forcing or $game_message.visible
     # 如果方向键被按下、主角就朝那个方向移动
     case Input.dir4
     when 2
       move_down
       @time = 0
       @scratch = false
       @character_name = @old_pic
     when 4
       move_left
       @time = 0
       @scratch = false
       @character_name = @old_pic
     when 6
       move_right
       @time = 0
       @scratch = false
       @character_name = @old_pic
     when 8
       move_up
       @time = 0
       @scratch = false
       @character_name = @old_pic
     end
   end
   # 本地变量记忆坐标
   last_real_x = @real_x
   last_real_y = @real_y
   super
   # 角色向下移动、画面上的位置在中央下方的情况下
   if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
     # 画面向下卷动
     $game_map.scroll_down(@real_y - last_real_y)
   end
   # 角色向左移动、画面上的位置在中央左方的情况下
   if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X
     # 画面向左卷动
     $game_map.scroll_left(last_real_x - @real_x)
   end
   # 角色向右移动、画面上的位置在中央右方的情况下
   if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X
     # 画面向右卷动
     $game_map.scroll_right(@real_x - last_real_x)
   end
   # 角色向上移动、画面上的位置在中央上方的情况下
   if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y
     # 画面向上卷动
     $game_map.scroll_up(last_real_y - @real_y)
   end
   # 不在移动中的情况下
   unless moving?
     @time += 1if @time < TIME_LIMIT
     # 上次主角移动中的情况
     if last_moving
       # 与同位置的事件接触就判定为事件启动
       result = check_event_trigger_here([1,2])
       # 没有可以启动的事件的情况下
       if result == false
         # 调试模式为 ON 并且按下 CTRL 键的情况下除外
         unless $TEST and Input.press?(Input::CTRL)
           # 遇敌计数下降
           if @encounter_count > 0
             @encounter_count -= 1
           end
         end
       end
     end
     # 按下 C 键的情况下
     if Input.trigger?(Input::C)
       # 判定为同位置以及正面的事件启动
       check_event_trigger_here([0])
       check_event_trigger_there([0,1,2])
     end
   end
end
end

#==============================================================================
# 本脚本来自www.66rpg.com,转载和使用请保留此信息
#==============================================================================
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-3-29 01:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表