Advertisement
Archeia

https://forums.rpgmakerweb.com/index.php?threads/scrolling-b

Jul 2nd, 2020
1,569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 4.38 KB | None | 0 0
  1. #==============================================================================
  2. #** NS
  3. #==============================================================================
  4. class NS;
  5. end #NS
  6.  
  7. #==============================================================================
  8. # ** NS::Battle_Plane
  9. #==============================================================================
  10. class NS::Battle_Plane      
  11.     # Switch to Enable Scrolling Background    
  12.     Enable_Switch    = 15        
  13.     # Variables for Horizontal and Vertical Scroll Speed    
  14.     Back1_X_Variable = 10    
  15.     Back1_Y_Variable = 11    
  16.     Back2_X_Variable = 12    
  17.     Back2_Y_Variable = 13    
  18. end # NS::Battle_Plane
  19.  
  20.  
  21. #==============================================================================
  22. #** Spriteset_Battle
  23. #==============================================================================
  24. class Spriteset_Battle  
  25.  
  26.     #--------------------------------------------------------------------------  
  27.     #* Create Battle Background (Floor) Sprite  
  28.     #--------------------------------------------------------------------------  
  29.     unless method_defined?(:battleback_C42W53GD_sb_create_battleback1)    
  30.         alias_method(:battleback_C42W53GD_sb_create_battleback1, :create_battleback1)
  31.     end    
  32.  
  33.     def create_battleback1(*args, &block)    
  34.         if $game_switches[NS::Battle_Plane::Enable_Switch] == true    
  35.             @back1_sprite = Plane.new(@viewport1)      
  36.             @back1_sprite.bitmap = battleback1_bitmap    
  37.             @back1_sprite.z  = 0            @back1_sprite_ox = 0  
  38.             @back1_sprite_oy = 0    
  39.         else    
  40.             battleback_C42W53GD_sb_create_battleback1(*args, &block)  
  41.         end  
  42.     end  
  43.  
  44.   #--------------------------------------------------------------------------  
  45.   # * Create Battle Background (Wall) Sprite  
  46.   #--------------------------------------------------------------------------  
  47.     unless method_defined?(:battleback_ms67JgWE_sb_create_battleback2)    
  48.         alias_method(:battleback_ms67JgWE_sb_create_battleback2, :create_battleback2)  
  49.     end    
  50.  
  51.     def create_battleback2(*args, &block)  
  52.         if $game_switches[NS::Battle_Plane::Enable_Switch] == true    
  53.             @back2_sprite = Plane.new(@viewport1)      
  54.             @back2_sprite.bitmap = battleback2_bitmap      
  55.             @back2_sprite.z = 1      @back2_sprite_ox = 0    
  56.             @back2_sprite_oy = 0    
  57.         else      
  58.             battleback_ms67JgWE_sb_create_battleback2(*args, &block)  
  59.         end  
  60.      end  
  61.   #--------------------------------------------------------------------------
  62.   #* Update Battle Background (Floor) Sprite  
  63.   #--------------------------------------------------------------------------  
  64.     unless method_defined?(:battleback_HNirC0QE_sb_update_battleback1)    
  65.      alias_method(:battleback_HNirC0QE_sb_update_battleback1, :update_battleback1)
  66.     end    
  67.  
  68.     def update_battleback1(*args, &block)  
  69.         if $game_switches[NS::Battle_Plane::Enable_Switch] == true    
  70.             @back1_sprite_ox += $game_variables[NS::Battle_Plane::Back1_X_Variable].to_f / 64
  71.             @back1_sprite_oy += $game_variables[NS::Battle_Plane::Back1_Y_Variable].to_f / 64
  72.             @back1_sprite.ox = @back1_sprite_ox * 16      @back1_sprite.oy = @back1_sprite_oy * 16  
  73.         else      
  74.             battleback_HNirC0QE_sb_update_battleback1(*args, &block)  
  75.         end  
  76.     end  
  77.    
  78.     #--------------------------------------------------------------------------  
  79.     # * Update Battle Background (Wall) Sprite  
  80.     #--------------------------------------------------------------------------
  81.     unless method_defined?(:battleback_zmrQkMCU_sb_update_battleback2)  
  82.         alias_method(:battleback_zmrQkMCU_sb_update_battleback2, :update_battleback2)
  83.     end  
  84.    
  85.     def update_battleback2(*args, &block)    
  86.         if $game_switches[NS::Battle_Plane::Enable_Switch] == true    
  87.             @back2_sprite_ox += $game_variables[NS::Battle_Plane::Back2_X_Variable].to_f / 64  
  88.             @back2_sprite_oy += $game_variables[NS::Battle_Plane::Back2_Y_Variable].to_f / 64  
  89.             @back2_sprite.ox = @back2_sprite_ox * 16      @back2_sprite.oy = @back2_sprite_oy * 16  
  90.         else      
  91.             battleback_zmrQkMCU_sb_update_battleback2(*args, &block)
  92.         end  
  93.     end
  94.  
  95. end # Spriteset_Battle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement