You're talking about this script, right?
So the idea is you're allowing the player to customize the SMOOTH_FACTOR through your game's options scene.
While there isn't anything inherently wrong with using a global here, you could've just done the script call
Code:
LiTTleDRAgo::SMOOTH_FACTOR = X
because (at least in 1.8) Ruby will allow you to modify constants during run-time.
The issue though is that your options aren't being saved. They will reset as soon as the player starts up the game again. A common solution is to add an attribute to Game_System, which is saved when the player saves their game.
Code:
class Game_System
attr_accessor :camera_smoothing
alias init_for_camera_smoothing initialize
def initialize
init_for_camera_smoothing
@camera_smoothing = 16
end
end
Now you just do
$game_system.camera_smoothing = X
. You also want to update the line in Drago's script to look like
Code:
sf = $game_system.camera_smoothing.to_f
Yes, the to_f is quite important for better smoothing.