- 注册时间
- 2008-2-19
- 最后登录
- 2019-5-19
⑥精研
●~ ●~ ●
- 积分
- 1635
|

楼主 |
发表于 2010-1-7 10:58:33
|
显示全部楼层
改成这样??
    def update_animation
      if @_animation_duration > 0
        frame_index = @_animation.frame_max - @_animation_duration
        cell_data = @_animation.frames[frame_index].cell_data
        position = @_animation.position
        animation_set_sprites(@_animation_sprites, cell_data, position)
        for timing in @_animation.timings
          if timing.frame == frame_index
            animation_process_timing(timing, @_animation_hit)
          end
        end
      else
        dispose_animation
      end
    end
class Scene_Map
alias update_old update
def update
update_old
    # 按下 S键的情况下
    if Input.press?(Input::Y)
      case $game_player.direction
      when 2
        $game_player.animation_id = 201
        $game_variables[10] += 1
      when 4
        $game_player.animation_id = 202
        $game_variables[9] -= 1
      when 6
        $game_player.animation_id = 203
        $game_variables[9] += 1
      when 8
        $game_player.animation_id = 204
        $game_variables[10] -= 1
      end
     $game_map.events[45].moveto($game_variables[9] , $game_variables[10])
      if @_animation_duration > 0
      update_animation
      else
        dispose_animation #剩余时间小于0了,也就是动画播放完毕了,就释放动画
      end
      return
end
end |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|