Private
Public Access
1
0

Increase number of underground stones per tile, limit to rectangular shapes only
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Has been cancelled

This commit is contained in:
Sebastian Unterschütz
2026-01-06 21:48:52 +01:00
parent d20f8f33bb
commit fc909fc2bc
2 changed files with 8 additions and 8 deletions

View File

@@ -27,11 +27,11 @@ type DirtPatch struct {
// Stone ist ein Stein auf dem Boden // Stone ist ein Stein auf dem Boden
type Stone struct { type Stone struct {
X float64 X float64
Y float64 Y float64
Size float64 Size float64
Color color.RGBA Color color.RGBA
Shape int // 0=rund, 1=eckig Shape int // 0=rund, 1=eckig
} }
// GroundCache speichert generierte Tiles // GroundCache speichert generierte Tiles
@@ -72,15 +72,15 @@ func GenerateGroundTile(tileIdx int) GroundTile {
}) })
} }
// Steine IN der Erde generieren (10-20 pro Tile, tief verteilt) // Steine IN der Erde generieren (30-50 pro Tile, nur eckig, tief verteilt)
numStones := 10 + rng.Intn(10) numStones := 30 + rng.Intn(20)
for i := 0; i < numStones; i++ { for i := 0; i < numStones; i++ {
tile.Stones = append(tile.Stones, Stone{ tile.Stones = append(tile.Stones, Stone{
X: rng.Float64() * 128, X: rng.Float64() * 128,
Y: rng.Float64()*dirtHeight + 20, // Tief in der Erde verteilt Y: rng.Float64()*dirtHeight + 20, // Tief in der Erde verteilt
Size: 4 + rng.Float64()*8, // Verschiedene Größen Size: 4 + rng.Float64()*8, // Verschiedene Größen
Color: color.RGBA{100 + uint8(rng.Intn(50)), 100 + uint8(rng.Intn(50)), 100 + uint8(rng.Intn(50)), 255}, Color: color.RGBA{100 + uint8(rng.Intn(50)), 100 + uint8(rng.Intn(50)), 100 + uint8(rng.Intn(50)), 255},
Shape: rng.Intn(2), // 0=rund, 1=eckig Shape: 1, // Nur eckig (keine runden Steine mehr)
}) })
} }

Binary file not shown.