In this challenge we will use a Python script (using Python Turtle) to generate a random background for a 2D video game.
To create a mountain range skyline we will use a polynomial function:
In our example (see trinket below) we will use a polynomial function of degree 3:
The coefficients a,b,c,d of our polynomial function will be randomly generated. This will hence create a different background/skyline every time the program is executed.
We will then use this function to place some trees on the skyline. The x coordinate of the tree will be randomly generated whereas the polynomial equation will be used to calculate the y coordinate of each tree.
Update this code to add another set of trees. The trees could be positioned randomly anywhere on the grass area of the landscape. (Anywhere between the bottom of the screen and the skyline)
Update this code to add some clouds. The clouds should be positioned randomly anywhere in the sky. (Anywhere between the top of the screen and the skyline)