import pyglet


def draw_card():
    pyglet.graphics.draw(4,
                         pyglet.gl.GL_QUADS,
                         ('v2i', (get_card_vertices()))
                         )


def get_card_width():
    return 300


def get_card_height():
    return 200


def get_card_vertices():
    card_width = get_card_width()
    card_height = get_card_height()
    card_vertices = [
        0, 0,
        0, card_height,
        card_width, card_height,
        card_width, 0
    ]
    return card_vertices


def on_mouse_press(x, y, button, modifiers):
    print("Mouse Pressed")
    if x < get_card_width() and y < get_card_height():
        print("Mouse inside card")
    else:
        print("Mouse outside card")


# Create a Pyglet Window
window = pyglet.window.Window()
window.push_handlers(on_mouse_press)


# Set up our window event handlers, we need to do this before we start our app running
@window.event
def on_draw():
    window.clear()
    draw_card()

# Start the app running!
pyglet.app.run()

Add card match v3 python file
3: Add card match v3 python file
