Project1

标题: 以下脚本为何错误?缺少那些脚本 [打印本页]

作者: chd114    时间: 2011-5-20 21:22
标题: 以下脚本为何错误?缺少那些脚本
module RPG
class Sprite < ::Sprite
def initialize(viewport = nil)
super(viewport)
@_whiten_duration = 0
@_appear_duration = 0
@_escape_duration = 0
@_collapse_duration = 0
@_damage_duration = 0
@_animation_duration = 0
@_blink = false
###########################################################################
@_word_duration = 0 #(和上面保持阵形 = =|||)
###########################################################################
end
def dispose
dispose_damage
dispose_animation
dispose_loop_animation
###########################################################################
dispose_word
###########################################################################
super
end
def word(value) #本脚本63行 = =||| 众:“太恶劣了!太恶劣了!”
dispose_word #= =b 64行
bitmap = Bitmap.new(250, 48) #.....65
bitmap.font.name = "黑体" #注意字体
bitmap.font.size = 22 #字体大小  
#bitmap.font.italic = true #这个是斜体 一般可以不用
bitmap.font.color.set(0, 0, 0) #R G B
bitmap.draw_text(-1, 12-1, 250, 36, value, 1)
bitmap.draw_text(+1, 12-1, 250, 36, value, 1)
bitmap.draw_text(-1, 12+1, 250, 36, value, 1)
bitmap.draw_text(+1, 12+1, 250, 36, value, 1)
#颜色 当然可以加很多 只要你记得住 = =|||
case $word_color
when 0 #==
bitmap.font.color.set(255, 255, 255)
when 1 #==
bitmap.font.color.set(255, 0, 0)
when 2 #==
bitmap.font.color.set(0, 255, 0)
when 3 #==
bitmap.font.color.set(0, 0, 255)
when 4 # = =
bitmap.font.color.set(255, 255, 0)
end
bitmap.draw_text(0, 12, 250, 36, value, 1)
#那啥 = = 呃....94行
@_word_sprite = ::Sprite.new(self.viewport)
@_word_sprite.bitmap = bitmap
@_word_sprite.ox = 105
@_word_sprite.oy = 15
@_word_sprite.x = self.x - self.ox
@_word_sprite.y = self.y - self.oy
#Z坐标 约等于层次 值越大越在前
@_word_sprite.z = 3001
@_word_duration = 40
end
def dispose_word #善后工作 = =||| 收尸......
if @_word_sprite != nil
@_word_sprite.bitmap.dispose
@_word_sprite.dispose
@_word_sprite = nil
@_word_duration = 0
end
end
def update
super
if @_whiten_duration > 0
@_whiten_duration -= 1
self.color.alpha = 128 - (16 - @_whiten_duration) * 10
end
if @_appear_duration > 0
@_appear_duration -= 1
self.opacity = (16 - @_appear_duration) * 16
end
if @_escape_duration > 0
@_escape_duration -= 1
self.opacity = 256 - (32 - @_escape_duration) * 10
end
if @_collapse_duration > 0
@_collapse_duration -= 1
self.opacity = 256 - (48 - @_collapse_duration) * 6
end
if @_damage_duration > 0
@_damage_duration -= 1
case @_damage_duration
when 38..39
@_damage_sprite.y -= 4
when 36..37
@_damage_sprite.y -= 2
when 34..35
@_damage_sprite.y += 2
when 28..33
@_damage_sprite.y += 4
end
@_damage_sprite.opacity = 256 - (12 - @_damage_duration) * 32
if @_damage_duration == 0
dispose_damage
end
end
###########################################################################
#众:"你小子要抄到什么时候?"
#众人使出了必杀:语法错误!
#Zapper充满恐惧的想要转身逃跑!
if @_word_duration > 0
@_word_duration -= 1
case @_word_duration
when 38..39
@_word_sprite.y -= 4
when 36..37
@_word_sprite.y -= 3
when 34..35
@_word_sprite.y -= 2
when 28..33
@_word_sprite.y -= 1
end
@_word_sprite.opacity = 256 - (12 - @_word_duration) * 32
if @_word_duration == 0
dispose_word #还记得那个善后工作么?
end
end
###########################################################################
if @_animation != nil and (Graphics.frame_count % 2 == 0)
@_animation_duration -= 1
update_animation
end
if @_loop_animation != nil and (Graphics.frame_count % 2 == 0)
update_loop_animation
@_loop_animation_index += 1
@_loop_animation_index %= @_loop_animation.frame_max
end
if @_blink
@_blink_count = (@_blink_count + 1) % 32
if @_blink_count < 16
alpha = (16 - @_blink_count) * 6
else
alpha = (@_blink_count - 16) * 6
end
self.color.set(255, 255, 255, alpha)
end
@@_animations.clear
end
end
end



chd114于2011-5-21 11:21补充以下内容:
66的人呢···怎么效率在香河么滴···dsu_plus_rewardpost_czw
作者: 忧雪の伤    时间: 2011-5-21 11:36
对不起我没看懂具体要求。




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