赞 | 0 |
VIP | 36 |
好人卡 | 0 |
积分 | 1 |
经验 | 2608 |
最后登录 | 2020-5-5 |
在线时间 | 52 小时 |
Lv1.梦旅人 敌敌畏
- 梦石
- 0
- 星屑
- 80
- 在线时间
- 52 小时
- 注册时间
- 2008-5-12
- 帖子
- 1748
|
7楼
楼主 |
发表于 2008-9-8 03:59:47
|
只看该作者
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
# タイトル画面の処理を行うクラスです。
#==============================================================================
class Scene_Snow < Scene_Base
WEATHER = 4 # 使用自定义效果(0:无,1:雨,2:暴风雨,3:雪,4:自定义)
MAXNUMBER = 18 # 天气图片数量
WEATHER_FILE = "Graphics/Pictures/Title_starlong.png"
# 自定义图片路径,这个文件是流星雨
BLEND_TYPE = 1 # 合成方式(0:普通,1:加法,2:减法)
WEATHER_X = 5 # X方向每回合减少象素
WEATHER_Y = 5 # Y方向每回合减少象素
WEATHER_OPACITY = 2 #每回合减低透明度
START_OPACITY = 200 #出现时的透明度
RAND_X = 1200 # 随机X范围
RAND_Y = 600 # 随机Y范围
HEIGHT = -600 # 出现时候的屏幕Y
WIDTH = 100 # 出现时候的屏幕X
#--------------------------------------------------------------------------
# ● 開始处理
#--------------------------------------------------------------------------
def start
super
@ox = 0
@oy = 0
color1 = Color.new(255, 255, 255, 255)
color2 = Color.new(255, 255, 255, 128)
@rain_bitmap = Bitmap.new(7, 56)
for i in 0..6
@rain_bitmap.fill_rect(6-i, i*8, 1, 8, color1)
end
@storm_bitmap = Bitmap.new(34, 64)
for i in 0..31
@storm_bitmap.fill_rect(33-i, i*2, 1, 2, color2)
@storm_bitmap.fill_rect(32-i, i*2, 1, 2, color1)
@storm_bitmap.fill_rect(31-i, i*2, 1, 2, color2)
end
@snow_bitmap = Bitmap.new(6, 6)
@snow_bitmap.fill_rect(0, 1, 6, 4, color2)
@snow_bitmap.fill_rect(1, 0, 4, 6, color2)
@snow_bitmap.fill_rect(1, 2, 4, 2, color1)
@snow_bitmap.fill_rect(2, 1, 2, 4, color1)
@sprites = []
for i in 1..40
sprite = Sprite.new
case WEATHER
when 1
sprite.bitmap = @rain_bitmap
when 2
sprite.bitmap = @storm_bitmap
when 3
sprite.bitmap = @snow_bitmap
when 4
sprite.bitmap = Bitmap.new(WEATHER_FILE)
end
sprite.z = 1000
sprite.x = -1000
sprite.y = -1000
sprite.visible = (i <= MAXNUMBER)
sprite.blend_type = BLEND_TYPE
sprite.opacity = START_OPACITY
@sprites.push(sprite)
end
weather_update
# タイトル画面の音楽を演奏
end
#--------------------------------------------------------------------------
# ● トランジション実行
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# ● 開始後処理
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# ● 終了前処理
#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
# ● 終了処理
#--------------------------------------------------------------------------
def terminate
super
dispose_command_window
snapshot_for_background
@sprite.bitmap.dispose
@sprite.dispose
for sprite in @sprites
sprite.dispose
end
@rain_bitmap.dispose
@storm_bitmap.dispose
@snow_bitmap.dispose
dispose_title_graphic
end
def weather_update#111111111111111111
return if WEATHER == 0
for i in 1..MAXNUMBER
sprite = @sprites
if sprite == nil
break
end
if WEATHER == 1
sprite.x -= 2
sprite.y += 16
sprite.opacity -= 8
end
if WEATHER == 2
sprite.x -= 8
sprite.y += 16
sprite.opacity -= 12
end
if WEATHER == 3
sprite.x -= 2
sprite.y += 8
sprite.opacity -= 8
end
if WEATHER == 4
sprite.x -= WEATHER_X
sprite.y += WEATHER_Y
sprite.opacity -= WEATHER_OPACITY
end
x = sprite.x - @ox
y = sprite.y - @oy
if sprite.opacity < 32 or x < -100 or x > 750 or y < -1000 or y > 500
sprite.x = rand(RAND_X) + WIDTH + @ox
sprite.y = rand(RAND_Y) + HEIGHT + @oy
sprite.opacity = START_OPACITY
end
end
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
weather_update
end
end
这段脚本怎么就扔不到scene里面呢?愤怒 |
|