Game resumes previous speed after load.

This commit is contained in:
Sander Schobers 2020-05-23 10:18:37 +02:00
parent 4519417b4e
commit 30add82f6a
2 changed files with 3 additions and 2 deletions

View File

@ -12,8 +12,8 @@ import (
"opslag.de/schobers/zntg/play"
"opslag.de/schobers/zntg/ui"
// _ "opslag.de/schobers/zntg/sdlui" // rendering backend
_ "opslag.de/schobers/zntg/allg5ui" // rendering backend
_ "opslag.de/schobers/zntg/sdlui" // rendering backend
// _ "opslag.de/schobers/zntg/allg5ui" // rendering backend
rice "github.com/GeertJohan/go.rice"
"github.com/veandco/go-sdl2/sdl"

View File

@ -163,6 +163,7 @@ func (g *Game) Load(ctx ui.Context) {
}
g.Terrain.Center = state.View.Center
g.centerChanged.Notify(ctx, g.Terrain.Center)
g.setSpeed(ctx, state.Speed)
}
func (g *Game) Pause(ctx ui.Context) { g.setSpeed(ctx, GameSpeedPaused) }