[SOLVED] [pygame] Updating mouse positions
I've been attempting to create a simple program which prints the x and y coordinates of my mouse. However, the program repeatedly prints the same x and y position. What am I doing wrong?
Here's my repl: https://repl.it/@ETHANSIAO/Mouse-Positions
(Please ignore the commented code, I plan on saving that for another project.)
Edit: not sure why the text is being displayed as if it's a program, sorry about that!
Edit 2: just put in the correct link, sorry about that!
Had this problem too, and I think that you just need to call pygame.event.get() every time you want the curser position to update, so you can just say:
position = pygame.mouse.get_pos()
and then it will keep giving back the old position even when you aren't moving the curser.