赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 3902 |
最后登录 | 2015-1-14 |
在线时间 | 139 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 139 小时
- 注册时间
- 2013-1-30
- 帖子
- 65
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
错误图片:
脚本如下:
#============================================================================== # ■ Window_TitleCommand #------------------------------------------------------------------------------ # 66RPG /YUI # 2011/12/22 #============================================================================== class Window_TitleCommand < Window_Command #-------------------------------------------------------------------------- # ● 生成指令列表 #-------------------------------------------------------------------------- def make_command_list add_command(Vocab::new_game, :new_game) add_command(Vocab::continue, :continue, continue_enabled) add_command("主页", :jump)#引号内中文自由编辑 add_command(Vocab::shutdown, :shutdown) end end #============================================================================== # ■ Scene_Title #------------------------------------------------------------------------------ # 标题画面 #============================================================================== class Scene_Title < Scene_Base #-------------------------------------------------------------------------- # ● 开始处理 #-------------------------------------------------------------------------- def start super SceneManager.clear Graphics.freeze create_background create_foreground create_command_window play_title_music end #-------------------------------------------------------------------------- # ● 取得渐变速度 #-------------------------------------------------------------------------- def transition_speed return 20 end #-------------------------------------------------------------------------- # ● 结束处理 #-------------------------------------------------------------------------- def terminate super SceneManager.snapshot_for_background dispose_background dispose_foreground end #-------------------------------------------------------------------------- # ● 生成背景 #-------------------------------------------------------------------------- def create_background @sprite1 = Sprite.new @sprite1.bitmap = Cache.title1($data_system.title1_name) @sprite2 = Sprite.new @sprite2.bitmap = Cache.title2($data_system.title2_name) center_sprite(@sprite1) center_sprite(@sprite2) end #-------------------------------------------------------------------------- # ● 生成前景 #-------------------------------------------------------------------------- def create_foreground @foreground_sprite = Sprite.new @foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height) @foreground_sprite.z = 100 draw_game_title if $data_system.opt_draw_title end #-------------------------------------------------------------------------- # ● 描画游戏标题 #-------------------------------------------------------------------------- def draw_game_title @foreground_sprite.bitmap.font.size = 48 rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2) @foreground_sprite.bitmap.draw_text(rect, $data_system.game_title, 1) end #-------------------------------------------------------------------------- # ● 释放背景 #-------------------------------------------------------------------------- def dispose_background @sprite1.bitmap.dispose @sprite1.dispose @sprite2.bitmap.dispose @sprite2.dispose end #-------------------------------------------------------------------------- # ● 释放前景 #-------------------------------------------------------------------------- def dispose_foreground @foreground_sprite.bitmap.dispose @foreground_sprite.dispose end #-------------------------------------------------------------------------- # ● 执行活动块的居中化 #-------------------------------------------------------------------------- def center_sprite(sprite) sprite.ox = sprite.bitmap.width / 2 sprite.oy = sprite.bitmap.height / 2 sprite.x = Graphics.width / 2 sprite.y = Graphics.height / 2 end #-------------------------------------------------------------------------- # ● 生成指令窗口 #-------------------------------------------------------------------------- def create_command_window @command_window = Window_TitleCommand.new @command_window.set_handler(:new_game, method(:command_new_game)) @command_window.set_handler(:continue, method(:command_continue)) @command_window.set_handler(:jump, method(:command_jump)) @command_window.set_handler(:shutdown, method(:command_shutdown)) end #-------------------------------------------------------------------------- # ● 关闭指令窗口 #-------------------------------------------------------------------------- def close_command_window @command_window.close update until @command_window.close? end #-------------------------------------------------------------------------- # ● 指令[新游戏] #-------------------------------------------------------------------------- def command_new_game DataManager.setup_new_game close_command_window fadeout_all $game_map.autoplay SceneManager.goto(Scene_Map) end #-------------------------------------------------------------------------- # ● 指令[继续] #-------------------------------------------------------------------------- def command_continue close_command_window SceneManager.call(Scene_Load) end #-------------------------------------------------------------------------- # ● 跳转网页 #-------------------------------------------------------------------------- def command_jump [url=home.php?mod=space&uid=271873]@jump[/url] = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')# @jump.call(0, 'open','http://www.4399.com',0, 0, 1) # 修改网址 @command_window.activate end #-------------------------------------------------------------------------- # ● 指令[退出] #-------------------------------------------------------------------------- def command_shutdown close_command_window fadeout_all SceneManager.exit end #-------------------------------------------------------------------------- # ● 演奏标题画面的音乐 #-------------------------------------------------------------------------- def play_title_music $data_system.title_bgm.play RPG::BGS.stop RPG::ME.stop end end
#==============================================================================
# ■ Window_TitleCommand
#------------------------------------------------------------------------------
# 66RPG /YUI
# 2011/12/22
#==============================================================================
class Window_TitleCommand < Window_Command
#--------------------------------------------------------------------------
# ● 生成指令列表
#--------------------------------------------------------------------------
def make_command_list
add_command(Vocab::new_game, :new_game)
add_command(Vocab::continue, :continue, continue_enabled)
add_command("主页", :jump)#引号内中文自由编辑
add_command(Vocab::shutdown, :shutdown)
end
end
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
# 标题画面
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# ● 开始处理
#--------------------------------------------------------------------------
def start
super
SceneManager.clear
Graphics.freeze
create_background
create_foreground
create_command_window
play_title_music
end
#--------------------------------------------------------------------------
# ● 取得渐变速度
#--------------------------------------------------------------------------
def transition_speed
return 20
end
#--------------------------------------------------------------------------
# ● 结束处理
#--------------------------------------------------------------------------
def terminate
super
SceneManager.snapshot_for_background
dispose_background
dispose_foreground
end
#--------------------------------------------------------------------------
# ● 生成背景
#--------------------------------------------------------------------------
def create_background
@sprite1 = Sprite.new
@sprite1.bitmap = Cache.title1($data_system.title1_name)
@sprite2 = Sprite.new
@sprite2.bitmap = Cache.title2($data_system.title2_name)
center_sprite(@sprite1)
center_sprite(@sprite2)
end
#--------------------------------------------------------------------------
# ● 生成前景
#--------------------------------------------------------------------------
def create_foreground
@foreground_sprite = Sprite.new
@foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
@foreground_sprite.z = 100
draw_game_title if $data_system.opt_draw_title
end
#--------------------------------------------------------------------------
# ● 描画游戏标题
#--------------------------------------------------------------------------
def draw_game_title
@foreground_sprite.bitmap.font.size = 48
rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2)
@foreground_sprite.bitmap.draw_text(rect, $data_system.game_title, 1)
end
#--------------------------------------------------------------------------
# ● 释放背景
#--------------------------------------------------------------------------
def dispose_background
@sprite1.bitmap.dispose
@sprite1.dispose
@sprite2.bitmap.dispose
@sprite2.dispose
end
#--------------------------------------------------------------------------
# ● 释放前景
#--------------------------------------------------------------------------
def dispose_foreground
@foreground_sprite.bitmap.dispose
@foreground_sprite.dispose
end
#--------------------------------------------------------------------------
# ● 执行活动块的居中化
#--------------------------------------------------------------------------
def center_sprite(sprite)
sprite.ox = sprite.bitmap.width / 2
sprite.oy = sprite.bitmap.height / 2
sprite.x = Graphics.width / 2
sprite.y = Graphics.height / 2
end
#--------------------------------------------------------------------------
# ● 生成指令窗口
#--------------------------------------------------------------------------
def create_command_window
@command_window = Window_TitleCommand.new
@command_window.set_handler(:new_game, method(:command_new_game))
@command_window.set_handler(:continue, method(:command_continue))
@command_window.set_handler(:jump, method(:command_jump))
@command_window.set_handler(:shutdown, method(:command_shutdown))
end
#--------------------------------------------------------------------------
# ● 关闭指令窗口
#--------------------------------------------------------------------------
def close_command_window
@command_window.close
update until @command_window.close?
end
#--------------------------------------------------------------------------
# ● 指令[新游戏]
#--------------------------------------------------------------------------
def command_new_game
DataManager.setup_new_game
close_command_window
fadeout_all
$game_map.autoplay
SceneManager.goto(Scene_Map)
end
#--------------------------------------------------------------------------
# ● 指令[继续]
#--------------------------------------------------------------------------
def command_continue
close_command_window
SceneManager.call(Scene_Load)
end
#--------------------------------------------------------------------------
# ● 跳转网页
#--------------------------------------------------------------------------
def command_jump
[url=home.php?mod=space&uid=271873]@jump[/url] = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')#
@jump.call(0, 'open','http://www.4399.com',0, 0, 1) # 修改网址
@command_window.activate
end
#--------------------------------------------------------------------------
# ● 指令[退出]
#--------------------------------------------------------------------------
def command_shutdown
close_command_window
fadeout_all
SceneManager.exit
end
#--------------------------------------------------------------------------
# ● 演奏标题画面的音乐
#--------------------------------------------------------------------------
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end
end
#encoding:utf-8 #============================================================================== # ■ 薄雾年代记标题脚本 #------------------------------------------------------------------------------ # 薄雾年代记的标题脚本 #============================================================================== #============================================================================== # 介绍: # 这个不完全是薄雾的标题脚本,但是是那个的普适版,作者:LBQ,请自由使用,转载 #============================================================================== # 设置模块 module LBQ module MC_Title #logo还有选项的淡入速度,数字越大淡出淡入越快 FADE_SPEED=4 #黑暗层的淡入淡出速度,数字越大淡出淡入越快。第一项是进入场景,第二项是退出 MASK_FADE=[5,3] #背景滑动速度,默认是[2,1],即为每两帧横向滑动一个单位。 SHIFT_SPEED=[2,1] #图像设置 GRAPHICS=['Choice','spark','logo','background'] #生成一个新的闪光点的间隔时间 TIME_SPARK=12 #分辨率设定 RESOLUTION=[640,480] #储存文件的文件夹名称,位于Graphics文件夹下面 FOLDER="Title" #离开界面的时候的BGM淡出速度,单位毫秒 BGM_FADE=1600 #4个层的Z坐标设定。 Z_SETTINGS=[1,2,3,4] #闪光的生命周期。(半衰期,总共生命周期)←装X的设定 LIFE_CYCLE=[300,500] end end #Cache加强 module Cache include LBQ::MC_Title #-------------------------------------------------------------------------- # ● 标题 #-------------------------------------------------------------------------- def self.mc_title(filename) load_bitmap("Graphics/#{FOLDER}/", filename) end end #============================================================================== # ■ LBQ Spark #------------------------------------------------------------------------------ # 闪光的精灵类 #============================================================================== class Sprite_lbqSpark < Sprite_Base include LBQ::MC_Title def initialize(viewport=nil) @timer=0 super(viewport) self.bitmap=Cache.mc_title(GRAPHICS[1]) @opacity_speed=10 @zoom_change=0 set_rand_stats end def update super @timer+=1 calc_speed self.x += @x_speed self.y += @y_speed if @timer<=LIFE_CYCLE[0] self.opacity += @opacity_speed else self.opacity -= @opacity_speed*2 end self.angle += @angle_speed self.zoom_x += @zoom_change self.zoom_y += @zoom_change self.visible=false if @timer>=LIFE_CYCLE[1] end def calc_speed end def set_rand_stats @x_speed=(rand(4)-2)*0.8 @y_speed=(rand(4)-2)*0.8 @x_speed+=rand(2)-1 if @x_speed==0 @y_speed+=rand(2)-1 if @y_speed==0 @opacity_speed=2 @angle_speed=rand(3)-3 self.opacity = 1 self.angle = rand(360) rand_num=rand(9) case rand_num when 0 self.x,self.y=0,0 when 1 self.x,self.y=RESOLUTION[0],RESOLUTION[1] when 2 self.x,self.y=RESOLUTION[0],0 when 3 self.x,self.y=0,RESOLUTION[1] when 4 self.x,self.y=RESOLUTION[0]/2,0 when 5 self.x,self.y=RESOLUTION[0]/2,RESOLUTION[1] when 6 self.x,self.y=0,208 when 7 self.x,self.y=RESOLUTION[0],RESOLUTION[1]/2 when 8 self.x,self.y=RESOLUTION[0]/2 ,RESOLUTION[1]/2 end self.zoom_x=(rand(100) + 100) / 100.0 self.zoom_y = self.zoom_x self.blend_type=1 end def get_rand_pos pos=[] case rand(4) when 0 pos[0]=0 when 1 pos[0]=200 when 2 pos[0]=300 when 3 pos[0]=500 when 4 pos[0]=100 end case rand(4) when 0 pos[1]=0 when 1 pos[1]=200 when 2 pos[1]=300 when 3 pos[1]=500 when 4 pos[1]=100 end return pos end end #============================================================================== # ■ MC Choice #------------------------------------------------------------------------------ # 可爱的选项~ #============================================================================== # 选项用精灵类 class Sprite_MCchoice < Sprite_Base include LBQ::MC_Title #设置 MAX_INDEX=4 MIN_INDEX=1 #初始化 def initialize(viewport=nil) super(viewport) #光标Index if DataManager.save_file_exists? @index=2 else @index=1 end #动态阶段 @stage=1 end #更新方法 def update #super super #基础的动态设定 case @stage when 1 #更新选项 update_cursor #再次强化不透明度 self.opacity=0 #之后转成第二步 @stage+=1 when 2 #变得透明 self.opacity+=FADE_SPEED #如果已经变完了 if self.opacity>=255 #进入第三步 @stage+=1 end when 3 #好的,于是咱来进行光标更新 if Input.trigger?(:UP) # if Input.trigger?(:LEFT) Sound.play_cursor if @index==MIN_INDEX @index=MAX_INDEX else @index-=1 end #输入完毕之后再更新 update_cursor elsif Input.trigger?(:DOWN) # elsif Input.trigger?(:RIGHT) Sound.play_cursor if @index==MAX_INDEX #强化条件 @index=MIN_INDEX else @index+=1 end #输入完毕之后再更新 update_cursor end end end #index外置接口 def index @index end #更新光标 def update_cursor #设置当前bitmap名字 bitmap_name="#{GRAPHICS[0]}#{@index}" self.bitmap=Cache.mc_title(bitmap_name) end #设置当前index def set_index(index) @index=index end end #============================================================================== # ■ Scene_Title #------------------------------------------------------------------------------ # 标题类 #============================================================================== # Scene类 class Scene_Title < Scene_Base include LBQ::MC_Title def start super @sparks=[] @timer=0 #抄袭原版的=-= SceneManager.clear Graphics.freeze #创建显示端口 create_viewports #创建背景 create_background #创建精灵类 create_sprites #播放标题音乐 play_title_music #动态阶段 @stage=0 end #创建各种显示端口 def create_viewports #背景 #RESOLUTION[0],RESOLUTION[1] @bg_vp=Viewport.new(0,0,RESOLUTION[0],RESOLUTION[1]) #选项 @choice_vp=Viewport.new(0,0,RESOLUTION[0],RESOLUTION[1]) @choice_vp.z=Z_SETTINGS[0] @spark_vp=Viewport.new(0,0,RESOLUTION[0],RESOLUTION[1]) @spark_vp.z=Z_SETTINGS[1] @mask_vp=Viewport.new(0,0,RESOLUTION[0],RESOLUTION[1]) @mask_vp.z=Z_SETTINGS[2] @mask_vp=Viewport.new(0,0,RESOLUTION[0],RESOLUTION[1]) @mask_vp.z=Z_SETTINGS[3] end #创建背景 def create_background #滚动的背景 @bg_sprite=Plane.new(@bg_vp) #设置背景图像 @bg_sprite.bitmap=Cache.mc_title(GRAPHICS[3]) end #更新 def update super #计时器+ @timer+=1 #滚动 @bg_sprite.ox+=SHIFT_SPEED[1] if @timer%SHIFT_SPEED[0]==0 @sparks.push(Sprite_lbqSpark.new(@spark_vp)) if @timer%TIME_SPARK==0 @sparks.each{|spk|spk.update } #~ unless spk.disposed? case @stage when 0 @mask_sprite.opacity-=MASK_FADE[0] if @mask_sprite.opacity<=0 @stage=1 end when 1 #淡入阶段 @logo_sprite.opacity+=FADE_SPEED if @logo_sprite.opacity>=255 @stage=2 end #更新选项 @choice_sprite.update when 2 @choice_sprite.update #如果确定了 if Input.trigger?(:C) Sound.play_ok case @choice_sprite.index when 1 @stage=3 when 2 @stage=4 when 3 @stage=5 when 4 @stage=6 end end when 3 Audio.bgm_fade(BGM_FADE) @mask_sprite.opacity+=MASK_FADE[1] if @mask_sprite.opacity>=255 command_new_game end when 4 command_continue when 5 command_jump when 6 Audio.bgm_fade(BGM_FADE) @mask_sprite.opacity+=MASK_FADE[1] if @mask_sprite.opacity>=255 exit end end end #-------------------------------------------------------------------------- # ● 指令“继续游戏” #-------------------------------------------------------------------------- def command_continue SceneManager.call(Scene_Load) end #-------------------------------------------------------------------------- # ● 结束处理 #-------------------------------------------------------------------------- def terminate super SceneManager.snapshot_for_background @logo_sprite.dispose @choice_sprite.dispose @bg_sprite.dispose @bg_vp.dispose @choice_vp.dispose end #-------------------------------------------------------------------------- # ● 指令“开始游戏” #-------------------------------------------------------------------------- def command_new_game DataManager.setup_new_game $game_map.autoplay SceneManager.goto(Scene_Map) end def create_sprites @logo_sprite=Sprite_Base.new(@choice_vp) @logo_sprite.bitmap=Cache.mc_title(GRAPHICS[2]) @logo_sprite.opacity=0 @choice_sprite=Sprite_Base.new(@choice_vp) @choice_sprite=Sprite_MCchoice.new(@choice_vp) @choice_sprite.opacity=0 @mask_sprite=Sprite.new(@mask_vp) @mask_sprite.bitmap=Bitmap.new(RESOLUTION[0],RESOLUTION[1]) @mask_sprite.bitmap.fill_rect(0,0,RESOLUTION[0],RESOLUTION[1],Color.new(0,0,0)) end def play_title_music $data_system.title_bgm.play RPG::BGS.stop RPG::ME.stop end end
#encoding:utf-8
#==============================================================================
# ■ 薄雾年代记标题脚本
#------------------------------------------------------------------------------
# 薄雾年代记的标题脚本
#==============================================================================
#==============================================================================
# 介绍:
# 这个不完全是薄雾的标题脚本,但是是那个的普适版,作者:LBQ,请自由使用,转载
#==============================================================================
# 设置模块
module LBQ
module MC_Title
#logo还有选项的淡入速度,数字越大淡出淡入越快
FADE_SPEED=4
#黑暗层的淡入淡出速度,数字越大淡出淡入越快。第一项是进入场景,第二项是退出
MASK_FADE=[5,3]
#背景滑动速度,默认是[2,1],即为每两帧横向滑动一个单位。
SHIFT_SPEED=[2,1]
#图像设置
GRAPHICS=['Choice','spark','logo','background']
#生成一个新的闪光点的间隔时间
TIME_SPARK=12
#分辨率设定
RESOLUTION=[640,480]
#储存文件的文件夹名称,位于Graphics文件夹下面
FOLDER="Title"
#离开界面的时候的BGM淡出速度,单位毫秒
BGM_FADE=1600
#4个层的Z坐标设定。
Z_SETTINGS=[1,2,3,4]
#闪光的生命周期。(半衰期,总共生命周期)←装X的设定
LIFE_CYCLE=[300,500]
end
end
#Cache加强
module Cache
include LBQ::MC_Title
#--------------------------------------------------------------------------
# ● 标题
#--------------------------------------------------------------------------
def self.mc_title(filename)
load_bitmap("Graphics/#{FOLDER}/", filename)
end
end
#==============================================================================
# ■ LBQ Spark
#------------------------------------------------------------------------------
# 闪光的精灵类
#==============================================================================
class Sprite_lbqSpark < Sprite_Base
include LBQ::MC_Title
def initialize(viewport=nil)
@timer=0
super(viewport)
self.bitmap=Cache.mc_title(GRAPHICS[1])
@opacity_speed=10
@zoom_change=0
set_rand_stats
end
def update
super
@timer+=1
calc_speed
self.x += @x_speed
self.y += @y_speed
if @timer<=LIFE_CYCLE[0]
self.opacity += @opacity_speed
else
self.opacity -= @opacity_speed*2
end
self.angle += @angle_speed
self.zoom_x += @zoom_change
self.zoom_y += @zoom_change
self.visible=false if @timer>=LIFE_CYCLE[1]
end
def calc_speed
end
def set_rand_stats
@x_speed=(rand(4)-2)*0.8
@y_speed=(rand(4)-2)*0.8
@x_speed+=rand(2)-1 if @x_speed==0
@y_speed+=rand(2)-1 if @y_speed==0
@opacity_speed=2
@angle_speed=rand(3)-3
self.opacity = 1
self.angle = rand(360)
rand_num=rand(9)
case rand_num
when 0
self.x,self.y=0,0
when 1
self.x,self.y=RESOLUTION[0],RESOLUTION[1]
when 2
self.x,self.y=RESOLUTION[0],0
when 3
self.x,self.y=0,RESOLUTION[1]
when 4
self.x,self.y=RESOLUTION[0]/2,0
when 5
self.x,self.y=RESOLUTION[0]/2,RESOLUTION[1]
when 6
self.x,self.y=0,208
when 7
self.x,self.y=RESOLUTION[0],RESOLUTION[1]/2
when 8
self.x,self.y=RESOLUTION[0]/2 ,RESOLUTION[1]/2
end
self.zoom_x=(rand(100) + 100) / 100.0
self.zoom_y = self.zoom_x
self.blend_type=1
end
def get_rand_pos
pos=[]
case rand(4)
when 0
pos[0]=0
when 1
pos[0]=200
when 2
pos[0]=300
when 3
pos[0]=500
when 4
pos[0]=100
end
case rand(4)
when 0
pos[1]=0
when 1
pos[1]=200
when 2
pos[1]=300
when 3
pos[1]=500
when 4
pos[1]=100
end
return pos
end
end
#==============================================================================
# ■ MC Choice
#------------------------------------------------------------------------------
# 可爱的选项~
#==============================================================================
# 选项用精灵类
class Sprite_MCchoice < Sprite_Base
include LBQ::MC_Title
#设置
MAX_INDEX=4
MIN_INDEX=1
#初始化
def initialize(viewport=nil)
super(viewport)
#光标Index
if DataManager.save_file_exists?
@index=2
else
@index=1
end
#动态阶段
@stage=1
end
#更新方法
def update
#super
super
#基础的动态设定
case @stage
when 1
#更新选项
update_cursor
#再次强化不透明度
self.opacity=0
#之后转成第二步
@stage+=1
when 2
#变得透明
self.opacity+=FADE_SPEED
#如果已经变完了
if self.opacity>=255
#进入第三步
@stage+=1
end
when 3
#好的,于是咱来进行光标更新
if Input.trigger?(:UP) # if Input.trigger?(:LEFT)
Sound.play_cursor
if @index==MIN_INDEX
@index=MAX_INDEX
else
@index-=1
end
#输入完毕之后再更新
update_cursor
elsif Input.trigger?(:DOWN) # elsif Input.trigger?(:RIGHT)
Sound.play_cursor
if @index==MAX_INDEX
#强化条件
@index=MIN_INDEX
else
@index+=1
end
#输入完毕之后再更新
update_cursor
end
end
end
#index外置接口
def index
@index
end
#更新光标
def update_cursor
#设置当前bitmap名字
bitmap_name="#{GRAPHICS[0]}#{@index}"
self.bitmap=Cache.mc_title(bitmap_name)
end
#设置当前index
def set_index(index)
@index=index
end
end
#==============================================================================
# ■ Scene_Title
#------------------------------------------------------------------------------
# 标题类
#==============================================================================
# Scene类
class Scene_Title < Scene_Base
include LBQ::MC_Title
def start
super
@sparks=[]
@timer=0
#抄袭原版的=-=
SceneManager.clear
Graphics.freeze
#创建显示端口
create_viewports
#创建背景
create_background
#创建精灵类
create_sprites
#播放标题音乐
play_title_music
#动态阶段
@stage=0
end
#创建各种显示端口
def create_viewports
#背景
#RESOLUTION[0],RESOLUTION[1]
@bg_vp=Viewport.new(0,0,RESOLUTION[0],RESOLUTION[1])
#选项
@choice_vp=Viewport.new(0,0,RESOLUTION[0],RESOLUTION[1])
@choice_vp.z=Z_SETTINGS[0]
@spark_vp=Viewport.new(0,0,RESOLUTION[0],RESOLUTION[1])
@spark_vp.z=Z_SETTINGS[1]
@mask_vp=Viewport.new(0,0,RESOLUTION[0],RESOLUTION[1])
@mask_vp.z=Z_SETTINGS[2]
@mask_vp=Viewport.new(0,0,RESOLUTION[0],RESOLUTION[1])
@mask_vp.z=Z_SETTINGS[3]
end
#创建背景
def create_background
#滚动的背景
@bg_sprite=Plane.new(@bg_vp)
#设置背景图像
@bg_sprite.bitmap=Cache.mc_title(GRAPHICS[3])
end
#更新
def update
super
#计时器+
@timer+=1
#滚动
@bg_sprite.ox+=SHIFT_SPEED[1] if @timer%SHIFT_SPEED[0]==0
@sparks.push(Sprite_lbqSpark.new(@spark_vp)) if @timer%TIME_SPARK==0
@sparks.each{|spk|spk.update }
#~ unless spk.disposed?
case @stage
when 0
@mask_sprite.opacity-=MASK_FADE[0]
if @mask_sprite.opacity<=0
@stage=1
end
when 1
#淡入阶段
@logo_sprite.opacity+=FADE_SPEED
if @logo_sprite.opacity>=255
@stage=2
end
#更新选项
@choice_sprite.update
when 2
@choice_sprite.update
#如果确定了
if Input.trigger?(:C)
Sound.play_ok
case @choice_sprite.index
when 1
@stage=3
when 2
@stage=4
when 3
@stage=5
when 4
@stage=6
end
end
when 3
Audio.bgm_fade(BGM_FADE)
@mask_sprite.opacity+=MASK_FADE[1]
if @mask_sprite.opacity>=255
command_new_game
end
when 4
command_continue
when 5
command_jump
when 6
Audio.bgm_fade(BGM_FADE)
@mask_sprite.opacity+=MASK_FADE[1]
if @mask_sprite.opacity>=255
exit
end
end
end
#--------------------------------------------------------------------------
# ● 指令“继续游戏”
#--------------------------------------------------------------------------
def command_continue
SceneManager.call(Scene_Load)
end
#--------------------------------------------------------------------------
# ● 结束处理
#--------------------------------------------------------------------------
def terminate
super
SceneManager.snapshot_for_background
@logo_sprite.dispose
@choice_sprite.dispose
@bg_sprite.dispose
@bg_vp.dispose
@choice_vp.dispose
end
#--------------------------------------------------------------------------
# ● 指令“开始游戏”
#--------------------------------------------------------------------------
def command_new_game
DataManager.setup_new_game
$game_map.autoplay
SceneManager.goto(Scene_Map)
end
def create_sprites
@logo_sprite=Sprite_Base.new(@choice_vp)
@logo_sprite.bitmap=Cache.mc_title(GRAPHICS[2])
@logo_sprite.opacity=0
@choice_sprite=Sprite_Base.new(@choice_vp)
@choice_sprite=Sprite_MCchoice.new(@choice_vp)
@choice_sprite.opacity=0
@mask_sprite=Sprite.new(@mask_vp)
@mask_sprite.bitmap=Bitmap.new(RESOLUTION[0],RESOLUTION[1])
@mask_sprite.bitmap.fill_rect(0,0,RESOLUTION[0],RESOLUTION[1],Color.new(0,0,0))
end
def play_title_music
$data_system.title_bgm.play
RPG::BGS.stop
RPG::ME.stop
end
end
|
|