#============================================================================== # ■ Game_Character #------------------------------------------------------------------------------ # 添加了行走图放缩的功能。 #------------------------------------------------------------------------------ # 作者:你最珍贵 # 日期:2014-04-3 13:10 # 使用方法:移动路线中 zoom(x, y, time) #============================================================================== class Game_Character #-------------------------------------------------------------------------- # ● 定义实例变量 #-------------------------------------------------------------------------- attr_accessor :zoom_x # 图形X放大率 attr_accessor :zoom_y # 图形Y放大率 attr_accessor :zoom_time # 图形放大时间 #-------------------------------------------------------------------------- # ● 初始化对像 #-------------------------------------------------------------------------- alias fs_zoom_initialize initialize def initialize fs_zoom_initialize @zoom_x = @zoom_y = 1.0 @zoom_time = 0 end #-------------------------------------------------------------------------- # ● 设置角色图像放大率(移动路线中 zoom(x,y)) #-------------------------------------------------------------------------- def zoom(zoom_x, zoom_y,zoom_time=0) @zoom_time = zoom_time.to_f * 7 @zoom_x = zoom_x / 100.0 @zoom_y = zoom_y / 100.0 end end class Sprite_Character < RPG::Sprite alias fs_zoom_update update #-------------------------------------------------------------------------- # ● 更新画面 #-------------------------------------------------------------------------- def update # 刷新角色放缩 fs_zoom_update if @character.zoom_time > 0 @move_time = @character.zoom_time @x,@y = self.zoom_x,self.zoom_y;@character.zoom_time -= 1 @target_x,@target_y = @character.zoom_x,@character.zoom_y self.zoom_x = (@x * (@move_time - 1) + @target_x) / @move_time self.zoom_y = (@y * (@move_time - 1) + @target_y) / @move_time end end end
89444640 发表于 2014-4-16 13:56
楼主请教这个脚本和重力脚本冲突问题
具体是重力脚本240行nomethoderror
undefined method - for nil:nilc ...
7.33 KB, 下载次数: 46
工程中用的脚本
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |