Guest User

fish(x0,y0)

a guest
Apr 21st, 2020
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.83 KB | None | 0 0
  1. def fish(x0, y0):
  2.     # Draw a fish:
  3.     # a torso
  4.     penSize(1)
  5.     penColor('black')
  6.     brushColor(193, 204, 202)
  7.     polygon([(x0+30, y0 +34),
  8.              (x0+40, y0 +24),
  9.              (x0+50, y0 +17),
  10.              (x0+60, y0 +13),
  11.              (x0+70, y0 +10),
  12.              (x0+80, y0 +10),
  13.              (x0+90, y0 +11),
  14.              (x0+100, y0 +13),
  15.              (x0+110, y0 +16),
  16.              (x0+100, y0 +25),
  17.              (x0+90, y0 +31),
  18.              (x0+80, y0 +34),
  19.              (x0+70, y0 +36),
  20.              (x0+60, y0 +37),
  21.              (x0+50, y0 +37),
  22.              (x0+40, y0 +36),
  23.              (x0+30, y0 +34)])
  24.  
  25.     # a tail
  26.     polygon([(x0+10, y0 +59),
  27.              (x0+0, y0 +39),
  28.              (x0+10, y0 +39),
  29.              (x0+20, y0 +38),
  30.              (x0+30, y0 +34)])
  31.  
  32.     # a fins
  33.     brushColor(222, 167, 167)
  34.     polygon([(x0+60, y0 +13),
  35.              (x0+55, y0 +10),
  36.              (x0+50, y0 +7),
  37.              (x0+40, y0 +4),
  38.              (x0+80, y0 +0),
  39.              (x0+83, y0 +5),
  40.              (x0+80, y0 +10),
  41.              (x0+70, y0 +10)])
  42.  
  43.     polygon([(x0+89, y0 +32),
  44.              (x0+94, y0 +36),
  45.              (x0+99, y0 +36),
  46.              (x0+87, y0 +44),
  47.              (x0+84, y0 +42),
  48.              (x0+82, y0 +39),
  49.              (x0+80, y0 +34)])
  50.  
  51.     polygon([(x0+50, y0 +37),
  52.              (x0+49, y0 +40),
  53.              (x0+46, y0 +45),
  54.              (x0+42, y0 +47),
  55.              (x0+59, y0 +47),
  56.              (x0+61, y0 +43),
  57.              (x0+59, y0 +37)])
  58.    
  59.     ## TODO глаза тоже привязать к x0,y0
  60.     # an eye
  61.     brushColor(121, 121, 243)
  62.     circle(442, 526, 5)
  63.     brushColor(127, 133, 141)
  64.     circle(443, 527, 2)
  65.     penColor(219, 219, 36)
  66.     penSize(2)
  67.     line(439, 525, 441, 527)
  68.  
  69. fish(350, 506)
  70. fish(150, 506)
  71. fish(350, 206)
Advertisement
Add Comment
Please, Sign In to add comment