diff --git a/obstacle.go b/obstacle.go index 529f144..bbb9516 100644 --- a/obstacle.go +++ b/obstacle.go @@ -12,10 +12,10 @@ type Obstacle struct { func GenerateObstacles(count int, width, height float32) []Obstacle { out := []Obstacle{} for i := 0; i < count; i++ { - x := rand.Float32() * width - y := rand.Float32() * height - w := rand.Float32() * width / 10 - h := rand.Float32() * height / 10 + x := rand.Float32() * (width - (width / 10)) + y := rand.Float32() * (height - (height / 10)) + w := rand.Float32() * (width / 10) + h := rand.Float32() * (height / 10) out = append( out, Obstacle{