赞 | 0 |
VIP | 0 |
好人卡 | 9 |
积分 | 1 |
经验 | 3675 |
最后登录 | 2015-1-10 |
在线时间 | 64 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 64 小时
- 注册时间
- 2011-4-1
- 帖子
- 39
|
本帖最后由 各种压力的猫君 于 2011-10-8 16:07 编辑
- #==============================================================================
- # 本脚本来自[url]http://www.66rpg.com/[/url],使用和转载请保留此信息
- #==============================================================================
- #==============================================================================
- # ■ 图片标题菜单1.0
- # Scene_Title
- #------------------------------------------------------------------------------
- # 作者:chaochao
- # [url]http://zhuchao.go1.icpcn.com/[/url]
- #==============================================================================
- class Scene_Title
- WEATHER = 0 # 使用自定义效果(0:无,1:雨,2:暴风雨,3:雪,4:自定义)
- MAXNUMBER = 10 # 天气图片数量
- WEATHER_FILE = "Graphics/titles/Title_star"
- # 自定义图片路径,这个文件可以从黑暗圣剑DEMO获得,是流星雨
- BLEND_TYPE = 0 # 合成方式(0:普通,1:加法,2:减法)
- WEATHER_X = 5 # X方向每回合减少象素
- WEATHER_Y = 5 # Y方向每回合减少象素
- WEATHER_OPACITY = 1 #每回合减低透明度
- START_OPACITY = 255 #出现时的透明度
- RAND_X = 1000 # 随机X范围
- RAND_Y = 100 # 随机Y范围
- HEIGHT = 60 # 出现时候的屏幕Y
- WIDTH = 640 # 出现时候的屏幕X
- #--------------------------------------------------------------------------
- # ● 主处理
- #--------------------------------------------------------------------------
- def main
- if $BTEST
- battle_test
- return
- end
- $data_actors = load_data("Data/Actors.rxdata")
- $data_classes = load_data("Data/Classes.rxdata")
- $data_skills = load_data("Data/Skills.rxdata")
- $data_items = load_data("Data/Items.rxdata")
- $data_weapons = load_data("Data/Weapons.rxdata")
- $data_armors = load_data("Data/Armors.rxdata")
- $data_enemies = load_data("Data/Enemies.rxdata")
- $data_troops = load_data("Data/Troops.rxdata")
- $data_states = load_data("Data/States.rxdata")
- $data_animations = load_data("Data/Animations.rxdata")
- $data_tilesets = load_data("Data/Tilesets.rxdata")
- $data_common_events = load_data("Data/CommonEvents.rxdata")
- $data_system = load_data("Data/System.rxdata")
- # 生成系统对像
- $game_system = Game_System.new
- # 进入事件显示LOGO,如果您不想在调试时总是显示LOGO就加上下一行中注释部分
- if $show_logo #and !$DEBUG
- # 设置标记变量保证下次回到标题画面不会再显示片头
- $show_logo = false
- # 重置测量游戏时间用的画面计数器
- Graphics.frame_count = 0
- # 生成各种游戏对像
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
- # 设置初期同伴位置
- $game_party.setup_starting_members
- # 设置初期位置的地图
- $game_map.setup($data_system.start_map_id)
- # 主角向初期位置移动
- $game_player.moveto($data_system.start_x, $data_system.start_y)
- # 刷新主角
- $game_player.refresh
- # 执行地图设置的 BGM 与 BGS 的自动切换
- $game_map.autoplay
- # 刷新地图 (执行并行事件)
- $game_map.update
- # 与真正的新游戏唯一不同就是将变量1设置一个标记值(暂用8764)
- $game_variables[1]=8764
- # 主角暂时是不能显示出来的……
- $game_player.transparent = true
- # 切换地图画面
- $scene = Scene_Map.new
- # 否则是默认显示标题画面
- else
- # 生成标题图形
- @sprite = [Sprite.new]
- for i in 0..6
- @sprite[i] = Sprite.new
- @sprite[i].opacity = 0
- end
- @sprite[0].bitmap = RPG::Cache.title($data_system.title_name)
- @sprite[0].opacity = 0
- @ox = 0
- @oy = 0
- color1 = Color.new(255,255,255, 255)
- color2 = Color.new(255, 255, 255, 128)
- @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 = -640
- sprite.y = 60
- sprite.visible = (i <= MAXNUMBER)
- sprite.blend_type = BLEND_TYPE
- sprite.opacity = START_OPACITY
- @sprites.push(sprite)
- end
- weather_update
-
- #开始游戏的图片
- @sprite[1].bitmap = Bitmap.new("Graphics/titles/start-1")
- @sprite[2].bitmap = Bitmap.new("Graphics/titles/start-2")
- #继续游戏的图片
- @sprite[3].bitmap = Bitmap.new("Graphics/titles/continue-1")
- @sprite[4].bitmap = Bitmap.new("Graphics/titles/continue-2")
- #结束游戏的图片
- @sprite[5].bitmap = Bitmap.new("Graphics/titles/exit-1")
- @sprite[6].bitmap = Bitmap.new("Graphics/titles/exit-1")
- for i in 1..6
- x=465
- y=(i+1)/2*35+313
- @sprite[i].x =x
- @sprite[i].y =y
- end
- for i in 1..6
- case i
- when 1
- x=220
- y=197
- @sprite[i].x =x
- @sprite[i].y =y
- when 2
- x=220
- y=197
- @sprite[i].x =x
- @sprite[i].y =y
-
- when 3
- x=312
- y=237
- @sprite[i].x =x
- @sprite[i].y =y
-
- when 4
- x=312
- y=237
- @sprite[i].x =x
- @sprite[i].y =y
- when 5
- x=135
- y=306
- @sprite[i].x =x
- @sprite[i].y =y
-
- when 6
- x=135
- y=306
- @sprite[i].x =x
- @sprite[i].y =y
- end
- end
-
- @continue_enabled = false
- for i in 0..3
- if FileTest.exist?("Save/Save#{i+1}.rxdata")
- @continue_enabled = true
- end
- end
- if @continue_enabled
- @command_index = 1
- else
- @command_index = 0
- #@sprite[3].tone = Tone.new(0, 0, 0, 255)
- #@sprite[4].tone = Tone.new(0, 0, 0, 255)
- end
-
-
- #$game_system.bgm_play($data_system.title_bgm)
- #Audio.me_stop
- #Audio.bgs_stop
- Graphics.transition
- loop do
- Graphics.update
- #淡出背景圖形
- if @sprite[0].opacity <= 255
- @sprite[0].opacity += 15
- end
- Input.update
- update
- if $scene != self
- break
- end
- end
- Graphics.freeze
- # 釋放圖形
- for i in 0..6
- @sprite[i].bitmap.dispose
- @sprite[i].dispose
- end
- for sprite in @sprites
- sprite.dispose
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新天气
- #--------------------------------------------------------------------------
- def weather_update
- return if WEATHER == 0
- for i in 1..MAXNUMBER
- sprite = @sprites[i]
- if sprite == nil
- break
- end
- if WEATHER == 4
- sprite.x -= WEATHER_X
- #sprite.opacity -= WEATHER_OPACITY
- end
- x = sprite.x - @ox
- #y = sprite.y - @oy
- if sprite.x < -144
- sprite.opacity == 0
- end
- if sprite.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
- chaochaocommandchaochao
- if Input.trigger?(Input::C)
- case @command_index
- when 0
- command_new_game
- when 1
- command_continue
- when 2
- command_shutdown
- end
- end
- weather_update
- end
- def chaochaocommandchaochao
- if Input.trigger?(Input::UP)
- @command_index -= 1
- if @command_index < 0
- @command_index = 2
- end
- $game_system.se_play($data_system.cursor_se)
- end
- if Input.trigger?(Input::DOWN)
- @command_index += 1
- if @command_index > 2
- @command_index = 0
- end
- $game_system.se_play($data_system.cursor_se)
- end
- case @command_index
- when 0
- if @sprite[1].opacity >= 0
- @sprite[1].opacity -= 30
- end
- if @sprite[2].opacity <= 240
- @sprite[2].opacity += 30
- end
- if @sprite[3].opacity <= 210
- @sprite[3].opacity += 30
- end
- if @sprite[4].opacity >= 0
- @sprite[4].opacity -= 30
- end
- if @sprite[5].opacity <= 210
- @sprite[5].opacity += 30
- end
- if @sprite[6].opacity >= 0
- @sprite[6].opacity -= 30
- end
- when 1
- if @sprite[1].opacity <= 210
- @sprite[1].opacity += 30
- end
- if @sprite[2].opacity >= 0
- @sprite[2].opacity -= 30
- end
- if @sprite[3].opacity >= 0
- @sprite[3].opacity -= 30
- end
- if @sprite[4].opacity <= 240
- @sprite[4].opacity += 30
- end
- if @sprite[5].opacity <= 210
- @sprite[5].opacity += 30
- end
- if @sprite[6].opacity >= 0
- @sprite[6].opacity -= 30
- end
- when 2
- if @sprite[1].opacity <= 210
- @sprite[1].opacity += 30
- end
- if @sprite[2].opacity >= 0
- @sprite[2].opacity -= 30
- end
- if @sprite[3].opacity <= 210
- @sprite[3].opacity += 30
- end
- if @sprite[4].opacity >= 0
- @sprite[4].opacity -= 30
- end
- if @sprite[5].opacity >= 0
- @sprite[5].opacity -= 30
- end
- if @sprite[6].opacity <= 240
- @sprite[6].opacity += 30
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 刷新画面
- #--------------------------------------------------------------------------
- def update
- # 刷新命令窗口
- @command_window.update
- # 按下 C 键的情况下
- if Input.trigger?(Input::C)
- # 命令窗口的光标位置的分支
- case @command_window.index
- when 0 # 新游戏
- command_new_game
- when 1 # 继续
- command_continue
- when 2 # 退出
- command_shutdown
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 命令 : 新游戏
- #--------------------------------------------------------------------------
- def command_new_game
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 停止 BGM
- Audio.bgm_stop
- # 重置测量游戏时间用的画面计数器
- Graphics.frame_count = 0
- # 生成各种游戏对像
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
- # 设置初期同伴位置
- $game_party.setup_starting_members
- # 设置初期位置的地图
- $game_map.setup($data_system.start_map_id)
- # 主角向初期位置移动
- $game_player.moveto($data_system.start_x, $data_system.start_y)
- # 刷新主角
- $game_player.refresh
- # 执行地图设置的 BGM 与 BGS 的自动切换
- $game_map.autoplay
- # 刷新地图 (执行并行事件)
- $game_map.update
- # 主角暂时是不能显示出来的……
- $game_player.transparent = true
- # 切换地图画面
- $scene = Scene_Map.new
- end
- #--------------------------------------------------------------------------
- # ● 命令 : 继续
- #--------------------------------------------------------------------------
- def command_continue
- # 继续无效的情况下
- unless @continue_enabled
- # 演奏无效 SE
- $game_system.se_play($data_system.buzzer_se)
- return
- end
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # 切换到读档画面
- $scene = Scene_Load.new
- end
- #--------------------------------------------------------------------------
- # ● 命令 : 新游戏
- #--------------------------------------------------------------------------
- def command_goto_title_map # 生成各种游戏对像并转到Title地图
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
- $game_party.setup_starting_members # 设置初期同伴位置
- $game_map.setup(004) # 设置Title的地图
- $game_player.moveto(0,0) # 主角向初期位置移动
- $game_player.refresh # 刷新主角
- $game_map.update # 刷新地图 (执行并行事件)
- $title_selecting = true
- $scene = Scene_Map.new # 切换地图画面
- end
- #--------------------------------------------------------------------------
- # ● 命令 : 退出
- #--------------------------------------------------------------------------
- def command_shutdown
- # 演奏确定 SE
- $game_system.se_play($data_system.decision_se)
- # BGM、BGS、ME 的淡入淡出
- Audio.bgm_fade(800)
- Audio.bgs_fade(800)
- Audio.me_fade(800)
- # 退出
- $scene = nil
- end
- #--------------------------------------------------------------------------
- # ● 战斗测试
- #--------------------------------------------------------------------------
- def battle_test
- # 载入数据库 (战斗测试用)
- $data_actors = load_data("Data/BT_Actors.rxdata")
- $data_classes = load_data("Data/BT_Classes.rxdata")
- $data_skills = load_data("Data/BT_Skills.rxdata")
- $data_items = load_data("Data/BT_Items.rxdata")
- $data_weapons = load_data("Data/BT_Weapons.rxdata")
- $data_armors = load_data("Data/BT_Armors.rxdata")
- $data_enemies = load_data("Data/BT_Enemies.rxdata")
- $data_troops = load_data("Data/BT_Troops.rxdata")
- $data_states = load_data("Data/BT_States.rxdata")
- $data_animations = load_data("Data/BT_Animations.rxdata")
- $data_tilesets = load_data("Data/BT_Tilesets.rxdata")
- $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
- $data_system = load_data("Data/BT_System.rxdata")
- # 重置测量游戏时间用的画面计数器
- Graphics.frame_count = 0
- # 生成各种游戏对像
- $game_temp = Game_Temp.new
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Game_Actors.new
- $game_party = Game_Party.new
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
- # 设置战斗测试用同伴
- $game_party.setup_battle_test_members
- # 设置队伍 ID、可以逃走标志、战斗背景
- $game_temp.battle_troop_id = $data_system.test_troop_id
- $game_temp.battle_can_escape = true
- $game_map.battleback_name = $data_system.battleback_name
- # 演奏战斗开始 BGM
- $game_system.se_play($data_system.battle_start_se)
- # 演奏战斗 BGM
- $game_system.bgm_play($game_system.battle_bgm)
- # 切换到战斗画面
- $scene = Scene_Battle.new
- end
- end
复制代码
請問一下為什麼會這樣子........... weather_update 出問題嗎
在#开始游戏的图片 的上面這段
@sprite[1].bitmap = Bitmap.new("Graphics/titles/start-1")
@sprite[2].bitmap = Bitmap.new("Graphics/titles/start-2")
#继续游戏的图片
@sprite[3].bitmap = Bitmap.new("Graphics/titles/continue-1")
@sprite[4].bitmap = Bitmap.new("Graphics/titles/continue-2")
#结束游戏的图片
@sprite[5].bitmap = Bitmap.new("Graphics/titles/exit-1")
@sprite[6].bitmap = Bitmap.new("Graphics/titles/exit-1")
結果變成這樣~.~ 看來我應該是跟這個腳本無緣份了 誰叫我不會改腳本.......
還是謝謝解答的人 |
评分
-
查看全部评分
|