mirror of
https://codeberg.org/scip/golsky.git
synced 2025-12-16 20:20:57 +01:00
fixed initial zoom for smaller grids, turned grid to 1px, fix generation count
This commit is contained in:
6
TODO.md
6
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
|
||||
|
||||
@@ -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))
|
||||
|
||||
5
play.go
5
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,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user