Pause, Slow Speed, Normal Speed and Fast Speed Buttons?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By dfoxworks
:warning: Old Version Published before Godot 3 was released.


I want to add some time functions to my game. Like the speed options in games like Project Highrise and Oxygen Not Included:

PAUSE (SpaceBar)
Slow Speed (key 1)
Normal Speed (key 2)
Fast Speed (key 3)

The only way I can think of to speed up and slow down all the animations and maybe the timers is add a global variable that changes all the delta codes like:

“delta * Global.current_speed”

I’m not too satisfied with this way because I have to go back to all the code I did and bugs might appear. Any ideas?

Also how can I add a pause function?


:bust_in_silhouette: Reply From: Jackain

This is for pause mode:

This is for altering time scale: