Game resumes previous speed after load.
This commit is contained in:
parent
4519417b4e
commit
30add82f6a
@ -12,8 +12,8 @@ import (
|
|||||||
"opslag.de/schobers/zntg/play"
|
"opslag.de/schobers/zntg/play"
|
||||||
"opslag.de/schobers/zntg/ui"
|
"opslag.de/schobers/zntg/ui"
|
||||||
|
|
||||||
// _ "opslag.de/schobers/zntg/sdlui" // rendering backend
|
_ "opslag.de/schobers/zntg/sdlui" // rendering backend
|
||||||
_ "opslag.de/schobers/zntg/allg5ui" // rendering backend
|
// _ "opslag.de/schobers/zntg/allg5ui" // rendering backend
|
||||||
|
|
||||||
rice "github.com/GeertJohan/go.rice"
|
rice "github.com/GeertJohan/go.rice"
|
||||||
"github.com/veandco/go-sdl2/sdl"
|
"github.com/veandco/go-sdl2/sdl"
|
||||||
|
1
game.go
1
game.go
@ -163,6 +163,7 @@ func (g *Game) Load(ctx ui.Context) {
|
|||||||
}
|
}
|
||||||
g.Terrain.Center = state.View.Center
|
g.Terrain.Center = state.View.Center
|
||||||
g.centerChanged.Notify(ctx, g.Terrain.Center)
|
g.centerChanged.Notify(ctx, g.Terrain.Center)
|
||||||
|
g.setSpeed(ctx, state.Speed)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (g *Game) Pause(ctx ui.Context) { g.setSpeed(ctx, GameSpeedPaused) }
|
func (g *Game) Pause(ctx ui.Context) { g.setSpeed(ctx, GameSpeedPaused) }
|
||||||
|
Loading…
Reference in New Issue
Block a user