Advertisement
Guest User

WL3

a guest
Mar 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.91 KB | None | 0 0
  1. # WL3 -- William Leonard -- 032217
  2.  
  3. def setup():
  4.     size(100, 100)
  5.     global i1, i2, i3, i4, counter1, counter2, counter3, counter4
  6.     noSmooth()
  7.  
  8. i1 = 10
  9. i2 = 10
  10. i3 = 10
  11. i4 = 10
  12.    
  13. def draw():
  14.     global i1, i2, i3, i4, counter1, counter2, counter3, counter4
  15.    
  16.     background(0)
  17.     fill(0)
  18.    
  19.     # moving lines
  20.     stroke(255)
  21.     line(i1, 10, i1, 30)
  22.     line(i2, 30, i2, 50)
  23.     line(i3, 50, i3, 70)
  24.     line(i4, 70, i4, 90)
  25.    
  26.     # left side gradient
  27.     fill(255-((dist(i1, 10, 10, 10)/80)*255))
  28.     rect(10, 10, i1-10, 20)
  29.     fill(255-((dist(i2, 10, 10, 10)/80)*255))
  30.     rect(10, 30, i2-10, 20)
  31.     fill(255-((dist(i3, 10, 10, 10)/80)*255))
  32.     rect(10, 50, i3-10, 20)
  33.     fill(255-((dist(i4, 10, 10, 10)/80)*255))
  34.     rect(10, 70, i4-10, 20)
  35.    
  36.     # right side gradient
  37.     fill(0+((dist(i1, 10, 10, 10)/80)*255))
  38.     rect(i1, 10, 90-i1, 20)
  39.     fill(0+((dist(i2, 10, 10, 10)/80)*255))
  40.     rect(i2, 30, 90-i2, 20)
  41.     fill(0+((dist(i3, 10, 10, 10)/80)*255))
  42.     rect(i3, 50, 90-i3, 20)
  43.     fill(0+((dist(i4, 10, 10, 10)/80)*255))
  44.     rect(i4, 70, 90-i4, 20)
  45.    
  46.     # box etc.
  47.     stroke(255)
  48.     fill(0, 0)
  49.     rect(10, 10, 80, 80)
  50.     line(10, 30, 90, 30)
  51.     line(10, 50, 90, 50)
  52.     line(10, 70, 90, 70)
  53.    
  54.     if i1 == 10:
  55.         counter1 = 1
  56.     if i1 == 90:
  57.         counter1 = -1
  58.     if i2 == 10:
  59.         counter2 = 2
  60.     if i2 == 90:
  61.         counter2 = -2
  62.     if i3 == 10:
  63.         counter3 = 4
  64.     if i3 == 90:
  65.         counter3 = -4
  66.     if i4 == 10:
  67.         counter4 = 8
  68.     if i4 == 90:
  69.         counter4 = -8
  70.        
  71.     i1 += counter1
  72.     i2 += counter2
  73.     i3 += counter3
  74.     i4 += counter4
  75.    
  76.     fill(0, 0)
  77.     stroke(100)
  78.     rect(0, 0, 100, 100)
  79.     rect(2, 2, 96, 96)
  80.     rect(4, 4, 92, 92)
  81.     rect(6, 6, 88, 88)
  82.     rect(8, 8, 84, 84)
  83.     fill(255)
  84.     textSize(9)
  85.     text("WL3", 10, 99)
  86.     text("03|22|17", 50, 99)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement