Optimizations and debug options
This commit is contained in:
@@ -273,6 +273,16 @@ func (g *Game) updatePlaying() error {
|
||||
delta := now.Sub(g.state.lastTick)
|
||||
g.state.lastTick = now
|
||||
|
||||
maxDelta := 100 * time.Millisecond
|
||||
if delta > maxDelta {
|
||||
delta = maxDelta
|
||||
}
|
||||
|
||||
minDelta := time.Microsecond
|
||||
if delta < minDelta {
|
||||
delta = minDelta
|
||||
}
|
||||
|
||||
input := readControls()
|
||||
g.state.gameplayScreen.Update(screens.GameplayInput{
|
||||
Left: input.Left,
|
||||
@@ -284,7 +294,6 @@ func (g *Game) updatePlaying() error {
|
||||
|
||||
if now.Sub(g.state.lastAutoSave) >= g.state.autoSaveInterval {
|
||||
g.saveGame()
|
||||
g.state.gameplayScreen.ShowSaveNotification()
|
||||
g.state.lastAutoSave = now
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user