Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # • Move Screen
- #==============================================================================
- # Author: Dax
- # Requirements: Dax Core
- # Version: 1.1
- # Site: www.dax-soft.weebly.com
- #==============================================================================
- # • Descrição:
- #------------------------------------------------------------------------------
- # Move the screen when is press the key Q(optional), the screen is moved according
- # with the arrow keys(optional).
- #==============================================================================
- Dax.register(:move_screen, "Dax", 1.1) {
- #==============================================================================
- # • Módulo de configuração.
- #==============================================================================
- module MoveScreen
- #----------------------------------------------------------------------------
- # • Setup
- #----------------------------------------------------------------------------
- KeySwitche = :Q # Key to the press.
- # You can turn off the script, just torn on the switch that you define.
- IdSwitche = 1
- Keys = [ # Keys that will move the screen.
- :UP, :LEFT, :RIGHT, :DOWN,
- ]
- Distance = 1 # Distance travaled
- Speed = 3 # Speed
- Directions = [8, 4, 6, 2] # Direction
- end
- #==============================================================================
- # • Game_Player
- #==============================================================================
- class Game_Player
- #----------------------------------------------------------------------------
- # • Processamento de movimento através de pressionar tecla
- #----------------------------------------------------------------------------
- alias :moveScreen_move_by_input :move_by_input
- def move_by_input(*args, &block)
- return if $game_map.moveScreen
- moveScreen_move_by_input(*args, &block)
- end
- end
- #==============================================================================
- # • Game_Map
- #==============================================================================
- class Game_Map
- #----------------------------------------------------------------------------
- # • Mover a tela.
- #----------------------------------------------------------------------------
- def moveScreen
- return if $game_switches[MoveScreen::IdSwitche]
- press?(MoveScreen::KeySwitche) {
- MoveScreen::Keys.each_with_index { |keys, id|
- press?(keys) { self.start_scroll(MoveScreen::Directions[id], MoveScreen::Distance, MoveScreen::Speed) }
- }
- return true
- }
- return false
- end
- #----------------------------------------------------------------------------
- # • Processo de atualização.
- #----------------------------------------------------------------------------
- alias :movescreen_update :update
- def update(*args, &block)
- movescreen_update(*args, &block)
- self.moveScreen
- end
- end
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement