From 30add82f6a33600d804308dc31519cfff1f7b86f Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Sat, 23 May 2020 10:18:37 +0200 Subject: [PATCH] Game resumes previous speed after load. --- cmd/tins2020/tins2020.go | 4 ++-- game.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/tins2020/tins2020.go b/cmd/tins2020/tins2020.go index e7f2364..759b133 100644 --- a/cmd/tins2020/tins2020.go +++ b/cmd/tins2020/tins2020.go @@ -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" diff --git a/game.go b/game.go index 18c132e..a8dc2ee 100644 --- a/game.go +++ b/game.go @@ -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) }