Optimizations and debug options

This commit is contained in:
2025-11-25 01:06:35 -07:00
parent 57d08f2f04
commit c84ba37353
13 changed files with 377 additions and 212 deletions

View File

@@ -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
}