Private
Public Access
1
0

Restrict debug rendering (colliders, hitboxes, etc.) to debug mode only.
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m46s

This commit is contained in:
Sebastian Unterschütz
2026-01-06 21:51:08 +01:00
parent fc909fc2bc
commit d156dce2e7
2 changed files with 14 additions and 10 deletions

View File

@@ -313,8 +313,10 @@ func (g *Game) DrawGame(screen *ebiten.Image) {
g.DrawAsset(screen, mp.AssetID, mp.X, mp.Y)
}
// 2.6 DEBUG: Basis-Boden-Collider visualisieren (GRÜN) - UNTER dem Gras bis tief in die Erde
vector.StrokeRect(screen, float32(-g.camX), float32(540), 10000, float32(5000), float32(2), color.RGBA{0, 255, 0, 255}, false)
// 2.6 DEBUG: Basis-Boden-Collider visualisieren (GRÜN) - NUR IM DEBUG-MODUS
if g.showDebug {
vector.StrokeRect(screen, float32(-g.camX), float32(540), 10000, float32(5000), float32(2), color.RGBA{0, 255, 0, 255}, false)
}
// 3. Spieler
for id, p := range g.gameState.Players {
@@ -358,15 +360,17 @@ func (g *Game) DrawGame(screen *ebiten.Image) {
}
text.Draw(screen, name, basicfont.Face7x13, int(posX-g.camX), int(posY-25), ColText)
// HITBOX VISUALISIERUNG (IMMER SICHTBAR)
if def, ok := g.world.Manifest.Assets["player"]; ok {
// Spieler-Hitbox (ROT)
hx := float32(posX + def.DrawOffX + def.Hitbox.OffsetX - g.camX)
hy := float32(posY + def.DrawOffY + def.Hitbox.OffsetY)
vector.StrokeRect(screen, hx, hy, float32(def.Hitbox.W), float32(def.Hitbox.H), 3, color.RGBA{255, 0, 0, 255}, false)
// HITBOX VISUALISIERUNG (NUR IM DEBUG-MODUS)
if g.showDebug {
if def, ok := g.world.Manifest.Assets["player"]; ok {
// Spieler-Hitbox (ROT)
hx := float32(posX + def.DrawOffX + def.Hitbox.OffsetX - g.camX)
hy := float32(posY + def.DrawOffY + def.Hitbox.OffsetY)
vector.StrokeRect(screen, hx, hy, float32(def.Hitbox.W), float32(def.Hitbox.H), 3, color.RGBA{255, 0, 0, 255}, false)
// Spieler-Position als Punkt (GELB)
vector.DrawFilledCircle(screen, float32(posX-g.camX), float32(posY), 5, color.RGBA{255, 255, 0, 255}, false)
// Spieler-Position als Punkt (GELB)
vector.DrawFilledCircle(screen, float32(posX-g.camX), float32(posY), 5, color.RGBA{255, 255, 0, 255}, false)
}
}
}