From 9cd5324465ce591325d7507a539d68acb30bd8e8 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Fri, 3 Jul 2020 17:13:52 +0100 Subject: [PATCH] Fix small and large rock spawning --- pkg/atlas/atlas.go | 2 ++ pkg/objects/objects.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/atlas/atlas.go b/pkg/atlas/atlas.go index 40969e1..6ec11e2 100644 --- a/pkg/atlas/atlas.go +++ b/pkg/atlas/atlas.go @@ -111,6 +111,8 @@ func (c *Chunk) populate(size int) { for i := 0; i < len(c.Tiles); i++ { if rand.Intn(16) == 0 { c.Objects[i] = objects.Object{Type: objects.LargeRock} + } else if rand.Intn(32) == 0 { + c.Objects[i] = objects.Object{Type: objects.SmallRock} } } } diff --git a/pkg/objects/objects.go b/pkg/objects/objects.go index 126d0d1..9338b68 100644 --- a/pkg/objects/objects.go +++ b/pkg/objects/objects.go @@ -15,7 +15,7 @@ const ( SmallRock = Type('o') // LargeRock is a large blocking rock - LargeRock = Type('o') + LargeRock = Type('O') ) // Object represents an object in the world