Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module TK_Scene_End
- Background_End = ["Background_End"]
- To_Title_Images = ["To_Title_1", "To_Title_2"]
- Shutdown_Images = ["Shutdown_1", "Shutdown_2"]
- Cancel_Images = ["Cancel_1", "Cancel_2"]
- To_Title_Positions = [10, 290]
- Shutdown_Positions = [10, 330]
- Cancel_Positions = [10, 370]
- end
- class Scene_End < Scene_MenuBase
- def start
- @background = []
- @to_title = Sprite.new
- @shutdown = Sprite.new
- @cancel = Sprite.new
- @index = 0
- create_command_images
- end
- def update
- super
- if Input.trigger?(:DOWN) and @index < 2
- @index += 1
- elsif Input.trigger?(:UP) and @index > 0
- @index -= 1
- elsif Input.trigger?(:C)
- case @index
- when 0 then command_to_title
- when 1 then command_shutdown
- when 2 then command_cancel
- end
- end
- case @index
- when 0
- @to_title.bitmap = Cache.system(TK_Scene_End::To_Title_Images[1])
- @shutdown.bitmap = Cache.system(TK_Scene_End::Shutdown_Images[0])
- @cancel.bitmap = Cache.system(TK_Scene_End::Cancel_Images[0])
- when 1
- @shutdown.bitmap = Cache.system(TK_Scene_End::Shutdown_Images[1])
- @to_title.bitmap = Cache.system(TK_Scene_End::To_Title_Images[0])
- @cancel.bitmap = Cache.system(TK_Scene_End::Cancel_Images[0])
- when 2
- @cancel.bitmap = Cache.system(TK_Scene_End::Cancel_Images[1])
- @to_title.bitmap = Cache.system(TK_Scene_End::To_Title_Images[0])
- @shutdown.bitmap = Cache.system(TK_Scene_End::Shutdown_Images[0])
- end
- end
- def create_command_images
- for i in 0...TK_Scene_End::Background_End.size
- @background.push(Sprite.new)
- @background[-1].bitmap = Cache.system(TK_Scene_End::Background_End[i])
- end
- @to_title.x = TK_Scene_End::To_Title_Positions[0]
- @to_title.y = TK_Scene_End::To_Title_Positions[1]
- @to_title.bitmap = Cache.system(TK_Scene_End::To_Title_Images[0])
- @shutdown.x = TK_Scene_End::Shutdown_Positions[0]
- @shutdown.y = TK_Scene_End::Shutdown_Positions[1]
- @shutdown.bitmap = Cache.system(TK_Scene_End::Shutdown_Images[0])
- @cancel.x = TK_Scene_End::Cancel_Positions[0]
- @cancel.y = TK_Scene_End::Cancel_Positions[1]
- @cancel.bitmap = Cache.system(TK_Scene_End::Cancel_Images[0])
- end
- def command_cancel
- fadeout_all
- return_scene
- end
- def command_to_title
- fadeout_all
- SceneManager.goto(Scene_Title)
- end
- def command_shutdown
- fadeout_all
- SceneManager.exit
- end
- def terminate
- super
- [@to_title, @shutdown, @cancel].each(&:dispose)
- @background.each(&:dispose)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment