Created
November 17, 2021 18:50
-
-
Save ahaym/115799afc7147cca16ccde3f38797a64 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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