PraetorRegnum

Grid

Mar 12th, 2022
1,286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. def setup():
  2.     size(300, 300)
  3.     background(200)
  4.     lines()
  5.    
  6. def lines():
  7.     line(100, 0, 100, 300)
  8.     line(200, 0, 200, 300)
  9.     line(0, 100, 300, 100)
  10.     line(0, 200, 300, 200)
  11.    
  12. def linesAndColour():
  13.     background(160, 32, 240)
  14.     lines()
  15.    
  16. def draw():
  17.     if (mouseX >= 0 and mouseX <= 100 and mouseY >= 100 and mouseY <= 200):
  18.         linesAndColour()
  19.     elif (mouseX >= 200 and mouseX <= 300 and mouseY >= 100 and mouseY <= 200):
  20.         linesAndColour()
  21.     elif (mouseX >= 100 and mouseX <= 200 and mouseY >= 200 and mouseY <= 300):
  22.         linesAndColour()
  23.     else:
  24.         setup()
Advertisement
Add Comment
Please, Sign In to add comment