Try and very rarely spawn a dormant rover
This commit is contained in:
parent
37d828c457
commit
faa1271c5a
1 changed files with 10 additions and 0 deletions
|
@ -31,6 +31,7 @@ func NewNoiseWorldGen(seed int64) WorldGen {
|
||||||
const (
|
const (
|
||||||
terrainNoiseScale = 6
|
terrainNoiseScale = 6
|
||||||
rockNoiseScale = 3
|
rockNoiseScale = 3
|
||||||
|
dormantRoverScale = 25
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetTile returns the chosen tile at a location
|
// GetTile returns the chosen tile at a location
|
||||||
|
@ -56,5 +57,14 @@ func (g *NoiseWorldGen) GetObject(v maths.Vector) Object {
|
||||||
case o > 0.5:
|
case o > 0.5:
|
||||||
obj = roveapi.Object_RockSmall
|
obj = roveapi.Object_RockSmall
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Very rarely spawn a dormant rover
|
||||||
|
if obj == roveapi.Object_ObjectUnknown {
|
||||||
|
o = g.noise.Eval2(float64(v.X)/dormantRoverScale, float64(v.Y)/dormantRoverScale)
|
||||||
|
if o > 0.8 {
|
||||||
|
obj = roveapi.Object_RoverDormant
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Object{Type: roveapi.Object(obj)}
|
return Object{Type: roveapi.Object(obj)}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue