DaxSoft

Faalcon

Jan 22nd, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. module TK_Scene_End
  2. Background_End = ["Background_End"]
  3. To_Title_Images = ["To_Title_1", "To_Title_2"]
  4. Shutdown_Images = ["Shutdown_1", "Shutdown_2"]
  5. Cancel_Images = ["Cancel_1", "Cancel_2"]
  6. To_Title_Positions = [10, 290]
  7. Shutdown_Positions = [10, 330]
  8. Cancel_Positions = [10, 370]
  9. end
  10.  
  11. class Scene_End < Scene_MenuBase
  12. def start
  13. @background = []
  14. @to_title = Sprite.new
  15. @shutdown = Sprite.new
  16. @cancel = Sprite.new
  17. @index = 0
  18. create_command_images
  19. end
  20. def update
  21. super
  22. if Input.trigger?(:DOWN) and @index < 2
  23. @index += 1
  24. elsif Input.trigger?(:UP) and @index > 0
  25. @index -= 1
  26. elsif Input.trigger?(:C)
  27. case @index
  28. when 0 then command_to_title
  29. when 1 then command_shutdown
  30. when 2 then command_cancel
  31. end
  32. end
  33. case @index
  34. when 0
  35. @to_title.bitmap = Cache.system(TK_Scene_End::To_Title_Images[1])
  36. @shutdown.bitmap = Cache.system(TK_Scene_End::Shutdown_Images[0])
  37. @cancel.bitmap = Cache.system(TK_Scene_End::Cancel_Images[0])
  38. when 1
  39. @shutdown.bitmap = Cache.system(TK_Scene_End::Shutdown_Images[1])
  40. @to_title.bitmap = Cache.system(TK_Scene_End::To_Title_Images[0])
  41. @cancel.bitmap = Cache.system(TK_Scene_End::Cancel_Images[0])
  42. when 2
  43. @cancel.bitmap = Cache.system(TK_Scene_End::Cancel_Images[1])
  44. @to_title.bitmap = Cache.system(TK_Scene_End::To_Title_Images[0])
  45. @shutdown.bitmap = Cache.system(TK_Scene_End::Shutdown_Images[0])
  46. end
  47. end
  48. def create_command_images
  49. for i in 0...TK_Scene_End::Background_End.size
  50. @background.push(Sprite.new)
  51. @background[-1].bitmap = Cache.system(TK_Scene_End::Background_End[i])
  52. end
  53. @to_title.x = TK_Scene_End::To_Title_Positions[0]
  54. @to_title.y = TK_Scene_End::To_Title_Positions[1]
  55. @to_title.bitmap = Cache.system(TK_Scene_End::To_Title_Images[0])
  56. @shutdown.x = TK_Scene_End::Shutdown_Positions[0]
  57. @shutdown.y = TK_Scene_End::Shutdown_Positions[1]
  58. @shutdown.bitmap = Cache.system(TK_Scene_End::Shutdown_Images[0])
  59. @cancel.x = TK_Scene_End::Cancel_Positions[0]
  60. @cancel.y = TK_Scene_End::Cancel_Positions[1]
  61. @cancel.bitmap = Cache.system(TK_Scene_End::Cancel_Images[0])
  62. end
  63. def command_cancel
  64. fadeout_all
  65. return_scene
  66. end
  67. def command_to_title
  68. fadeout_all
  69. SceneManager.goto(Scene_Title)
  70. end
  71. def command_shutdown
  72. fadeout_all
  73. SceneManager.exit
  74. end
  75. def terminate
  76. super
  77. [@to_title, @shutdown, @cancel].each(&:dispose)
  78. @background.each(&:dispose)
  79. end
  80. end
Advertisement
Add Comment
Please, Sign In to add comment