switched to yadu debug log

This commit is contained in:
2024-02-13 18:42:13 +01:00
parent c9f8783521
commit 48396e7e0a
11 changed files with 63 additions and 32 deletions

View File

@@ -3,6 +3,7 @@ package components
import (
"fmt"
"image"
"log/slog"
. "openquell/config"
)
@@ -83,10 +84,13 @@ func (tile *Position) Intersects(moving *Position, velocity *Velocity) (bool, *P
is := tile.Rect.Bounds().Intersect(object.Rect.Bounds())
if is != image.ZR {
fmt.Printf(" velocity: %d,%d\n", velocity.Data.X, velocity.Data.Y)
fmt.Printf(" player: %s\n", moving.Rect)
fmt.Printf("moved player: %s\n", object.Rect)
fmt.Printf("collision at: %s\n", is)
slog.Debug("Intersect",
"velocity", velocity.Data,
"player", moving.Rect,
"moved player", object.Rect,
"collision at", is,
)
// collision, snap into neighbouring tile depending on the direction
switch velocity.Direction {
case West: