Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #==============================================================================
  2. # +++ MOG - Rin Title Screen (v1.0) +++
  3. #==============================================================================
  4. # By Moghunter
  5. # https://atelierrgss.wordpress.com/
  6. #==============================================================================
  7. # Animated title screen with the theme of Rin Kaenbyou, for fans of Touhou.
  8. # Of course you can customize any type of character.
  9. #==============================================================================
  10. module MOG_RIN_TITLE_SCRREN
  11.   #Setting the slide speed of the background image.
  12.   BACKGROUND_SCROLL_SPEED = [1,0]
  13.   #Definition of the amount of particles.
  14.   NUMBER_OF_PARTICLES = 30
  15.   #Definition of the type of the particle blend.
  16.   PARTICLES_BLEND_TYPE  = 1
  17.   #Definition of the force of the wave effect in the fog.
  18.   FIRE_WIND_POWER = 10
  19.   #Definition of the speed of the wave effect in the fog.
  20.   FIRE_WIND_SPEED = 1
  21.   #Blend Type.
  22.   FIRE_BLEND_TYPE = 1
  23.   #Defining fog opacity.
  24.   FIRE_OPACITY = 255
  25.   #Definition of the position of the character.
  26.   CHARACTER_POSITION = [0,0]
  27.   #Command position definition.
  28.   COMMAND_POSITION = [0,5]
  29.   #Enable aura effect on the character image.
  30.   CHARACTER_AURA_EFFECT = true
  31.   #Enable Logo.
  32.   LOGO = true
  33.   #Setting the duration of the logo.
  34.   LOGO_DURATION = 2
  35. end
  36.  
  37. #==============================================================================
  38. # ■ Scene Title
  39. #==============================================================================
  40. class Scene_Title
  41.   include MOG_RIN_TITLE_SCRREN
  42.  
  43.   #--------------------------------------------------------------------------
  44.   # ● Main
  45.   #--------------------------------------------------------------------------        
  46.   def main
  47.       execute_logo if LOGO
  48.       Graphics.update
  49.       Graphics.freeze
  50.       execute_setup
  51.       execute_loop
  52.       dispose
  53.   end  
  54.  
  55.   #--------------------------------------------------------------------------
  56.   # ● Execute Setup
  57.   #--------------------------------------------------------------------------        
  58.   def execute_setup
  59.       @phase = 0
  60.       @active = false
  61.       @continue_enabled = DataManager.save_file_exists?
  62.       @com_index = @continue_enabled ? 1 : 0
  63.       @com_index_old = @com_index
  64.       @com_index_max = 2
  65.       create_sprites
  66.   end
  67.  
  68.   #--------------------------------------------------------------------------
  69.   # ● Execute Lopp
  70.   #--------------------------------------------------------------------------        
  71.   def execute_loop
  72.       Graphics.transition(60)
  73.       play_title_music
  74.       loop do
  75.          Input.update
  76.          update
  77.          Graphics.update
  78.          break if SceneManager.scene != self
  79.       end
  80.    end
  81.      
  82. end
  83.  
  84. #==============================================================================
  85. # ■ Scene Title
  86. #==============================================================================
  87. class Scene_Title
  88.   include MOG_RIN_TITLE_SCRREN
  89.  
  90.   #--------------------------------------------------------------------------
  91.   # ● Execute Logo
  92.   #--------------------------------------------------------------------------    
  93.   def execute_logo
  94.       Graphics.transition
  95.       create_logo
  96.       loop do
  97.          Input.update
  98.          update_logo
  99.          Graphics.update
  100.          break if !@logo_phase
  101.       end
  102.       dispose_logo
  103.   end
  104.    
  105.   #--------------------------------------------------------------------------
  106.   # ● Create Logo
  107.   #--------------------------------------------------------------------------      
  108.   def create_logo
  109.       @logo = Sprite.new
  110.       @logo.z = 100
  111.       @logo.opacity = 0
  112.       @logo_duration = [0,60 * LOGO_DURATION]
  113.       @logo.bitmap = Cache.title1("Logo") rescue nil
  114.       @logo_phase = @logo.bitmap != nil ? true : false      
  115.   end
  116.  
  117.   #--------------------------------------------------------------------------
  118.   # ● Dispose Logo
  119.   #--------------------------------------------------------------------------      
  120.   def dispose_logo      
  121.       Graphics.freeze
  122.       @logo.bitmap.dispose if @logo.bitmap != nil
  123.       @logo.dispose
  124.   end
  125.  
  126.   #--------------------------------------------------------------------------
  127.   # ● Update Logo
  128.   #--------------------------------------------------------------------------      
  129.   def update_logo  
  130.       return if !@logo_phase
  131.       update_logo_command
  132.       if @logo_duration[0] == 0
  133.          @logo.opacity += 5
  134.          @logo_duration[0] = 1 if @logo.opacity >= 255
  135.        elsif @logo_duration[0] == 1
  136.          @logo_duration[1] -= 1
  137.          @logo_duration[0] = 2 if @logo_duration[1] <= 0
  138.        else  
  139.          @logo.opacity -= 5
  140.          @logo_phase = false if @logo.opacity <= 0
  141.        end
  142.   end
  143.  
  144.   #--------------------------------------------------------------------------
  145.   # ● Update Logo Command
  146.   #--------------------------------------------------------------------------      
  147.   def update_logo_command
  148.       return if @logo_duration[0] == 2
  149.       if Input.trigger?(:C) or Input.trigger?(:B)
  150.          @logo_duration = [2,0]
  151.       end
  152.   end
  153.  
  154. end
  155.  
  156. #==============================================================================
  157. # ■ Scene Title
  158. #==============================================================================
  159. class Scene_Title
  160.  
  161.   #--------------------------------------------------------------------------
  162.   # ● Create Sprites
  163.   #--------------------------------------------------------------------------          
  164.   def create_sprites
  165.       create_background
  166.       create_fire_wind
  167.       create_commands
  168.       create_particles
  169.       create_character
  170.       create_layout
  171.       create_skulls
  172.   end
  173.    
  174.   #--------------------------------------------------------------------------
  175.   # ● Create Background
  176.   #--------------------------------------------------------------------------            
  177.   def create_background
  178.       @background = Plane.new
  179.       @background.bitmap = Cache.title1("Background")
  180.       @background_scroll = [BACKGROUND_SCROLL_SPEED[0],BACKGROUND_SCROLL_SPEED[1],0]
  181.       @background.z = 0
  182.   end
  183.  
  184.   #--------------------------------------------------------------------------
  185.   # ● Create Layout
  186.   #--------------------------------------------------------------------------              
  187.   def create_layout
  188.       @layout = Sprite.new
  189.       @layout.bitmap = Cache.title1("Layout")
  190.       @layout.z = 20
  191.       @layout.opacity = 0
  192.   end
  193.  
  194.   #--------------------------------------------------------------------------
  195.   # ● Create Commands
  196.   #--------------------------------------------------------------------------                
  197.   def create_commands
  198.       @com = []
  199.       for index in 0...3
  200.           @com.push(Title_Commands.new(nil,index))
  201.       end
  202.   end
  203.  
  204.   #--------------------------------------------------------------------------
  205.   # ● Create Skulls
  206.   #--------------------------------------------------------------------------                
  207.   def create_skulls
  208.       @skulls = []
  209.       for index in 0...3
  210.           @skulls.push(Title_Skull.new(nil,index))
  211.       end
  212.   end  
  213.  
  214.   #--------------------------------------------------------------------------
  215.   # ● Create Fire Wind
  216.   #--------------------------------------------------------------------------            
  217.   def create_fire_wind
  218.       @fire_wind = []
  219.       @fire_wind_image = Cache.title1("Fire_Wind")
  220.       fire_max = 1
  221.       for index in 0...fire_max
  222.       range = (FIRE_WIND_POWER + 1 + (index * 2)) * 10
  223.       range = 500 if range > 500
  224.       speed = (FIRE_WIND_SPEED + 1 + (index * 2)) * 100
  225.       speed = 1000 if speed > 1000          
  226.           @fire_wind.push(Sprite.new)
  227.           @fire_wind[index].wave_amp = range
  228.           @fire_wind[index].wave_length = Graphics.width
  229.           @fire_wind[index].wave_speed = speed        
  230.           @fire_wind[index].bitmap = Bitmap.new(Graphics.width + (range * 2),Graphics.height)
  231.           @fire_wind[index].bitmap.stretch_blt(@fire_wind[index].bitmap.rect, @fire_wind_image, @fire_wind_image.rect)
  232.           @fire_wind[index].x = -range
  233.           @fire_wind[index].z = 6
  234.           @fire_wind[index].blend_type = FIRE_BLEND_TYPE
  235.           @fire_wind[index].opacity = FIRE_OPACITY + (40 * index)
  236.       end
  237.   end  
  238.  
  239.   #--------------------------------------------------------------------------
  240.   # ● Create Particles
  241.   #--------------------------------------------------------------------------  
  242.   def create_particles
  243.       @particles_sprite =[]
  244.       for i in 0...NUMBER_OF_PARTICLES
  245.           @particles_sprite.push(Particles_Title.new(nil))
  246.       end
  247.   end  
  248.  
  249.   #--------------------------------------------------------------------------
  250.   # ● Create Character
  251.   #--------------------------------------------------------------------------    
  252.   def create_character
  253.       @character = Sprite.new
  254.       @character.bitmap = Cache.title1("Character")
  255.       @character.ox = @character.bitmap.width / 2
  256.       @character.oy = @character.bitmap.height / 2
  257.       @character.x = CHARACTER_POSITION[0] + @character.ox
  258.       @character.y = CHARACTER_POSITION[1] + @character.oy
  259.       @character.z = 3
  260.       @character.opacity = 0
  261.       @char_zoom_speed = [0,0]
  262.       @character2 = Sprite.new
  263.       @character2.bitmap = Cache.title1("Character")
  264.       @character2.ox = @character.bitmap.width / 2
  265.       @character2.oy = @character.bitmap.height / 2
  266.       @character2.x = CHARACTER_POSITION[0] + @character.ox
  267.       @character2.y = CHARACTER_POSITION[1] + @character.oy
  268.       @character2.z = 2      
  269.       @character2.blend_type = 0
  270.       @character2.opacity = 0
  271.       @character2.visible = CHARACTER_AURA_EFFECT
  272.   end
  273.  
  274. end
  275.  
  276. #==============================================================================
  277. # ■ Particles Title
  278. #==============================================================================
  279. class Particles_Title < Sprite
  280.  
  281.   include MOG_RIN_TITLE_SCRREN
  282.  
  283.  #--------------------------------------------------------------------------
  284.  # ● Initialize
  285.  #--------------------------------------------------------------------------            
  286.   def initialize(viewport = nil)
  287.       super(viewport)
  288.       @speed_x = 0
  289.       @speed_y = 0
  290.       @speed_a = 0
  291.       self.bitmap = Cache.title1("Particles")
  292.       self.blend_type = PARTICLES_BLEND_TYPE
  293.       self.z = 4
  294.       reset_setting(true)
  295.   end  
  296.  
  297.  #--------------------------------------------------------------------------
  298.  # ● Reset Setting
  299.  #--------------------------------------------------------------------------              
  300.   def reset_setting(initial = false)
  301.       zoom = (50 + rand(100)) / 100.1
  302.       self.zoom_x = zoom
  303.       self.zoom_y = zoom
  304.       self.x = rand(576) - 160
  305.       self.y = initial == true ? rand(480) : 512
  306.       self.opacity = 0
  307.       @speed_y = -(1 + rand(3))
  308.       @speed_x = (1 + rand(2))
  309.       @speed_a = (1 + rand(2))    
  310.   end
  311.  
  312.  #--------------------------------------------------------------------------
  313.  # ● Dispose
  314.  #--------------------------------------------------------------------------              
  315.   def dispose
  316.       super
  317.       self.bitmap.dispose if self.bitmap != nil
  318.   end  
  319.  
  320.  #--------------------------------------------------------------------------
  321.  # ● Update
  322.  #--------------------------------------------------------------------------              
  323.   def update
  324.       super
  325.       self.x += @speed_x
  326.       self.y += @speed_y
  327.      # self.angle += @speed_a
  328.       self.opacity += 5
  329.       reset_setting if can_reset_setting?
  330.   end  
  331.  
  332.  #--------------------------------------------------------------------------
  333.  # ● Can Reset Setting
  334.  #--------------------------------------------------------------------------                
  335.   def can_reset_setting?
  336.       return true if self.y < -50
  337.       return true if self.x > 576
  338.       return false
  339.   end  
  340.  
  341. end
  342.  
  343. #==============================================================================
  344. # ■ Title Commands
  345. #==============================================================================
  346. class Title_Commands < Sprite
  347.   include MOG_RIN_TITLE_SCRREN
  348.  
  349.   #--------------------------------------------------------------------------
  350.   # ● Initialize
  351.   #--------------------------------------------------------------------------  
  352.   def initialize(viewport = nil,index)
  353.       super(viewport)
  354.       @index = index
  355.       @float = [0,0,0]
  356.       self.bitmap = Cache.title1("Command" + index.to_s)
  357.       self.ox = self.bitmap.width / 2
  358.       self.oy = self.bitmap.height / 2
  359.       @org_pos = [COMMAND_POSITION[0] + self.ox,
  360.         COMMAND_POSITION[1] + self.oy + (self.bitmap.height + 2) * index,
  361.         self.ox - 24]
  362.       self.x = @org_pos[0] - self.bitmap.width - (self.bitmap.width * index)
  363.       self.y = @org_pos[1]
  364.       self.z = 25
  365.       @next_pos = [@org_pos[0],@org_pos[1]]
  366.   end
  367.  
  368.   #--------------------------------------------------------------------------
  369.   # ● Dispose
  370.   #--------------------------------------------------------------------------  
  371.   def dispose_sprites
  372.       self.bitmap.dispose
  373.   end
  374.  
  375.   #--------------------------------------------------------------------------
  376.   # ● Update
  377.   #--------------------------------------------------------------------------              
  378.   def update_sprites(index,active)
  379.      # return if !active
  380.       if index == @index
  381.          self.opacity += 10
  382.          @next_pos[0] = @org_pos[0]
  383.         # update_float_effect  
  384.       else
  385.          self.opacity -= 10 if self.opacity > 120
  386.          @next_pos[0] = @org_pos[2]
  387.          @float = [0,0,0]
  388.       end  
  389.       update_slide(0,@next_pos[0])
  390.       update_slide(1,@org_pos[1] + @float[0])
  391.   end
  392.  
  393.  #--------------------------------------------------------------------------
  394.  # ● Update Slide
  395.  #--------------------------------------------------------------------------                      
  396.   def update_slide(type,np)
  397.       cp = type == 0 ? self.x : self.y
  398.       sp = 3 + ((cp - np).abs / 10)
  399.       if cp > np
  400.          cp -= sp
  401.          cp = np if cp < np
  402.       elsif cp < np
  403.          cp += sp
  404.          cp = np if cp > np
  405.       end    
  406.       self.x = cp if type == 0
  407.       self.y = cp if type == 1
  408.   end    
  409.  
  410.   #--------------------------------------------------------------------------
  411.   # ● Update Float Effect
  412.   #--------------------------------------------------------------------------                
  413.   def update_float_effect
  414.       @float[2] += 1
  415.       return if @float[2] < 5
  416.       @float[2] = 0
  417.       @float[1] += 1
  418.       case @float[1]
  419.            when 1..5
  420.                @float[0] -= 1
  421.            when 6..15  
  422.                @float[0] += 1
  423.            when 16..20  
  424.                @float[0] -= 1
  425.            else  
  426.                @float[0] = 0
  427.                @float[1] = 0
  428.       end
  429.   end
  430.  
  431. end
  432.  
  433. #==============================================================================
  434. # ■ Title Skull
  435. #==============================================================================
  436. class Title_Skull < Sprite
  437.   include MOG_RIN_TITLE_SCRREN
  438.  
  439.   #--------------------------------------------------------------------------
  440.   # ● Initialize
  441.   #--------------------------------------------------------------------------  
  442.   def initialize(viewport = nil,index)
  443.       super(viewport)
  444.       @index = index
  445.       @float = [0,0,0]
  446.       @move_phase = @index
  447.       self.bitmap = Cache.title1("Skull")
  448.       self.ox = self.bitmap.width / 2
  449.       self.oy = self.bitmap.height / 2
  450.       @org_pos = [Graphics.width + self.ox, 150 + self.oy,
  451.         -self.ox]
  452.       self.x = @index == 0 ? @org_pos[0] : @org_pos[2]      
  453.       self.y = @org_pos[1]
  454.       self.z = 15
  455.       self.blend_type = 0
  456.       @next_pos = [@org_pos[0],@org_pos[1]]
  457.       z1 = Graphics.width / 3
  458.       z2 = z1 * 2
  459.       @zoom_phase = [0,z2,@org_pos[0]]  
  460.       @fade_phase = 0
  461.       setup_move
  462.       if @index == 2
  463.          @org_pos[0] = 150
  464.          @org_pos[1] = 200
  465.          self.x = @org_pos[0]
  466.          self.y = @org_pos[1]
  467.          self.mirror = false    
  468.          self.zoom_x = 1.00
  469.          self.zoom_y = 1.00
  470.          self.angle = 30
  471.          self.z = 15
  472.       end  
  473.   end
  474.  
  475.   #--------------------------------------------------------------------------
  476.   # ● Dispose
  477.   #--------------------------------------------------------------------------  
  478.   def dispose_sprites
  479.       self.bitmap.dispose
  480.   end
  481.  
  482.   #--------------------------------------------------------------------------
  483.   # ● Update
  484.   #--------------------------------------------------------------------------              
  485.   def update_sprites(active)
  486.      # return if !active
  487.       update_float_effect  
  488.       update_move unless @index == 2
  489.       update_slide(1,@org_pos[1] + @float[0])
  490.   end
  491.  
  492.   #--------------------------------------------------------------------------
  493.   # ● Setup Move
  494.   #--------------------------------------------------------------------------                
  495.   def setup_move
  496.     #  self.opacity = 100 + rand(155)
  497.     #  @fade_phase = 0
  498.       if @move_phase == 0
  499.          @move_phase = 1
  500.          self.x = @org_pos[2]
  501.          self.mirror = true    
  502.          self.z = 15
  503.          self.zoom_x = 0.50
  504.          self.zoom_y = 0.50        
  505.          @org_pos[1] = 100 + self.oy + rand(100)
  506.       else
  507.          @move_phase = 0
  508.          self.x = @org_pos[0]
  509.          self.mirror = false  
  510.          self.z = 2
  511.          self.zoom_x = 1.00
  512.          self.zoom_y = 1.00
  513.          @org_pos[1] = -50 + self.oy + rand(100)
  514.       end
  515.   end
  516.  
  517.   #--------------------------------------------------------------------------
  518.   # ● Update Move
  519.   #--------------------------------------------------------------------------                
  520.   def update_move
  521.       if @move_phase == 0
  522.          self.x -= 1
  523.          if self.x.between?(@zoom_phase[1],@zoom_phase[2])
  524.             self.zoom_x -= 0.001
  525.             self.zoom_x = 0.50 if self.zoom_x < 0.50    
  526.          else  
  527.             self.zoom_x += 0.001
  528.             self.zoom_x = 1.00 if self.zoom_x > 1.00      
  529.          end  
  530.          setup_move if self.x <= @org_pos[2]
  531.       else
  532.          self.x += 1
  533.          if self.x.between?(@zoom_phase[0],@zoom_phase[1])
  534.             self.zoom_x += 0.001
  535.             self.zoom_x = 1.00 if self.zoom_x > 1.00
  536.          else  
  537.             self.zoom_x -= 0.001
  538.             self.zoom_x = 0.50 if self.zoom_x < 0.50
  539.          end  
  540.          setup_move if self.x >= @org_pos[0]
  541.       end
  542.       self.zoom_y = self.zoom_x
  543.   #    update_fade
  544.   end
  545.  
  546.  #--------------------------------------------------------------------------
  547.  # ● Update Fade
  548.  #--------------------------------------------------------------------------
  549.   def update_fade
  550.       if @fade_phase == 0
  551.          self.opacity -= 5
  552.          @fade_phase = 1 if self.opacity == 0
  553.       else
  554.          self.opacity += 5
  555.          @fade_phase = 0 if self.opacity == 255
  556.       end  
  557.   end
  558.  
  559.  #--------------------------------------------------------------------------
  560.  # ● Update Slide
  561.  #--------------------------------------------------------------------------                      
  562.   def update_slide(type,np)
  563.       cp = type == 0 ? self.x : self.y
  564.       sp = 3 + ((cp - np).abs / 10)
  565.       if cp > np
  566.          cp -= sp
  567.          cp = np if cp < np
  568.       elsif cp < np
  569.          cp += sp
  570.          cp = np if cp > np
  571.       end    
  572.       self.x = cp if type == 0
  573.       self.y = cp if type == 1
  574.   end    
  575.  
  576.   #--------------------------------------------------------------------------
  577.   # ● Update Float Effect
  578.   #--------------------------------------------------------------------------                
  579.   def update_float_effect
  580.       @float[2] += 1
  581.       return if @float[2] < 4
  582.       @float[2] = 0
  583.       @float[1] += 1
  584.       case @float[1]
  585.            when 1..5
  586.                @float[0] -= 1
  587.            when 6..15  
  588.                @float[0] += 1
  589.            when 16..20  
  590.                @float[0] -= 1
  591.            else  
  592.                @float[0] = 0
  593.                @float[1] = 0
  594.       end
  595.   end
  596.  
  597. end
  598.  
  599. #==============================================================================
  600. # ■ Scene Title
  601. #==============================================================================
  602. class Scene_Title
  603.  
  604.   #--------------------------------------------------------------------------
  605.   # ● Dispose
  606.   #--------------------------------------------------------------------------          
  607.   def dispose
  608.       Graphics.freeze
  609.       dispose_background
  610.       dispose_fire_wind
  611.       dispose_particles
  612.       dispose_character
  613.       dispose_layout
  614.       dispose_commands
  615.       dispose_skulls
  616.   end
  617.    
  618.   #--------------------------------------------------------------------------
  619.   # ● Dispose Background
  620.   #--------------------------------------------------------------------------            
  621.   def dispose_background
  622.       @background.bitmap.dispose
  623.       @background.dispose      
  624.   end
  625.  
  626.   #--------------------------------------------------------------------------
  627.   # ● Dispose Layout
  628.   #--------------------------------------------------------------------------              
  629.   def dispose_layout  
  630.       @layout.bitmap.dispose
  631.       @layout.dispose
  632.   end  
  633.    
  634.   #--------------------------------------------------------------------------
  635.   # ● Dispose Commands
  636.   #--------------------------------------------------------------------------                
  637.   def dispose_commands
  638.       @com.each {|sprite| sprite.dispose_sprites }
  639.   end  
  640.  
  641.   #--------------------------------------------------------------------------
  642.   # ● Dispose Skulls
  643.   #--------------------------------------------------------------------------                
  644.   def dispose_skulls
  645.       @skulls.each {|sprite| sprite.dispose_sprites }
  646.   end  
  647.  
  648.   #--------------------------------------------------------------------------
  649.   # ● Dispose Fire Wind
  650.   #--------------------------------------------------------------------------            
  651.   def dispose_fire_wind
  652.       @fire_wind.each {|sprite| sprite.bitmap.dispose }
  653.       @fire_wind.each {|sprite| sprite.dispose }
  654.       @fire_wind_image.dispose
  655.   end
  656.  
  657.  #--------------------------------------------------------------------------
  658.  # ● Dispose Particles
  659.  #--------------------------------------------------------------------------    
  660.  def dispose_particles
  661.      @particles_sprite.each {|sprite| sprite.dispose }
  662.  end    
  663.  
  664.   #--------------------------------------------------------------------------
  665.   # ● Dispose Character
  666.   #--------------------------------------------------------------------------    
  667.   def dispose_character
  668.       @character.bitmap.dispose
  669.       @character.dispose
  670.       @character2.bitmap.dispose
  671.       @character2.dispose      
  672.   end    
  673.  
  674. end
  675.  
  676. #==============================================================================
  677. # ■ Scene Title
  678. #==============================================================================
  679. class Scene_Title
  680.  
  681.   #--------------------------------------------------------------------------
  682.   # ● Update Sprites
  683.   #--------------------------------------------------------------------------          
  684.   def update_sprites
  685.       update_background
  686.       update_fire_wind
  687.       update_particles
  688.       update_character
  689.       update_commands
  690.       update_skulls
  691.   end
  692.    
  693.   #--------------------------------------------------------------------------
  694.   # ● Update Background
  695.   #--------------------------------------------------------------------------            
  696.   def update_background
  697.       @layout.opacity += 5
  698.       @background_scroll[2] += 1
  699.       return if @background_scroll[2] < 4
  700.       @background_scroll[2] = 0
  701.       @background.ox += @background_scroll[0]
  702.       @background.oy += @background_scroll[1]
  703.   end  
  704.  
  705.   #--------------------------------------------------------------------------
  706.   # ● Update Commands
  707.   #--------------------------------------------------------------------------                
  708.   def update_commands
  709.       @com.each {|sprite| sprite.update_sprites(@com_index,@active)}
  710.   end      
  711.  
  712.   #--------------------------------------------------------------------------
  713.   # ● Update Skulls
  714.   #--------------------------------------------------------------------------                
  715.   def update_skulls
  716.       @skulls.each {|sprite| sprite.update_sprites(@active)}
  717.   end    
  718.  
  719.   #--------------------------------------------------------------------------
  720.   # ● Update Fire Wind
  721.   #--------------------------------------------------------------------------            
  722.   def update_fire_wind
  723.       @fire_wind.each {|sprite| sprite.update }
  724.   end    
  725.  
  726.   #--------------------------------------------------------------------------
  727.   # ● Update Particles
  728.   #--------------------------------------------------------------------------  
  729.   def update_particles
  730.       @particles_sprite.each {|sprite| sprite.update }
  731.   end  
  732.  
  733.   #--------------------------------------------------------------------------
  734.   # ● Update Character
  735.   #--------------------------------------------------------------------------    
  736.   def update_character
  737.       @character.opacity += 5
  738.       return if !@character2.visible
  739.       if @char_zoom_speed[1] > 0
  740.          @char_zoom_speed[1] -= 1
  741.          @character2.opacity = 0
  742.          @character2.opacity = 255 if @char_zoom_speed[1] == 0
  743.       end
  744.       return if @char_zoom_speed[1] > 0
  745.       @char_zoom_speed[0] += 1
  746.       return if @char_zoom_speed[0] < 5
  747.       @char_zoom_speed[0] = 0
  748.       @character2.zoom_x += 0.01
  749.       @character2.opacity -= 5
  750.       if @character2.opacity <= 0
  751.          @character2.zoom_x = 1.00
  752.          @character2.opacity = 0
  753.          @char_zoom_speed[1] = 120
  754.       end
  755.       @character2.zoom_y = @character2.zoom_x
  756.   end
  757.  
  758. end
  759.  
  760. #==============================================================================
  761. # ■ Scene Title
  762. #==============================================================================
  763. class Scene_Title
  764.  
  765.   #--------------------------------------------------------------------------
  766.   # ● Update
  767.   #--------------------------------------------------------------------------          
  768.   def update
  769.       update_command
  770.       update_sprites
  771.   end
  772.    
  773. end
  774.  
  775. #==============================================================================
  776. # ■ Scene Title
  777. #==============================================================================
  778. class Scene_Title
  779.  
  780.   #--------------------------------------------------------------------------
  781.   # ● Update Command
  782.   #--------------------------------------------------------------------------          
  783.   def update_command
  784.       update_key
  785.       refresh_index if @com_index_old != @com_index
  786.   end
  787.    
  788.   #--------------------------------------------------------------------------
  789.   # ● Update Key
  790.   #--------------------------------------------------------------------------            
  791.   def update_key
  792.       if Input.trigger?(:DOWN)
  793.          add_index(1)
  794.       elsif Input.trigger?(:UP)
  795.          add_index(-1)
  796.       elsif Input.trigger?(:C)  
  797.          select_command
  798.       end  
  799.   end
  800.  
  801.   #--------------------------------------------------------------------------
  802.   # ● Select Command
  803.   #--------------------------------------------------------------------------              
  804.   def select_command
  805.     #  if !@active
  806.     #     @active = true  
  807.     #     return
  808.     #  end  
  809.       case @com_index
  810.          when 0; command_new_game
  811.          when 1; command_continue
  812.          when 2; command_shutdown  
  813.       end
  814.   end
  815.  
  816.   #--------------------------------------------------------------------------
  817.   # ● Add Index
  818.   #--------------------------------------------------------------------------              
  819.   def add_index(value = 0)
  820.       @com_index += value
  821.       if !@continue_enabled and @com_index == 1
  822.           @com_index = 2 if value == 1
  823.           @com_index = 0 if value == -1
  824.       end    
  825.       @com_index = 0 if @com_index > @com_index_max
  826.       @com_index = @com_index_max if @com_index < 0
  827.   end
  828.  
  829.   #--------------------------------------------------------------------------
  830.   # ● Refresh Index
  831.   #--------------------------------------------------------------------------            
  832.   def refresh_index
  833.       @com_index_old = @com_index
  834.       Sound.play_cursor
  835.   end
  836.  
  837.   #--------------------------------------------------------------------------
  838.   # ● Command New Game
  839.   #--------------------------------------------------------------------------            
  840.   def command_new_game    
  841.       Sound.play_ok
  842.       DataManager.setup_new_game
  843.       fadeout_all
  844.       $game_map.autoplay
  845.       SceneManager.goto(Scene_Map)      
  846.   end  
  847.  
  848.   #--------------------------------------------------------------------------
  849.   # ● Command Continue
  850.   #--------------------------------------------------------------------------            
  851.   def command_continue
  852.       if !@continue_enabled
  853.          Sound.play_cancel
  854.          return
  855.       else  
  856.          Sound.play_ok
  857.       end
  858.       SceneManager.call(Scene_Load)
  859.   end    
  860.  
  861.   #--------------------------------------------------------------------------
  862.   # ● Command Shutdown
  863.   #--------------------------------------------------------------------------            
  864.   def command_shutdown
  865.       Sound.play_ok
  866.       fadeout_all
  867.       SceneManager.exit    
  868.   end
  869.  
  870.   #--------------------------------------------------------------------------
  871.   # ● play_title_music
  872.   #--------------------------------------------------------------------------
  873.   def play_title_music
  874.       $data_system.title_bgm.play
  875.       RPG::BGS.stop
  876.       RPG::ME.stop
  877.   end  
  878.  
  879.   #--------------------------------------------------------------------------
  880.   # ● Fadeout_all
  881.   #--------------------------------------------------------------------------
  882.   def fadeout_all(time = 1000)
  883.       RPG::BGM.fade(time)
  884.       RPG::BGS.fade(time)
  885.       RPG::ME.fade(time)
  886.       Graphics.fadeout(time * Graphics.frame_rate / 1000)
  887.       RPG::BGM.stop
  888.       RPG::BGS.stop
  889.       RPG::ME.stop
  890.   end  
  891.  
  892. end
  893.  
  894. $mog_rgss3_rin_title_screen = true