Hidden object game in Python

Hello!
I’m making an easy Hidden object game in Python and need some advice. I have an image (.png) in Python and need it to disappear after clicking on it. A completely primitive solution is enough for me, I’m just a beginner.
I will be grateful for any help.

what code do you have?

from tkinter import *

x = 600
y = 350

okno = Tk()
okno.geometry("1200x700")
okno.title('hra')

p = Canvas(okno, background='white', width=1200, height=700)
p.pack()

index_miesta = 0
pocet = 0

zoznam_miesta = [
    PhotoImage(file='din.png'),
    PhotoImage(file='egy.png'),
    PhotoImage(file='ryti.png'),
    PhotoImage(file='soc.png'),
    PhotoImage(file='mo.png')
    ]


def minigame1(event):
    global index_miesta
    index_miesta += 1
    if index_miesta >= len(zoznam_miesta):
        okno.quit()
        return
    p.delete('all')

p.create_image(x, y, image=zoznam_miesta[index_miesta])


okno.bind_all('<Right>', minigame1)

okno.mainloop()

It is just a start because I want to figure out how to delete images so I can move forward

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.