So i am fairly new to python and i am trying to build a "stock-market-like" game.
If the clicks per time goes up, the price goes up and the other way around.
My first challenge now is to store the number of times I've clicked.
Till now my code looks like this:
from pynput.mouse import Listener
count = 0
def on_click(x, y, button, pressed):
print("check")
count += 1
print(count)
with Listener(on_click=on_click) as listener:
listener.join()
Now when i click it prints out "check" as it should and also prints out "0", because i defined it like this before. But if i click again it doesn't count up. Sorry i only recently started programming.
Later on i want to find out how many times i clicked per timespan. But there's still a long way to go.
Thanks for any help