Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # Pong Game
- # Version: 1.1
- # Author: DiamondandPlatinum3
- # Date: May 28, 2012
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- # Description:
- # This script allows you to play an old retro game called pong in your game.
- # It would generally be used as a mini game of some sorts, or just a plain
- # old easter egg.
- #
- # Pong is a game featuring two players and a ball, the ball moves back and
- # forth from one player to the other and the objective is to never miss the
- # ball.
- # If you miss the ball, your opponent will score a point and the same goes
- # for you, should the opponent miss the ball.
- # The first person to score 6 points will win the match, Although you can
- # edit this if you wish.
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- #------------------------------------------------------------------------------
- # Instructions:
- #
- # - Place this script in the materials section, above Main.
- #
- # - In your Pictures folder where your project is located, create a new
- # subdfolder and name it 'Pong Images'.
- #
- # - Be sure that you have the appropriate pictures located in your
- # 'Pong Images' folder, as they will be required for the minigame.
- #
- # - Check the script options below these instructions to tweak the minigames
- # settings (including sounds, picture names and size dimensions of sprites).
- #
- # - You can set in game variables to be increased whenever you Win or Lose a
- # game of Pong. You can set which variable ID they are in the editable region.
- # To use them for item gaining conditions and ridiculing conditions the same
- # way you would use normal variables.
- # (ie checking if Variable ID 5 is equal to 3; then running an event if that is true).
- #
- # - To start the minigame, simply call it with an event by using the
- # script command and entering "$scene = Pong_Scene.new" without the
- # quotation marks. It'll automatically initiate the game.
- #
- # - You can alter settings in your event pages simply by using a script call
- # that says 'Pong_Options::' followed by the appropriate variable name in
- # the editable region.
- # So if I wanted to edit Access to the menu, the music being played, or
- # the points to win. I would simply do this in a script command
- #
- # Pong_Options::Access_Menu = false
- # Pong_Options::Game_BGM = "Town2"
- # Pong_Options::Points_To_Win = 3
- #
- # You do not have to do this, this is just a way to allow you to alter
- # settings in game if you were running a competition or anything similar.
- #
- #==============================================================================
- module Pong_Options
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -=
- # Editable Region //// ==
- # =-
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Only Edit what is after the equals ( = ) sign. ==
- # If there are brackets '()' or quotation marks ==
- # only edit what is inside of them. ==
- #==========================================================
- #////////////////////////////////////////////////////////
- # Images and Dimensions ||
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Screen_Width = 544 # The Width of the Screen
- Screen_Height = 414 # The Height of the Screen
- # (Leave both of these as defaults
- # if you're not using a higher screen
- # resolution for your game).
- Background_Image = true # Do you want a background image? (true / false)
- Background_Sprite = ("Background") # The Name of the Background image
- Left_Paddle_Sprite = ("LeftPaddle_Sprite") # The Name of the Sprite
- Left_Paddle_Width = 20 # The Width of the Left Paddle
- Left_Paddle_Height = 20 # The Height of the Left Paddle
- Right_Paddle_Sprite = ("RightPaddle_Sprite")# The Name of the Sprite
- Right_Paddle_Width = 20 # The Width of the Right Paddle
- Right_Paddle_Height = 20 # The Height of the Right Paddle
- Ball_Sprite = ("Ball_Sprite") # The Name of the Sprite
- Ball_Width = 10 # The Width of the Ball
- Ball_Height = 10 # The Height of the Ball
- #////////////////////////////////////////////////////////
- # Game Mechanics ||
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Access_Menu = true # Allow access to the menu? (true / false)
- Points_To_Win = 6 # How many points needed to win a game.
- # Standard = 6
- Initial_Ball_Speed = 2.0 # Initial Speed of the Ball
- Ball_Speed_Increase = 0.1 # How much the balls speed should increase
- # after a player hits it. Best to play
- # around with this option to see what you like.
- Frame_Wait_Amount = 180 # How long you want the ball to wait
- # in the middle after scoring a point
- # (60 frames = one second)
- Left_Paddle_Speed = 3.0 # Speed of the Left Paddle
- Right_Paddle_Speed = 3.0 # Speed of the Right Paddle
- #////////////////////////////////////////////////////////
- # Sound ||
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Game_Music = true # Play a different BGM during game? (true / false)
- Game_BGM = "Battle5" # BGM played during the game
- BGM_Volume = 100 # Volume of the BGM
- BGM_Pitch = 100 # Pitch of the BGM
- #////////////////////////////////////////////////////////
- # Windows ||
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- P1Score_Window_Xpos = 50 # The X position of P1's Score display
- P1Score_Window_Ypos = 30 # The Y position of P1's Score display
- P1Score_Window_Opacity = 0 # The Opacity of P1's Score display
- P2Score_Window_Xpos = 390 # The X position of P2's Score display
- P2Score_Window_Ypos = 30 # The Y position of P2's Score display
- P2Score_Window_Opacity = 0 # The Opacity of P2's Score display
- #////////////////////////////////////////////////////////
- # Project Related ||
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||||
- Set_Win_Counter = true # Do you want the game to hold a variable for the amount of wins you have earned in Pong?
- Win_Count_Variable_ID = 10 # The ID of the variable that holds your win counter
- Set_Loss_Counter = true # Do you want the game to hold a variable for the amount of loses you have gained in Pong?
- Loss_Count_Variable_ID = 11 # The ID of the variable that holds your loss counter
- Show_Scoreboard = true # Show a scoreboard in the Pong game to reflect the above statements?
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- end # of editable region //// ||
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -=
- # Start of Script //// ==
- # =-
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # Classes
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- #======================================================
- # P1 Score Window
- #======================================================
- class Pong_P1Score_Window < Window_Base
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def initialize (playerOne_Score)
- super(Pong_Options::P1Score_Window_Xpos, Pong_Options::P1Score_Window_Ypos, 150, 60)
- self.opacity = Pong_Options::P1Score_Window_Opacity
- @stxt_p1 = playerOne_Score.to_s
- self.contents.draw_text(0, 0, 150, WLH, "Score: " + @stxt_p1, 0)
- end
- def update (playerOne_Score)
- self.contents.clear
- @stxt_p1 = playerOne_Score.to_s
- self.contents.draw_text(0, 0, 150, WLH, "Score: " + @stxt_p1, 0)
- end
- end
- #======================================================
- # P2 Score Window
- #======================================================
- class Pong_P2Score_Window < Window_Base
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def initialize (playerTwo_Score)
- super(Pong_Options::P2Score_Window_Xpos, Pong_Options::P2Score_Window_Ypos, 150, 60)
- self.opacity = Pong_Options::P2Score_Window_Opacity
- @stxt_p2 = playerTwo_Score.to_s
- self.contents.draw_text(0, 0, 150, WLH, "Score: " + @stxt_p2, 0)
- end
- def update (playerTwo_Score)
- self.contents.clear
- @stxt_p2 = playerTwo_Score.to_s
- self.contents.draw_text(0, 0, 150, WLH, "Score: " + @stxt_p2, 0)
- end
- end
- #======================================================
- # Winner Window
- #======================================================
- class Pong_Winner_Window < Window_Base
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def initialize (playerOne_Score)
- super(197, 50, 200, 100)
- if playerOne_Score == Pong_Options::Points_To_Win
- @winner = "Player 1 Wins"
- $game_variables[Pong_Options::Win_Count_Variable_ID] += 1 if Pong_Options::Set_Win_Counter == true
- else
- @winner = "Player 2 Wins"
- $game_variables[Pong_Options::Loss_Count_Variable_ID] += 1 if Pong_Options::Set_Loss_Counter == true
- end
- self.opacity = 0
- self.contents.draw_text(0, 0, 200, WLH, @winner, 0)
- end
- end
- #======================================================
- # P1 Total Wins Window
- #======================================================
- class Pong_P1TotalWinsScore_Window < Window_Base
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def initialize
- super(20, Pong_Options::Screen_Height - 100, 160, 60)
- @totalwins = $game_variables[Pong_Options::Win_Count_Variable_ID].to_s
- self.opacity = 0
- self.contents.draw_text(0, 0, 200, WLH, "Total Wins: " + @totalwins, 0)
- end
- def update
- @totalwins = $game_variables[Pong_Options::Win_Count_Variable_ID].to_s
- self.contents.clear
- self.contents.draw_text(0, 0, 200, WLH, "Total Wins: " + @totalwins, 0)
- end
- end
- #======================================================
- # P1 Total Losses Window
- #======================================================
- class Pong_P1TotalLossesScore_Window < Window_Base
- #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- def initialize
- super(Pong_Options::Screen_Width - 200, Pong_Options::Screen_Height - 100, 160, 60)
- @totallosses = $game_variables[Pong_Options::Loss_Count_Variable_ID].to_s
- self.opacity = 0
- self.contents.draw_text(0, 0, 200, WLH, "Total Wins: " + @totallosses, 0)
- end
- def update
- @totalwins = $game_variables[Pong_Options::Loss_Count_Variable_ID].to_s
- self.contents.clear
- self.contents.draw_text(0, 0, 200, WLH, "Total Wins: " + @totallosses, 0)
- end
- end
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # Functions
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- #======================================================
- # Process Reset
- #======================================================
- def process_pong_reset
- if @gameover == true
- @Pong_Winner_Window.dispose
- @gameover = false
- end
- @waiting = false
- @iFrameCount = 0
- @ballspeedx = (Pong_Options::Initial_Ball_Speed)
- @ballspeedy = (Pong_Options::Initial_Ball_Speed)
- @ball_sprite.x = @middleScreenPosX
- @ball_sprite.y = @middleScreenPosY
- @leftpaddle_sprite.x = @leftpaddle_StartPosX
- @leftpaddle_sprite.y = @leftpaddle_StartPosY
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- @rightpaddle_sprite.y = @rightpaddle_StartPosY - @rightpaddle_height
- @playerOne_Score = 0
- @playerTwo_Score = 0
- end
- #======================================================
- # Create Command Window
- #======================================================
- def create_command_window
- s1 = "Play"
- s2 = "Reset"
- s3 = "Options"
- s4 = "Exit"
- @command_window = Window_Command.new(142, [s1, s2, s3, s4])
- @command_window.x = (Pong_Options::Screen_Width - @command_window.width) * 0.5
- @command_window.y = (Pong_Options::Screen_Height - @command_window.height) * 0.5
- @command_window.openness = 0
- end
- #======================================================
- # Open Command Window
- #======================================================
- def open_command_window
- @command_window.open
- begin
- @command_window.update
- Graphics.update
- end until @command_window.openness == 255
- @cmmd_wnd_open = true
- end
- #======================================================
- # Process Command Window
- #======================================================
- def process_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- close_command_window
- @cmmd_wnd_open = false
- end
- if Input.trigger?(Input::C)
- case @command_window.index
- #-------------------------------------------------------------------
- when 0 #Play Game
- #-------------------------------------------------------------------
- Sound.play_decision
- close_command_window
- @cmmd_wnd_open = false
- #-------------------------------------------------------------------
- when 1 #Reset
- #-------------------------------------------------------------------
- Sound.play_decision
- process_pong_reset
- close_command_window
- #-------------------------------------------------------------------
- when 2 #Options
- #-------------------------------------------------------------------
- Sound.play_decision
- close_command_window
- open_options_command_window
- #-------------------------------------------------------------------
- when 3 #Exit
- #-------------------------------------------------------------------
- Sound.play_cancel
- close_command_window
- $scene = Scene_Map.new
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Command Window
- #======================================================
- def close_command_window
- @command_window.close
- begin
- @command_window.update
- Graphics.update
- end until @command_window.openness == 0
- @cmmd_wnd_open = false
- end
- #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- #//////////////////////////////////////////////////////
- # Options Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Options Command Window
- #======================================================
- def create_options_command_window
- s1 = "Scoreboard Options"
- s2 = "Ball Options"
- s3 = "Left Paddle Options"
- s4 = "Right Paddle Options"
- @options_command_window = Window_Command.new(230, [s1, s2, s3, s4])
- @options_command_window.x = (((Pong_Options::Screen_Width - @command_window.width) * 0.5) - 45)
- @options_command_window.y = (Pong_Options::Screen_Height - @command_window.height) * 0.5
- @options_command_window.openness = 0
- end
- #======================================================
- # Open Options Command Window
- #======================================================
- def open_options_command_window
- @options_command_window.open
- begin
- @options_command_window.update
- Graphics.update
- end until @options_command_window.openness == 255
- @opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Options Command Window
- #======================================================
- def process_options_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_command_window
- close_options_command_window
- end
- if Input.trigger?(Input::C)
- case @options_command_window.index
- #-------------------------------------------------------------------
- when 0 #Scoreboard
- #-------------------------------------------------------------------
- Sound.play_decision
- open_scoreboardoptions_command_window
- close_options_command_window
- #-------------------------------------------------------------------
- when 1 #Ball Options
- #-------------------------------------------------------------------
- Sound.play_decision
- open_balloptions_command_window
- close_options_command_window
- #-------------------------------------------------------------------
- when 2 #Left Paddle Options
- #-------------------------------------------------------------------
- Sound.play_decision
- open_leftpaddleoptions_command_window
- close_options_command_window
- #-------------------------------------------------------------------
- when 3 #Right Paddle Options
- #-------------------------------------------------------------------
- Sound.play_decision
- open_rightpaddleoptions_command_window
- close_options_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Options Command Window
- #======================================================
- def close_options_command_window
- @options_command_window.close
- begin
- @options_command_window.update
- Graphics.update
- end until @options_command_window.openness == 0
- @opt_cmmd_wnd_open = false
- end
- #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- # Scoreboard Options Comand Window $$
- #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- #======================================================
- # Create Scoreboard Options Command Window
- #======================================================
- def create_scoreboardoptions_command_window
- s1 = "Show P1 Score"
- s2 = "Show P2 Score"
- s3 = "Show Total Wins"
- s4 = "Show Total Losses"
- @sb_options_command_window = Window_Command.new(220, [s1, s2, s3, s4])
- @sb_options_command_window.x = (((Pong_Options::Screen_Width - @command_window.width) * 0.5) - 40)
- @sb_options_command_window.y = (Pong_Options::Screen_Height - @command_window.height) * 0.5
- @sb_options_command_window.openness = 0
- end
- #======================================================
- # Open Scoreboard Options Command Window
- #======================================================
- def open_scoreboardoptions_command_window
- @sb_options_command_window.open
- begin
- @sb_options_command_window.update
- Graphics.update
- end until @sb_options_command_window.openness == 255
- @sb_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Scoreboard Options Command Window
- #======================================================
- def process_scoreboardoptions_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_options_command_window
- close_scoreboardoptions_command_window
- end
- if Input.trigger?(Input::C)
- case @sb_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #Show P1 Score
- #-------------------------------------------------------------------
- Sound.play_decision
- if @p1score_window_active == true
- @Pong_P1Score_Window.dispose
- @p1score_window_active = false
- elsif @p1score_window_active == false
- @Pong_P1Score_Window = Pong_P1Score_Window.new(@playerOne_Score)
- @p1score_window_active = true
- end
- #-------------------------------------------------------------------
- when 1 #Show P2 Score
- #-------------------------------------------------------------------
- Sound.play_decision
- if @p2score_window_active == true
- @Pong_P2Score_Window.dispose
- @p2score_window_active = false
- elsif @p2score_window_active == false
- @Pong_P2Score_Window = Pong_P2Score_Window.new(@playerOne_Score)
- @p2score_window_active = true
- end
- #-------------------------------------------------------------------
- when 2 #Show Total Wins
- #-------------------------------------------------------------------
- Sound.play_decision
- if Pong_Options::Set_Win_Counter == true && @totalwins_window_active == false
- @pong_P1TotalWinsScore_Window = Pong_P1TotalWinsScore_Window.new
- @totalwins_window_active = true
- elsif @totalwins_window_active == true
- @pong_P1TotalWinsScore_Window.dispose
- @totalwins_window_active = false
- end
- #-------------------------------------------------------------------
- when 3 #Show Total Losses
- #-------------------------------------------------------------------
- Sound.play_decision
- if Pong_Options::Set_Loss_Counter == true && @totallosses_window_active == false
- @pong_P1TotalLossesScore_Window = Pong_P1TotalLossesScore_Window.new
- @totallosses_window_active = true
- elsif @totallosses_window_active == true
- @pong_P1TotalLossesScore_Window.dispose
- @totallosses_window_active = false
- end
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Scoreboard Options Command Window
- #======================================================
- def close_scoreboardoptions_command_window
- @sb_options_command_window.close
- begin
- @sb_options_command_window.update
- Graphics.update
- end until @sb_options_command_window.openness == 0
- @sb_opt_cmmd_wnd_open = false
- end
- #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- #//////////////////////////////////////////////////////
- # Ball Options Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Ball Options Command Window
- #======================================================
- def create_balloptions_command_window
- s1 = "Speed Increase"
- s2 = "Ball Height"
- s3 = "Ball Width"
- @ball_options_command_window = Window_Command.new(220, [s1, s2, s3])
- @ball_options_command_window.x = (((Pong_Options::Screen_Width - @command_window.width) * 0.5) - 40)
- @ball_options_command_window.y = (Pong_Options::Screen_Height - @command_window.height) * 0.5
- @ball_options_command_window.openness = 0
- end
- #======================================================
- # Open Ball Options Command Window
- #======================================================
- def open_balloptions_command_window
- @ball_options_command_window.open
- begin
- @ball_options_command_window.update
- Graphics.update
- end until @ball_options_command_window.openness == 255
- @ball_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Ball Options Command Window
- #======================================================
- def process_balloptions_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_options_command_window
- close_balloptions_command_window
- end
- if Input.trigger?(Input::C)
- case @ball_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #Speed Increase
- #-------------------------------------------------------------------
- Sound.play_decision
- open_ball_sp_incr_options_command_window
- close_balloptions_command_window
- #-------------------------------------------------------------------
- when 1 #Ball Height
- #-------------------------------------------------------------------
- Sound.play_decision
- open_ball_height_options_command_window
- close_balloptions_command_window
- #-------------------------------------------------------------------
- when 2 #Ball Width
- #-------------------------------------------------------------------
- Sound.play_decision
- open_ball_width_options_command_window
- close_balloptions_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Ball Options Command Window
- #======================================================
- def close_balloptions_command_window
- @ball_options_command_window.close
- begin
- @ball_options_command_window.update
- Graphics.update
- end until @ball_options_command_window.openness == 0
- @ball_opt_cmmd_wnd_open = false
- end
- #//////////////////////////////////////////////////////
- # Ball Speed Increase Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Ball Speed Increase Options Command Window
- #======================================================
- def create_ball_sp_incr_options_command_window
- s1 = "1"
- s2 = "2"
- s3 = "3"
- s4 = "4"
- s5 = "5"
- s6 = "6"
- s7 = "7"
- s8 = "8"
- s9 = "9"
- s10 = "10"
- @ball_sp_incr_options_command_window = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
- @ball_sp_incr_options_command_window.x = (Pong_Options::Screen_Width - @command_window.width) * 0.5
- @ball_sp_incr_options_command_window.y = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
- @ball_sp_incr_options_command_window.openness = 0
- end
- #======================================================
- # Open Ball Speed Increase Options Command Window
- #======================================================
- def open_ball_sp_incr_options_command_window
- @ball_sp_incr_options_command_window.open
- begin
- @ball_sp_incr_options_command_window.update
- Graphics.update
- end until @ball_sp_incr_options_command_window.openness == 255
- @ball_si_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Ball Speed Increase Options Command Window
- #======================================================
- def process_ball_sp_incr_options_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- end
- if Input.trigger?(Input::C)
- case @ball_sp_incr_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #1
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_speed_increase = 0.1
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 1 #2
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_speed_increase = 0.2
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 2 #3
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_speed_increase = 0.3
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 3 #4
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_speed_increase = 0.4
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 4 #5
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_speed_increase = 0.5
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 5 #6
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_speed_increase = 0.6
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 6 #7
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_speed_increase = 0.7
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 7 #8
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_speed_increase = 0.8
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 8 #9
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_speed_increase = 0.9
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 9 #10
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_speed_increase = 1.0
- open_balloptions_command_window
- close_ball_sp_incr_options_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Ball Speed Increase Options Command Window
- #======================================================
- def close_ball_sp_incr_options_command_window
- @ball_sp_incr_options_command_window.close
- begin
- @ball_sp_incr_options_command_window.update
- Graphics.update
- end until @ball_sp_incr_options_command_window.openness == 0
- @ball_si_opt_cmmd_wnd_open = false
- end
- #//////////////////////////////////////////////////////
- # Ball Height Options Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Ball Height Options Command Window
- #======================================================
- def create_ball_height_options_command_window
- s1 = "10"
- s2 = "20"
- s3 = "30"
- s4 = "40"
- s5 = "50"
- s6 = "60"
- s7 = "70"
- s8 = "80"
- s9 = "90"
- s10 = "100"
- @ball_height_options_command_window = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
- @ball_height_options_command_window.x = (Pong_Options::Screen_Width - @command_window.width) * 0.5
- @ball_height_options_command_window.y = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
- @ball_height_options_command_window.openness = 0
- end
- #======================================================
- # Open Ball Height Options Command Window
- #======================================================
- def open_ball_height_options_command_window
- @ball_height_options_command_window.open
- begin
- @ball_height_options_command_window.update
- Graphics.update
- end until @ball_height_options_command_window.openness == 255
- @ball_height_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Ball Height Options Command Window
- #======================================================
- def process_ball_height_options_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_balloptions_command_window
- close_ball_height_options_command_window
- end
- if Input.trigger?(Input::C)
- case @ball_height_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #10
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_height = 10
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- open_balloptions_command_window
- close_ball_height_options_command_window
- #-------------------------------------------------------------------
- when 1 #20
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_height = 20
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- open_balloptions_command_window
- close_ball_height_options_command_window
- #-------------------------------------------------------------------
- when 2 #30
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_height = 30
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- open_balloptions_command_window
- close_ball_height_options_command_window
- #-------------------------------------------------------------------
- when 3 #40
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_height = 40
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- open_balloptions_command_window
- close_ball_height_options_command_window
- #-------------------------------------------------------------------
- when 4 #50
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_height = 50
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- open_balloptions_command_window
- close_ball_height_options_command_window
- #-------------------------------------------------------------------
- when 5 #60
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_height = 60
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- open_balloptions_command_window
- close_ball_height_options_command_window
- #-------------------------------------------------------------------
- when 6 #70
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_height = 70
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- open_balloptions_command_window
- close_ball_height_options_command_window
- #-------------------------------------------------------------------
- when 7 #80
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_height = 80
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- open_balloptions_command_window
- close_ball_height_options_command_window
- #-------------------------------------------------------------------
- when 8 #90
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_height = 90
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- open_balloptions_command_window
- close_ball_height_options_command_window
- #-------------------------------------------------------------------
- when 9 #100
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_height = 100
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- open_balloptions_command_window
- close_ball_height_options_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Ball Height Options Command Window
- #======================================================
- def close_ball_height_options_command_window
- @ball_height_options_command_window.close
- begin
- @ball_height_options_command_window.update
- Graphics.update
- end until @ball_height_options_command_window.openness == 0
- @ball_height_opt_cmmd_wnd_open = false
- end
- #//////////////////////////////////////////////////////
- # Ball Width Options Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Ball Width Options Command Window
- #======================================================
- def create_ball_width_options_command_window
- s1 = "10"
- s2 = "20"
- s3 = "30"
- s4 = "40"
- s5 = "50"
- s6 = "60"
- s7 = "70"
- s8 = "80"
- s9 = "90"
- s10 = "100"
- @ball_width_options_command_window = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
- @ball_width_options_command_window.x = (Pong_Options::Screen_Width - @command_window.width) * 0.5
- @ball_width_options_command_window.y = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
- @ball_width_options_command_window.openness = 0
- end
- #======================================================
- # Open Ball Width Options Command Window
- #======================================================
- def open_ball_width_options_command_window
- @ball_width_options_command_window.open
- begin
- @ball_width_options_command_window.update
- Graphics.update
- end until @ball_width_options_command_window.openness == 255
- @ball_width_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Ball Width Options Command Window
- #======================================================
- def process_ball_width_options_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_balloptions_command_window
- close_ball_width_options_command_window
- end
- if Input.trigger?(Input::C)
- case @ball_width_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #10
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_width = 10
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- open_balloptions_command_window
- close_ball_width_options_command_window
- #-------------------------------------------------------------------
- when 1 #20
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_width = 20
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- open_balloptions_command_window
- close_ball_width_options_command_window
- #-------------------------------------------------------------------
- when 2 #30
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_width = 30
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- open_balloptions_command_window
- close_ball_width_options_command_window
- #-------------------------------------------------------------------
- when 3 #40
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_width = 40
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- open_balloptions_command_window
- close_ball_width_options_command_window
- #-------------------------------------------------------------------
- when 4 #50
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_width = 50
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- open_balloptions_command_window
- close_ball_width_options_command_window
- #-------------------------------------------------------------------
- when 5 #60
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_width = 60
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- open_balloptions_command_window
- close_ball_width_options_command_window
- #-------------------------------------------------------------------
- when 6 #70
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_width = 70
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- open_balloptions_command_window
- close_ball_width_options_command_window
- #-------------------------------------------------------------------
- when 7 #80
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_width = 80
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- open_balloptions_command_window
- close_ball_width_options_command_window
- #-------------------------------------------------------------------
- when 8 #90
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_width = 90
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- open_balloptions_command_window
- close_ball_width_options_command_window
- #-------------------------------------------------------------------
- when 9 #100
- #-------------------------------------------------------------------
- Sound.play_decision
- @ball_width = 100
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- open_balloptions_command_window
- close_ball_width_options_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Ball Width Options Command Window
- #======================================================
- def close_ball_width_options_command_window
- @ball_width_options_command_window.close
- begin
- @ball_width_options_command_window.update
- Graphics.update
- end until @ball_width_options_command_window.openness == 0
- @ball_width_opt_cmmd_wnd_open = false
- end
- #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- #//////////////////////////////////////////////////////
- # Left Paddle Options Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Left Paddle Options Command Window
- #======================================================
- def create_leftpaddleoptions_command_window
- s1 = "Movement Speed"
- s2 = "Left Paddle Height"
- s3 = "Left Paddle Width"
- @leftpaddle_options_command_window = Window_Command.new(220, [s1, s2, s3])
- @leftpaddle_options_command_window.x = (((Pong_Options::Screen_Width - @command_window.width) * 0.5) - 40)
- @leftpaddle_options_command_window.y = (Pong_Options::Screen_Height - @command_window.height) * 0.5
- @leftpaddle_options_command_window.openness = 0
- end
- #======================================================
- # Open Left Paddle Options Command Window
- #======================================================
- def open_leftpaddleoptions_command_window
- @leftpaddle_options_command_window.open
- begin
- @leftpaddle_options_command_window.update
- Graphics.update
- end until @leftpaddle_options_command_window.openness == 255
- @leftpaddle_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Left Paddle Options Command Window
- #======================================================
- def process_leftpaddleoptions_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_options_command_window
- close_leftpaddleoptions_command_window
- end
- if Input.trigger?(Input::C)
- case @leftpaddle_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #Left Paddle Speed Increase
- #-------------------------------------------------------------------
- Sound.play_decision
- open_leftpaddle_sp_incr_options_command_window
- close_leftpaddleoptions_command_window
- #-------------------------------------------------------------------
- when 1 #Left Paddle Height
- #-------------------------------------------------------------------
- Sound.play_decision
- open_leftpaddle_height_options_command_window
- close_leftpaddleoptions_command_window
- #-------------------------------------------------------------------
- when 2 #Left Paddle Width
- #-------------------------------------------------------------------
- Sound.play_decision
- open_leftpaddle_width_options_command_window
- close_leftpaddleoptions_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Left Paddle Options Command Window
- #======================================================
- def close_leftpaddleoptions_command_window
- @leftpaddle_options_command_window.close
- begin
- @leftpaddle_options_command_window.update
- Graphics.update
- end until @leftpaddle_options_command_window.openness == 0
- @leftpaddle_opt_cmmd_wnd_open = false
- end
- #//////////////////////////////////////////////////////
- # Left Paddle Speed Increase Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Left Paddle Speed Increase Options Command Window
- #======================================================
- def create_leftpaddle_sp_incr_options_command_window
- s1 = "1"
- s2 = "2"
- s3 = "3"
- s4 = "4"
- s5 = "5"
- s6 = "6"
- s7 = "7"
- s8 = "8"
- s9 = "9"
- s10 = "10"
- @leftpaddle_sp_incr_options_command_window = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
- @leftpaddle_sp_incr_options_command_window.x = (Pong_Options::Screen_Width - @command_window.width) * 0.5
- @leftpaddle_sp_incr_options_command_window.y = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
- @leftpaddle_sp_incr_options_command_window.openness = 0
- end
- #======================================================
- # Open Left Paddle Speed Increase Options Command Window
- #======================================================
- def open_leftpaddle_sp_incr_options_command_window
- @leftpaddle_sp_incr_options_command_window.open
- begin
- @leftpaddle_sp_incr_options_command_window.update
- Graphics.update
- end until @leftpaddle_sp_incr_options_command_window.openness == 255
- @leftpaddle_si_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Left Paddle Speed Increase Options Command Window
- #======================================================
- def process_leftpaddle_sp_incr_options_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- end
- if Input.trigger?(Input::C)
- case @leftpaddle_sp_incr_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #1
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_speed = 1.0
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 1 #2
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_speed = 2.0
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 2 #3
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_speed = 3.0
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 3 #4
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_speed = 4.0
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 4 #5
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_speed = 5.0
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 5 #6
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_speed = 6.0
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 6 #7
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_speed = 7.0
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 7 #8
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_speed = 8.0
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 8 #9
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_speed = 9.0
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 9 #10
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_speed = 10.0
- open_leftpaddleoptions_command_window
- close_leftpaddle_sp_incr_options_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Left Paddle Speed Increase Options Command Window
- #======================================================
- def close_leftpaddle_sp_incr_options_command_window
- @leftpaddle_sp_incr_options_command_window.close
- begin
- @leftpaddle_sp_incr_options_command_window.update
- Graphics.update
- end until @leftpaddle_sp_incr_options_command_window.openness == 0
- @leftpaddle_si_opt_cmmd_wnd_open = false
- end
- #//////////////////////////////////////////////////////
- # Left Paddle Height Options Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Left Paddle Height Options Command Window
- #======================================================
- def create_leftpaddle_height_options_command_window
- s1 = "20"
- s2 = "40"
- s3 = "60"
- s4 = "80"
- s5 = "100"
- s6 = "120"
- s7 = "140"
- s8 = "160"
- s9 = "180"
- s10 = "200"
- @leftpaddle_height_options_command_window = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
- @leftpaddle_height_options_command_window.x = (Pong_Options::Screen_Width - @command_window.width) * 0.5
- @leftpaddle_height_options_command_window.y = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
- @leftpaddle_height_options_command_window.openness = 0
- end
- #======================================================
- # Open Left Paddle Height Options Command Window
- #======================================================
- def open_leftpaddle_height_options_command_window
- @leftpaddle_height_options_command_window.open
- begin
- @leftpaddle_height_options_command_window.update
- Graphics.update
- end until @leftpaddle_height_options_command_window.openness == 255
- @leftpaddle_height_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Left Paddle Height Options Command Window
- #======================================================
- def process_leftpaddle_height_options_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- end
- if Input.trigger?(Input::C)
- case @leftpaddle_height_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #20
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_height = 20
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 1 #40
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_height = 40
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- @leftpaddle_sprite.y -= @leftpaddle_height
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 2 #60
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_height = 60
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- @leftpaddle_sprite.y -= @leftpaddle_height
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 3 #80
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_height = 80
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- @leftpaddle_sprite.y -= @leftpaddle_height
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 4 #100
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_height = 100
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- @leftpaddle_sprite.y -= @leftpaddle_height
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 5 #120
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_height = 120
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- @leftpaddle_sprite.y -= @leftpaddle_height
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 6 #140
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_height = 140
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- @leftpaddle_sprite.y -= @leftpaddle_height
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 7 #160
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_height = 160
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- @leftpaddle_sprite.y -= @leftpaddle_height
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 8 #180
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_height = 180
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- @leftpaddle_sprite.y -= @leftpaddle_height
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 9 #200
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_height = 200
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- @leftpaddle_sprite.y -= @leftpaddle_height
- open_leftpaddleoptions_command_window
- close_leftpaddle_height_options_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- if @leftpaddle_sprite.y < 0
- @leftpaddle_sprite.y = 10
- end
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Left Paddle Height Options Command Window
- #======================================================
- def close_leftpaddle_height_options_command_window
- @leftpaddle_height_options_command_window.close
- begin
- @leftpaddle_height_options_command_window.update
- Graphics.update
- end until @leftpaddle_height_options_command_window.openness == 0
- @leftpaddle_height_opt_cmmd_wnd_open = false
- end
- #//////////////////////////////////////////////////////
- # Left Paddle Width Options Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Left Paddle Width Options Command Window
- #======================================================
- def create_leftpaddle_width_options_command_window
- s1 = "20"
- s2 = "40"
- s3 = "60"
- s4 = "80"
- s5 = "100"
- s6 = "120"
- s7 = "140"
- s8 = "160"
- s9 = "180"
- s10 = "200"
- @leftpaddle_width_options_command_window = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
- @leftpaddle_width_options_command_window.x = (Pong_Options::Screen_Width - @command_window.width) * 0.5
- @leftpaddle_width_options_command_window.y = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
- @leftpaddle_width_options_command_window.openness = 0
- end
- #======================================================
- # Open Left Paddle Width Options Command Window
- #======================================================
- def open_leftpaddle_width_options_command_window
- @leftpaddle_width_options_command_window.open
- begin
- @leftpaddle_width_options_command_window.update
- Graphics.update
- end until @leftpaddle_width_options_command_window.openness == 255
- @leftpaddle_width_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Left Paddle Width Options Command Window
- #======================================================
- def process_leftpaddle_width_options_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- end
- if Input.trigger?(Input::C)
- case @leftpaddle_width_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #20
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_width = 20
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 1 #40
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_width = 40
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 2 #60
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_width = 60
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 3 #80
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_width = 80
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 4 #100
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_width = 100
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 5 #120
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_width = 120
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 6 #140
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_width = 140
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 7 #160
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_width = 160
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 8 #180
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_width = 180
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 9 #200
- #-------------------------------------------------------------------
- Sound.play_decision
- @leftpaddle_width = 200
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- open_leftpaddleoptions_command_window
- close_leftpaddle_width_options_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Left Paddle Width Options Command Window
- #======================================================
- def close_leftpaddle_width_options_command_window
- @leftpaddle_width_options_command_window.close
- begin
- @leftpaddle_width_options_command_window.update
- Graphics.update
- end until @leftpaddle_width_options_command_window.openness == 0
- @leftpaddle_width_opt_cmmd_wnd_open = false
- end
- #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- #//////////////////////////////////////////////////////
- # Right Paddle Options Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Right Paddle Options Command Window
- #======================================================
- def create_rightpaddleoptions_command_window
- s1 = "Movement Speed"
- s2 = "Right Paddle Height"
- s3 = "Right Paddle Width"
- @rightpaddle_options_command_window = Window_Command.new(220, [s1, s2, s3])
- @rightpaddle_options_command_window.x = (((Pong_Options::Screen_Width - @command_window.width) * 0.5) - 40)
- @rightpaddle_options_command_window.y = (Pong_Options::Screen_Height - @command_window.height) * 0.5
- @rightpaddle_options_command_window.openness = 0
- end
- #======================================================
- # Open Right Paddle Options Command Window
- #======================================================
- def open_rightpaddleoptions_command_window
- @rightpaddle_options_command_window.open
- begin
- @rightpaddle_options_command_window.update
- Graphics.update
- end until @rightpaddle_options_command_window.openness == 255
- @rightpaddle_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Right Paddle Options Command Window
- #======================================================
- def process_rightpaddleoptions_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_options_command_window
- close_rightpaddleoptions_command_window
- end
- if Input.trigger?(Input::C)
- case @rightpaddle_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #Right Paddle Speed Increase
- #-------------------------------------------------------------------
- Sound.play_decision
- open_rightpaddle_sp_incr_options_command_window
- close_rightpaddleoptions_command_window
- #-------------------------------------------------------------------
- when 1 #Right Paddle Height
- #-------------------------------------------------------------------
- Sound.play_decision
- open_rightpaddle_height_options_command_window
- close_rightpaddleoptions_command_window
- #-------------------------------------------------------------------
- when 2 #Right Paddle Width
- #-------------------------------------------------------------------
- Sound.play_decision
- open_rightpaddle_width_options_command_window
- close_rightpaddleoptions_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Right Paddle Options Command Window
- #======================================================
- def close_rightpaddleoptions_command_window
- @rightpaddle_options_command_window.close
- begin
- @rightpaddle_options_command_window.update
- Graphics.update
- end until @rightpaddle_options_command_window.openness == 0
- @rightpaddle_opt_cmmd_wnd_open = false
- end
- #//////////////////////////////////////////////////////
- # Right Paddle Speed Increase Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Right Paddle Speed Increase Options Command Window
- #======================================================
- def create_rightpaddle_sp_incr_options_command_window
- s1 = "1"
- s2 = "2"
- s3 = "3"
- s4 = "4"
- s5 = "5"
- s6 = "6"
- s7 = "7"
- s8 = "8"
- s9 = "9"
- s10 = "10"
- @rightpaddle_sp_incr_options_command_window = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
- @rightpaddle_sp_incr_options_command_window.x = (Pong_Options::Screen_Width - @command_window.width) * 0.5
- @rightpaddle_sp_incr_options_command_window.y = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
- @rightpaddle_sp_incr_options_command_window.openness = 0
- end
- #======================================================
- # Open Right Paddle Speed Increase Options Command Window
- #======================================================
- def open_rightpaddle_sp_incr_options_command_window
- @rightpaddle_sp_incr_options_command_window.open
- begin
- @rightpaddle_sp_incr_options_command_window.update
- Graphics.update
- end until @rightpaddle_sp_incr_options_command_window.openness == 255
- @rightpaddle_si_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Right Paddle Speed Increase Options Command Window
- #======================================================
- def process_rightpaddle_sp_incr_options_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- end
- if Input.trigger?(Input::C)
- case @rightpaddle_sp_incr_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #1
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_speed = 1.0
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 1 #2
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_speed = 2.0
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 2 #3
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_speed = 3.0
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 3 #4
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_speed = 4.0
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 4 #5
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_speed = 5.0
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 5 #6
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_speed = 6.0
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 6 #7
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_speed = 7.0
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 7 #8
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_speed = 8.0
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 8 #9
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_speed = 9.0
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- #-------------------------------------------------------------------
- when 9 #10
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_speed = 10.0
- open_rightpaddleoptions_command_window
- close_rightpaddle_sp_incr_options_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Right Paddle Speed Increase Options Command Window
- #======================================================
- def close_rightpaddle_sp_incr_options_command_window
- @rightpaddle_sp_incr_options_command_window.close
- begin
- @rightpaddle_sp_incr_options_command_window.update
- Graphics.update
- end until @rightpaddle_sp_incr_options_command_window.openness == 0
- @rightpaddle_si_opt_cmmd_wnd_open = false
- end
- #//////////////////////////////////////////////////////
- # Right Paddle Height Options Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Right Paddle Height Options Command Window
- #======================================================
- def create_rightpaddle_height_options_command_window
- s1 = "20"
- s2 = "40"
- s3 = "60"
- s4 = "80"
- s5 = "100"
- s6 = "120"
- s7 = "140"
- s8 = "160"
- s9 = "180"
- s10 = "200"
- @rightpaddle_height_options_command_window = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
- @rightpaddle_height_options_command_window.x = (Pong_Options::Screen_Width - @command_window.width) * 0.5
- @rightpaddle_height_options_command_window.y = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
- @rightpaddle_height_options_command_window.openness = 0
- end
- #======================================================
- # Open Right Paddle Height Options Command Window
- #======================================================
- def open_rightpaddle_height_options_command_window
- @rightpaddle_height_options_command_window.open
- begin
- @rightpaddle_height_options_command_window.update
- Graphics.update
- end until @rightpaddle_height_options_command_window.openness == 255
- @rightpaddle_height_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Right Paddle Height Options Command Window
- #======================================================
- def process_rightpaddle_height_options_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- end
- if Input.trigger?(Input::C)
- case @rightpaddle_height_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #20
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_height = 20
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 1 #40
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_height = 40
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- @rightpaddle_sprite.y -= @rightpaddle_height
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 2 #60
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_height = 60
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- @rightpaddle_sprite.y -= @rightpaddle_height
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 3 #80
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_height = 80
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- @rightpaddle_sprite.y -= @rightpaddle_height
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 4 #100
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_height = 100
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- @rightpaddle_sprite.y -= @rightpaddle_height
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 5 #120
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_height = 120
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- @rightpaddle_sprite.y -= @rightpaddle_height
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 6 #140
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_height = 140
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- @rightpaddle_sprite.y -= @rightpaddle_height
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 7 #160
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_height = 160
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- @rightpaddle_sprite.y -= @rightpaddle_height
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 8 #180
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_height = 180
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- @rightpaddle_sprite.y -= @rightpaddle_height
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- #-------------------------------------------------------------------
- when 9 #200
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_height = 200
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- @rightpaddle_sprite.y -= @rightpaddle_height
- open_rightpaddleoptions_command_window
- close_rightpaddle_height_options_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- if @rightpaddle_sprite.y < 0
- @rightpaddle_sprite.y = 10
- end
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Right Paddle Height Options Command Window
- #======================================================
- def close_rightpaddle_height_options_command_window
- @rightpaddle_height_options_command_window.close
- begin
- @rightpaddle_height_options_command_window.update
- Graphics.update
- end until @rightpaddle_height_options_command_window.openness == 0
- @rightpaddle_height_opt_cmmd_wnd_open = false
- end
- #//////////////////////////////////////////////////////
- # Right Paddle Width Options Comand Window \\
- #||||||||||||||||||||||||||||||||||||||||||||||||||||||
- #======================================================
- # Create Right Paddle Width Options Command Window
- #======================================================
- def create_rightpaddle_width_options_command_window
- s1 = "20"
- s2 = "40"
- s3 = "60"
- s4 = "80"
- s5 = "100"
- s6 = "120"
- s7 = "140"
- s8 = "160"
- s9 = "180"
- s10 = "200"
- @rightpaddle_width_options_command_window = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
- @rightpaddle_width_options_command_window.x = (Pong_Options::Screen_Width - @command_window.width) * 0.5
- @rightpaddle_width_options_command_window.y = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
- @rightpaddle_width_options_command_window.openness = 0
- end
- #======================================================
- # Open Right Paddle Width Options Command Window
- #======================================================
- def open_rightpaddle_width_options_command_window
- @rightpaddle_width_options_command_window.open
- begin
- @rightpaddle_width_options_command_window.update
- Graphics.update
- end until @rightpaddle_width_options_command_window.openness == 255
- @rightpaddle_width_opt_cmmd_wnd_open = true
- end
- #======================================================
- # Process Right Paddle Width Options Command Window
- #======================================================
- def process_rightpaddle_width_options_command_window
- if Input.trigger?(Input::B)
- Sound.play_cancel
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- end
- if Input.trigger?(Input::C)
- case @rightpaddle_width_options_command_window.index
- #-------------------------------------------------------------------
- when 0 #20
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_width = 20
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 1 #40
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_width = 40
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 2 #60
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_width = 60
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 3 #80
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_width = 80
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 4 #100
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_width = 100
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 5 #120
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_width = 120
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 6 #140
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_width = 140
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 7 #160
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_width = 160
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 8 #180
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_width = 180
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- #-------------------------------------------------------------------
- when 9 #200
- #-------------------------------------------------------------------
- Sound.play_decision
- @rightpaddle_width = 200
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- open_rightpaddleoptions_command_window
- close_rightpaddle_width_options_command_window
- #---------------
- end # of case
- #---------------
- #------------------------------------
- end # of if Input.trigger?(Input::C)
- #------------------------------------
- #======================================================
- end # of function
- #======================================================
- #======================================================
- # Close Right Paddle Width Options Command Window
- #======================================================
- def close_rightpaddle_width_options_command_window
- @rightpaddle_width_options_command_window.close
- begin
- @rightpaddle_width_options_command_window.update
- Graphics.update
- end until @rightpaddle_width_options_command_window.openness == 0
- @rightpaddle_width_opt_cmmd_wnd_open = false
- end
- #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
- #==========================================================
- # Scene
- #==========================================================
- class Pong_Scene < Scene_Base
- #========================================================
- # Start
- #========================================================
- def start
- super
- #------------------------------------------------------------------------------------
- # Setup the Values
- #------------------------------------------------------------------------------------
- # It's obviously not going to be gameover as soon as the Game Starts, so we're
- # going to set this value to false.
- #
- # @waiting is a boolean variable that tells the ball to wait a little while
- # before moving. This is also not needed for the start of the game, so it's false
- #
- # @iFrameCount is just a value that tells the script how long the ball has been
- # waiting, which for the beginning of the game is equal to zero.
- #------------------------------------------------------------------------------------
- @gameover = false
- @waiting = false
- @iFrameCount = 0
- @ballspeedx = Pong_Options::Initial_Ball_Speed
- @ballspeedy = Pong_Options::Initial_Ball_Speed
- @playerOne_Score = 0
- @playerTwo_Score = 0
- if Pong_Options::Access_Menu == true
- @cmmd_wnd_open = true
- @is_a_cmmd_wnd_open = true
- else
- @is_a_cmmd_wnd_open = false
- end
- @p1score_window_active = true
- @p2score_window_active = true
- @totalwins_window_active = false
- @totallosses_window_active = false
- @ball_speed_increase = Pong_Options::Ball_Speed_Increase
- @ball_width = Pong_Options::Ball_Width
- @ball_height = Pong_Options::Ball_Height
- @leftpaddle_speed = Pong_Options::Left_Paddle_Speed
- @leftpaddle_width = Pong_Options::Left_Paddle_Width
- @leftpaddle_height = Pong_Options::Left_Paddle_Height
- @rightpaddle_speed = Pong_Options::Right_Paddle_Speed
- @rightpaddle_width = Pong_Options::Right_Paddle_Width
- @rightpaddle_height = Pong_Options::Right_Paddle_Height
- #These variables are not necessary, but I like to avoid using
- #magic numbers, so I asign variables to things where I can.
- @middleScreenPosX = ((Pong_Options::Screen_Width) * 0.5)
- @middleScreenPosY = ((Pong_Options::Screen_Height) * 0.5)
- @leftpaddle_StartPosX = 10
- @leftpaddle_StartPosY = 100
- @rightpaddle_StartPosX = 534
- @rightpaddle_StartPosY = 336
- @topScreenBorder = 1
- @leftScreenBorder = 1
- @rightScreenBorder = Pong_Options::Screen_Width
- @bottomScreenBorder = Pong_Options::Screen_Height
- #------------------------------------------------------------------------------------
- # Play Audio
- #------------------------------------------------------------------------------------
- # If the player has opted to allow music to be played. Then save the last BGM & \/
- # BGS that were playing and tell the BGS to stop. /\
- # \/
- # Once done, play the user selected music, simply using the "Audio/BGM/" string /\
- # to tell the script which folder should contain the audio, then add the string \/
- # the user defined in the editable region in order to get the name of the audio /\
- # file in that folder. \/
- # /\
- # Now you play the audio using the temp_sound as a parameter along with the \/
- # volue and pitch that the user defined in the editable region. /\
- #-----------------------------------------------------------------------------------
- if Pong_Options::Game_Music == true #\/
- #/\
- @last_bgm = RPG::BGM::last #\/
- @last_bgs = RPG::BGS::last #/\
- #\/
- RPG::BGS.stop #/\
- #\/
- temp_sound = "Audio/BGM/" + Pong_Options::Game_BGM #/\
- #\/
- Audio.bgm_play(temp_sound, Pong_Options::BGM_Volume, Pong_Options::BGM_Pitch) #/\
- #\/
- end #/\
- #-----------------------------------------------------------------------------------
- #------------------------------------------------------------------------------------
- # Set the Background Image
- #------------------------------------------------------------------------------------
- if Pong_Options::Background_Image == true
- @background_sprite = Sprite.new
- @background_sprite.bitmap = Cache.picture("Pong Images/" + Pong_Options::Background_Sprite)
- @background_sprite.y = 0 #Top
- @background_sprite.x = 0 #Left corner of the screen
- @background_sprite.zoom_x = Pong_Options::Screen_Width.to_f / @background_sprite.bitmap.width
- @background_sprite.zoom_y = Pong_Options::Screen_Height.to_f / @background_sprite.bitmap.height
- end
- #------------------------------------------------------------------------------------
- # Setup the Sprites
- #------------------------------------------------------------------------------------
- @leftpaddle_sprite = Sprite.new
- @leftpaddle_sprite.bitmap = Cache.picture("Pong Images/" + Pong_Options::Left_Paddle_Sprite)
- @leftpaddle_sprite.x = @leftpaddle_StartPosX
- @leftpaddle_sprite.y = @leftpaddle_StartPosY
- @leftpaddle_sprite.zoom_x = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
- @leftpaddle_sprite.zoom_y = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
- @rightpaddle_sprite = Sprite.new
- @rightpaddle_sprite.bitmap = Cache.picture("Pong Images/" + Pong_Options::Right_Paddle_Sprite)
- @rightpaddle_sprite.x = @rightpaddle_StartPosX - @rightpaddle_width
- @rightpaddle_sprite.y = @rightpaddle_StartPosY - @rightpaddle_height
- @rightpaddle_sprite.zoom_x = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
- @rightpaddle_sprite.zoom_y = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
- @ball_sprite = Sprite.new
- @ball_sprite.bitmap = Cache.picture("Pong Images/" + Pong_Options::Ball_Sprite)
- @ball_sprite.x = @middleScreenPosX
- @ball_sprite.y = @middleScreenPosY
- @ball_sprite.zoom_x = @ball_width.to_f / @ball_sprite.bitmap.width
- @ball_sprite.zoom_y = @ball_height.to_f / @ball_sprite.bitmap.height
- #------------------------------------------------------------------------------------
- # Setup the Windows
- #------------------------------------------------------------------------------------
- @Pong_P1Score_Window = Pong_P1Score_Window.new(@playerOne_Score)
- @Pong_P2Score_Window = Pong_P2Score_Window.new(@playerTwo_Score)
- if Pong_Options::Set_Win_Counter == true
- @pong_P1TotalWinsScore_Window = Pong_P1TotalWinsScore_Window.new
- @totalwins_window_active = true
- end
- if Pong_Options::Set_Loss_Counter == true
- @pong_P1TotalLossesScore_Window = Pong_P1TotalLossesScore_Window.new
- @totallosses_window_active = true
- end
- #--------------------------------
- # Command Window
- #--------------------------------
- create_command_window #call the create_command_window function
- create_options_command_window
- create_scoreboardoptions_command_window
- create_balloptions_command_window
- create_ball_sp_incr_options_command_window
- create_ball_height_options_command_window
- create_ball_width_options_command_window
- create_leftpaddleoptions_command_window
- create_leftpaddle_sp_incr_options_command_window
- create_leftpaddle_height_options_command_window
- create_leftpaddle_width_options_command_window
- create_rightpaddleoptions_command_window
- create_rightpaddle_sp_incr_options_command_window
- create_rightpaddle_height_options_command_window
- create_rightpaddle_width_options_command_window
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- end # of Start Function //// ||
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #========================================================
- # Post Start
- #========================================================
- def post_start
- super
- #call the open_command_window function
- open_command_window unless Pong_Options::Access_Menu == false
- end
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # Update
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- def update
- super
- #===================================================
- # Update Command Windows
- #===================================================
- if @cmmd_wnd_open == true #if a command window is open
- @is_a_cmmd_wnd_open = true #set the boolean to true
- @command_window.update #update the command window
- process_command_window #process the events for the command window
- elsif @opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @options_command_window.update
- process_options_command_window
- elsif @sb_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @sb_options_command_window.update
- process_scoreboardoptions_command_window
- elsif @ball_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @ball_options_command_window.update
- process_balloptions_command_window
- elsif @ball_si_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @ball_sp_incr_options_command_window.update
- process_ball_sp_incr_options_command_window
- elsif @ball_height_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @ball_height_options_command_window.update
- process_ball_height_options_command_window
- elsif @ball_width_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @ball_width_options_command_window.update
- process_ball_width_options_command_window
- elsif @leftpaddle_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @leftpaddle_options_command_window.update
- process_leftpaddleoptions_command_window
- elsif @leftpaddle_si_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @leftpaddle_sp_incr_options_command_window.update
- process_leftpaddle_sp_incr_options_command_window
- elsif @leftpaddle_height_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @leftpaddle_height_options_command_window.update
- process_leftpaddle_height_options_command_window
- elsif @leftpaddle_width_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @leftpaddle_width_options_command_window.update
- process_leftpaddle_width_options_command_window
- elsif @rightpaddle_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @rightpaddle_options_command_window.update
- process_rightpaddleoptions_command_window
- elsif @rightpaddle_si_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @rightpaddle_sp_incr_options_command_window.update
- process_rightpaddle_sp_incr_options_command_window
- elsif @rightpaddle_height_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @rightpaddle_height_options_command_window.update
- process_rightpaddle_height_options_command_window
- elsif @rightpaddle_width_opt_cmmd_wnd_open == true
- @is_a_cmmd_wnd_open = true
- @rightpaddle_width_options_command_window.update
- process_rightpaddle_width_options_command_window
- else #No command window is open
- @is_a_cmmd_wnd_open = false
- #----------------------------------
- end # if statement
- #----------------------------------
- #======================================================
- # Update Windows
- #======================================================
- if @p1score_window_active == true
- @Pong_P1Score_Window.update(@playerOne_Score)
- end
- if @p2score_window_active == true
- @Pong_P2Score_Window.update(@playerTwo_Score)
- end
- if @totalwins_window_active == true
- @pong_P1TotalWinsScore_Window.update
- end
- if @totallosses_window_active == true
- @pong_P1TotalLossesScore_Window.update
- end
- if @is_a_cmmd_wnd_open == false #Don't update the game if a command window is open
- #======================================================
- # Game Over
- #======================================================
- if @gameover == true
- if Input.trigger?(Input::C)
- process_pong_reset
- end
- end
- #---------------------------------------------------
- # If the game is not over yet and either player one
- # or player two has scored six points, then create
- # a new window showing who the winner is and set the
- # gameover boolean to true (which stops the game)
- #---------------------------------------------------
- if @gameover == false && ((@playerOne_Score == Pong_Options::Points_To_Win) || (@playerTwo_Score == Pong_Options::Points_To_Win))
- @Pong_Winner_Window = Pong_Winner_Window.new(@playerOne_Score)
- if @totalwins_window_active == true
- @pong_P1TotalWinsScore_Window.dispose
- @pong_P1TotalWinsScore_Window = Pong_P1TotalWinsScore_Window.new
- end
- if @totallosses_window_active == true
- @pong_P1TotalLossesScore_Window.dispose
- @pong_P1TotalLossesScore_Window = Pong_P1TotalLossesScore_Window.new
- end
- @gameover = true
- end
- if @gameover == false # Don't do anything for the game if it is gameover
- #======================================================
- # Start the round
- #======================================================
- if @waiting == true
- @iFrameCount += 1
- if @iFrameCount > Pong_Options::Frame_Wait_Amount
- @waiting = false
- @iFrameCount = 0
- end
- #roll a random variable out of fifty, and if the result
- #is less than 25, invert the direction of the balls Y
- if rand(50) + 1 < 25
- @ballspeedy *= -1
- end
- #this keeps the game a little more random rather than linear
- #-----------------------------
- end # of if @waiting == true
- #-----------------------------
- #======================================================
- # Move the Ball
- #======================================================
- if @waiting == false
- @ball_sprite.x += @ballspeedx
- @ball_sprite.y += @ballspeedy
- end
- #if the ball has hit the right wall
- if @ball_sprite.x >= @rightScreenBorder
- @ball_sprite.x = @middleScreenPosX - (@ball_width * 0.5)
- @ball_sprite.y = @middleScreenPosY - (@ball_height * 0.5)
- @ballspeedx = -(Pong_Options::Initial_Ball_Speed)
- @playerOne_Score += 1
- @waiting = true
- end
- #if the ball has hit the left wall
- if @ball_sprite.x <= @leftScreenBorder
- @ball_sprite.x = @middleScreenPosX - (@ball_width * 0.5)
- @ball_sprite.y = @middleScreenPosY - (@ball_height * 0.5)
- @ballspeedx = (Pong_Options::Initial_Ball_Speed)
- @playerTwo_Score += 1
- @waiting = true
- end
- #======================================================
- # Controls
- #======================================================
- if Input.press?(Input::UP) && @leftpaddle_sprite.y > @topScreenBorder
- @leftpaddle_sprite.y -= @leftpaddle_speed
- end
- if Input.press?(Input::DOWN) && (@leftpaddle_sprite.y + @leftpaddle_height) < @bottomScreenBorder
- @leftpaddle_sprite.y += @leftpaddle_speed
- end
- #======================================================
- # Add Collision
- #======================================================
- #------------------------------------------------------
- # ( *= -1 ) Inverts the speed of the ball, making a
- # positive number turn into a negative number or vice-versa.
- #------------------------------------------------------
- if @ball_sprite.y + @ball_height >= @bottomScreenBorder
- @ballspeedy *= -1
- end
- if @ball_sprite.y <= @topScreenBorder
- @ballspeedy *= -1
- end
- #If the ball comes into direct contact with the left paddle.
- if (@leftpaddle_sprite.x + @leftpaddle_width > @ball_sprite.x) &&
- (@leftpaddle_sprite.x < @ball_sprite.x + @ball_width) &&
- (@leftpaddle_sprite.y + @leftpaddle_height > @ball_sprite.y) &&
- (@leftpaddle_sprite.y < @ball_sprite.y + @ball_height)
- #Invert the ball speed and increase the current ball speed.
- @ballspeedx *= -1
- @ball_sprite.x = @leftpaddle_sprite.x + @leftpaddle_width #This is a dirty little trick that puts the ball in front of the paddle, fixing any issue that could have arisen due to the user being able to define the width of the paddle.
- @ballspeedx += @ball_speed_increase
- end
- #If the ball comes into direct contact with the right paddle.
- if (@rightpaddle_sprite.x + @rightpaddle_width > @ball_sprite.x) &&
- (@rightpaddle_sprite.x < @ball_sprite.x + @ball_width) &&
- (@rightpaddle_sprite.y + @rightpaddle_height > @ball_sprite.y) &&
- (@rightpaddle_sprite.y < @ball_sprite.y + @ball_height)
- #Invert the ball speed and increase the current ball speed.
- @ballspeedx *= -1
- @ball_sprite.x = @rightpaddle_sprite.x - @ball_width #This is a dirty little trick that puts the ball in front of the paddle, fixing any issue that could have arisen due to the user being able to define the width of the paddle.
- @ballspeedx -= @ball_speed_increase
- end
- #======================================================
- # A.I
- #======================================================
- #------------------------------------------------------
- # I am using ( * 0.5 ) instead of ( / 2 ), they are basically
- # the same thing, but multiplying is more efficient than
- # dividing when it comes to computers doing math functions.
- #------------------------------------------------------
- #if the ball is heading towards the AI
- if @ball_sprite.x + @ball_width > @middleScreenPosY
- #the AI will try to keep its center focused on the balls path
- if (@rightpaddle_sprite.y + (@rightpaddle_height * 0.5)) > @ball_sprite.y + (@ball_height * 0.5) && @rightpaddle_sprite.y > @topScreenBorder
- @rightpaddle_sprite.y -= @rightpaddle_speed
- end
- if (@rightpaddle_sprite.y + (@rightpaddle_height * 0.5)) < @ball_sprite.y + (@ball_height * 0.5) && (@rightpaddle_sprite.y + @rightpaddle_height) < @bottomScreenBorder
- @rightpaddle_sprite.y += @rightpaddle_speed
- end
- end
- #if the ball is heading away from the right paddle.
- #the AI will try to move back to the center of the screen.
- if @ballspeedx < 1 && @rightpaddle_sprite.y < @middleScreenPosY
- @rightpaddle_sprite.y += 1
- end
- if @ballspeedx < 1 && @rightpaddle_sprite.y > @middleScreenPosY
- @rightpaddle_sprite.y -= 1
- end
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- end # if @gameover == false //// ||
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #======================================================
- # Open Command Window or Return to Map
- #======================================================
- if Input.trigger?(Input::B)
- if Pong_Options::Access_Menu == true
- open_command_window
- else
- $scene = Scene_Map.new
- end
- end
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- end # if @is_a_cmmd_wnd_open == false //// ||
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- end # of Update Function //// ||
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- # Terminate
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- def terminate
- #=============================================
- # Dispose Windows
- #=============================================
- if @gameover == true
- @Pong_Winner_Window.dispose
- end
- if @totalwins_window_active == true
- @pong_P1TotalWinsScore_Window.dispose
- end
- if @totallosses_window_active == true
- @pong_P1TotalLossesScore_Window.dispose
- end
- if @p1score_window_active == true
- @Pong_P1Score_Window.dispose
- end
- if @p2score_window_active == true
- @Pong_P2Score_Window.dispose
- end
- #=============================================
- # Dispose Sprites
- #=============================================
- if Pong_Options::Background_Image == true
- @background_sprite.dispose
- end
- @leftpaddle_sprite.dispose
- @rightpaddle_sprite.dispose
- @ball_sprite.dispose
- #=============================================
- # Dispose Command Windows
- #=============================================
- @command_window.dispose
- @options_command_window.dispose
- @sb_options_command_window.dispose
- @ball_options_command_window.dispose
- @ball_sp_incr_options_command_window.dispose
- @ball_height_options_command_window.dispose
- @ball_width_options_command_window.dispose
- @leftpaddle_options_command_window.dispose
- @leftpaddle_sp_incr_options_command_window.dispose
- @leftpaddle_height_options_command_window.dispose
- @leftpaddle_width_options_command_window.dispose
- @rightpaddle_options_command_window.dispose
- @rightpaddle_sp_incr_options_command_window.dispose
- @rightpaddle_height_options_command_window.dispose
- @rightpaddle_width_options_command_window.dispose
- #=============================================
- # Play Map Music & BGS
- #=============================================
- if Pong_Options::Game_Music == true
- @last_bgm.play
- @last_bgs.play
- end
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- end # of Terminate Function //// ||
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- end # of Pong_Scene //// ||
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # -=
- # End of Script //// ==
- # =-
- #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement