If the player press F12 during a transition the transition will reset and start again.
If F12 is kept pressed the game will feel like it has been paused. The FPS registered will typically be registered as higher although game playing will not change. Nor will it if it's Graphics.update being cancelled. The shown timer will however run faster.
Here is a snippet where it feels like the game simply pauses when pressing F12, if that is what one prefer:
If F12 is kept pressed the game will feel like it has been paused. The FPS registered will typically be registered as higher although game playing will not change. Nor will it if it's Graphics.update being cancelled. The shown timer will however run faster.
Here is a snippet where it feels like the game simply pauses when pressing F12, if that is what one prefer:
Code:
#=============================================================================
# ** Reset class (because it won't be defined until F12 is pressed otherwise)
#=============================================================================
class Reset < Exception
end
#=============================================================================
# ** Module Graphics
#=============================================================================
module Graphics
class << self
#-------------------------------------------------------------------------
# * Aliases Graphics.update and Graphics.transition
#-------------------------------------------------------------------------
unless self.method_defined?(:zeriab_f12_removal_update)
alias_method(:zeriab_f12_removal_update, :update)
alias_method(:zeriab_f12_removal_transition, :transition)
end
def update(*args)
done = false
# Keep trying to do the update
while !done
begin
zeriab_f12_removal_update(*args)
done = true
rescue Reset
# Do nothing
end
end
end
def transition(*args)
done = false
# Keep trying to do the transition
while !done
begin
zeriab_f12_removal_transition(*args)
done = true
rescue Reset
# Do nothing
end
end
end
end
end