加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
{:2_270:}明明原案测试没问题,放到我的游戏里就出现问题了。出现的是这个(错误是67位)NoMethodError,undefined method zoom_x'for nil:NilClass
原案是没问题的,为啥放到我这就有问题了,难道确实什么?
#====================================================================# # #*****************# Allow you animate battlers graphics # # #*** By Falcao ***# during the battle process # # #*****************# # # RMVX Intrucciones: Copy and paste the # # makerpalace.onlinegoo.com script to your project # #====================================================================# #-------------------------------------- # Animated Battlers 1.0 Falcao script #------------------------------------- class Game_Battler attr_accessor :zoom_x attr_accessor :zoom_y alias falcaoB_zoom_ini initialize def initialize falcaoB_zoom_ini @zoom_x = 1.0 @zoom_y = 1.0 @zoom_time = 0 end def zoom(x,y) self.zoom_x = x self.zoom_y = y end def zoom_plus(x,y) self.zoom_x += x self.zoom_y += y end def zoom_less(x,y) self.zoom_x -= x self.zoom_y -= y end def breath @zoom_time += 1 if @zoom_time <= 50 zoom_plus(0.002,0.002) end if @zoom_time >= 50 zoom_less(0.002,0.002) if self.zoom_x <= 1 zoom(1,1); @zoom_time = 0 end end end def breath_slow @zoom_time += 1 if @zoom_time <= 50 zoom_plus(0.001,0.001) end if @zoom_time >= 50 zoom_less(0.001,0.001) if self.zoom_x <= 1 zoom(1,1); @zoom_time = 0 end end end end class Sprite_Battler < Sprite_Base alias falcaoBattler_zoom_update update def update falcaoBattler_zoom_update if @zoom_x != @battler.zoom_x or @zoom_y != @battler.zoom_y @zoom_x = @battler.zoom_x @zoom_y = @battler.zoom_y self.zoom_x = @battler.zoom_x self.zoom_y = @battler.zoom_y end end alias falcaoBattler_update update_battler_bitmap def update_battler_bitmap falcaoBattler_update if @height <= 200 @battler.breath elsif @height > 200 @battler.breath_slow end end end
#====================================================================#
# #*****************# Allow you animate battlers graphics #
# #*** By Falcao ***# during the battle process #
# #*****************# #
# RMVX Intrucciones: Copy and paste the #
# makerpalace.onlinegoo.com script to your project #
#====================================================================#
#--------------------------------------
# Animated Battlers 1.0 Falcao script
#-------------------------------------
class Game_Battler
attr_accessor :zoom_x
attr_accessor :zoom_y
alias falcaoB_zoom_ini initialize
def initialize
falcaoB_zoom_ini
@zoom_x = 1.0
@zoom_y = 1.0
@zoom_time = 0
end
def zoom(x,y)
self.zoom_x = x
self.zoom_y = y
end
def zoom_plus(x,y)
self.zoom_x += x
self.zoom_y += y
end
def zoom_less(x,y)
self.zoom_x -= x
self.zoom_y -= y
end
def breath
@zoom_time += 1
if @zoom_time <= 50
zoom_plus(0.002,0.002)
end
if @zoom_time >= 50
zoom_less(0.002,0.002)
if self.zoom_x <= 1
zoom(1,1); @zoom_time = 0
end
end
end
def breath_slow
@zoom_time += 1
if @zoom_time <= 50
zoom_plus(0.001,0.001)
end
if @zoom_time >= 50
zoom_less(0.001,0.001)
if self.zoom_x <= 1
zoom(1,1); @zoom_time = 0
end
end
end
end
class Sprite_Battler < Sprite_Base
alias falcaoBattler_zoom_update update
def update
falcaoBattler_zoom_update
if @zoom_x != @battler.zoom_x or
@zoom_y != @battler.zoom_y
@zoom_x = @battler.zoom_x
@zoom_y = @battler.zoom_y
self.zoom_x = @battler.zoom_x
self.zoom_y = @battler.zoom_y
end
end
alias falcaoBattler_update update_battler_bitmap
def update_battler_bitmap
falcaoBattler_update
if @height <= 200
@battler.breath
elsif @height > 200
@battler.breath_slow
end
end
end
|