Fix small and large rock spawning
This commit is contained in:
parent
1a1ef9a376
commit
9cd5324465
2 changed files with 3 additions and 1 deletions
|
@ -111,6 +111,8 @@ func (c *Chunk) populate(size int) {
|
||||||
for i := 0; i < len(c.Tiles); i++ {
|
for i := 0; i < len(c.Tiles); i++ {
|
||||||
if rand.Intn(16) == 0 {
|
if rand.Intn(16) == 0 {
|
||||||
c.Objects[i] = objects.Object{Type: objects.LargeRock}
|
c.Objects[i] = objects.Object{Type: objects.LargeRock}
|
||||||
|
} else if rand.Intn(32) == 0 {
|
||||||
|
c.Objects[i] = objects.Object{Type: objects.SmallRock}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ const (
|
||||||
SmallRock = Type('o')
|
SmallRock = Type('o')
|
||||||
|
|
||||||
// LargeRock is a large blocking rock
|
// LargeRock is a large blocking rock
|
||||||
LargeRock = Type('o')
|
LargeRock = Type('O')
|
||||||
)
|
)
|
||||||
|
|
||||||
// Object represents an object in the world
|
// Object represents an object in the world
|
||||||
|
|
Loading…
Add table
Reference in a new issue