I just started at this a little while ago and was wondering about how to get a couple of things done. But first, my assemblage of code. (Most of it is taken from other works and slightly modified as I'm not familiar enough with CFDG to do certain things.)
Code: Select all
startshape ground
background { hue 210 sat 0.1 b 1 }
rule ground {
Lawn { x -20.0 }
Lawn2 { x 150.0 }
CIRCLE { x 50.0 y 50.0 s 10.0 hue 55 sat 1 b 1 }
Rays { x 50 y 50 s 3 }
forest { }
}
rule forest {
tree { y 1.0 s 1.0 }
forest { x 15 }
}
rule forest 1.5 {
tree { y 1.0 s 0.5 }
forest { x 7 }
}
rule forest 0.2 { }
rule Lawn { Grass { hue 90 sat 0.5 b 0.5 } Lawn { x 0.2 s 0.999 } }
rule Lawn2{ Grass { hue 90 sat 0.5 b 0.5 } Lawn2 { x -0.2 s 0.999 } }
rule tree {
limb { |hue 30 |b 1 |sat 0 }
}
rule limb {
SQUARE { }
limb { y 1.0 s 0.99 r 1.5 b 0.02| hue 0.5| sat 0.9| }
}
rule limb 0.05 { branch { } }
rule limb 0.05 {
SQUARE { }
branch { y 1.0 s 0.95 r 1.5 }
limb { y 1.0 s 0.5 r -20 }
branch { y 1.0 s 0.5 r 20 }
}
rule branch {
SQUARE { }
branch { y 1.0 s 0.99 r -1.5 }
}
rule branch 0.05 {
SQUARE { }
limb { y 1.0 s 0.9 r 1.5 }
branch { y 1.0 s 0.5 r -60 }
limb { y 1.0 s 0.5 r 60 }
}
rule Rays {
Grass { hue 55 sat 1 b 1 }
Rays { s 0.99 r 5 }
}
rule Grass 2 { Grass {b 0.1} }
rule Grass { Grass {s 1.1} }
rule Grass { Grass {s 0.9} }
rule Grass 2 { GrassL {s 0.3} }
rule Grass { GrassR {s 0.3} }
rule GrassL 15 {FilledSquare{} GrassL{y 0.5} }
rule GrassL 3 {GrassL{r -2} }
rule GrassL 3 {GrassL{r -1} }
rule GrassL 10 {GrassL{s 0.95} }
rule GrassL 2 {GrassR{} }
rule GrassR 15 {FilledSquare{} GrassR{y 0.5} }
rule GrassR 3 {GrassR{r 2} }
rule GrassR 3 {GrassR{r 1} }
rule GrassR 10 {GrassR{s 0.95} }
rule GrassR 10 {GrassL{} }
rule FilledSquare { SQUARE{} }
Also, how would I get the grass to spawn at the bottom of the scene. Currently it spawns a little over it and you can see the background under it.
Finally, how would I keep the trees from bending over and going through the grass? (Going through the sun is fine because sometimes trees do in fact block out the sun. However, I've yet to see a full sized tree bend it's branches and go through the ground. (Some shrubs actually do it but I digress...))
Thanks for any help!
*Edit: Found out phpBB doesn't like png files as images. Switched to jpg.*