If this value ever gets wildly large in either direction, the game will appear to have frozen at the start of gameplay until a few seconds have passed. This value shouldn't realistically get larger then 1000 but due to some reason mine reached -120000.
This isn't a number that the user can easily change and can only be reset by fully resetting the settings which isn't obvious.
By clamping the value within 5000, while still high, can correct previously extreme values in a reasonable amount of time if it's garbage values.
This also moves the Stage & Keyboard addEventListeners after the rest Gameplay init.
If this value ever gets wildly large in either direction, the game will appear to have frozen at the start of gameplay until a few seconds have passed. This value shouldn't realistically get larger then 1000 but due to some reason mine reached -120000.
This isn't a number that the user can easily change and can only be reset by fully resetting the settings which isn't obvious.
By clamping the value within 5000, while still high, can correct previously extreme values in a reasonable amount of time if it's garbage values.
This also moves the Stage & Keyboard addEventListeners after the rest Gameplay init.