Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import *
- #This is the angle of direction for testing
- z = 0
- def triangle_sign(s1):
- penup()
- color('yellow')
- goto(0, s1 / 2)
- pensize(6)
- setheading(240 + z)
- pendown()
- begin_fill()
- forward(s1)
- setheading(0+z)
- forward(s1)
- setheading(120+z)
- forward(s1)
- end_fill()
- penup()
- pensize(10)
- goto (0, s1 / 2)
- color('black')
- setheading(240+z)
- pendown()
- forward(s1)
- setheading(0+z)
- forward(s1)
- setheading(120+z)
- forward(s1)
- pensize(2)
- penup()
- setheading(270+z)
- forward(s1 * 0.55)
- #Draw the big lasers
- def big_laser(a1):
- penup()
- color('black')
- pensize(3)
- pendown()
- setheading(a1+z)
- forward(30)
- backward(30)
- penup()
- #Draw the smaller lasers
- def small_laser(a2):
- penup()
- color('black')
- pensize(2)
- pendown()
- setheading(a2+z)
- forward(27.5)
- backward(27.5)
- penup()
- def long_laser(a3):
- penup()
- color('black')
- pensize(4)
- pendown()
- setheading(a3+z)
- forward(42.5)
- backward(42.5)
- penup()
- def laser_source(sx):
- penup()
- color('black')
- pensize(2)
- setheading(90+z)
- backward(22)
- setheading(0+z)
- begin_fill()
- pendown()
- circle(22)
- end_fill()
- #Draw the warning sign sheet
- triangle_sign(150)
- #Draw the big lasers
- big_laser(30)
- big_laser(60)
- big_laser(90)
- big_laser(120)
- big_laser(150)
- big_laser(180)
- big_laser(210)
- big_laser(240)
- big_laser(270)
- big_laser(300)
- big_laser(330)
- #Draw the smaller lasers
- small_laser(15)
- small_laser(45)
- small_laser(75)
- small_laser(105)
- small_laser(135)
- small_laser(165)
- small_laser(195)
- small_laser(225)
- small_laser(255)
- small_laser(285)
- small_laser(315)
- small_laser(345)
- #Draw the long laser that hits the border
- long_laser(0)
- #Draw the circle in the middle of the lasers
- laser_source(150)
- hideturtle()
- done()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement