Click The Fruit.


import pgzrun

from random import randint
apple = Actor("apple")
score = 0

def draw() :
    screen.clear()
    apple.draw()

def place_apple() :
    apple.x = randint(10, 800)
    apple.y = randint(10, 600)

def on_mouse_down(pos) :
    if apple.collidepoint(pos) :
        print("Good shoot!")
        place_apple()
    else :
        print("You missed.")
        print(score)
        quit()
    
place_apple()
 
pgzrun.go()    

Leave a comment

Log in with itch.io to leave a comment.