switched to yadu debug log
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user