diff --git a/TODO.md b/TODO.md index ef45c03..f43c00e 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1 @@ - add all other options like size etc - -- changing options mid-game has no effect in most cases, even after a restart - -- initial zoom pos doesnt work for small grids - -- fix generation count: starts even when delayedstart is on or on restart diff --git a/config.go b/config.go index 0a0fc43..a4c9d32 100644 --- a/config.go +++ b/config.go @@ -66,10 +66,10 @@ func (config *Config) SetupCamera() { config.InitialCamPos[0] = math.Abs(config.InitialCamPos[0]) } - // for Y we need only positive (really?) + // same for Y + config.InitialCamPos[1] = float64(((config.ScreenHeight - (config.Height * config.Cellsize)) / 2) * -1) if config.Height*config.Cellsize > config.ScreenHeight { - config.InitialCamPos[1] = math.Abs( - float64(((config.ScreenHeight - (config.Height * config.Cellsize)) / 2))) + config.InitialCamPos[1] = math.Abs(config.InitialCamPos[1]) } // Calculate zoom out factor, which shows 100% of the world. We @@ -80,7 +80,7 @@ func (config *Config) SetupCamera() { // is being used in camera.go:worldMatrix(). // FIXME: determine if the diff is larger on width, then calc with - // widh instead of height + // width instead of height config.ZoomOutFactor = int( math.Log(float64(config.ScreenHeight)/(float64(config.Height)*float64(config.Cellsize))) / math.Log(1.01)) diff --git a/play.go b/play.go index c3eca05..6f109e1 100644 --- a/play.go +++ b/play.go @@ -385,6 +385,7 @@ func (scene *ScenePlay) SaveRectRLE() { func (scene *ScenePlay) Update() error { if scene.Config.Restart { scene.Config.Restart = false + scene.Generations = 0 scene.InitGrid() scene.InitCache() return nil @@ -713,8 +714,8 @@ func FillCell(tile *ebiten.Image, cellsize int, col color.RGBA) { tile, float32(1), float32(1), - float32(cellsize-1), - float32(cellsize-1), + float32(cellsize), + float32(cellsize), col, false, ) }