From 6ff960636750118474cd9ead3181e2cb245e7366 Mon Sep 17 00:00:00 2001 From: Fraser Graham Date: Wed, 6 Nov 2013 19:58:16 -0800 Subject: [PATCH] objects generate entirely inside world --- obstacle.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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{