Spread seeds correctly
authorJoachim Breitner <mail@joachim-breitner.de>
Sun, 7 Jun 2009 22:09:49 +0000 (00:09 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Sun, 7 Jun 2009 22:09:49 +0000 (00:09 +0200)
src/Lseed/Logic.hs

index 6007a8c..2524e0a 100644 (file)
@@ -62,7 +62,10 @@ applyGenome angle rgen garden = concat $ zipWith applyGenome' rgens aGarden
        collectSeeds rgen planted = snd $ F.foldr go (rgen,[]) planted
          where go si (rgen,newPlants) = case siGrowth si of
                        GrowingSeed _ ->
-                               let (posDelta,rgen') = randomR (-0.05,0.05) rgen
+                               let spread = ( - siHeight si + siOffset si
+                                            ,   siHeight si + siOffset si
+                                            )
+                                   (posDelta,rgen') = randomR spread rgen
                                    p = Planted (plantPosition planted + posDelta)
                                                  (plantOwner planted)
                                                  (genome planted)