Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- # http://dekitarpg.wordpress.com/
- #===============================================================================
- #
- # Easily change the default FPS (frames per second) for your game, also allows
- # a slow key && a fast key, press to speed up the FPS (only for $TEST / $BTEST).
- # Requires $D13x Core to use Fast / Slow key functions.
- #
- #===============================================================================
- module FPS_Set
- #===============================================================================
- Use = true # Make false to disable snippet
- Fps = {
- :default => 60, # Default FPS (Vx Ace Default is 60)
- :slow => [:LSHIFT, 30], # Slow FPS => [ :key , fps ]
- :fast => [:L_CTRL, 120], # Fast FPS => [ :key , fps ]
- } # << Keep
- end
- #===============================================================================
- module Graphics
- #===============================================================================
- if FPS_Set::Use
- #---------------------------------------------------------------------------
- # Alias List
- #---------------------------------------------------------------------------
- class << self
- alias :update_fps :update
- end
- #---------------------------------------------------------------------------
- # Update
- #---------------------------------------------------------------------------
- def self.update
- update_fps
- update_de_fps
- end
- #---------------------------------------------------------------------------
- # Update FPS
- #---------------------------------------------------------------------------
- def self.update_de_fps
- if ($TEST || $BTEST) && $D13x[:CORE]
- if Keys.press?(Keys::Key[FPS_Set::Fps[:slow][0]])
- return unless self.frame_rate != FPS_Set::Fps[:slow][1]
- return self.frame_rate = FPS_Set::Fps[:slow][1]
- end
- if Keys.press?(Keys::Key[FPS_Set::Fps[:fast][0]])
- return unless self.frame_rate != FPS_Set::Fps[:fast][1]
- return self.frame_rate = FPS_Set::Fps[:fast][1]
- end
- end
- return unless self.frame_rate != FPS_Set::Fps[:default]
- return self.frame_rate = FPS_Set::Fps[:default]
- end
- end # << if FPS::Use
- end # << module Graphics
- #===============================================================================
- # http://dekitarpg.wordpress.com/
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement