Skip to content

Instantly share code, notes, and snippets.

@ahaym
Created November 17, 2021 18:50
Show Gist options
  • Save ahaym/115799afc7147cca16ccde3f38797a64 to your computer and use it in GitHub Desktop.
Save ahaym/115799afc7147cca16ccde3f38797a64 to your computer and use it in GitHub Desktop.
Rect(0,0,400,200, fill='skyBlue')
Rect(0,200,400,200, fill='Blue')
def drawFish(x,y):
Rect(x,y,30,10,fill='gold')
RegularPolygon(x-5, y+5, 10, 3, rotateAngle=90, fill='gold')
def drawBird(x,y):
Rect(x,y,30,10,fill='white')
RegularPolygon(x+15, y+15, 10, 3, fill='white', rotateAngle=180)
RegularPolygon(x+15, y-5, 10, 3, fill='white', rotateAngle=0)
drawBird(100,100)
drawFish(200,200)
def onMousePress(mouseX, mouseY):
if mouseY < 200:
drawBird(mouseX, mouseY)
else:
drawFish(mouseX, mouseY)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment