objects generate entirely inside world
This commit is contained in:
parent
c8913c563e
commit
6ff9606367
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user