Restrict debug rendering (colliders, hitboxes, etc.) to debug mode only.
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m46s
All checks were successful
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m46s
This commit is contained in:
@@ -313,8 +313,10 @@ func (g *Game) DrawGame(screen *ebiten.Image) {
|
|||||||
g.DrawAsset(screen, mp.AssetID, mp.X, mp.Y)
|
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
|
// 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)
|
vector.StrokeRect(screen, float32(-g.camX), float32(540), 10000, float32(5000), float32(2), color.RGBA{0, 255, 0, 255}, false)
|
||||||
|
}
|
||||||
|
|
||||||
// 3. Spieler
|
// 3. Spieler
|
||||||
for id, p := range g.gameState.Players {
|
for id, p := range g.gameState.Players {
|
||||||
@@ -358,7 +360,8 @@ func (g *Game) DrawGame(screen *ebiten.Image) {
|
|||||||
}
|
}
|
||||||
text.Draw(screen, name, basicfont.Face7x13, int(posX-g.camX), int(posY-25), ColText)
|
text.Draw(screen, name, basicfont.Face7x13, int(posX-g.camX), int(posY-25), ColText)
|
||||||
|
|
||||||
// HITBOX VISUALISIERUNG (IMMER SICHTBAR)
|
// HITBOX VISUALISIERUNG (NUR IM DEBUG-MODUS)
|
||||||
|
if g.showDebug {
|
||||||
if def, ok := g.world.Manifest.Assets["player"]; ok {
|
if def, ok := g.world.Manifest.Assets["player"]; ok {
|
||||||
// Spieler-Hitbox (ROT)
|
// Spieler-Hitbox (ROT)
|
||||||
hx := float32(posX + def.DrawOffX + def.Hitbox.OffsetX - g.camX)
|
hx := float32(posX + def.DrawOffX + def.Hitbox.OffsetX - g.camX)
|
||||||
@@ -369,6 +372,7 @@ func (g *Game) DrawGame(screen *ebiten.Image) {
|
|||||||
vector.DrawFilledCircle(screen, float32(posX-g.camX), float32(posY), 5, color.RGBA{255, 255, 0, 255}, false)
|
vector.DrawFilledCircle(screen, float32(posX-g.camX), float32(posY), 5, color.RGBA{255, 255, 0, 255}, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 4. UI Status (Canvas-relativ)
|
// 4. UI Status (Canvas-relativ)
|
||||||
canvasW, canvasH := screen.Size()
|
canvasW, canvasH := screen.Size()
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user