Advertisement
diamondandplatinum3

Pong Minigame ~ RGSS2

Jun 30th, 2012
727
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 123.17 KB | None | 0 0
  1. #==============================================================================
  2. #  Pong Game
  3. #  Version: 1.1
  4. #  Author: DiamondandPlatinum3
  5. #  Date: May 28, 2012
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #  Description:
  8. #    This script allows you to play an old retro game called pong in your game.
  9. #    It would generally be used as a mini game of some sorts, or just a plain
  10. #    old easter egg.
  11. #
  12. #    Pong is a game featuring two players and a ball, the ball moves back and
  13. #    forth from one player to the other and the objective is to never miss the
  14. #    ball.
  15. #    If you miss the ball, your opponent will score a point and the same goes
  16. #    for you, should the opponent miss the ball.
  17. #    The first person to score 6 points will win the match, Although you can
  18. #    edit this if you wish.
  19. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  20. #------------------------------------------------------------------------------
  21. #  Instructions:
  22. #  
  23. #     - Place this script in the materials section, above Main.
  24. #
  25. #     - In your Pictures folder where your project is located, create a new
  26. #       subdfolder and name it 'Pong Images'.
  27. #
  28. #     - Be sure that you have the appropriate pictures located in your
  29. #       'Pong Images' folder, as they will be required for the minigame.
  30. #
  31. #     - Check the script options below these instructions to tweak the minigames
  32. #       settings (including sounds, picture names and size dimensions of sprites).
  33. #
  34. #     - You can set in game variables to be increased whenever you Win or Lose a
  35. #       game of Pong. You can set which variable ID they are in the editable region.
  36. #       To use them for item gaining conditions and ridiculing conditions the same
  37. #       way you would use normal variables.
  38. #       (ie checking if Variable ID 5 is equal to 3; then running an event if that is true).
  39. #
  40. #     - To start the minigame, simply call it with an event by using the
  41. #       script command and entering "$scene = Pong_Scene.new" without the
  42. #       quotation marks. It'll automatically initiate the game.
  43. #
  44. #     - You can alter settings in your event pages simply by using a script call
  45. #       that says 'Pong_Options::' followed by the appropriate variable name in
  46. #       the editable region.
  47. #       So if I wanted to edit Access to the menu, the music being played, or
  48. #       the points to win. I would simply do this in a script command
  49. #
  50. #           Pong_Options::Access_Menu = false
  51. #           Pong_Options::Game_BGM = "Town2"
  52. #           Pong_Options::Points_To_Win = 3
  53. #
  54. #       You do not have to do this, this is just a way to allow you to alter
  55. #       settings in game if you were running a competition or anything similar.
  56. #
  57. #==============================================================================
  58.  
  59. module Pong_Options
  60. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  61. #                                                        -=
  62. #                 Editable Region        ////            ==
  63. #                                                        =-
  64. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  65. # Only Edit what is after the equals ( = ) sign.         ==
  66. # If there are brackets '()' or quotation marks          ==
  67. # only edit what is inside of them.                      ==
  68. #==========================================================
  69.  
  70.   #////////////////////////////////////////////////////////
  71.   #                 Images and Dimensions                ||
  72.   #||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  73.   Screen_Width        = 544                   #  The Width of the Screen
  74.   Screen_Height       = 414                   #  The Height of the Screen
  75.                                               # (Leave both of these as defaults
  76.                                               #  if you're not using a higher screen
  77.                                               #  resolution for your game).
  78.  
  79.   Background_Image    = true                  #  Do you want a background image? (true / false)
  80.   Background_Sprite   = ("Background")        #  The Name of the Background image
  81.  
  82.  
  83.   Left_Paddle_Sprite  = ("LeftPaddle_Sprite") #  The Name of the Sprite
  84.   Left_Paddle_Width   = 20                    #  The Width of the Left Paddle
  85.   Left_Paddle_Height  = 20                    #  The Height of the Left Paddle
  86.  
  87.   Right_Paddle_Sprite = ("RightPaddle_Sprite")#  The Name of the Sprite
  88.   Right_Paddle_Width  = 20                    #  The Width of the Right Paddle
  89.   Right_Paddle_Height = 20                    #  The Height of the Right Paddle
  90.  
  91.   Ball_Sprite         = ("Ball_Sprite")       #  The Name of the Sprite
  92.   Ball_Width          = 10                    #  The Width of the Ball
  93.   Ball_Height         = 10                    #  The Height of the Ball
  94.  
  95.  
  96.   #////////////////////////////////////////////////////////
  97.   #                   Game Mechanics                     ||
  98.   #||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  99.   Access_Menu         = true                  #  Allow access to the menu? (true / false)
  100.  
  101.   Points_To_Win       = 6                     #  How many points needed to win a game.
  102.                                               #  Standard = 6
  103.  
  104.   Initial_Ball_Speed  = 2.0                   #  Initial Speed of the Ball
  105.  
  106.   Ball_Speed_Increase = 0.1                   #  How much the balls speed should increase
  107.                                               #  after a player hits it. Best to play
  108.                                               #  around with this option to see what you like.
  109.  
  110.   Frame_Wait_Amount   = 180                   #  How long you want the ball to wait
  111.                                               #  in the middle after scoring a point
  112.                                               #  (60 frames = one second)
  113.                                              
  114.   Left_Paddle_Speed   = 3.0                   #  Speed of the Left Paddle
  115.   Right_Paddle_Speed  = 3.0                   #  Speed of the Right Paddle
  116.  
  117.  
  118.   #////////////////////////////////////////////////////////
  119.   #                     Sound                            ||
  120.   #||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  121.   Game_Music          = true                  #  Play a different BGM during game? (true / false)
  122.   Game_BGM            = "Battle5"             #  BGM played during the game
  123.   BGM_Volume          = 100                   #  Volume of the BGM
  124.   BGM_Pitch           = 100                   #  Pitch of the BGM
  125.  
  126.                                              
  127.   #////////////////////////////////////////////////////////
  128.   #                   Windows                            ||
  129.   #||||||||||||||||||||||||||||||||||||||||||||||||||||||||  
  130.   P1Score_Window_Xpos     = 50                #  The X position of P1's Score display
  131.   P1Score_Window_Ypos     = 30                #  The Y position of P1's Score display
  132.   P1Score_Window_Opacity  = 0                 #  The Opacity of P1's Score display
  133.  
  134.   P2Score_Window_Xpos     = 390               #  The X position of P2's Score display
  135.   P2Score_Window_Ypos     = 30                #  The Y position of P2's Score display
  136.   P2Score_Window_Opacity  = 0                 #  The Opacity of P2's Score display
  137.    
  138.  
  139.  
  140.   #////////////////////////////////////////////////////////
  141.   #              Project Related                         ||
  142.   #||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  143.   Set_Win_Counter         = true              #  Do you want the game to hold a variable for the amount of wins you have earned in Pong?
  144.   Win_Count_Variable_ID   = 10                #  The ID of the variable that holds your win counter
  145.  
  146.   Set_Loss_Counter        = true              #  Do you want the game to hold a variable for the amount of loses you have gained in Pong?
  147.   Loss_Count_Variable_ID  = 11                #  The ID of the variable that holds your loss counter
  148.  
  149.   Show_Scoreboard         = true              #  Show a scoreboard in the Pong game to reflect the above statements?
  150.  
  151.  
  152. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  153. end # of editable region          ////                   ||
  154. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  165. #                                                        -=
  166. #                 Start of Script        ////            ==
  167. #                                                        =-
  168. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  169.  
  170.  
  171.  
  172.  
  173.  
  174. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  175. #               Classes
  176. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  177.  
  178. #======================================================
  179. #             P1 Score Window
  180. #======================================================
  181. class Pong_P1Score_Window < Window_Base
  182. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  183.   def initialize (playerOne_Score)
  184.     super(Pong_Options::P1Score_Window_Xpos, Pong_Options::P1Score_Window_Ypos, 150, 60)
  185.     self.opacity = Pong_Options::P1Score_Window_Opacity
  186.    
  187.     @stxt_p1 = playerOne_Score.to_s
  188.    
  189.     self.contents.draw_text(0, 0, 150, WLH, "Score: " + @stxt_p1, 0)
  190.   end
  191.    
  192.   def update (playerOne_Score)
  193.     self.contents.clear
  194.    
  195.     @stxt_p1 = playerOne_Score.to_s
  196.    
  197.     self.contents.draw_text(0, 0, 150, WLH, "Score: " + @stxt_p1, 0)
  198.   end
  199. end
  200.  
  201.  
  202. #======================================================
  203. #             P2 Score Window
  204. #======================================================
  205. class Pong_P2Score_Window < Window_Base
  206. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  207.   def initialize (playerTwo_Score)
  208.     super(Pong_Options::P2Score_Window_Xpos, Pong_Options::P2Score_Window_Ypos, 150, 60)
  209.     self.opacity = Pong_Options::P2Score_Window_Opacity
  210.    
  211.     @stxt_p2 = playerTwo_Score.to_s
  212.    
  213.     self.contents.draw_text(0, 0, 150, WLH, "Score: " + @stxt_p2, 0)
  214.   end
  215.   def update (playerTwo_Score)
  216.     self.contents.clear
  217.    
  218.     @stxt_p2 = playerTwo_Score.to_s
  219.    
  220.     self.contents.draw_text(0, 0, 150, WLH, "Score: " + @stxt_p2, 0)
  221.   end
  222. end
  223.  
  224.  
  225. #======================================================
  226. #             Winner Window
  227. #======================================================
  228. class Pong_Winner_Window < Window_Base
  229. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  230.   def initialize (playerOne_Score)
  231.     super(197, 50, 200, 100)
  232.    
  233.     if playerOne_Score == Pong_Options::Points_To_Win
  234.       @winner = "Player 1 Wins"
  235.       $game_variables[Pong_Options::Win_Count_Variable_ID] += 1 if Pong_Options::Set_Win_Counter == true
  236.     else
  237.       @winner = "Player 2 Wins"
  238.       $game_variables[Pong_Options::Loss_Count_Variable_ID] += 1 if Pong_Options::Set_Loss_Counter == true
  239.     end
  240.    
  241.     self.opacity = 0
  242.    
  243.     self.contents.draw_text(0, 0, 200, WLH, @winner, 0)
  244.   end
  245. end
  246.  
  247.  
  248. #======================================================
  249. #             P1 Total Wins Window
  250. #======================================================
  251. class Pong_P1TotalWinsScore_Window < Window_Base
  252. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  253.   def initialize
  254.     super(20, Pong_Options::Screen_Height - 100, 160, 60)
  255.     @totalwins = $game_variables[Pong_Options::Win_Count_Variable_ID].to_s
  256.     self.opacity = 0
  257.     self.contents.draw_text(0, 0, 200, WLH, "Total Wins: " + @totalwins, 0)
  258.   end
  259.   def update
  260.     @totalwins = $game_variables[Pong_Options::Win_Count_Variable_ID].to_s
  261.     self.contents.clear
  262.     self.contents.draw_text(0, 0, 200, WLH, "Total Wins: " + @totalwins, 0)
  263.   end
  264. end
  265.  
  266.  
  267.  
  268.  
  269. #======================================================
  270. #             P1 Total Losses Window
  271. #======================================================
  272. class Pong_P1TotalLossesScore_Window < Window_Base
  273. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  274.   def initialize
  275.     super(Pong_Options::Screen_Width - 200, Pong_Options::Screen_Height - 100, 160, 60)
  276.     @totallosses = $game_variables[Pong_Options::Loss_Count_Variable_ID].to_s
  277.     self.opacity = 0
  278.     self.contents.draw_text(0, 0, 200, WLH, "Total Wins: " + @totallosses, 0)
  279.   end
  280.   def update
  281.     @totalwins = $game_variables[Pong_Options::Loss_Count_Variable_ID].to_s
  282.     self.contents.clear
  283.     self.contents.draw_text(0, 0, 200, WLH, "Total Wins: " + @totallosses, 0)
  284.   end
  285. end
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  300. #               Functions
  301. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  302.  
  303.  
  304. #======================================================
  305. #             Process Reset
  306. #======================================================
  307. def process_pong_reset
  308.   if @gameover == true
  309.    @Pong_Winner_Window.dispose
  310.    @gameover = false
  311.  end
  312.  
  313.   @waiting = false
  314.   @iFrameCount             = 0
  315.   @ballspeedx              = (Pong_Options::Initial_Ball_Speed)
  316.   @ballspeedy              = (Pong_Options::Initial_Ball_Speed)
  317.   @ball_sprite.x           = @middleScreenPosX
  318.   @ball_sprite.y           = @middleScreenPosY
  319.   @leftpaddle_sprite.x     = @leftpaddle_StartPosX
  320.   @leftpaddle_sprite.y     = @leftpaddle_StartPosY
  321.   @rightpaddle_sprite.x    = @rightpaddle_StartPosX - @rightpaddle_width
  322.   @rightpaddle_sprite.y    = @rightpaddle_StartPosY - @rightpaddle_height
  323.   @playerOne_Score         = 0
  324.   @playerTwo_Score         = 0
  325. end
  326.        
  327.  
  328.  
  329.  
  330. #======================================================
  331. #             Create Command Window
  332. #======================================================
  333. def create_command_window
  334.   s1 = "Play"
  335.   s2 = "Reset"
  336.   s3 = "Options"
  337.   s4 = "Exit"
  338.   @command_window           = Window_Command.new(142, [s1, s2, s3, s4])
  339.   @command_window.x         = (Pong_Options::Screen_Width - @command_window.width) * 0.5
  340.   @command_window.y         = (Pong_Options::Screen_Height - @command_window.height) * 0.5
  341.   @command_window.openness  = 0
  342. end
  343.  
  344.  
  345. #======================================================
  346. #             Open Command Window
  347. #======================================================
  348. def open_command_window
  349.   @command_window.open
  350.   begin
  351.     @command_window.update
  352.     Graphics.update
  353.   end until @command_window.openness == 255
  354.  
  355.   @cmmd_wnd_open = true
  356.  
  357. end
  358.  
  359.  
  360. #======================================================
  361. #             Process Command Window
  362. #======================================================
  363. def process_command_window
  364.  
  365.   if Input.trigger?(Input::B)
  366.     Sound.play_cancel
  367.     close_command_window
  368.     @cmmd_wnd_open = false
  369.   end
  370.  
  371.  
  372.  
  373.   if Input.trigger?(Input::C)
  374.     case @command_window.index
  375.        
  376.       #-------------------------------------------------------------------
  377.       when 0 #Play Game
  378.       #-------------------------------------------------------------------  
  379.         Sound.play_decision
  380.         close_command_window
  381.         @cmmd_wnd_open = false
  382.        
  383.       #-------------------------------------------------------------------  
  384.       when 1 #Reset
  385.       #-------------------------------------------------------------------  
  386.          Sound.play_decision
  387.          
  388.          process_pong_reset        
  389.          close_command_window
  390.      
  391.       #-------------------------------------------------------------------  
  392.       when 2 #Options
  393.       #-------------------------------------------------------------------  
  394.          Sound.play_decision
  395.          close_command_window
  396.          open_options_command_window
  397.      
  398.       #-------------------------------------------------------------------  
  399.       when 3 #Exit
  400.       #-------------------------------------------------------------------  
  401.         Sound.play_cancel
  402.         close_command_window
  403.         $scene = Scene_Map.new
  404.        
  405.     #---------------  
  406.     end # of case
  407.     #---------------
  408.    
  409.   #------------------------------------  
  410.   end # of if Input.trigger?(Input::C)
  411.   #------------------------------------
  412.  
  413. #======================================================
  414. end # of function
  415. #======================================================
  416.  
  417.    
  418.    
  419. #======================================================
  420. #             Close Command Window
  421. #======================================================
  422. def close_command_window
  423.   @command_window.close
  424.   begin
  425.     @command_window.update
  426.     Graphics.update
  427.   end until @command_window.openness == 0
  428.  
  429.   @cmmd_wnd_open = false
  430.  
  431. end
  432.  
  433. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  434.  
  435.  
  436.  
  437. #//////////////////////////////////////////////////////
  438. #             Options Comand Window                  \\
  439. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  440. #======================================================
  441. #             Create Options Command Window
  442. #======================================================
  443. def create_options_command_window
  444.   s1 = "Scoreboard Options"
  445.   s2 = "Ball Options"
  446.   s3 = "Left Paddle Options"
  447.   s4 = "Right Paddle Options"
  448.   @options_command_window           = Window_Command.new(230, [s1, s2, s3, s4])
  449.   @options_command_window.x         = (((Pong_Options::Screen_Width - @command_window.width) * 0.5) - 45)
  450.   @options_command_window.y         = (Pong_Options::Screen_Height - @command_window.height) * 0.5
  451.   @options_command_window.openness  = 0
  452. end
  453.  
  454.  
  455. #======================================================
  456. #             Open Options Command Window
  457. #======================================================
  458. def open_options_command_window
  459.   @options_command_window.open
  460.  
  461.   begin
  462.     @options_command_window.update
  463.     Graphics.update
  464.   end until @options_command_window.openness == 255
  465.  
  466.   @opt_cmmd_wnd_open = true
  467. end
  468.  
  469.  
  470. #======================================================
  471. #             Process Options Command Window
  472. #======================================================
  473. def process_options_command_window
  474.  
  475.   if Input.trigger?(Input::B)
  476.     Sound.play_cancel
  477.     open_command_window
  478.     close_options_command_window
  479.   end
  480.  
  481.  
  482.  
  483.   if Input.trigger?(Input::C)
  484.     case @options_command_window.index
  485.        
  486.       #-------------------------------------------------------------------
  487.       when 0 #Scoreboard
  488.       #-------------------------------------------------------------------  
  489.         Sound.play_decision
  490.         open_scoreboardoptions_command_window
  491.         close_options_command_window
  492.        
  493.         #-------------------------------------------------------------------  
  494.         when 1 #Ball Options
  495.         #-------------------------------------------------------------------  
  496.          Sound.play_decision
  497.          open_balloptions_command_window
  498.          close_options_command_window
  499.      
  500.       #-------------------------------------------------------------------  
  501.       when 2 #Left Paddle Options
  502.       #-------------------------------------------------------------------  
  503.          Sound.play_decision
  504.          open_leftpaddleoptions_command_window
  505.          close_options_command_window
  506.      
  507.       #-------------------------------------------------------------------  
  508.       when 3 #Right Paddle Options
  509.       #-------------------------------------------------------------------  
  510.         Sound.play_decision
  511.         open_rightpaddleoptions_command_window
  512.         close_options_command_window
  513.        
  514.     #---------------  
  515.     end # of case
  516.     #---------------
  517.    
  518.   #------------------------------------  
  519.   end # of if Input.trigger?(Input::C)
  520.   #------------------------------------
  521.  
  522. #======================================================
  523. end # of function
  524. #======================================================
  525.  
  526.    
  527.    
  528. #======================================================
  529. #             Close Options Command Window
  530. #======================================================
  531. def close_options_command_window
  532.   @options_command_window.close
  533.  
  534.   begin
  535.     @options_command_window.update
  536.     Graphics.update
  537.   end until @options_command_window.openness == 0
  538.  
  539.   @opt_cmmd_wnd_open = false
  540.  
  541. end
  542.  
  543.  
  544. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  545.  
  546.  
  547.  
  548.  
  549. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  550. #         Scoreboard Options Comand Window           $$
  551. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  552. #======================================================
  553. #        Create Scoreboard Options Command Window
  554. #======================================================
  555. def create_scoreboardoptions_command_window
  556.   s1 = "Show P1 Score"
  557.   s2 = "Show P2 Score"
  558.   s3 = "Show Total Wins"
  559.   s4 = "Show Total Losses"
  560.   @sb_options_command_window           = Window_Command.new(220, [s1, s2, s3, s4])
  561.   @sb_options_command_window.x         = (((Pong_Options::Screen_Width - @command_window.width) * 0.5) - 40)
  562.   @sb_options_command_window.y         = (Pong_Options::Screen_Height - @command_window.height) * 0.5
  563.   @sb_options_command_window.openness  = 0
  564. end
  565.  
  566.  
  567. #======================================================
  568. #       Open Scoreboard Options Command Window
  569. #======================================================
  570. def open_scoreboardoptions_command_window
  571.   @sb_options_command_window.open
  572.  
  573.   begin
  574.     @sb_options_command_window.update
  575.     Graphics.update
  576.   end until @sb_options_command_window.openness == 255
  577.  
  578.   @sb_opt_cmmd_wnd_open = true
  579. end
  580.  
  581.  
  582. #======================================================
  583. #      Process Scoreboard Options Command Window
  584. #======================================================
  585. def process_scoreboardoptions_command_window
  586.  
  587.   if Input.trigger?(Input::B)
  588.     Sound.play_cancel
  589.     open_options_command_window
  590.     close_scoreboardoptions_command_window
  591.   end
  592.  
  593.  
  594.   if Input.trigger?(Input::C)
  595.     case @sb_options_command_window.index
  596.    
  597.       #-------------------------------------------------------------------
  598.       when 0 #Show P1 Score
  599.       #-------------------------------------------------------------------  
  600.         Sound.play_decision
  601.        
  602.         if @p1score_window_active == true
  603.           @Pong_P1Score_Window.dispose
  604.           @p1score_window_active = false
  605.          
  606.         elsif @p1score_window_active == false
  607.           @Pong_P1Score_Window = Pong_P1Score_Window.new(@playerOne_Score)
  608.           @p1score_window_active = true
  609.         end
  610.        
  611.       #-------------------------------------------------------------------
  612.       when 1 #Show P2 Score
  613.       #-------------------------------------------------------------------  
  614.         Sound.play_decision
  615.        
  616.         if @p2score_window_active == true
  617.           @Pong_P2Score_Window.dispose
  618.           @p2score_window_active = false
  619.          
  620.         elsif @p2score_window_active == false
  621.           @Pong_P2Score_Window = Pong_P2Score_Window.new(@playerOne_Score)
  622.           @p2score_window_active = true
  623.         end
  624.          
  625.       #-------------------------------------------------------------------
  626.       when 2 #Show Total Wins
  627.       #-------------------------------------------------------------------  
  628.         Sound.play_decision
  629.        
  630.         if Pong_Options::Set_Win_Counter == true && @totalwins_window_active == false
  631.           @pong_P1TotalWinsScore_Window = Pong_P1TotalWinsScore_Window.new
  632.           @totalwins_window_active = true
  633.        
  634.         elsif @totalwins_window_active == true
  635.           @pong_P1TotalWinsScore_Window.dispose
  636.           @totalwins_window_active = false
  637.         end        
  638.        
  639.       #-------------------------------------------------------------------  
  640.       when 3 #Show Total Losses
  641.       #-------------------------------------------------------------------  
  642.        Sound.play_decision
  643.        
  644.         if Pong_Options::Set_Loss_Counter == true && @totallosses_window_active == false
  645.           @pong_P1TotalLossesScore_Window = Pong_P1TotalLossesScore_Window.new
  646.           @totallosses_window_active = true
  647.        
  648.         elsif @totallosses_window_active == true
  649.           @pong_P1TotalLossesScore_Window.dispose
  650.           @totallosses_window_active = false
  651.         end
  652.        
  653.        
  654.     #---------------  
  655.     end # of case
  656.     #---------------
  657.    
  658.   #------------------------------------  
  659.   end # of if Input.trigger?(Input::C)
  660.   #------------------------------------
  661.  
  662. #======================================================
  663. end # of function
  664. #======================================================
  665.  
  666.    
  667.    
  668. #======================================================
  669. #       Close Scoreboard Options Command Window
  670. #======================================================
  671. def close_scoreboardoptions_command_window
  672.   @sb_options_command_window.close
  673.  
  674.   begin
  675.     @sb_options_command_window.update
  676.     Graphics.update
  677.   end until @sb_options_command_window.openness == 0
  678.  
  679.   @sb_opt_cmmd_wnd_open = false
  680.  
  681. end
  682.  
  683. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  684.  
  685.  
  686.  
  687.  
  688. #//////////////////////////////////////////////////////
  689. #            Ball Options Comand Window              \\
  690. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  691. #======================================================
  692. #        Create Ball Options Command Window
  693. #======================================================
  694. def create_balloptions_command_window
  695.   s1 = "Speed Increase"
  696.   s2 = "Ball Height"
  697.   s3 = "Ball Width"
  698.   @ball_options_command_window           = Window_Command.new(220, [s1, s2, s3])
  699.   @ball_options_command_window.x         = (((Pong_Options::Screen_Width - @command_window.width) * 0.5) - 40)
  700.   @ball_options_command_window.y         = (Pong_Options::Screen_Height - @command_window.height) * 0.5
  701.   @ball_options_command_window.openness  = 0
  702. end
  703.  
  704.  
  705. #======================================================
  706. #             Open Ball Options Command Window
  707. #======================================================
  708. def open_balloptions_command_window
  709.   @ball_options_command_window.open
  710.  
  711.   begin
  712.     @ball_options_command_window.update
  713.     Graphics.update
  714.   end until @ball_options_command_window.openness == 255
  715.  
  716.   @ball_opt_cmmd_wnd_open = true
  717. end
  718.  
  719.  
  720. #======================================================
  721. #        Process Ball Options Command Window
  722. #======================================================
  723. def process_balloptions_command_window
  724.  
  725.   if Input.trigger?(Input::B)
  726.     Sound.play_cancel
  727.     open_options_command_window
  728.     close_balloptions_command_window
  729.   end
  730.  
  731.  
  732.   if Input.trigger?(Input::C)
  733.     case @ball_options_command_window.index
  734.        
  735.       #-------------------------------------------------------------------
  736.       when 0 #Speed Increase
  737.       #-------------------------------------------------------------------  
  738.         Sound.play_decision
  739.         open_ball_sp_incr_options_command_window
  740.         close_balloptions_command_window
  741.        
  742.       #-------------------------------------------------------------------  
  743.       when 1 #Ball Height
  744.       #-------------------------------------------------------------------  
  745.        Sound.play_decision
  746.        open_ball_height_options_command_window
  747.        close_balloptions_command_window
  748.        
  749.       #-------------------------------------------------------------------  
  750.       when 2 #Ball Width
  751.       #-------------------------------------------------------------------  
  752.        Sound.play_decision
  753.        open_ball_width_options_command_window
  754.        close_balloptions_command_window
  755.        
  756.     #---------------  
  757.     end # of case
  758.     #---------------
  759.    
  760.   #------------------------------------  
  761.   end # of if Input.trigger?(Input::C)
  762.   #------------------------------------
  763.  
  764. #======================================================
  765. end # of function
  766. #======================================================
  767.  
  768.    
  769.    
  770. #======================================================
  771. #        Close Ball Options Command Window
  772. #======================================================
  773. def close_balloptions_command_window
  774.   @ball_options_command_window.close
  775.  
  776.   begin
  777.     @ball_options_command_window.update
  778.     Graphics.update
  779.   end until @ball_options_command_window.openness == 0
  780.  
  781.   @ball_opt_cmmd_wnd_open = false
  782.  
  783. end
  784.  
  785.  
  786.  
  787.  
  788.  
  789. #//////////////////////////////////////////////////////
  790. #         Ball Speed Increase Comand Window          \\
  791. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  792. #======================================================
  793. #   Create Ball Speed Increase Options Command Window
  794. #======================================================
  795. def create_ball_sp_incr_options_command_window
  796.   s1  = "1"
  797.   s2  = "2"
  798.   s3  = "3"
  799.   s4  = "4"
  800.   s5  = "5"
  801.   s6  = "6"
  802.   s7  = "7"
  803.   s8  = "8"
  804.   s9  = "9"
  805.   s10 = "10"
  806.   @ball_sp_incr_options_command_window           = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
  807.   @ball_sp_incr_options_command_window.x         = (Pong_Options::Screen_Width - @command_window.width) * 0.5
  808.   @ball_sp_incr_options_command_window.y         = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
  809.   @ball_sp_incr_options_command_window.openness  = 0
  810. end
  811.  
  812.  
  813. #======================================================
  814. #    Open Ball Speed Increase Options Command Window
  815. #======================================================
  816. def open_ball_sp_incr_options_command_window
  817.   @ball_sp_incr_options_command_window.open
  818.  
  819.   begin
  820.     @ball_sp_incr_options_command_window.update
  821.     Graphics.update
  822.   end until @ball_sp_incr_options_command_window.openness == 255
  823.  
  824.   @ball_si_opt_cmmd_wnd_open = true
  825. end
  826.  
  827.  
  828. #======================================================
  829. #  Process Ball Speed Increase Options Command Window
  830. #======================================================
  831. def process_ball_sp_incr_options_command_window
  832.  
  833.   if Input.trigger?(Input::B)
  834.     Sound.play_cancel
  835.     open_balloptions_command_window
  836.     close_ball_sp_incr_options_command_window
  837.   end
  838.  
  839.  
  840.   if Input.trigger?(Input::C)
  841.     case @ball_sp_incr_options_command_window.index
  842.        
  843.       #-------------------------------------------------------------------
  844.       when 0 #1
  845.       #-------------------------------------------------------------------  
  846.         Sound.play_decision
  847.         @ball_speed_increase = 0.1
  848.         open_balloptions_command_window
  849.         close_ball_sp_incr_options_command_window
  850.        
  851.       #-------------------------------------------------------------------
  852.       when 1 #2
  853.       #-------------------------------------------------------------------  
  854.         Sound.play_decision
  855.         @ball_speed_increase = 0.2
  856.         open_balloptions_command_window
  857.         close_ball_sp_incr_options_command_window
  858.        
  859.       #-------------------------------------------------------------------
  860.       when 2 #3
  861.       #-------------------------------------------------------------------  
  862.         Sound.play_decision
  863.         @ball_speed_increase = 0.3
  864.         open_balloptions_command_window
  865.         close_ball_sp_incr_options_command_window
  866.        
  867.       #-------------------------------------------------------------------
  868.       when 3 #4
  869.       #-------------------------------------------------------------------  
  870.         Sound.play_decision
  871.         @ball_speed_increase = 0.4
  872.         open_balloptions_command_window
  873.         close_ball_sp_incr_options_command_window
  874.        
  875.       #-------------------------------------------------------------------
  876.       when 4 #5
  877.       #-------------------------------------------------------------------  
  878.         Sound.play_decision
  879.         @ball_speed_increase = 0.5
  880.         open_balloptions_command_window
  881.         close_ball_sp_incr_options_command_window
  882.        
  883.       #-------------------------------------------------------------------
  884.       when 5 #6
  885.       #-------------------------------------------------------------------  
  886.         Sound.play_decision
  887.         @ball_speed_increase = 0.6
  888.         open_balloptions_command_window
  889.         close_ball_sp_incr_options_command_window
  890.        
  891.       #-------------------------------------------------------------------
  892.       when 6 #7
  893.       #-------------------------------------------------------------------  
  894.         Sound.play_decision
  895.         @ball_speed_increase = 0.7
  896.         open_balloptions_command_window
  897.         close_ball_sp_incr_options_command_window
  898.        
  899.       #-------------------------------------------------------------------
  900.       when 7 #8
  901.       #-------------------------------------------------------------------  
  902.         Sound.play_decision
  903.         @ball_speed_increase = 0.8
  904.         open_balloptions_command_window
  905.         close_ball_sp_incr_options_command_window
  906.        
  907.       #-------------------------------------------------------------------
  908.       when 8 #9
  909.       #-------------------------------------------------------------------  
  910.         Sound.play_decision
  911.         @ball_speed_increase = 0.9
  912.         open_balloptions_command_window
  913.         close_ball_sp_incr_options_command_window
  914.        
  915.       #-------------------------------------------------------------------
  916.       when 9 #10
  917.       #-------------------------------------------------------------------  
  918.         Sound.play_decision
  919.         @ball_speed_increase = 1.0
  920.         open_balloptions_command_window
  921.         close_ball_sp_incr_options_command_window
  922.        
  923.     #---------------  
  924.     end # of case
  925.     #---------------
  926.    
  927.   #------------------------------------  
  928.   end # of if Input.trigger?(Input::C)
  929.   #------------------------------------
  930.  
  931. #======================================================
  932. end # of function
  933. #======================================================
  934.  
  935.    
  936.    
  937. #======================================================
  938. #   Close Ball Speed Increase Options Command Window
  939. #======================================================
  940. def close_ball_sp_incr_options_command_window
  941.   @ball_sp_incr_options_command_window.close
  942.  
  943.   begin
  944.     @ball_sp_incr_options_command_window.update
  945.     Graphics.update
  946.   end until @ball_sp_incr_options_command_window.openness == 0
  947.  
  948.   @ball_si_opt_cmmd_wnd_open = false
  949.  
  950. end
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957. #//////////////////////////////////////////////////////
  958. #          Ball Height Options Comand Window         \\
  959. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  960. #======================================================
  961. #      Create Ball Height Options Command Window
  962. #======================================================
  963. def create_ball_height_options_command_window
  964.   s1  = "10"
  965.   s2  = "20"
  966.   s3  = "30"
  967.   s4  = "40"
  968.   s5  = "50"
  969.   s6  = "60"
  970.   s7  = "70"
  971.   s8  = "80"
  972.   s9  = "90"
  973.   s10 = "100"
  974.   @ball_height_options_command_window           = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
  975.   @ball_height_options_command_window.x         = (Pong_Options::Screen_Width - @command_window.width) * 0.5
  976.   @ball_height_options_command_window.y         = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
  977.   @ball_height_options_command_window.openness  = 0
  978. end
  979.  
  980.  
  981. #======================================================
  982. #        Open Ball Height Options Command Window
  983. #======================================================
  984. def open_ball_height_options_command_window
  985.   @ball_height_options_command_window.open
  986.  
  987.   begin
  988.     @ball_height_options_command_window.update
  989.     Graphics.update
  990.   end until @ball_height_options_command_window.openness == 255
  991.  
  992.   @ball_height_opt_cmmd_wnd_open = true
  993. end
  994.  
  995.  
  996. #======================================================
  997. #     Process Ball Height Options Command Window
  998. #======================================================
  999. def process_ball_height_options_command_window
  1000.  
  1001.   if Input.trigger?(Input::B)
  1002.     Sound.play_cancel
  1003.     open_balloptions_command_window
  1004.     close_ball_height_options_command_window
  1005.   end
  1006.  
  1007.  
  1008.   if Input.trigger?(Input::C)
  1009.     case @ball_height_options_command_window.index
  1010.        
  1011.       #-------------------------------------------------------------------
  1012.       when 0 #10
  1013.       #-------------------------------------------------------------------  
  1014.         Sound.play_decision
  1015.         @ball_height              = 10
  1016.         @ball_sprite.zoom_y       = @ball_height.to_f / @ball_sprite.bitmap.height
  1017.         open_balloptions_command_window
  1018.         close_ball_height_options_command_window
  1019.        
  1020.       #-------------------------------------------------------------------
  1021.       when 1 #20
  1022.       #-------------------------------------------------------------------  
  1023.         Sound.play_decision
  1024.         @ball_height              = 20
  1025.         @ball_sprite.zoom_y       = @ball_height.to_f / @ball_sprite.bitmap.height
  1026.         open_balloptions_command_window
  1027.         close_ball_height_options_command_window
  1028.        
  1029.       #-------------------------------------------------------------------
  1030.       when 2 #30
  1031.       #-------------------------------------------------------------------  
  1032.         Sound.play_decision
  1033.         @ball_height              = 30
  1034.         @ball_sprite.zoom_y       = @ball_height.to_f / @ball_sprite.bitmap.height
  1035.         open_balloptions_command_window
  1036.         close_ball_height_options_command_window
  1037.        
  1038.       #-------------------------------------------------------------------
  1039.       when 3 #40
  1040.       #-------------------------------------------------------------------  
  1041.         Sound.play_decision
  1042.         @ball_height             = 40
  1043.         @ball_sprite.zoom_y       = @ball_height.to_f / @ball_sprite.bitmap.height
  1044.         open_balloptions_command_window
  1045.         close_ball_height_options_command_window
  1046.        
  1047.       #-------------------------------------------------------------------
  1048.       when 4 #50
  1049.       #-------------------------------------------------------------------  
  1050.         Sound.play_decision
  1051.         @ball_height              = 50
  1052.         @ball_sprite.zoom_y       = @ball_height.to_f / @ball_sprite.bitmap.height
  1053.         open_balloptions_command_window
  1054.         close_ball_height_options_command_window
  1055.        
  1056.       #-------------------------------------------------------------------
  1057.       when 5 #60
  1058.       #-------------------------------------------------------------------  
  1059.         Sound.play_decision
  1060.         @ball_height              = 60
  1061.         @ball_sprite.zoom_y       = @ball_height.to_f / @ball_sprite.bitmap.height
  1062.         open_balloptions_command_window
  1063.         close_ball_height_options_command_window
  1064.        
  1065.       #-------------------------------------------------------------------
  1066.       when 6 #70
  1067.       #-------------------------------------------------------------------  
  1068.         Sound.play_decision
  1069.         @ball_height              = 70
  1070.         @ball_sprite.zoom_y       = @ball_height.to_f / @ball_sprite.bitmap.height
  1071.         open_balloptions_command_window
  1072.         close_ball_height_options_command_window
  1073.        
  1074.       #-------------------------------------------------------------------
  1075.       when 7 #80
  1076.       #-------------------------------------------------------------------  
  1077.         Sound.play_decision
  1078.         @ball_height              = 80
  1079.         @ball_sprite.zoom_y       = @ball_height.to_f / @ball_sprite.bitmap.height
  1080.         open_balloptions_command_window
  1081.         close_ball_height_options_command_window
  1082.        
  1083.       #-------------------------------------------------------------------
  1084.       when 8 #90
  1085.       #-------------------------------------------------------------------  
  1086.         Sound.play_decision
  1087.         @ball_height              = 90
  1088.         @ball_sprite.zoom_y       = @ball_height.to_f / @ball_sprite.bitmap.height
  1089.         open_balloptions_command_window
  1090.         close_ball_height_options_command_window
  1091.        
  1092.       #-------------------------------------------------------------------
  1093.       when 9 #100
  1094.       #-------------------------------------------------------------------  
  1095.         Sound.play_decision
  1096.         @ball_height              = 100
  1097.         @ball_sprite.zoom_y       = @ball_height.to_f / @ball_sprite.bitmap.height
  1098.         open_balloptions_command_window
  1099.         close_ball_height_options_command_window
  1100.        
  1101.     #---------------  
  1102.     end # of case
  1103.     #---------------
  1104.    
  1105.   #------------------------------------  
  1106.   end # of if Input.trigger?(Input::C)
  1107.   #------------------------------------
  1108.  
  1109. #======================================================
  1110. end # of function
  1111. #======================================================
  1112.  
  1113.    
  1114.    
  1115. #======================================================
  1116. #      Close Ball Height Options Command Window
  1117. #======================================================
  1118. def close_ball_height_options_command_window
  1119.   @ball_height_options_command_window.close
  1120.  
  1121.   begin
  1122.     @ball_height_options_command_window.update
  1123.     Graphics.update
  1124.   end until @ball_height_options_command_window.openness == 0
  1125.  
  1126.   @ball_height_opt_cmmd_wnd_open = false
  1127.  
  1128. end
  1129.  
  1130.  
  1131.  
  1132. #//////////////////////////////////////////////////////
  1133. #         Ball Width Options Comand Window           \\
  1134. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  1135. #======================================================
  1136. #      Create Ball Width Options Command Window
  1137. #======================================================
  1138. def create_ball_width_options_command_window
  1139.   s1  = "10"
  1140.   s2  = "20"
  1141.   s3  = "30"
  1142.   s4  = "40"
  1143.   s5  = "50"
  1144.   s6  = "60"
  1145.   s7  = "70"
  1146.   s8  = "80"
  1147.   s9  = "90"
  1148.   s10 = "100"
  1149.   @ball_width_options_command_window           = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
  1150.   @ball_width_options_command_window.x         = (Pong_Options::Screen_Width - @command_window.width) * 0.5
  1151.   @ball_width_options_command_window.y         = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
  1152.   @ball_width_options_command_window.openness  = 0
  1153. end
  1154.  
  1155.  
  1156. #======================================================
  1157. #        Open Ball Width Options Command Window
  1158. #======================================================
  1159. def open_ball_width_options_command_window
  1160.   @ball_width_options_command_window.open
  1161.  
  1162.   begin
  1163.     @ball_width_options_command_window.update
  1164.     Graphics.update
  1165.   end until @ball_width_options_command_window.openness == 255
  1166.  
  1167.   @ball_width_opt_cmmd_wnd_open = true
  1168. end
  1169.  
  1170.  
  1171. #======================================================
  1172. #     Process Ball Width Options Command Window
  1173. #======================================================
  1174. def process_ball_width_options_command_window
  1175.  
  1176.   if Input.trigger?(Input::B)
  1177.     Sound.play_cancel
  1178.     open_balloptions_command_window
  1179.     close_ball_width_options_command_window
  1180.   end
  1181.  
  1182.  
  1183.   if Input.trigger?(Input::C)
  1184.     case @ball_width_options_command_window.index
  1185.        
  1186.       #-------------------------------------------------------------------
  1187.       when 0 #10
  1188.       #-------------------------------------------------------------------  
  1189.         Sound.play_decision
  1190.         @ball_width              = 10
  1191.         @ball_sprite.zoom_x      = @ball_width.to_f / @ball_sprite.bitmap.width
  1192.         open_balloptions_command_window
  1193.         close_ball_width_options_command_window
  1194.        
  1195.       #-------------------------------------------------------------------
  1196.       when 1 #20
  1197.       #-------------------------------------------------------------------  
  1198.         Sound.play_decision
  1199.         @ball_width              = 20
  1200.         @ball_sprite.zoom_x      = @ball_width.to_f / @ball_sprite.bitmap.width
  1201.         open_balloptions_command_window
  1202.         close_ball_width_options_command_window
  1203.        
  1204.       #-------------------------------------------------------------------
  1205.       when 2 #30
  1206.       #-------------------------------------------------------------------  
  1207.         Sound.play_decision
  1208.         @ball_width              = 30
  1209.         @ball_sprite.zoom_x      = @ball_width.to_f / @ball_sprite.bitmap.width
  1210.         open_balloptions_command_window
  1211.         close_ball_width_options_command_window
  1212.        
  1213.       #-------------------------------------------------------------------
  1214.       when 3 #40
  1215.       #-------------------------------------------------------------------  
  1216.         Sound.play_decision
  1217.         @ball_width              = 40
  1218.         @ball_sprite.zoom_x      = @ball_width.to_f / @ball_sprite.bitmap.width
  1219.         open_balloptions_command_window
  1220.         close_ball_width_options_command_window
  1221.        
  1222.       #-------------------------------------------------------------------
  1223.       when 4 #50
  1224.       #-------------------------------------------------------------------  
  1225.         Sound.play_decision
  1226.         @ball_width              = 50
  1227.         @ball_sprite.zoom_x      = @ball_width.to_f / @ball_sprite.bitmap.width
  1228.         open_balloptions_command_window
  1229.         close_ball_width_options_command_window
  1230.        
  1231.       #-------------------------------------------------------------------
  1232.       when 5 #60
  1233.       #-------------------------------------------------------------------  
  1234.         Sound.play_decision
  1235.         @ball_width              = 60
  1236.         @ball_sprite.zoom_x      = @ball_width.to_f / @ball_sprite.bitmap.width
  1237.         open_balloptions_command_window
  1238.         close_ball_width_options_command_window
  1239.        
  1240.       #-------------------------------------------------------------------
  1241.       when 6 #70
  1242.       #-------------------------------------------------------------------  
  1243.         Sound.play_decision
  1244.         @ball_width              = 70
  1245.         @ball_sprite.zoom_x      = @ball_width.to_f / @ball_sprite.bitmap.width
  1246.         open_balloptions_command_window
  1247.         close_ball_width_options_command_window
  1248.        
  1249.       #-------------------------------------------------------------------
  1250.       when 7 #80
  1251.       #-------------------------------------------------------------------  
  1252.         Sound.play_decision
  1253.         @ball_width              = 80
  1254.         @ball_sprite.zoom_x      = @ball_width.to_f / @ball_sprite.bitmap.width
  1255.         open_balloptions_command_window
  1256.         close_ball_width_options_command_window
  1257.        
  1258.       #-------------------------------------------------------------------
  1259.       when 8 #90
  1260.       #-------------------------------------------------------------------  
  1261.         Sound.play_decision
  1262.         @ball_width              = 90
  1263.         @ball_sprite.zoom_x      = @ball_width.to_f / @ball_sprite.bitmap.width
  1264.         open_balloptions_command_window
  1265.         close_ball_width_options_command_window
  1266.        
  1267.       #-------------------------------------------------------------------
  1268.       when 9 #100
  1269.       #-------------------------------------------------------------------  
  1270.         Sound.play_decision
  1271.         @ball_width              = 100
  1272.         @ball_sprite.zoom_x      = @ball_width.to_f / @ball_sprite.bitmap.width
  1273.         open_balloptions_command_window
  1274.         close_ball_width_options_command_window
  1275.        
  1276.     #---------------  
  1277.     end # of case
  1278.     #---------------
  1279.    
  1280.   #------------------------------------  
  1281.   end # of if Input.trigger?(Input::C)
  1282.   #------------------------------------
  1283.  
  1284. #======================================================
  1285. end # of function
  1286. #======================================================
  1287.  
  1288.    
  1289.    
  1290. #======================================================
  1291. #     Close Ball Width Options Command Window
  1292. #======================================================
  1293. def close_ball_width_options_command_window
  1294.   @ball_width_options_command_window.close
  1295.  
  1296.   begin
  1297.     @ball_width_options_command_window.update
  1298.     Graphics.update
  1299.   end until @ball_width_options_command_window.openness == 0
  1300.  
  1301.   @ball_width_opt_cmmd_wnd_open = false
  1302.  
  1303. end
  1304.  
  1305. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312. #//////////////////////////////////////////////////////
  1313. #        Left Paddle Options Comand Window           \\
  1314. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  1315. #======================================================
  1316. #       Create Left Paddle Options Command Window
  1317. #======================================================
  1318. def create_leftpaddleoptions_command_window
  1319.   s1 = "Movement Speed"
  1320.   s2 = "Left Paddle Height"
  1321.   s3 = "Left Paddle Width"
  1322.   @leftpaddle_options_command_window           = Window_Command.new(220, [s1, s2, s3])
  1323.   @leftpaddle_options_command_window.x         = (((Pong_Options::Screen_Width - @command_window.width) * 0.5) - 40)
  1324.   @leftpaddle_options_command_window.y         = (Pong_Options::Screen_Height - @command_window.height) * 0.5
  1325.   @leftpaddle_options_command_window.openness  = 0
  1326. end
  1327.  
  1328.  
  1329. #======================================================
  1330. #       Open Left Paddle Options Command Window
  1331. #======================================================
  1332. def open_leftpaddleoptions_command_window
  1333.   @leftpaddle_options_command_window.open
  1334.  
  1335.   begin
  1336.     @leftpaddle_options_command_window.update
  1337.     Graphics.update
  1338.   end until @leftpaddle_options_command_window.openness == 255
  1339.  
  1340.   @leftpaddle_opt_cmmd_wnd_open = true
  1341. end
  1342.  
  1343.  
  1344. #======================================================
  1345. #      Process Left Paddle Options Command Window
  1346. #======================================================
  1347. def process_leftpaddleoptions_command_window
  1348.  
  1349.   if Input.trigger?(Input::B)
  1350.     Sound.play_cancel
  1351.     open_options_command_window
  1352.     close_leftpaddleoptions_command_window
  1353.   end
  1354.  
  1355.  
  1356.   if Input.trigger?(Input::C)
  1357.     case @leftpaddle_options_command_window.index
  1358.        
  1359.       #-------------------------------------------------------------------
  1360.       when 0 #Left Paddle Speed Increase
  1361.       #-------------------------------------------------------------------  
  1362.         Sound.play_decision
  1363.         open_leftpaddle_sp_incr_options_command_window
  1364.         close_leftpaddleoptions_command_window
  1365.        
  1366.       #-------------------------------------------------------------------  
  1367.       when 1 #Left Paddle Height
  1368.       #-------------------------------------------------------------------  
  1369.        Sound.play_decision
  1370.        open_leftpaddle_height_options_command_window
  1371.        close_leftpaddleoptions_command_window
  1372.        
  1373.       #-------------------------------------------------------------------  
  1374.       when 2 #Left Paddle Width
  1375.       #-------------------------------------------------------------------  
  1376.        Sound.play_decision
  1377.        open_leftpaddle_width_options_command_window
  1378.        close_leftpaddleoptions_command_window
  1379.        
  1380.     #---------------  
  1381.     end # of case
  1382.     #---------------
  1383.    
  1384.   #------------------------------------  
  1385.   end # of if Input.trigger?(Input::C)
  1386.   #------------------------------------
  1387.  
  1388. #======================================================
  1389. end # of function
  1390. #======================================================
  1391.  
  1392.    
  1393.    
  1394. #======================================================
  1395. #       Close Left Paddle Options Command Window
  1396. #======================================================
  1397. def close_leftpaddleoptions_command_window
  1398.   @leftpaddle_options_command_window.close
  1399.  
  1400.   begin
  1401.     @leftpaddle_options_command_window.update
  1402.     Graphics.update
  1403.   end until @leftpaddle_options_command_window.openness == 0
  1404.  
  1405.   @leftpaddle_opt_cmmd_wnd_open = false
  1406.  
  1407. end
  1408.  
  1409.  
  1410.  
  1411.  
  1412. #//////////////////////////////////////////////////////
  1413. #     Left Paddle Speed Increase Comand Window       \\
  1414. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  1415. #======================================================
  1416. # Create Left Paddle Speed Increase Options Command Window
  1417. #======================================================
  1418. def create_leftpaddle_sp_incr_options_command_window
  1419.   s1  = "1"
  1420.   s2  = "2"
  1421.   s3  = "3"
  1422.   s4  = "4"
  1423.   s5  = "5"
  1424.   s6  = "6"
  1425.   s7  = "7"
  1426.   s8  = "8"
  1427.   s9  = "9"
  1428.   s10 = "10"
  1429.   @leftpaddle_sp_incr_options_command_window           = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
  1430.   @leftpaddle_sp_incr_options_command_window.x         = (Pong_Options::Screen_Width - @command_window.width) * 0.5
  1431.   @leftpaddle_sp_incr_options_command_window.y         = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
  1432.   @leftpaddle_sp_incr_options_command_window.openness  = 0
  1433. end
  1434.  
  1435.  
  1436. #======================================================
  1437. #  Open Left Paddle Speed Increase Options Command Window
  1438. #======================================================
  1439. def open_leftpaddle_sp_incr_options_command_window
  1440.   @leftpaddle_sp_incr_options_command_window.open
  1441.  
  1442.   begin
  1443.     @leftpaddle_sp_incr_options_command_window.update
  1444.     Graphics.update
  1445.   end until @leftpaddle_sp_incr_options_command_window.openness == 255
  1446.  
  1447.   @leftpaddle_si_opt_cmmd_wnd_open = true
  1448. end
  1449.  
  1450.  
  1451. #======================================================
  1452. # Process Left Paddle Speed Increase Options Command Window
  1453. #======================================================
  1454. def process_leftpaddle_sp_incr_options_command_window
  1455.  
  1456.   if Input.trigger?(Input::B)
  1457.     Sound.play_cancel
  1458.     open_leftpaddleoptions_command_window
  1459.     close_leftpaddle_sp_incr_options_command_window
  1460.   end
  1461.  
  1462.  
  1463.   if Input.trigger?(Input::C)
  1464.     case @leftpaddle_sp_incr_options_command_window.index
  1465.        
  1466.       #-------------------------------------------------------------------
  1467.       when 0 #1
  1468.       #-------------------------------------------------------------------  
  1469.         Sound.play_decision
  1470.         @leftpaddle_speed = 1.0
  1471.         open_leftpaddleoptions_command_window
  1472.         close_leftpaddle_sp_incr_options_command_window
  1473.        
  1474.       #-------------------------------------------------------------------
  1475.       when 1 #2
  1476.       #-------------------------------------------------------------------  
  1477.         Sound.play_decision
  1478.         @leftpaddle_speed = 2.0
  1479.         open_leftpaddleoptions_command_window
  1480.         close_leftpaddle_sp_incr_options_command_window
  1481.        
  1482.       #-------------------------------------------------------------------
  1483.       when 2 #3
  1484.       #-------------------------------------------------------------------  
  1485.         Sound.play_decision
  1486.         @leftpaddle_speed = 3.0
  1487.         open_leftpaddleoptions_command_window
  1488.         close_leftpaddle_sp_incr_options_command_window
  1489.        
  1490.       #-------------------------------------------------------------------
  1491.       when 3 #4
  1492.       #-------------------------------------------------------------------  
  1493.         Sound.play_decision
  1494.         @leftpaddle_speed = 4.0
  1495.         open_leftpaddleoptions_command_window
  1496.         close_leftpaddle_sp_incr_options_command_window
  1497.        
  1498.       #-------------------------------------------------------------------
  1499.       when 4 #5
  1500.       #-------------------------------------------------------------------  
  1501.         Sound.play_decision
  1502.         @leftpaddle_speed = 5.0
  1503.         open_leftpaddleoptions_command_window
  1504.         close_leftpaddle_sp_incr_options_command_window
  1505.        
  1506.       #-------------------------------------------------------------------
  1507.       when 5 #6
  1508.       #-------------------------------------------------------------------  
  1509.         Sound.play_decision
  1510.         @leftpaddle_speed = 6.0
  1511.         open_leftpaddleoptions_command_window
  1512.         close_leftpaddle_sp_incr_options_command_window
  1513.        
  1514.       #-------------------------------------------------------------------
  1515.       when 6 #7
  1516.       #-------------------------------------------------------------------  
  1517.         Sound.play_decision
  1518.         @leftpaddle_speed = 7.0
  1519.         open_leftpaddleoptions_command_window
  1520.         close_leftpaddle_sp_incr_options_command_window
  1521.        
  1522.       #-------------------------------------------------------------------
  1523.       when 7 #8
  1524.       #-------------------------------------------------------------------  
  1525.         Sound.play_decision
  1526.         @leftpaddle_speed = 8.0
  1527.         open_leftpaddleoptions_command_window
  1528.         close_leftpaddle_sp_incr_options_command_window
  1529.        
  1530.       #-------------------------------------------------------------------
  1531.       when 8 #9
  1532.       #-------------------------------------------------------------------  
  1533.         Sound.play_decision
  1534.         @leftpaddle_speed = 9.0
  1535.         open_leftpaddleoptions_command_window
  1536.         close_leftpaddle_sp_incr_options_command_window
  1537.        
  1538.       #-------------------------------------------------------------------
  1539.       when 9 #10
  1540.       #-------------------------------------------------------------------  
  1541.         Sound.play_decision
  1542.         @leftpaddle_speed = 10.0
  1543.         open_leftpaddleoptions_command_window
  1544.         close_leftpaddle_sp_incr_options_command_window
  1545.        
  1546.     #---------------  
  1547.     end # of case
  1548.     #---------------
  1549.    
  1550.   #------------------------------------  
  1551.   end # of if Input.trigger?(Input::C)
  1552.   #------------------------------------
  1553.  
  1554. #======================================================
  1555. end # of function
  1556. #======================================================
  1557.  
  1558.    
  1559.    
  1560. #======================================================
  1561. # Close Left Paddle Speed Increase Options Command Window
  1562. #======================================================
  1563. def close_leftpaddle_sp_incr_options_command_window
  1564.   @leftpaddle_sp_incr_options_command_window.close
  1565.  
  1566.   begin
  1567.     @leftpaddle_sp_incr_options_command_window.update
  1568.     Graphics.update
  1569.   end until @leftpaddle_sp_incr_options_command_window.openness == 0
  1570.  
  1571.   @leftpaddle_si_opt_cmmd_wnd_open = false
  1572.  
  1573. end
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580. #//////////////////////////////////////////////////////
  1581. #      Left Paddle Height Options Comand Window      \\
  1582. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  1583. #======================================================
  1584. #   Create Left Paddle Height Options Command Window
  1585. #======================================================
  1586. def create_leftpaddle_height_options_command_window
  1587.   s1  = "20"
  1588.   s2  = "40"
  1589.   s3  = "60"
  1590.   s4  = "80"
  1591.   s5  = "100"
  1592.   s6  = "120"
  1593.   s7  = "140"
  1594.   s8  = "160"
  1595.   s9  = "180"
  1596.   s10 = "200"
  1597.   @leftpaddle_height_options_command_window           = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
  1598.   @leftpaddle_height_options_command_window.x         = (Pong_Options::Screen_Width - @command_window.width) * 0.5
  1599.   @leftpaddle_height_options_command_window.y         = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
  1600.   @leftpaddle_height_options_command_window.openness  = 0
  1601. end
  1602.  
  1603.  
  1604. #======================================================
  1605. #     Open Left Paddle Height Options Command Window
  1606. #======================================================
  1607. def open_leftpaddle_height_options_command_window
  1608.   @leftpaddle_height_options_command_window.open
  1609.  
  1610.   begin
  1611.     @leftpaddle_height_options_command_window.update
  1612.     Graphics.update
  1613.   end until @leftpaddle_height_options_command_window.openness == 255
  1614.  
  1615.   @leftpaddle_height_opt_cmmd_wnd_open = true
  1616. end
  1617.  
  1618.  
  1619. #======================================================
  1620. #   Process Left Paddle Height Options Command Window
  1621. #======================================================
  1622. def process_leftpaddle_height_options_command_window
  1623.  
  1624.   if Input.trigger?(Input::B)
  1625.     Sound.play_cancel
  1626.     open_leftpaddleoptions_command_window
  1627.     close_leftpaddle_height_options_command_window
  1628.   end
  1629.  
  1630.  
  1631.   if Input.trigger?(Input::C)
  1632.     case @leftpaddle_height_options_command_window.index
  1633.        
  1634.       #-------------------------------------------------------------------
  1635.       when 0 #20
  1636.       #-------------------------------------------------------------------  
  1637.         Sound.play_decision
  1638.         @leftpaddle_height          = 20
  1639.         @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  1640.         open_leftpaddleoptions_command_window
  1641.         close_leftpaddle_height_options_command_window
  1642.        
  1643.       #-------------------------------------------------------------------
  1644.       when 1 #40
  1645.       #-------------------------------------------------------------------  
  1646.         Sound.play_decision
  1647.         @leftpaddle_height          = 40
  1648.         @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  1649.         @leftpaddle_sprite.y       -= @leftpaddle_height
  1650.         open_leftpaddleoptions_command_window
  1651.         close_leftpaddle_height_options_command_window
  1652.        
  1653.       #-------------------------------------------------------------------
  1654.       when 2 #60
  1655.       #-------------------------------------------------------------------  
  1656.         Sound.play_decision
  1657.         @leftpaddle_height          = 60
  1658.         @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  1659.         @leftpaddle_sprite.y       -= @leftpaddle_height
  1660.         open_leftpaddleoptions_command_window
  1661.         close_leftpaddle_height_options_command_window
  1662.        
  1663.       #-------------------------------------------------------------------
  1664.       when 3 #80
  1665.       #-------------------------------------------------------------------  
  1666.         Sound.play_decision
  1667.         @leftpaddle_height          = 80
  1668.         @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  1669.         @leftpaddle_sprite.y       -= @leftpaddle_height
  1670.         open_leftpaddleoptions_command_window
  1671.         close_leftpaddle_height_options_command_window
  1672.        
  1673.       #-------------------------------------------------------------------
  1674.       when 4 #100
  1675.       #-------------------------------------------------------------------  
  1676.         Sound.play_decision
  1677.         @leftpaddle_height          = 100
  1678.         @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  1679.         @leftpaddle_sprite.y       -= @leftpaddle_height
  1680.         open_leftpaddleoptions_command_window
  1681.         close_leftpaddle_height_options_command_window
  1682.        
  1683.       #-------------------------------------------------------------------
  1684.       when 5 #120
  1685.       #-------------------------------------------------------------------  
  1686.         Sound.play_decision
  1687.         @leftpaddle_height          = 120
  1688.         @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  1689.         @leftpaddle_sprite.y       -= @leftpaddle_height
  1690.         open_leftpaddleoptions_command_window
  1691.         close_leftpaddle_height_options_command_window
  1692.        
  1693.       #-------------------------------------------------------------------
  1694.       when 6 #140
  1695.       #-------------------------------------------------------------------  
  1696.         Sound.play_decision
  1697.         @leftpaddle_height          = 140
  1698.         @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  1699.         @leftpaddle_sprite.y       -= @leftpaddle_height
  1700.         open_leftpaddleoptions_command_window
  1701.         close_leftpaddle_height_options_command_window
  1702.        
  1703.       #-------------------------------------------------------------------
  1704.       when 7 #160
  1705.       #-------------------------------------------------------------------  
  1706.         Sound.play_decision
  1707.         @leftpaddle_height          = 160
  1708.         @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  1709.         @leftpaddle_sprite.y       -= @leftpaddle_height
  1710.         open_leftpaddleoptions_command_window
  1711.         close_leftpaddle_height_options_command_window
  1712.        
  1713.       #-------------------------------------------------------------------
  1714.       when 8 #180
  1715.       #-------------------------------------------------------------------  
  1716.         Sound.play_decision
  1717.         @leftpaddle_height          = 180
  1718.         @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  1719.         @leftpaddle_sprite.y       -= @leftpaddle_height
  1720.         open_leftpaddleoptions_command_window
  1721.         close_leftpaddle_height_options_command_window
  1722.        
  1723.       #-------------------------------------------------------------------
  1724.       when 9 #200
  1725.       #-------------------------------------------------------------------  
  1726.         Sound.play_decision
  1727.         @leftpaddle_height          = 200
  1728.         @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  1729.         @leftpaddle_sprite.y       -= @leftpaddle_height
  1730.         open_leftpaddleoptions_command_window
  1731.         close_leftpaddle_height_options_command_window
  1732.        
  1733.     #---------------  
  1734.     end # of case
  1735.     #---------------
  1736.    
  1737.   #------------------------------------  
  1738.   end # of if Input.trigger?(Input::C)
  1739.   #------------------------------------
  1740.  
  1741.   if @leftpaddle_sprite.y < 0
  1742.     @leftpaddle_sprite.y = 10
  1743.   end
  1744.  
  1745. #======================================================
  1746. end # of function
  1747. #======================================================
  1748.  
  1749.    
  1750.    
  1751. #======================================================
  1752. #    Close Left Paddle Height Options Command Window
  1753. #======================================================
  1754. def close_leftpaddle_height_options_command_window
  1755.   @leftpaddle_height_options_command_window.close
  1756.  
  1757.   begin
  1758.     @leftpaddle_height_options_command_window.update
  1759.     Graphics.update
  1760.   end until @leftpaddle_height_options_command_window.openness == 0
  1761.  
  1762.   @leftpaddle_height_opt_cmmd_wnd_open = false
  1763.  
  1764. end
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771. #//////////////////////////////////////////////////////
  1772. #     Left Paddle Width Options Comand Window        \\
  1773. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  1774. #======================================================
  1775. #   Create Left Paddle Width Options Command Window
  1776. #======================================================
  1777. def create_leftpaddle_width_options_command_window
  1778.   s1  = "20"
  1779.   s2  = "40"
  1780.   s3  = "60"
  1781.   s4  = "80"
  1782.   s5  = "100"
  1783.   s6  = "120"
  1784.   s7  = "140"
  1785.   s8  = "160"
  1786.   s9  = "180"
  1787.   s10 = "200"
  1788.   @leftpaddle_width_options_command_window           = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
  1789.   @leftpaddle_width_options_command_window.x         = (Pong_Options::Screen_Width - @command_window.width) * 0.5
  1790.   @leftpaddle_width_options_command_window.y         = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
  1791.   @leftpaddle_width_options_command_window.openness  = 0
  1792. end
  1793.  
  1794.  
  1795. #======================================================
  1796. #     Open Left Paddle Width Options Command Window
  1797. #======================================================
  1798. def open_leftpaddle_width_options_command_window
  1799.   @leftpaddle_width_options_command_window.open
  1800.  
  1801.   begin
  1802.     @leftpaddle_width_options_command_window.update
  1803.     Graphics.update
  1804.   end until @leftpaddle_width_options_command_window.openness == 255
  1805.  
  1806.   @leftpaddle_width_opt_cmmd_wnd_open = true
  1807. end
  1808.  
  1809.  
  1810. #======================================================
  1811. #   Process Left Paddle Width Options Command Window
  1812. #======================================================
  1813. def process_leftpaddle_width_options_command_window
  1814.  
  1815.   if Input.trigger?(Input::B)
  1816.     Sound.play_cancel
  1817.     open_leftpaddleoptions_command_window
  1818.     close_leftpaddle_width_options_command_window
  1819.   end
  1820.  
  1821.  
  1822.   if Input.trigger?(Input::C)
  1823.     case @leftpaddle_width_options_command_window.index
  1824.        
  1825.       #-------------------------------------------------------------------
  1826.       when 0 #20
  1827.       #-------------------------------------------------------------------  
  1828.         Sound.play_decision
  1829.         @leftpaddle_width           = 20
  1830.         @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  1831.         open_leftpaddleoptions_command_window
  1832.         close_leftpaddle_width_options_command_window
  1833.        
  1834.       #-------------------------------------------------------------------
  1835.       when 1 #40
  1836.       #-------------------------------------------------------------------  
  1837.         Sound.play_decision
  1838.         @leftpaddle_width           = 40
  1839.         @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  1840.         open_leftpaddleoptions_command_window
  1841.         close_leftpaddle_width_options_command_window
  1842.        
  1843.       #-------------------------------------------------------------------
  1844.       when 2 #60
  1845.       #-------------------------------------------------------------------  
  1846.         Sound.play_decision
  1847.         @leftpaddle_width           = 60
  1848.         @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  1849.         open_leftpaddleoptions_command_window
  1850.         close_leftpaddle_width_options_command_window
  1851.        
  1852.       #-------------------------------------------------------------------
  1853.       when 3 #80
  1854.       #-------------------------------------------------------------------  
  1855.         Sound.play_decision
  1856.         @leftpaddle_width           = 80
  1857.         @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  1858.         open_leftpaddleoptions_command_window
  1859.         close_leftpaddle_width_options_command_window
  1860.        
  1861.       #-------------------------------------------------------------------
  1862.       when 4 #100
  1863.       #-------------------------------------------------------------------  
  1864.         Sound.play_decision
  1865.         @leftpaddle_width           = 100
  1866.         @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  1867.         open_leftpaddleoptions_command_window
  1868.         close_leftpaddle_width_options_command_window
  1869.        
  1870.       #-------------------------------------------------------------------
  1871.       when 5 #120
  1872.       #-------------------------------------------------------------------  
  1873.         Sound.play_decision
  1874.         @leftpaddle_width           = 120
  1875.         @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  1876.         open_leftpaddleoptions_command_window
  1877.         close_leftpaddle_width_options_command_window
  1878.        
  1879.       #-------------------------------------------------------------------
  1880.       when 6 #140
  1881.       #-------------------------------------------------------------------  
  1882.         Sound.play_decision
  1883.         @leftpaddle_width           = 140
  1884.         @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  1885.         open_leftpaddleoptions_command_window
  1886.         close_leftpaddle_width_options_command_window
  1887.        
  1888.       #-------------------------------------------------------------------
  1889.       when 7 #160
  1890.       #-------------------------------------------------------------------  
  1891.         Sound.play_decision
  1892.         @leftpaddle_width           = 160
  1893.         @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  1894.         open_leftpaddleoptions_command_window
  1895.         close_leftpaddle_width_options_command_window
  1896.        
  1897.       #-------------------------------------------------------------------
  1898.       when 8 #180
  1899.       #-------------------------------------------------------------------  
  1900.         Sound.play_decision
  1901.         @leftpaddle_width           = 180
  1902.         @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  1903.         open_leftpaddleoptions_command_window
  1904.         close_leftpaddle_width_options_command_window
  1905.        
  1906.       #-------------------------------------------------------------------
  1907.       when 9 #200
  1908.       #-------------------------------------------------------------------  
  1909.         Sound.play_decision
  1910.         @leftpaddle_width           = 200
  1911.         @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  1912.         open_leftpaddleoptions_command_window
  1913.         close_leftpaddle_width_options_command_window
  1914.        
  1915.     #---------------  
  1916.     end # of case
  1917.     #---------------
  1918.    
  1919.   #------------------------------------  
  1920.   end # of if Input.trigger?(Input::C)
  1921.   #------------------------------------
  1922.  
  1923. #======================================================
  1924. end # of function
  1925. #======================================================
  1926.  
  1927.    
  1928.    
  1929. #======================================================
  1930. #    Close Left Paddle Width Options Command Window
  1931. #======================================================
  1932. def close_leftpaddle_width_options_command_window
  1933.   @leftpaddle_width_options_command_window.close
  1934.  
  1935.   begin
  1936.     @leftpaddle_width_options_command_window.update
  1937.     Graphics.update
  1938.   end until @leftpaddle_width_options_command_window.openness == 0
  1939.  
  1940.   @leftpaddle_width_opt_cmmd_wnd_open = false
  1941.  
  1942. end
  1943.  
  1944. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  1945.  
  1946.  
  1947.  
  1948. #//////////////////////////////////////////////////////
  1949. #       Right Paddle Options Comand Window           \\
  1950. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  1951. #======================================================
  1952. #       Create Right Paddle Options Command Window
  1953. #======================================================
  1954. def create_rightpaddleoptions_command_window
  1955.   s1 = "Movement Speed"
  1956.   s2 = "Right Paddle Height"
  1957.   s3 = "Right Paddle Width"
  1958.   @rightpaddle_options_command_window           = Window_Command.new(220, [s1, s2, s3])
  1959.   @rightpaddle_options_command_window.x         = (((Pong_Options::Screen_Width - @command_window.width) * 0.5) - 40)
  1960.   @rightpaddle_options_command_window.y         = (Pong_Options::Screen_Height - @command_window.height) * 0.5
  1961.   @rightpaddle_options_command_window.openness  = 0
  1962. end
  1963.  
  1964.  
  1965. #======================================================
  1966. #       Open Right Paddle Options Command Window
  1967. #======================================================
  1968. def open_rightpaddleoptions_command_window
  1969.   @rightpaddle_options_command_window.open
  1970.  
  1971.   begin
  1972.     @rightpaddle_options_command_window.update
  1973.     Graphics.update
  1974.   end until @rightpaddle_options_command_window.openness == 255
  1975.  
  1976.   @rightpaddle_opt_cmmd_wnd_open = true
  1977. end
  1978.  
  1979.  
  1980. #======================================================
  1981. #      Process Right Paddle Options Command Window
  1982. #======================================================
  1983. def process_rightpaddleoptions_command_window
  1984.  
  1985.   if Input.trigger?(Input::B)
  1986.     Sound.play_cancel
  1987.     open_options_command_window
  1988.     close_rightpaddleoptions_command_window
  1989.   end
  1990.  
  1991.  
  1992.   if Input.trigger?(Input::C)
  1993.     case @rightpaddle_options_command_window.index
  1994.        
  1995.       #-------------------------------------------------------------------
  1996.       when 0 #Right Paddle Speed Increase
  1997.       #-------------------------------------------------------------------  
  1998.         Sound.play_decision
  1999.         open_rightpaddle_sp_incr_options_command_window
  2000.         close_rightpaddleoptions_command_window
  2001.        
  2002.       #-------------------------------------------------------------------  
  2003.       when 1 #Right Paddle Height
  2004.       #-------------------------------------------------------------------  
  2005.        Sound.play_decision
  2006.        open_rightpaddle_height_options_command_window
  2007.        close_rightpaddleoptions_command_window
  2008.        
  2009.       #-------------------------------------------------------------------  
  2010.       when 2 #Right Paddle Width
  2011.       #-------------------------------------------------------------------  
  2012.        Sound.play_decision
  2013.        open_rightpaddle_width_options_command_window
  2014.        close_rightpaddleoptions_command_window
  2015.        
  2016.     #---------------  
  2017.     end # of case
  2018.     #---------------
  2019.    
  2020.   #------------------------------------  
  2021.   end # of if Input.trigger?(Input::C)
  2022.   #------------------------------------
  2023.  
  2024. #======================================================
  2025. end # of function
  2026. #======================================================
  2027.  
  2028.    
  2029.    
  2030. #======================================================
  2031. #       Close Right Paddle Options Command Window
  2032. #======================================================
  2033. def close_rightpaddleoptions_command_window
  2034.   @rightpaddle_options_command_window.close
  2035.  
  2036.   begin
  2037.     @rightpaddle_options_command_window.update
  2038.     Graphics.update
  2039.   end until @rightpaddle_options_command_window.openness == 0
  2040.  
  2041.   @rightpaddle_opt_cmmd_wnd_open = false
  2042.  
  2043. end
  2044.  
  2045.  
  2046.  
  2047.  
  2048. #//////////////////////////////////////////////////////
  2049. #     Right Paddle Speed Increase Comand Window       \\
  2050. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  2051. #======================================================
  2052. # Create Right Paddle Speed Increase Options Command Window
  2053. #======================================================
  2054. def create_rightpaddle_sp_incr_options_command_window
  2055.   s1  = "1"
  2056.   s2  = "2"
  2057.   s3  = "3"
  2058.   s4  = "4"
  2059.   s5  = "5"
  2060.   s6  = "6"
  2061.   s7  = "7"
  2062.   s8  = "8"
  2063.   s9  = "9"
  2064.   s10 = "10"
  2065.   @rightpaddle_sp_incr_options_command_window           = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
  2066.   @rightpaddle_sp_incr_options_command_window.x         = (Pong_Options::Screen_Width - @command_window.width) * 0.5
  2067.   @rightpaddle_sp_incr_options_command_window.y         = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
  2068.   @rightpaddle_sp_incr_options_command_window.openness  = 0
  2069. end
  2070.  
  2071.  
  2072. #======================================================
  2073. #  Open Right Paddle Speed Increase Options Command Window
  2074. #======================================================
  2075. def open_rightpaddle_sp_incr_options_command_window
  2076.   @rightpaddle_sp_incr_options_command_window.open
  2077.  
  2078.   begin
  2079.     @rightpaddle_sp_incr_options_command_window.update
  2080.     Graphics.update
  2081.   end until @rightpaddle_sp_incr_options_command_window.openness == 255
  2082.  
  2083.   @rightpaddle_si_opt_cmmd_wnd_open = true
  2084. end
  2085.  
  2086.  
  2087. #======================================================
  2088. # Process Right Paddle Speed Increase Options Command Window
  2089. #======================================================
  2090. def process_rightpaddle_sp_incr_options_command_window
  2091.  
  2092.   if Input.trigger?(Input::B)
  2093.     Sound.play_cancel
  2094.     open_rightpaddleoptions_command_window
  2095.     close_rightpaddle_sp_incr_options_command_window
  2096.   end
  2097.  
  2098.  
  2099.   if Input.trigger?(Input::C)
  2100.     case @rightpaddle_sp_incr_options_command_window.index
  2101.        
  2102.       #-------------------------------------------------------------------
  2103.       when 0 #1
  2104.       #-------------------------------------------------------------------  
  2105.         Sound.play_decision
  2106.         @rightpaddle_speed = 1.0
  2107.         open_rightpaddleoptions_command_window
  2108.         close_rightpaddle_sp_incr_options_command_window
  2109.        
  2110.       #-------------------------------------------------------------------
  2111.       when 1 #2
  2112.       #-------------------------------------------------------------------  
  2113.         Sound.play_decision
  2114.         @rightpaddle_speed = 2.0
  2115.         open_rightpaddleoptions_command_window
  2116.         close_rightpaddle_sp_incr_options_command_window
  2117.        
  2118.       #-------------------------------------------------------------------
  2119.       when 2 #3
  2120.       #-------------------------------------------------------------------  
  2121.         Sound.play_decision
  2122.         @rightpaddle_speed = 3.0
  2123.         open_rightpaddleoptions_command_window
  2124.         close_rightpaddle_sp_incr_options_command_window
  2125.        
  2126.       #-------------------------------------------------------------------
  2127.       when 3 #4
  2128.       #-------------------------------------------------------------------  
  2129.         Sound.play_decision
  2130.         @rightpaddle_speed = 4.0
  2131.         open_rightpaddleoptions_command_window
  2132.         close_rightpaddle_sp_incr_options_command_window
  2133.        
  2134.       #-------------------------------------------------------------------
  2135.       when 4 #5
  2136.       #-------------------------------------------------------------------  
  2137.         Sound.play_decision
  2138.         @rightpaddle_speed = 5.0
  2139.         open_rightpaddleoptions_command_window
  2140.         close_rightpaddle_sp_incr_options_command_window
  2141.        
  2142.       #-------------------------------------------------------------------
  2143.       when 5 #6
  2144.       #-------------------------------------------------------------------  
  2145.         Sound.play_decision
  2146.         @rightpaddle_speed = 6.0
  2147.         open_rightpaddleoptions_command_window
  2148.         close_rightpaddle_sp_incr_options_command_window
  2149.        
  2150.       #-------------------------------------------------------------------
  2151.       when 6 #7
  2152.       #-------------------------------------------------------------------  
  2153.         Sound.play_decision
  2154.         @rightpaddle_speed = 7.0
  2155.         open_rightpaddleoptions_command_window
  2156.         close_rightpaddle_sp_incr_options_command_window
  2157.        
  2158.       #-------------------------------------------------------------------
  2159.       when 7 #8
  2160.       #-------------------------------------------------------------------  
  2161.         Sound.play_decision
  2162.         @rightpaddle_speed = 8.0
  2163.         open_rightpaddleoptions_command_window
  2164.         close_rightpaddle_sp_incr_options_command_window
  2165.        
  2166.       #-------------------------------------------------------------------
  2167.       when 8 #9
  2168.       #-------------------------------------------------------------------  
  2169.         Sound.play_decision
  2170.         @rightpaddle_speed = 9.0
  2171.         open_rightpaddleoptions_command_window
  2172.         close_rightpaddle_sp_incr_options_command_window
  2173.        
  2174.       #-------------------------------------------------------------------
  2175.       when 9 #10
  2176.       #-------------------------------------------------------------------  
  2177.         Sound.play_decision
  2178.         @rightpaddle_speed = 10.0
  2179.         open_rightpaddleoptions_command_window
  2180.         close_rightpaddle_sp_incr_options_command_window
  2181.        
  2182.     #---------------  
  2183.     end # of case
  2184.     #---------------
  2185.    
  2186.   #------------------------------------  
  2187.   end # of if Input.trigger?(Input::C)
  2188.   #------------------------------------
  2189.  
  2190. #======================================================
  2191. end # of function
  2192. #======================================================
  2193.  
  2194.    
  2195.    
  2196. #======================================================
  2197. # Close Right Paddle Speed Increase Options Command Window
  2198. #======================================================
  2199. def close_rightpaddle_sp_incr_options_command_window
  2200.   @rightpaddle_sp_incr_options_command_window.close
  2201.  
  2202.   begin
  2203.     @rightpaddle_sp_incr_options_command_window.update
  2204.     Graphics.update
  2205.   end until @rightpaddle_sp_incr_options_command_window.openness == 0
  2206.  
  2207.   @rightpaddle_si_opt_cmmd_wnd_open = false
  2208.  
  2209. end
  2210.  
  2211.  
  2212.  
  2213.  
  2214.  
  2215.  
  2216. #//////////////////////////////////////////////////////
  2217. #     Right Paddle Height Options Comand Window      \\
  2218. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  2219. #======================================================
  2220. #   Create Right Paddle Height Options Command Window
  2221. #======================================================
  2222. def create_rightpaddle_height_options_command_window
  2223.   s1  = "20"
  2224.   s2  = "40"
  2225.   s3  = "60"
  2226.   s4  = "80"
  2227.   s5  = "100"
  2228.   s6  = "120"
  2229.   s7  = "140"
  2230.   s8  = "160"
  2231.   s9  = "180"
  2232.   s10 = "200"
  2233.   @rightpaddle_height_options_command_window           = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
  2234.   @rightpaddle_height_options_command_window.x         = (Pong_Options::Screen_Width - @command_window.width) * 0.5
  2235.   @rightpaddle_height_options_command_window.y         = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
  2236.   @rightpaddle_height_options_command_window.openness  = 0
  2237. end
  2238.  
  2239.  
  2240. #======================================================
  2241. #     Open Right Paddle Height Options Command Window
  2242. #======================================================
  2243. def open_rightpaddle_height_options_command_window
  2244.   @rightpaddle_height_options_command_window.open
  2245.  
  2246.   begin
  2247.     @rightpaddle_height_options_command_window.update
  2248.     Graphics.update
  2249.   end until @rightpaddle_height_options_command_window.openness == 255
  2250.  
  2251.   @rightpaddle_height_opt_cmmd_wnd_open = true
  2252. end
  2253.  
  2254.  
  2255. #======================================================
  2256. #   Process Right Paddle Height Options Command Window
  2257. #======================================================
  2258. def process_rightpaddle_height_options_command_window
  2259.  
  2260.   if Input.trigger?(Input::B)
  2261.     Sound.play_cancel
  2262.     open_rightpaddleoptions_command_window
  2263.     close_rightpaddle_height_options_command_window
  2264.   end
  2265.  
  2266.  
  2267.   if Input.trigger?(Input::C)
  2268.     case @rightpaddle_height_options_command_window.index
  2269.        
  2270.       #-------------------------------------------------------------------
  2271.       when 0 #20
  2272.       #-------------------------------------------------------------------  
  2273.         Sound.play_decision
  2274.         @rightpaddle_height          = 20
  2275.         @rightpaddle_sprite.zoom_y   = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2276.         open_rightpaddleoptions_command_window
  2277.         close_rightpaddle_height_options_command_window
  2278.        
  2279.       #-------------------------------------------------------------------
  2280.       when 1 #40
  2281.       #-------------------------------------------------------------------  
  2282.         Sound.play_decision
  2283.         @rightpaddle_height          = 40
  2284.         @rightpaddle_sprite.zoom_y   = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2285.         @rightpaddle_sprite.y       -= @rightpaddle_height
  2286.         open_rightpaddleoptions_command_window
  2287.         close_rightpaddle_height_options_command_window
  2288.        
  2289.       #-------------------------------------------------------------------
  2290.       when 2 #60
  2291.       #-------------------------------------------------------------------  
  2292.         Sound.play_decision
  2293.         @rightpaddle_height          = 60
  2294.         @rightpaddle_sprite.zoom_y   = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2295.         @rightpaddle_sprite.y       -= @rightpaddle_height
  2296.         open_rightpaddleoptions_command_window
  2297.         close_rightpaddle_height_options_command_window
  2298.        
  2299.       #-------------------------------------------------------------------
  2300.       when 3 #80
  2301.       #-------------------------------------------------------------------  
  2302.         Sound.play_decision
  2303.         @rightpaddle_height          = 80
  2304.         @rightpaddle_sprite.zoom_y   = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2305.         @rightpaddle_sprite.y       -= @rightpaddle_height
  2306.         open_rightpaddleoptions_command_window
  2307.         close_rightpaddle_height_options_command_window
  2308.        
  2309.       #-------------------------------------------------------------------
  2310.       when 4 #100
  2311.       #-------------------------------------------------------------------  
  2312.         Sound.play_decision
  2313.         @rightpaddle_height          = 100
  2314.         @rightpaddle_sprite.zoom_y   = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2315.         @rightpaddle_sprite.y       -= @rightpaddle_height
  2316.         open_rightpaddleoptions_command_window
  2317.         close_rightpaddle_height_options_command_window
  2318.        
  2319.       #-------------------------------------------------------------------
  2320.       when 5 #120
  2321.       #-------------------------------------------------------------------  
  2322.         Sound.play_decision
  2323.         @rightpaddle_height          = 120
  2324.         @rightpaddle_sprite.zoom_y   = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2325.         @rightpaddle_sprite.y       -= @rightpaddle_height
  2326.         open_rightpaddleoptions_command_window
  2327.         close_rightpaddle_height_options_command_window
  2328.        
  2329.       #-------------------------------------------------------------------
  2330.       when 6 #140
  2331.       #-------------------------------------------------------------------  
  2332.         Sound.play_decision
  2333.         @rightpaddle_height          = 140
  2334.         @rightpaddle_sprite.zoom_y   = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2335.         @rightpaddle_sprite.y       -= @rightpaddle_height
  2336.         open_rightpaddleoptions_command_window
  2337.         close_rightpaddle_height_options_command_window
  2338.        
  2339.       #-------------------------------------------------------------------
  2340.       when 7 #160
  2341.       #-------------------------------------------------------------------  
  2342.         Sound.play_decision
  2343.         @rightpaddle_height          = 160
  2344.         @rightpaddle_sprite.zoom_y   = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2345.         @rightpaddle_sprite.y       -= @rightpaddle_height
  2346.         open_rightpaddleoptions_command_window
  2347.         close_rightpaddle_height_options_command_window
  2348.        
  2349.       #-------------------------------------------------------------------
  2350.       when 8 #180
  2351.       #-------------------------------------------------------------------  
  2352.         Sound.play_decision
  2353.         @rightpaddle_height          = 180
  2354.         @rightpaddle_sprite.zoom_y   = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2355.         @rightpaddle_sprite.y       -= @rightpaddle_height
  2356.         open_rightpaddleoptions_command_window
  2357.         close_rightpaddle_height_options_command_window
  2358.        
  2359.       #-------------------------------------------------------------------
  2360.       when 9 #200
  2361.       #-------------------------------------------------------------------  
  2362.         Sound.play_decision
  2363.         @rightpaddle_height          = 200
  2364.         @rightpaddle_sprite.zoom_y   = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2365.         @rightpaddle_sprite.y       -= @rightpaddle_height
  2366.         open_rightpaddleoptions_command_window
  2367.         close_rightpaddle_height_options_command_window
  2368.        
  2369.     #---------------  
  2370.     end # of case
  2371.     #---------------
  2372.    
  2373.   #------------------------------------  
  2374.   end # of if Input.trigger?(Input::C)
  2375.   #------------------------------------
  2376.  
  2377.   if @rightpaddle_sprite.y < 0
  2378.     @rightpaddle_sprite.y = 10
  2379.   end
  2380.  
  2381. #======================================================
  2382. end # of function
  2383. #======================================================
  2384.  
  2385.    
  2386.    
  2387. #======================================================
  2388. #    Close Right Paddle Height Options Command Window
  2389. #======================================================
  2390. def close_rightpaddle_height_options_command_window
  2391.   @rightpaddle_height_options_command_window.close
  2392.  
  2393.   begin
  2394.     @rightpaddle_height_options_command_window.update
  2395.     Graphics.update
  2396.   end until @rightpaddle_height_options_command_window.openness == 0
  2397.  
  2398.   @rightpaddle_height_opt_cmmd_wnd_open = false
  2399.  
  2400. end
  2401.  
  2402.  
  2403.  
  2404. #//////////////////////////////////////////////////////
  2405. #    Right Paddle Width Options Comand Window        \\
  2406. #||||||||||||||||||||||||||||||||||||||||||||||||||||||
  2407. #======================================================
  2408. #   Create Right Paddle Width Options Command Window
  2409. #======================================================
  2410. def create_rightpaddle_width_options_command_window
  2411.   s1  = "20"
  2412.   s2  = "40"
  2413.   s3  = "60"
  2414.   s4  = "80"
  2415.   s5  = "100"
  2416.   s6  = "120"
  2417.   s7  = "140"
  2418.   s8  = "160"
  2419.   s9  = "180"
  2420.   s10 = "200"
  2421.   @rightpaddle_width_options_command_window           = Window_Command.new(142, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10])
  2422.   @rightpaddle_width_options_command_window.x         = (Pong_Options::Screen_Width - @command_window.width) * 0.5
  2423.   @rightpaddle_width_options_command_window.y         = (((Pong_Options::Screen_Height - @command_window.height) * 0.5) - 60)
  2424.   @rightpaddle_width_options_command_window.openness  = 0
  2425. end
  2426.  
  2427.  
  2428. #======================================================
  2429. #     Open Right Paddle Width Options Command Window
  2430. #======================================================
  2431. def open_rightpaddle_width_options_command_window
  2432.   @rightpaddle_width_options_command_window.open
  2433.  
  2434.   begin
  2435.     @rightpaddle_width_options_command_window.update
  2436.     Graphics.update
  2437.   end until @rightpaddle_width_options_command_window.openness == 255
  2438.  
  2439.   @rightpaddle_width_opt_cmmd_wnd_open = true
  2440. end
  2441.  
  2442.  
  2443. #======================================================
  2444. #   Process Right Paddle Width Options Command Window
  2445. #======================================================
  2446. def process_rightpaddle_width_options_command_window
  2447.  
  2448.   if Input.trigger?(Input::B)
  2449.     Sound.play_cancel
  2450.     open_rightpaddleoptions_command_window
  2451.     close_rightpaddle_width_options_command_window
  2452.   end
  2453.  
  2454.  
  2455.   if Input.trigger?(Input::C)
  2456.     case @rightpaddle_width_options_command_window.index
  2457.        
  2458.       #-------------------------------------------------------------------
  2459.       when 0 #20
  2460.       #-------------------------------------------------------------------  
  2461.         Sound.play_decision
  2462.         @rightpaddle_width           = 20
  2463.         @rightpaddle_sprite.zoom_x   = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2464.         @rightpaddle_sprite.x        = @rightpaddle_StartPosX - @rightpaddle_width
  2465.         open_rightpaddleoptions_command_window
  2466.         close_rightpaddle_width_options_command_window
  2467.        
  2468.       #-------------------------------------------------------------------
  2469.       when 1 #40
  2470.       #-------------------------------------------------------------------  
  2471.         Sound.play_decision
  2472.         @rightpaddle_width           = 40
  2473.         @rightpaddle_sprite.zoom_x   = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2474.         @rightpaddle_sprite.x        = @rightpaddle_StartPosX - @rightpaddle_width
  2475.         open_rightpaddleoptions_command_window
  2476.         close_rightpaddle_width_options_command_window
  2477.        
  2478.       #-------------------------------------------------------------------
  2479.       when 2 #60
  2480.       #-------------------------------------------------------------------  
  2481.         Sound.play_decision
  2482.         @rightpaddle_width           = 60
  2483.         @rightpaddle_sprite.zoom_x   = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2484.         @rightpaddle_sprite.x        = @rightpaddle_StartPosX - @rightpaddle_width
  2485.         open_rightpaddleoptions_command_window
  2486.         close_rightpaddle_width_options_command_window
  2487.        
  2488.       #-------------------------------------------------------------------
  2489.       when 3 #80
  2490.       #-------------------------------------------------------------------  
  2491.         Sound.play_decision
  2492.         @rightpaddle_width           = 80
  2493.         @rightpaddle_sprite.zoom_x   = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2494.         @rightpaddle_sprite.x        = @rightpaddle_StartPosX - @rightpaddle_width
  2495.         open_rightpaddleoptions_command_window
  2496.         close_rightpaddle_width_options_command_window
  2497.        
  2498.       #-------------------------------------------------------------------
  2499.       when 4 #100
  2500.       #-------------------------------------------------------------------  
  2501.         Sound.play_decision
  2502.         @rightpaddle_width           = 100
  2503.         @rightpaddle_sprite.zoom_x   = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2504.         @rightpaddle_sprite.x        = @rightpaddle_StartPosX - @rightpaddle_width
  2505.         open_rightpaddleoptions_command_window
  2506.         close_rightpaddle_width_options_command_window
  2507.        
  2508.       #-------------------------------------------------------------------
  2509.       when 5 #120
  2510.       #-------------------------------------------------------------------  
  2511.         Sound.play_decision
  2512.         @rightpaddle_width           = 120
  2513.         @rightpaddle_sprite.zoom_x   = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2514.         @rightpaddle_sprite.x        = @rightpaddle_StartPosX - @rightpaddle_width
  2515.         open_rightpaddleoptions_command_window
  2516.         close_rightpaddle_width_options_command_window
  2517.        
  2518.       #-------------------------------------------------------------------
  2519.       when 6 #140
  2520.       #-------------------------------------------------------------------  
  2521.         Sound.play_decision
  2522.         @rightpaddle_width           = 140
  2523.         @rightpaddle_sprite.zoom_x   = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2524.         @rightpaddle_sprite.x        = @rightpaddle_StartPosX - @rightpaddle_width
  2525.         open_rightpaddleoptions_command_window
  2526.         close_rightpaddle_width_options_command_window
  2527.        
  2528.       #-------------------------------------------------------------------
  2529.       when 7 #160
  2530.       #-------------------------------------------------------------------  
  2531.         Sound.play_decision
  2532.         @rightpaddle_width           = 160
  2533.         @rightpaddle_sprite.zoom_x   = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2534.         @rightpaddle_sprite.x        = @rightpaddle_StartPosX - @rightpaddle_width
  2535.         open_rightpaddleoptions_command_window
  2536.         close_rightpaddle_width_options_command_window
  2537.        
  2538.       #-------------------------------------------------------------------
  2539.       when 8 #180
  2540.       #-------------------------------------------------------------------  
  2541.         Sound.play_decision
  2542.         @rightpaddle_width           = 180
  2543.         @rightpaddle_sprite.zoom_x   = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2544.         @rightpaddle_sprite.x        = @rightpaddle_StartPosX - @rightpaddle_width
  2545.         open_rightpaddleoptions_command_window
  2546.         close_rightpaddle_width_options_command_window
  2547.        
  2548.       #-------------------------------------------------------------------
  2549.       when 9 #200
  2550.       #-------------------------------------------------------------------  
  2551.         Sound.play_decision
  2552.         @rightpaddle_width           = 200
  2553.         @rightpaddle_sprite.zoom_x   = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2554.         @rightpaddle_sprite.x        = @rightpaddle_StartPosX - @rightpaddle_width
  2555.         open_rightpaddleoptions_command_window
  2556.         close_rightpaddle_width_options_command_window
  2557.        
  2558.     #---------------  
  2559.     end # of case
  2560.     #---------------
  2561.    
  2562.   #------------------------------------  
  2563.   end # of if Input.trigger?(Input::C)
  2564.   #------------------------------------
  2565.  
  2566. #======================================================
  2567. end # of function
  2568. #======================================================
  2569.  
  2570.    
  2571.    
  2572. #======================================================
  2573. #    Close Right Paddle Width Options Command Window
  2574. #======================================================
  2575. def close_rightpaddle_width_options_command_window
  2576.   @rightpaddle_width_options_command_window.close
  2577.  
  2578.   begin
  2579.     @rightpaddle_width_options_command_window.update
  2580.     Graphics.update
  2581.   end until @rightpaddle_width_options_command_window.openness == 0
  2582.  
  2583.   @rightpaddle_width_opt_cmmd_wnd_open = false
  2584.  
  2585. end
  2586.  
  2587. #$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
  2588.  
  2589.  
  2590.  
  2591.  
  2592. #==========================================================
  2593. #                       Scene
  2594. #==========================================================
  2595.  
  2596. class Pong_Scene < Scene_Base
  2597.  #========================================================
  2598.  #                      Start
  2599.  #========================================================
  2600.   def start
  2601.     super
  2602.    
  2603.     #------------------------------------------------------------------------------------
  2604.     #     Setup the Values
  2605.     #------------------------------------------------------------------------------------
  2606.     # It's obviously not going to be gameover as soon as the Game Starts, so we're
  2607.     # going to set this value to false.
  2608.     #
  2609.     # @waiting is a boolean variable that tells the ball to wait a little while
  2610.     # before moving. This is also not needed for the start of the game, so it's false
  2611.     #
  2612.     # @iFrameCount is just a value that tells the script how long the ball has been
  2613.     # waiting, which for the beginning of the game is equal to zero.
  2614.     #------------------------------------------------------------------------------------
  2615.     @gameover                   = false
  2616.    
  2617.     @waiting                    = false
  2618.     @iFrameCount                = 0
  2619.    
  2620.     @ballspeedx                 = Pong_Options::Initial_Ball_Speed
  2621.     @ballspeedy                 = Pong_Options::Initial_Ball_Speed
  2622.    
  2623.        
  2624.     @playerOne_Score            = 0
  2625.     @playerTwo_Score            = 0
  2626.    
  2627.     if Pong_Options::Access_Menu == true
  2628.       @cmmd_wnd_open            = true
  2629.       @is_a_cmmd_wnd_open       = true
  2630.     else
  2631.       @is_a_cmmd_wnd_open       = false
  2632.     end
  2633.    
  2634.     @p1score_window_active      = true
  2635.     @p2score_window_active      = true
  2636.    
  2637.     @totalwins_window_active    = false
  2638.     @totallosses_window_active  = false
  2639.    
  2640.    
  2641.     @ball_speed_increase        = Pong_Options::Ball_Speed_Increase
  2642.     @ball_width                 = Pong_Options::Ball_Width
  2643.     @ball_height                = Pong_Options::Ball_Height
  2644.    
  2645.     @leftpaddle_speed           = Pong_Options::Left_Paddle_Speed
  2646.     @leftpaddle_width           = Pong_Options::Left_Paddle_Width
  2647.     @leftpaddle_height          = Pong_Options::Left_Paddle_Height
  2648.    
  2649.     @rightpaddle_speed          = Pong_Options::Right_Paddle_Speed
  2650.     @rightpaddle_width          = Pong_Options::Right_Paddle_Width
  2651.     @rightpaddle_height         = Pong_Options::Right_Paddle_Height
  2652.    
  2653.    
  2654.    
  2655.    
  2656.     #These variables are not necessary, but I like to avoid using
  2657.     #magic numbers, so I asign variables to things where I can.
  2658.     @middleScreenPosX       = ((Pong_Options::Screen_Width)  * 0.5)
  2659.     @middleScreenPosY       = ((Pong_Options::Screen_Height) * 0.5)
  2660.    
  2661.     @leftpaddle_StartPosX   = 10
  2662.     @leftpaddle_StartPosY   = 100
  2663.    
  2664.     @rightpaddle_StartPosX  = 534
  2665.     @rightpaddle_StartPosY  = 336
  2666.    
  2667.    
  2668.     @topScreenBorder        = 1
  2669.     @leftScreenBorder       = 1
  2670.     @rightScreenBorder      = Pong_Options::Screen_Width
  2671.     @bottomScreenBorder     = Pong_Options::Screen_Height
  2672.    
  2673.     #------------------------------------------------------------------------------------
  2674.     #     Play Audio
  2675.     #------------------------------------------------------------------------------------
  2676.     # If the player has opted to allow music to be played. Then save the last BGM &   \/
  2677.     # BGS that were playing and tell the BGS to stop.                                 /\
  2678.     #                                                                                 \/
  2679.     # Once done, play the user selected music, simply using the "Audio/BGM/" string   /\
  2680.     # to tell the script which folder should contain the audio, then add the string   \/
  2681.     # the user defined in the editable region in order to get the name of the audio   /\
  2682.     # file in that folder.                                                            \/
  2683.     #                                                                                 /\
  2684.     # Now you play the audio using the temp_sound as a parameter along with the       \/
  2685.     # volue and pitch that the user defined in the editable region.                   /\
  2686.     #-----------------------------------------------------------------------------------
  2687.     if Pong_Options::Game_Music == true                                              #\/
  2688.                                                                                      #/\
  2689.       @last_bgm         = RPG::BGM::last                                             #\/
  2690.       @last_bgs         = RPG::BGS::last                                             #/\
  2691.                                                                                      #\/
  2692.       RPG::BGS.stop                                                                  #/\
  2693.                                                                                      #\/
  2694.       temp_sound        = "Audio/BGM/" + Pong_Options::Game_BGM                      #/\
  2695.                                                                                      #\/
  2696.       Audio.bgm_play(temp_sound, Pong_Options::BGM_Volume, Pong_Options::BGM_Pitch)  #/\
  2697.                                                                                      #\/
  2698.     end                                                                              #/\
  2699.     #-----------------------------------------------------------------------------------
  2700.    
  2701.    
  2702.    
  2703.     #------------------------------------------------------------------------------------
  2704.     #     Set the Background Image
  2705.     #------------------------------------------------------------------------------------
  2706.     if Pong_Options::Background_Image == true
  2707.      
  2708.       @background_sprite          = Sprite.new
  2709.       @background_sprite.bitmap   = Cache.picture("Pong Images/" + Pong_Options::Background_Sprite)
  2710.       @background_sprite.y        = 0  #Top
  2711.       @background_sprite.x        = 0  #Left corner of the screen
  2712.       @background_sprite.zoom_x   = Pong_Options::Screen_Width.to_f / @background_sprite.bitmap.width
  2713.       @background_sprite.zoom_y   = Pong_Options::Screen_Height.to_f / @background_sprite.bitmap.height
  2714.    
  2715.     end
  2716.    
  2717.    
  2718.    
  2719.     #------------------------------------------------------------------------------------
  2720.     #     Setup the Sprites
  2721.     #------------------------------------------------------------------------------------
  2722.     @leftpaddle_sprite          = Sprite.new
  2723.     @leftpaddle_sprite.bitmap   = Cache.picture("Pong Images/" + Pong_Options::Left_Paddle_Sprite)
  2724.     @leftpaddle_sprite.x        = @leftpaddle_StartPosX
  2725.     @leftpaddle_sprite.y        = @leftpaddle_StartPosY
  2726.     @leftpaddle_sprite.zoom_x   = @leftpaddle_width.to_f / @leftpaddle_sprite.bitmap.width
  2727.     @leftpaddle_sprite.zoom_y   = @leftpaddle_height.to_f / @leftpaddle_sprite.bitmap.height
  2728.    
  2729.    
  2730.     @rightpaddle_sprite         = Sprite.new
  2731.     @rightpaddle_sprite.bitmap  = Cache.picture("Pong Images/" + Pong_Options::Right_Paddle_Sprite)
  2732.     @rightpaddle_sprite.x       = @rightpaddle_StartPosX - @rightpaddle_width
  2733.     @rightpaddle_sprite.y       = @rightpaddle_StartPosY - @rightpaddle_height
  2734.     @rightpaddle_sprite.zoom_x  = @rightpaddle_width.to_f / @rightpaddle_sprite.bitmap.width
  2735.     @rightpaddle_sprite.zoom_y  = @rightpaddle_height.to_f / @rightpaddle_sprite.bitmap.height
  2736.    
  2737.    
  2738.     @ball_sprite                = Sprite.new
  2739.     @ball_sprite.bitmap         = Cache.picture("Pong Images/" + Pong_Options::Ball_Sprite)
  2740.     @ball_sprite.x              = @middleScreenPosX
  2741.     @ball_sprite.y              = @middleScreenPosY
  2742.     @ball_sprite.zoom_x         = @ball_width.to_f / @ball_sprite.bitmap.width
  2743.     @ball_sprite.zoom_y         = @ball_height.to_f / @ball_sprite.bitmap.height
  2744.        
  2745.    
  2746.    
  2747.     #------------------------------------------------------------------------------------
  2748.     #     Setup the Windows
  2749.     #------------------------------------------------------------------------------------    
  2750.     @Pong_P1Score_Window        = Pong_P1Score_Window.new(@playerOne_Score)
  2751.     @Pong_P2Score_Window        = Pong_P2Score_Window.new(@playerTwo_Score)
  2752.    
  2753.    
  2754.    
  2755.     if Pong_Options::Set_Win_Counter == true
  2756.       @pong_P1TotalWinsScore_Window = Pong_P1TotalWinsScore_Window.new
  2757.       @totalwins_window_active = true
  2758.     end
  2759.    
  2760.     if Pong_Options::Set_Loss_Counter == true
  2761.       @pong_P1TotalLossesScore_Window = Pong_P1TotalLossesScore_Window.new
  2762.       @totallosses_window_active = true
  2763.     end
  2764.    
  2765.     #--------------------------------
  2766.     #   Command Window
  2767.     #--------------------------------    
  2768.     create_command_window #call the create_command_window function
  2769.    
  2770.     create_options_command_window
  2771.    
  2772.     create_scoreboardoptions_command_window
  2773.    
  2774.     create_balloptions_command_window
  2775.     create_ball_sp_incr_options_command_window
  2776.     create_ball_height_options_command_window
  2777.     create_ball_width_options_command_window
  2778.    
  2779.     create_leftpaddleoptions_command_window
  2780.     create_leftpaddle_sp_incr_options_command_window
  2781.     create_leftpaddle_height_options_command_window
  2782.     create_leftpaddle_width_options_command_window
  2783.    
  2784.     create_rightpaddleoptions_command_window
  2785.     create_rightpaddle_sp_incr_options_command_window
  2786.     create_rightpaddle_height_options_command_window
  2787.     create_rightpaddle_width_options_command_window
  2788.    
  2789.   #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2790.   end # of Start Function           ////                   ||
  2791.   #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2792.  
  2793.  
  2794.  #========================================================
  2795.  #                      Post Start
  2796.  #========================================================
  2797.   def post_start
  2798.     super
  2799.     #call the open_command_window function
  2800.     open_command_window unless Pong_Options::Access_Menu == false
  2801.   end
  2802.  
  2803.  
  2804.  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  2805.  #                      Update
  2806.  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2807.   def update
  2808.     super    
  2809.    
  2810.     #===================================================
  2811.     #                Update Command Windows
  2812.     #===================================================
  2813.     if @cmmd_wnd_open == true     #if a command window is open
  2814.       @is_a_cmmd_wnd_open = true  #set the boolean to true
  2815.       @command_window.update      #update the command window
  2816.       process_command_window      #process the events for the command window
  2817.    
  2818.     elsif @opt_cmmd_wnd_open == true
  2819.       @is_a_cmmd_wnd_open = true
  2820.       @options_command_window.update
  2821.       process_options_command_window
  2822.      
  2823.     elsif @sb_opt_cmmd_wnd_open == true
  2824.       @is_a_cmmd_wnd_open = true
  2825.       @sb_options_command_window.update
  2826.       process_scoreboardoptions_command_window
  2827.    
  2828.     elsif @ball_opt_cmmd_wnd_open == true
  2829.       @is_a_cmmd_wnd_open = true
  2830.       @ball_options_command_window.update
  2831.       process_balloptions_command_window
  2832.      
  2833.     elsif @ball_si_opt_cmmd_wnd_open == true
  2834.       @is_a_cmmd_wnd_open = true
  2835.       @ball_sp_incr_options_command_window.update
  2836.       process_ball_sp_incr_options_command_window
  2837.      
  2838.     elsif @ball_height_opt_cmmd_wnd_open == true
  2839.       @is_a_cmmd_wnd_open = true
  2840.       @ball_height_options_command_window.update
  2841.       process_ball_height_options_command_window
  2842.      
  2843.     elsif @ball_width_opt_cmmd_wnd_open == true
  2844.       @is_a_cmmd_wnd_open = true
  2845.       @ball_width_options_command_window.update
  2846.       process_ball_width_options_command_window
  2847.    
  2848.     elsif @leftpaddle_opt_cmmd_wnd_open == true
  2849.       @is_a_cmmd_wnd_open = true
  2850.       @leftpaddle_options_command_window.update
  2851.       process_leftpaddleoptions_command_window
  2852.      
  2853.     elsif @leftpaddle_si_opt_cmmd_wnd_open == true
  2854.       @is_a_cmmd_wnd_open = true
  2855.       @leftpaddle_sp_incr_options_command_window.update
  2856.       process_leftpaddle_sp_incr_options_command_window
  2857.      
  2858.     elsif @leftpaddle_height_opt_cmmd_wnd_open == true
  2859.       @is_a_cmmd_wnd_open = true
  2860.       @leftpaddle_height_options_command_window.update
  2861.       process_leftpaddle_height_options_command_window
  2862.      
  2863.     elsif @leftpaddle_width_opt_cmmd_wnd_open == true
  2864.       @is_a_cmmd_wnd_open = true
  2865.       @leftpaddle_width_options_command_window.update
  2866.       process_leftpaddle_width_options_command_window
  2867.      
  2868.     elsif @rightpaddle_opt_cmmd_wnd_open == true
  2869.       @is_a_cmmd_wnd_open = true
  2870.       @rightpaddle_options_command_window.update
  2871.       process_rightpaddleoptions_command_window
  2872.      
  2873.     elsif @rightpaddle_si_opt_cmmd_wnd_open == true
  2874.       @is_a_cmmd_wnd_open = true
  2875.       @rightpaddle_sp_incr_options_command_window.update
  2876.       process_rightpaddle_sp_incr_options_command_window
  2877.      
  2878.     elsif @rightpaddle_height_opt_cmmd_wnd_open == true
  2879.       @is_a_cmmd_wnd_open = true
  2880.       @rightpaddle_height_options_command_window.update
  2881.       process_rightpaddle_height_options_command_window
  2882.      
  2883.     elsif @rightpaddle_width_opt_cmmd_wnd_open == true
  2884.       @is_a_cmmd_wnd_open = true
  2885.       @rightpaddle_width_options_command_window.update
  2886.       process_rightpaddle_width_options_command_window
  2887.      
  2888.     else #No command window is open
  2889.       @is_a_cmmd_wnd_open = false
  2890.      
  2891.   #----------------------------------  
  2892.   end # if statement
  2893.   #----------------------------------
  2894.    
  2895.    #======================================================
  2896.    #                   Update Windows
  2897.    #======================================================      
  2898.     if @p1score_window_active == true
  2899.       @Pong_P1Score_Window.update(@playerOne_Score)
  2900.     end
  2901.    
  2902.     if @p2score_window_active == true
  2903.       @Pong_P2Score_Window.update(@playerTwo_Score)
  2904.     end
  2905.        
  2906.     if @totalwins_window_active == true
  2907.       @pong_P1TotalWinsScore_Window.update
  2908.     end
  2909.    
  2910.     if @totallosses_window_active == true
  2911.       @pong_P1TotalLossesScore_Window.update
  2912.     end
  2913.    
  2914.    
  2915.     if @is_a_cmmd_wnd_open == false #Don't update the game if a command window is open
  2916.       #======================================================
  2917.       #                   Game Over
  2918.       #======================================================
  2919.       if @gameover == true
  2920.         if Input.trigger?(Input::C)
  2921.           process_pong_reset
  2922.         end
  2923.       end
  2924.      
  2925.       #---------------------------------------------------
  2926.       # If the game is not over yet and either player one
  2927.       # or player two has scored six points, then create
  2928.       # a new window showing who the winner is and set the
  2929.       # gameover boolean to true (which stops the game)
  2930.       #---------------------------------------------------
  2931.       if @gameover == false && ((@playerOne_Score == Pong_Options::Points_To_Win) || (@playerTwo_Score == Pong_Options::Points_To_Win))
  2932.         @Pong_Winner_Window = Pong_Winner_Window.new(@playerOne_Score)        
  2933.         if @totalwins_window_active == true
  2934.           @pong_P1TotalWinsScore_Window.dispose
  2935.           @pong_P1TotalWinsScore_Window = Pong_P1TotalWinsScore_Window.new
  2936.         end      
  2937.         if @totallosses_window_active == true
  2938.           @pong_P1TotalLossesScore_Window.dispose
  2939.           @pong_P1TotalLossesScore_Window = Pong_P1TotalLossesScore_Window.new
  2940.         end
  2941.         @gameover = true
  2942.       end
  2943.      
  2944.      
  2945.       if @gameover == false # Don't do anything for the game if it is gameover
  2946.       #======================================================
  2947.       #                   Start the round
  2948.       #======================================================
  2949.         if @waiting == true
  2950.           @iFrameCount += 1
  2951.           if @iFrameCount > Pong_Options::Frame_Wait_Amount
  2952.             @waiting = false
  2953.             @iFrameCount = 0
  2954.           end
  2955.          
  2956.           #roll a random variable out of fifty, and if the result
  2957.           #is less than 25, invert the direction of the balls Y
  2958.           if rand(50) + 1 < 25
  2959.             @ballspeedy *= -1
  2960.           end
  2961.           #this keeps the game a little more random rather than linear
  2962.        
  2963.       #-----------------------------  
  2964.       end # of if @waiting == true
  2965.       #-----------------------------
  2966.        
  2967.            
  2968.       #======================================================
  2969.       #                    Move the Ball
  2970.       #======================================================
  2971.         if @waiting == false
  2972.           @ball_sprite.x    += @ballspeedx
  2973.           @ball_sprite.y    += @ballspeedy
  2974.         end
  2975.      
  2976.         #if the ball has hit the right wall
  2977.         if @ball_sprite.x   >= @rightScreenBorder
  2978.           @ball_sprite.x     = @middleScreenPosX - (@ball_width * 0.5)
  2979.           @ball_sprite.y     = @middleScreenPosY - (@ball_height * 0.5)
  2980.           @ballspeedx        = -(Pong_Options::Initial_Ball_Speed)
  2981.           @playerOne_Score  += 1
  2982.           @waiting           = true
  2983.         end
  2984.        
  2985.         #if the ball has hit the left wall
  2986.         if @ball_sprite.x   <= @leftScreenBorder
  2987.           @ball_sprite.x     = @middleScreenPosX - (@ball_width * 0.5)
  2988.           @ball_sprite.y     = @middleScreenPosY - (@ball_height * 0.5)
  2989.           @ballspeedx        = (Pong_Options::Initial_Ball_Speed)
  2990.           @playerTwo_Score  += 1
  2991.           @waiting = true
  2992.         end
  2993.          
  2994.       #======================================================
  2995.       #                    Controls
  2996.       #======================================================  
  2997.         if Input.press?(Input::UP) && @leftpaddle_sprite.y > @topScreenBorder
  2998.           @leftpaddle_sprite.y -= @leftpaddle_speed
  2999.         end
  3000.        
  3001.         if Input.press?(Input::DOWN) && (@leftpaddle_sprite.y + @leftpaddle_height) < @bottomScreenBorder
  3002.           @leftpaddle_sprite.y += @leftpaddle_speed
  3003.         end
  3004.        
  3005.       #======================================================
  3006.       #                  Add Collision
  3007.       #======================================================
  3008.       #------------------------------------------------------
  3009.       # ( *= -1 ) Inverts the speed of the ball, making a
  3010.       # positive number turn into a negative number or vice-versa.
  3011.       #------------------------------------------------------
  3012.         if @ball_sprite.y + @ball_height >= @bottomScreenBorder
  3013.           @ballspeedy *= -1
  3014.         end
  3015.         if @ball_sprite.y <= @topScreenBorder
  3016.           @ballspeedy *= -1
  3017.         end
  3018.        
  3019.        
  3020.        
  3021.         #If the ball comes into direct contact with the left paddle.      
  3022.         if (@leftpaddle_sprite.x + @leftpaddle_width  > @ball_sprite.x) &&
  3023.            (@leftpaddle_sprite.x < @ball_sprite.x     + @ball_width)    &&
  3024.            (@leftpaddle_sprite.y + @leftpaddle_height > @ball_sprite.y) &&
  3025.            (@leftpaddle_sprite.y < @ball_sprite.y     + @ball_height)
  3026.        
  3027.               #Invert the ball speed and increase the current ball speed.
  3028.               @ballspeedx *= -1
  3029.               @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.
  3030.               @ballspeedx += @ball_speed_increase
  3031.         end
  3032.        
  3033.        
  3034.         #If the ball comes into direct contact with the right paddle.
  3035.         if (@rightpaddle_sprite.x + @rightpaddle_width  > @ball_sprite.x) &&
  3036.            (@rightpaddle_sprite.x < @ball_sprite.x      + @ball_width)    &&
  3037.            (@rightpaddle_sprite.y + @rightpaddle_height > @ball_sprite.y) &&
  3038.            (@rightpaddle_sprite.y < @ball_sprite.y      + @ball_height)
  3039.            
  3040.            #Invert the ball speed and increase the current ball speed.
  3041.             @ballspeedx *= -1
  3042.             @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.
  3043.             @ballspeedx -= @ball_speed_increase
  3044.         end
  3045.          
  3046.       #======================================================
  3047.       #                       A.I
  3048.       #======================================================
  3049.       #------------------------------------------------------
  3050.       # I am using ( * 0.5 ) instead of ( / 2 ), they are basically
  3051.       # the same thing, but multiplying is more efficient than
  3052.       # dividing when it comes to computers doing math functions.
  3053.       #------------------------------------------------------
  3054.      
  3055.         #if the ball is heading towards the AI
  3056.         if @ball_sprite.x + @ball_width > @middleScreenPosY
  3057.          
  3058.           #the AI will try to keep its center focused on the balls path
  3059.           if (@rightpaddle_sprite.y + (@rightpaddle_height * 0.5)) > @ball_sprite.y + (@ball_height * 0.5) && @rightpaddle_sprite.y > @topScreenBorder
  3060.             @rightpaddle_sprite.y -= @rightpaddle_speed
  3061.           end
  3062.          
  3063.           if (@rightpaddle_sprite.y + (@rightpaddle_height * 0.5)) < @ball_sprite.y + (@ball_height * 0.5) && (@rightpaddle_sprite.y + @rightpaddle_height) < @bottomScreenBorder
  3064.             @rightpaddle_sprite.y += @rightpaddle_speed
  3065.           end
  3066.         end
  3067.        
  3068.         #if the ball is heading away from the right paddle.
  3069.         #the AI will try to move back to the center of the screen.
  3070.         if @ballspeedx < 1 && @rightpaddle_sprite.y < @middleScreenPosY
  3071.           @rightpaddle_sprite.y += 1
  3072.         end
  3073.         if @ballspeedx < 1 && @rightpaddle_sprite.y > @middleScreenPosY
  3074.           @rightpaddle_sprite.y -= 1
  3075.         end
  3076.      
  3077.        
  3078.       #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3079.       end # if @gameover == false       ////                   ||
  3080.       #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3081.      
  3082.      
  3083.      
  3084.      
  3085.       #======================================================
  3086.       #   Open Command Window   or    Return to Map                
  3087.       #======================================================
  3088.       if Input.trigger?(Input::B)                    
  3089.         if Pong_Options::Access_Menu == true
  3090.           open_command_window  
  3091.         else
  3092.           $scene = Scene_Map.new
  3093.         end
  3094.       end                                            
  3095.      
  3096.      
  3097.      
  3098.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3099.     end # if @is_a_cmmd_wnd_open == false     ////           ||
  3100.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=    
  3101.        
  3102.   #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3103.   end # of Update Function          ////                   ||
  3104.   #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3105.  
  3106.  
  3107.  
  3108.  
  3109.  
  3110.  
  3111.  
  3112.  
  3113.  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3114.  #                Terminate
  3115.  #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3116.   def terminate
  3117.        
  3118.     #=============================================
  3119.     #           Dispose Windows
  3120.     #=============================================
  3121.     if @gameover == true
  3122.       @Pong_Winner_Window.dispose
  3123.     end
  3124.              
  3125.     if @totalwins_window_active == true
  3126.       @pong_P1TotalWinsScore_Window.dispose
  3127.     end
  3128.    
  3129.     if @totallosses_window_active == true
  3130.       @pong_P1TotalLossesScore_Window.dispose
  3131.     end
  3132.    
  3133.     if @p1score_window_active == true
  3134.       @Pong_P1Score_Window.dispose
  3135.     end
  3136.    
  3137.     if @p2score_window_active == true
  3138.       @Pong_P2Score_Window.dispose
  3139.     end
  3140.    
  3141.    
  3142.     #=============================================
  3143.     #           Dispose Sprites
  3144.     #=============================================
  3145.     if Pong_Options::Background_Image == true
  3146.       @background_sprite.dispose
  3147.     end
  3148.    
  3149.     @leftpaddle_sprite.dispose
  3150.     @rightpaddle_sprite.dispose
  3151.     @ball_sprite.dispose
  3152.    
  3153.    
  3154.     #=============================================
  3155.     #         Dispose Command Windows
  3156.     #=============================================
  3157.     @command_window.dispose
  3158.    
  3159.     @options_command_window.dispose
  3160.    
  3161.     @sb_options_command_window.dispose
  3162.    
  3163.     @ball_options_command_window.dispose
  3164.     @ball_sp_incr_options_command_window.dispose
  3165.     @ball_height_options_command_window.dispose
  3166.     @ball_width_options_command_window.dispose
  3167.    
  3168.     @leftpaddle_options_command_window.dispose
  3169.     @leftpaddle_sp_incr_options_command_window.dispose
  3170.     @leftpaddle_height_options_command_window.dispose
  3171.     @leftpaddle_width_options_command_window.dispose
  3172.    
  3173.     @rightpaddle_options_command_window.dispose
  3174.     @rightpaddle_sp_incr_options_command_window.dispose
  3175.     @rightpaddle_height_options_command_window.dispose
  3176.     @rightpaddle_width_options_command_window.dispose
  3177.    
  3178.    
  3179.     #=============================================
  3180.     #           Play Map Music & BGS
  3181.     #=============================================
  3182.     if Pong_Options::Game_Music == true
  3183.       @last_bgm.play
  3184.       @last_bgs.play
  3185.     end
  3186.    
  3187.   #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3188.   end # of Terminate Function       ////                   ||
  3189.   #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  
  3190.  
  3191.  
  3192. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3193. end # of Pong_Scene                 ////                   ||
  3194. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  3195.  
  3196.  
  3197. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  3198. #                                                        -=
  3199. #                 End of Script          ////            ==
  3200. #                                                        =-
  3201. #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement