Skip to content

Instantly share code, notes, and snippets.

@EllaY44
Created February 21, 2023 00:53
Show Gist options
  • Save EllaY44/82ea05aeb18cc78d142b35419d218942 to your computer and use it in GitHub Desktop.
Save EllaY44/82ea05aeb18cc78d142b35419d218942 to your computer and use it in GitHub Desktop.
homework week 4 question
global circleX, direction
circleX = 500
direction = 8
global circletwoX, directiontwo
circletwoX = 450
directiontwo = 3
global circlethreeX, directionthree
circlethreeX = 550
directionthree = 6
def setup():
size (600, 600)
noStroke
def draw():
global circleX, direction
background(255, 255, 255)
img = loadImage("cat-raster-image.png")
image(img, 0, 0, 600, 600)
fill(165, 131, 98)
ellipse(circleX, 500, 50, 50)
circleX = circleX + direction
if circleX > 500:
direction = -15
if circleX < 120:
direction = 15
global circletwoX, directiontwo
fill(252, 222, 240)
ellipse(circletwoX, 450, 60, 60)
circletwoX = circletwoX + directiontwo
if circletwoX > 520:
directiontwo = -10
if circletwoX < 150:
directiontwo = 10
fill(236, 214, 255)
circle(335, 350, 35)
if mousePressed:
global circlethreeX, directionthree
fill(176, 211, 252)
ellipse(circlethreeX, 550, 40, 40)
circlethreeX = circlethreeX + directionthree
if circlethreeX > 600:
directionthree = -10
if circlethreeX < 0:
directionthree = 10
@EllaY44
Copy link
Author

EllaY44 commented Feb 21, 2023

Hello,
All those corrections worked; thank you! @rors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment