Advertisement
LiTTleDRAgo

[RGSS] Stop All Movement

Apr 22nd, 2012
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.85 KB | None | 0 0
  1. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  2. # Stop All Movement
  3. # Version: 1.00
  4. # Author : LiTTleDRAgo
  5. #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  6. #
  7. # Explanation :
  8. #   This script can stop all movements just by flipping the switch
  9. #
  10. # To Stop Player movement just turn on switch 1 (default)
  11. # And to stop All Events movement, turn on switch 2 (default)
  12. #=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
  13. #==============================================================================
  14. # ** Game_Player / Game_Event
  15. #------------------------------------------------------------------------------
  16. # This class handles the player and events. It's used within the Game_Map class.
  17. # Refer to "$game_player" and "$game_events" for the one instance of this class.
  18. #==============================================================================
  19.  
  20. (0...2).each {|i| eval "
  21. class #{['Game_Player','Game_Event'][i]} < Game_Character
  22.  #--------------------------------------------------------------------------
  23.  # * Constant Variables
  24.  #--------------------------------------------------------------------------
  25.  STOP_PLAYER_SWITCH = 1
  26.  STOP_EVENT_SWITCH = 2
  27.  #--------------------------------------------------------------------------
  28.  # * Alias Listing
  29.  #--------------------------------------------------------------------------
  30.  alias_method :drg127_upd, :update
  31.  #--------------------------------------------------------------------------
  32.  # * Frame Update
  33.  #--------------------------------------------------------------------------
  34.  def update
  35.    if self.is_a?(Game_Player)
  36.      return super if $game_switches[STOP_PLAYER_SWITCH] && Input.dir8
  37.    else
  38.      return if $game_switches[STOP_EVENT_SWITCH]
  39.    end
  40.    drg127_upd
  41.  end
  42. end#"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement