Here's something that I've tried for a snake game, but I get an error.
I did come up with another way,
(that is, redefining the thread every time the snake touches a coin)
but am still confused as to what the problem was, and how to solve it.
import playsound
import threading
import time
def coin():
playsound.playsound('coin.mp3')
ding = threading.Tread(target=coin)
ding.start()
time.sleep(5)
ding.start()
RuntimeError: threads can only be started once