Created
February 14, 2023 21:10
-
-
Save EllaY44/565fc5a4a86524e586e109251ccbfe49 to your computer and use it in GitHub Desktop.
Week 3 homework question
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setup(): | |
size(800, 700); | |
stroke(100, 100, 255, 80) | |
background(255) | |
frameRate(30) | |
def draw(): | |
fill(245, 242, 195) | |
rect(0, 0, 800, 700) | |
fill(40, 49, 48) | |
rect(0, 0, 800, 70) | |
fill(40, 49, 48) | |
rect(0,130,800,2) | |
rect(0,180,800,2) | |
rect(0,230,800,2) | |
rect(0,280,800,2) | |
rect(0,330,800,2) | |
rect(0,380,800,2) | |
rect(0,430,800,2) | |
rect(0,480,800,2) | |
rect(0,530,800,2) | |
rect(0,580,800,2) | |
rect(0,630,800,2) | |
rect(0,680,800,2) | |
rect(0,730,800,2) | |
stroke(150, 150, 250, 90) | |
distance = dist(pmouseX, pmouseY, mouseX, mouseY) | |
mappedDistance = map(distance, 0,200, 40,1) | |
d = dist(pmouseX, pmouseY, mouseX, mouseY) | |
line(pmouseX, pmouseY, mouseX, mouseY) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @rors ,
Thank you for your response! I've just fixed it and it's working how I wanted it to now.