add moving animation support, fix debug printing

This commit is contained in:
2024-04-16 17:46:53 +02:00
parent f2f134fddb
commit b7383f065f
7 changed files with 37 additions and 9 deletions

View File

@@ -8,6 +8,7 @@ import (
. "openquell/config"
"openquell/grid"
"openquell/observers"
"openquell/util"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
@@ -136,7 +137,9 @@ func (system *PlayerSystem) Draw(screen *ebiten.Image) {
screen.DrawImage(sprite.Image, op)
ebitenutil.DebugPrintAt(screen, pos.String(), pos.X, pos.Y) // print player pos
if util.DebugEnabled() {
ebitenutil.DebugPrintAt(screen, pos.SmallString(), pos.X, pos.Y+16) // print player pos
}
}
}
@@ -210,7 +213,9 @@ func (system *PlayerSystem) CheckMovement(
observer.AddMove()
}
} else {
fmt.Println("------------------------")
if util.DebugEnabled() {
fmt.Println("------------------------")
}
slog.Debug("(1) player is at", "current", position.String())
}
}