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

Project1

 找回密码
 注册会员
搜索
查看: 1095|回复: 1
打印 上一主题 下一主题

[已经过期] 以下脚本为何错误?缺少那些脚本

 关闭 [复制链接]

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

跳转到指定楼层
1
发表于 2011-5-20 21:22:10 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
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的人呢···怎么效率在香河么滴···
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png

Lv2.观梦者

虚構歪曲

梦石
0
星屑
334
在线时间
1196 小时
注册时间
2010-12-18
帖子
3928

贵宾

2
发表于 2011-5-21 11:36:34 | 只看该作者
对不起我没看懂具体要求。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2025-7-21 15:19

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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