Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- speed(0)
- bgcolor((0,235,260,0.5))
- penup()
- x=-290
- y=100
- setposition(x,y)
- r=220
- setposition(-200,0)
- #this function makes the sky
- def rectangle(color_choice):
- begin_fill()
- color(color_choice)
- for i in range(8):
- forward(400)
- left(90)
- end_fill()
- left(90)
- forward(13)
- right(90)
- for i in range(16):
- r=r-10
- rectangle((r,225,255))
- penup()
- setposition(-190,150)
- def clouds(size):
- for i in range(4):
- pendown()
- left(180)
- color("white")
- begin_fill()
- backward(size)
- right(90)
- circle(size/9,100,0)
- right(90)
- circle(size/5,120,0)
- right(90)
- circle(size/6,146,0)
- right(90)
- circle(size/1.9,30,0)
- end_fill()
- right(216)
- size=size-10
- forward(size)
- def theclouds():
- clouds(60)
- penup()
- setposition(-50,140)
- clouds(30)
- clouds(60)
- penup()
- setposition(-200,100)
- clouds(80)
- penup()
- setposition(-10, 180)
- clouds(30)
- penup()
- setposition(0,0)
- theclouds()
- def cloud_mountain(size):
- for i in range(4):
- pendown()
- right(180)
- color("white")
- begin_fill()
- backward(size)
- right(90)
- circle(size/9,100,0)
- right(90)
- circle(size/5,120,0)
- right(90)
- circle(size/6,146,0)
- right(90)
- circle(size/1.9,30,0)
- end_fill()
- right(216)
- size=size-10
- forward(size)
- def themountainclouds():
- penup()
- home()
- setposition(-10,10)
- pendown()
- cloud_mountain(50)
- penup()
- home()
- setposition(-100,10)
- pendown()
- cloud_mountain(40)
- penup()
- home()
- setposition(110,10)
- pendown()
- cloud_mountain(60)
- themountainclouds()
- speed(0)
- penup()
- setposition(-200,0)
- r=200
- def rectanglerefl(color_choice):
- begin_fill()
- color(color_choice)
- for i in range(8):
- forward(400)
- right(90)
- end_fill()
- right(90)
- forward(13)
- left(90)
- for i in range(16):
- r=r-10
- rectanglerefl((r,225,255))
- penup()
- setposition(-190,-150)
- def clouds(size):
- for i in range(4):
- pendown()
- left(180)
- color("white")
- begin_fill()
- backward(size)
- right(90)
- circle(size/9,100,0)
- right(90)
- circle(size/5,120,0)
- right(90)
- circle(size/6,146,0)
- right(90)
- circle(size/1.9,30,0)
- end_fill()
- right(216)
- size=size-10
- forward(size)
- def theclouds():
- clouds(60)
- penup()
- setposition(-50,-140)
- clouds(30)
- clouds(60)
- penup()
- setposition(-200,-100)
- clouds(80)
- penup()
- setposition(-10, -180)
- clouds(30)
- penup()
- setposition(0,0)
- theclouds()
- def cloud_mountain(size):
- for i in range(4):
- pendown()
- right(180)
- color("white")
- begin_fill()
- backward(size)
- right(90)
- circle(size/9,100,0)
- right(90)
- circle(size/5,120,0)
- right(90)
- circle(size/6,146,0)
- right(90)
- circle(size/1.9,30,0)
- end_fill()
- right(216)
- size=size-10
- forward(size)
- def themountainclouds():
- penup()
- home()
- setposition(-10,-10)
- pendown()
- cloud_mountain(50)
- penup()
- home()
- setposition(-100,-10)
- pendown()
- cloud_mountain(40)
- penup()
- home()
- setposition(110,-10)
- pendown()
- cloud_mountain(60)
- themountainclouds()
- import random, turtle
- speed(0)
- #draws large background mountain
- def large_mountain():
- #setting up to draw mountain
- penup()
- setposition(-125,0)
- pendown()
- begin_fill()
- color("#c6ccc6")
- pensize(10)
- #sets parameters for tracy to move forward at a random angle on intervals until she reaches a certain coordinate
- while ycor() <= 150:
- length=random.randint(5,15)
- angle=random.randint(40,45)
- left(angle)
- forward(length)
- right(angle)
- if ycor() >= 150:
- break
- #after passing above coordinate, tracy will start moving towards ycoordinate 0
- while ycor() >= 0:
- pensize(1)
- color("#878c88")
- length=random.randint(5,15)
- angle=random.randint(40,45)
- right(angle)
- forward(length)
- left(angle)
- if ycor() <= 0:
- break
- end_fill()
- #draws small mountain
- def small_long_mountain():
- penup()
- setposition(-75,0)
- pendown()
- begin_fill()
- pensize(10)
- color("#6d8f6d")
- #setting coordinate for tracy to reach
- while ycor() <= 50:
- length=random.randint(5,10)
- angle=random.randint(35,40)
- left(angle)
- forward(length)
- right(angle)
- if ycor() >= 50:
- break
- #setting coordinate for tracy to reach
- while ycor() >= 0:
- pensize(1)
- color("#5b6e5f")
- length=random.randint(5,10)
- angle=random.randint(35,40)
- right(angle)
- forward(length)
- left(angle)
- if ycor() <= 0:
- break
- end_fill()
- #draw double mountain
- def small_mountains():
- pendown()
- begin_fill()
- pensize(10)
- color("#a9c2a9")
- #setting coordinate for tracy to reach
- while ycor() <= 50:
- length=random.randint(5,10)
- angle=random.randint(48,52)
- left(angle)
- forward(length)
- right(angle)
- if ycor() >= 50:
- break
- #setting coordinate for tracy to reach
- while ycor() >= 30:
- color("#a9c2a9")
- length=random.randint(5,10)
- angle=random.randint(48,52)
- right(angle)
- forward(length)
- left(angle)
- if ycor() <= 30:
- break
- #setting coordinate for tracy to reach
- while ycor() <= 75:
- color("#a9c2a9")
- length=random.randint(5,10)
- angle=random.randint(48,52)
- left(angle)
- forward(length)
- right(angle)
- if ycor() >= 75:
- break
- #setting coordinate for tracy to reach
- while ycor() >= 0:
- color("#6e8a73")
- pensize(1)
- color("#6e8a73")
- length=random.randint(5,10)
- angle=random.randint(48,52)
- right(angle)
- forward(length)
- left(angle)
- if ycor() <= 0:
- break
- end_fill()
- #draw reflection, with slight changes to make it more realistic
- def large_mountain_flipped():
- penup()
- setposition(-125,-10)
- pendown()
- begin_fill()
- color("#c6ccc6")
- pensize(10)
- #path to coordinate will vary slightly from the original
- while ycor() >= -150:
- length=random.randint(5,15)
- angle=random.randint(40,45)
- right(angle)
- forward(length)
- left(angle)
- if ycor() >= 150:
- break
- #path to coordinate will vary slightly from the original
- while ycor() <= -10:
- pensize(1)
- color("#878c88")
- length=random.randint(5,15)
- angle=random.randint(40,45)
- left(angle)
- forward(length)
- right(angle)
- if ycor() >= -10:
- break
- end_fill()
- #draw reflection, with slight changes to make it more realistic
- def small_long_mountain_flipped():
- penup()
- setposition(-75,-10)
- pendown()
- begin_fill()
- pensize(10)
- color("#6d8f6d")
- #path to coordinate will vary slightly from the original
- while ycor() >= -60:
- length=random.randint(5,10)
- angle=random.randint(35,40)
- right(angle)
- forward(length)
- left(angle)
- if ycor() <= -60:
- break
- #path to coordinate will vary slightly from the original
- while ycor() <= -10:
- color("#5b6e5f")
- pensize(1)
- length=random.randint(5,10)
- angle=random.randint(35,40)
- left(angle)
- forward(length)
- right(angle)
- if ycor() >= -10:
- break
- end_fill()
- #draw reflection, with slight changes to make it more realistic
- def small_mountains_flipped():
- pendown()
- begin_fill()
- pensize(10)
- color("#a9c2a9")
- #path to coordinate will vary slightly from the original
- while ycor() >= -60:
- length=random.randint(5,10)
- angle=random.randint(48,52)
- right(angle)
- forward(length)
- left(angle)
- if ycor() <= -60:
- break
- #path to coordinate will vary slightly from the original
- while ycor() <= -40:
- length=random.randint(5,10)
- angle=random.randint(48,52)
- left(angle)
- forward(length)
- right(angle)
- if ycor() >= -40:
- break
- while ycor() >= -85:
- length=random.randint(5,10)
- angle=random.randint(48,52)
- right(angle)
- forward(length)
- left(angle)
- if ycor() <= -85:
- break
- while ycor() <= -10:
- color("#6e8a73")
- pensize(1)
- length=random.randint(5,10)
- angle=random.randint(48,52)
- left(angle)
- forward(length)
- right(angle)
- if ycor() >= -10:
- break
- end_fill()
- #draws complete scene and reflection
- def complete_mountain_and_reflection():
- large_mountain()
- small_long_mountain()
- small_mountains()
- penup()
- home()
- pendown()
- large_mountain_flipped()
- small_long_mountain_flipped()
- small_mountains_flipped()
- complete_mountain_and_reflection()
- import random, turtle
- speed(0)
- penup()
- #Adjust evergreen size
- leaves_size=random.randint(23,25)
- tree_height=random.randint(3,4)
- stump_size=25
- stump_size_2=10
- #These lines of code are for parts of the first tree (stump)
- def draw_stump():
- pendown()
- pensize(5)
- color("#8B5725")
- backward(stump_size)
- penup()
- forward(stump_size)
- #These lines of code are for parts of the second tree (stump)
- def draw_stump_2():
- global stump_size_2
- pendown()
- pensize(5)
- color("#8B5725")
- backward(stump_size_2)
- penup()
- forward(stump_size)
- stump_size_2=stump_size_2+1
- #These lines of code are for parts of the first tree (leaves)
- def leaves():
- colors = ["#22391F","#14210F","#4A5E30","#6d4919","#4B1C00","#14210F","#14210F","#14210F"]
- colorchoice = random.choice(colors)
- color(colorchoice)
- begin_fill()
- for i in range(tree_height):
- forward(leaves_size)
- pendown()
- left(90)
- circle(leaves_size,360,3)
- right(90)
- penup()
- end_fill()
- #These lines of code are for parts of the second tree (leaves)
- def leaves_2():
- colors = ["#22391F","#14210F","#4A5E30","#4B1C00","#14210F","#14210F","#14210F"]
- colorchoice = random.choice(colors)
- color(colorchoice)
- begin_fill()
- for i in range(tree_height):
- pendown()
- left(90)
- circle(10,360,3)
- right(90)
- penup()
- forward(10)
- end_fill()
- #These lines of code are for drawing the first tree
- def evergreen_1():
- global leaves_size
- draw_stump()
- leaves()
- if xcor()<=-100:
- leaves_size=leaves_size-1
- else:
- leaves_size=leaves_size-2
- #These lines of code are for drawing the left island
- def land_left():
- penup()
- setposition(-200,-37)
- pendown()
- begin_fill()
- color("#8FA014")
- right(90)
- while xcor() <= -60:
- forward(30)
- right(3)
- right(165)
- forward(150)
- end_fill()
- penup()
- #These lines of code are for drawing the left scenary (including land and trees)
- def left_scenary():
- x_position=-190
- y_position=-10
- for i in range(7):
- setposition(x_position,y_position)
- evergreen_1()
- x_position=x_position+20
- y_position=y_position-3
- land_left()
- #These lines of code are for drawing the right island
- def land_right():
- penup()
- setposition(200,-25)
- pendown()
- begin_fill()
- while xcor() >=-9:
- forward(50)
- left(2)
- left(170)
- forward(258)
- end_fill()
- #These lines of code are for the second tree
- def evergreen_2():
- draw_stump_2()
- leaves_2()
- #These lines of code are for drawing the right scenary (including land and trees)
- def right_scenary():
- land_right()
- penup()
- x_position=-40
- y_position=-26
- left(90)
- for i in range(16):
- setposition(x_position,y_position)
- pendown()
- evergreen_2()
- x_position=x_position+15
- y_position=y_position+2
- #These lines of code are for drawing the right scenary reflection (including land and trees)
- def reflect_left_scenary():
- x_position=-190
- y_position=-100
- left(180)
- for i in range(7):
- setposition(x_position,y_position)
- evergreen_1()
- x_position=x_position+20
- y_position=y_position+3
- right(90)
- penup()
- right(180)
- setposition(-200,-73)
- color((143,160,20,0.6))
- begin_fill()
- while xcor() <= -60:
- forward(30)
- left(3)
- left(165)
- forward(150)
- end_fill()
- #These lines of code are for drawing the left scenary reflection (including land and trees)
- def reflect_right_scenary():
- x_position=-40
- y_position=-76
- penup()
- setposition(200,-65)
- color((143,160,20,0.6))
- begin_fill()
- while xcor() >=-9:
- forward(50)
- right(2)
- right(170)
- forward(258)
- end_fill()
- right(90)
- for i in range(16):
- setposition(x_position,y_position)
- pendown()
- evergreen_2()
- x_position=x_position+15
- y_position=y_position-2
- #These lines of code will execute the commands needed to draw the trees and land
- left(90)
- left_scenary()
- right_scenary()
- reflect_left_scenary()
- reflect_right_scenary()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement