Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # WL3 -- William Leonard -- 032217
- def setup():
- size(100, 100)
- global i1, i2, i3, i4, counter1, counter2, counter3, counter4
- noSmooth()
- i1 = 10
- i2 = 10
- i3 = 10
- i4 = 10
- def draw():
- global i1, i2, i3, i4, counter1, counter2, counter3, counter4
- background(0)
- fill(0)
- # moving lines
- stroke(255)
- line(i1, 10, i1, 30)
- line(i2, 30, i2, 50)
- line(i3, 50, i3, 70)
- line(i4, 70, i4, 90)
- # left side gradient
- fill(255-((dist(i1, 10, 10, 10)/80)*255))
- rect(10, 10, i1-10, 20)
- fill(255-((dist(i2, 10, 10, 10)/80)*255))
- rect(10, 30, i2-10, 20)
- fill(255-((dist(i3, 10, 10, 10)/80)*255))
- rect(10, 50, i3-10, 20)
- fill(255-((dist(i4, 10, 10, 10)/80)*255))
- rect(10, 70, i4-10, 20)
- # right side gradient
- fill(0+((dist(i1, 10, 10, 10)/80)*255))
- rect(i1, 10, 90-i1, 20)
- fill(0+((dist(i2, 10, 10, 10)/80)*255))
- rect(i2, 30, 90-i2, 20)
- fill(0+((dist(i3, 10, 10, 10)/80)*255))
- rect(i3, 50, 90-i3, 20)
- fill(0+((dist(i4, 10, 10, 10)/80)*255))
- rect(i4, 70, 90-i4, 20)
- # box etc.
- stroke(255)
- fill(0, 0)
- rect(10, 10, 80, 80)
- line(10, 30, 90, 30)
- line(10, 50, 90, 50)
- line(10, 70, 90, 70)
- if i1 == 10:
- counter1 = 1
- if i1 == 90:
- counter1 = -1
- if i2 == 10:
- counter2 = 2
- if i2 == 90:
- counter2 = -2
- if i3 == 10:
- counter3 = 4
- if i3 == 90:
- counter3 = -4
- if i4 == 10:
- counter4 = 8
- if i4 == 90:
- counter4 = -8
- i1 += counter1
- i2 += counter2
- i3 += counter3
- i4 += counter4
- fill(0, 0)
- stroke(100)
- rect(0, 0, 100, 100)
- rect(2, 2, 96, 96)
- rect(4, 4, 92, 92)
- rect(6, 6, 88, 88)
- rect(8, 8, 84, 84)
- fill(255)
- textSize(9)
- text("WL3", 10, 99)
- text("03|22|17", 50, 99)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement