Jump to content
Sign in to follow this  
Parthanandix

Particle Splash Collaboration

Recommended Posts

Introduction

This is a collaboration from Moghunter and Me (Parthanandix).

This creates a splash screen that has particles on it.

 

Script

 

 

#=============================================================================#
#                     Parthanandix's Particle Splash                          #
#-----------------------------------------------------------------------------#
# Instructions: Place this below Materials but above Main. If using with      #
# Moghunter's Animated Title A place this below it. Flows very well with      #
# his title screen.                                                           #
#                                                                             #
# Credits: Moghunter for the particles movement                               #
#-----------------------------------------------------------------------------#
# Usage Terms: You may use this both in commercial and non-commercial as long #
# as credit is given.                                                         #
#                                                                             #
# This is also stated below his website:                                      #
#                                                                             #
# License to use                                                              #
# 1 - You're free to use all Atelier-Rgss scripts in commercial or            #
#     non-commercial projects.                                                #
# 2 - You're free to edit and adapt my scripts                                #
#-----------------------------------------------------------------------------#
module Particle_Splash
  #----------------#
  # Splash Picture #
  #----------------#
  Splash_Pic = "Logo"    # Place inside "Graphics/Titles2/"
  Splash_X = 0           # X position of splash
  Splash_Y = 0           # Y position of splash
  Skip_Button = :C       # Button used to skip the splash
  Dur = 180              # Duration of the splash
  Fade_Dur = 60          # Fade duration of the splash
  #-------------------#
  # Particle Settings #  MOGHUNTER SETTINGS
  #-------------------#
  Use_Particles = true          # Really self explanatory....
  Particle = "Particle"         # Place inside "Graphics/Titles2/"
  Particle_Rand_Color = true    # Set to true if you want random hues/colors
  Particle_Move_Range_X = 3     # X and Y range the particles are allowed to move
  Particle_Move_Range_Y = 3
                                # If you want the particles to turn set this to
  Particle_Angle_Range = 3      # something other than 0.
                                # Makes it look like they're dancing around
end
#=============================================================================#
#                    NO EDIT PASTA HERE (hehe pasta...)                       #
#=============================================================================#
module SceneManager
  class << self
    alias first_scene_class_new first_scene_class
  end
  def self.first_scene_class
    if $BTEST
      Scene_Battle
    else
      Scene_Particle_Splash
    end
  end
end

class Scene_Particle_Splash < Scene_Base
  def initialize
    make_splash_pic
    make_particles
    @p_splash_time = 0
  end
  def make_splash_pic
    @p_splash = Sprite.new
    @p_splash.bitmap = Cache.title2(Particle_Splash::Splash_Pic)
    @p_splash.opacity = 0
    @p_splash.x = Particle_Splash::Splash_X
    @p_splash.y = Particle_Splash::Splash_Y
    @p_splash.z = 201
  end
  def make_particles
    return unless Particle_Splash::Use_Particles
    @viewport_particle = Viewport.new(-32, -32, 576, 448)
    @viewport_particle.z = 202
    @particle_bitmap =[]
    for i in 0...20
        @particle_bitmap.push(Particles.new(@viewport_particle))
    end  
  end
  def terminate
    super
    dispose_particles
    @p_splash.bitmap.dispose
    @p_splash.dispose
  end
  def dispose_particles
    return unless Particle_Splash::Use_Particles
    if @particle_bitmap != nil
        for i in @particle_bitmap
            i.dispose
        end
        @particle_bitmap = nil
    end
    @viewport_particle.dispose 
  end 
  def update
    super
    update_splash
    update_particles
  end
  def update_splash
    @p_splash.opacity += 1
    proceed_2_title if Input.press?(Particle_Splash::Skip_Button)
    if @p_splash.opacity >= 255
      @p_splash_time += 1
      proceed_2_title if @p_splash_time >= Particle_Splash::Dur
    end
  end
  def update_particles
    return unless Particle_Splash::Particle
    if @particle_bitmap != nil
      for i in @particle_bitmap
        i.update
      end  
    end   
  end
  def proceed_2_title
    Graphics.fadeout(Particle_Splash::Fade_Dur)
    SceneManager.goto(Scene_Title)
  end
end

# MOGHUNTER's Coding
class Particles < Sprite           
  def initialize(viewport = nil)
    super(viewport)
    self.bitmap = Cache.title2(Particle_Splash::Particle)
    self.tone.set(rand(255),rand(255), rand(255), 255) if Particle_Splash::Particle_Rand_Color
    reset
  end            
  def reset
    self.x = rand(576)- 32
    self.y = rand(448 + self.bitmap.height)
    self.opacity = 0
    self.angle = rand(360)
    @speed_x = [[rand(Particle_Splash::Particle_Move_Range_X), Particle_Splash::Particle_Move_Range_X].min, 1].max 
    @speed_x = 0 if Particle_Splash::Particle_Move_Range_X < 1
    @speed_y = [[rand(Particle_Splash::Particle_Move_Range_Y), Particle_Splash::Particle_Move_Range_Y].min, 1].max
    @speed_y = 0 if Particle_Splash::Particle_Move_Range_Y < 1
    @speed_a = [[rand(Particle_Splash::Particle_Angle_Range), Particle_Splash::Particle_Angle_Range].min, 0].max 
  end
  def dispose
    super
    self.bitmap.dispose
  end              
  def update
    super
    self.x += @speed_x
    self.y -= @speed_y
    self.angle += @speed_a
    self.opacity += 5
    reset if can_reset?
  end             
  def can_reset?
    return true if (self.x < -64 or self.x > 600)    
    return true if (self.y < -64 or self.y > 500)
    return false
  end  
end

 

 

 

 

Credits

  • Moghunter
  • Parthanandix

Screenshot

 

 

post-21986-0-14715100-1363637690_thumb.png

 

 

Share this post


Link to post
Share on other sites

Thanks  :D  it ran really smoothly with his titlescreen. It just sorta gave it a better feel with some sort of animation to it.

 

-Edit-

Maybe I should add like a slide effect to the splash idk need some ideas.

Edited by Parthanandix

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted