I am trying to implement a movement system where the player move\'s towards the click position. But I have been running into some problems with the arguments of the movement met
Your problem is that "global" variables in python are not actually global, but rather local to the module in which they were defined in. Thus, you cannot reference globals decalred in the main.py file in the classes.py file.
There are three possible solutions:
(not recomended) Move the declarations of screen and background to the classes.py file, which would put them seemingly out of place.
(also not recommended) Add a from main import screen, background to the classes.py file, which creates circular import problems, forcing the main.py module to do its from classes import * after defining screen and background
display.py or screen.py file, where the screen and background variabled are defined and import it from main.py and classes.pyThe mouse_pos variable is totally unnecessary and misused:
pygame.mouse.get_pos() directly in the classes.py file, butpygame.mouse.get_pos() itself is extranious because pygame.MOUSEBUTTONDOWN events have a pos attribute pointing to the position of the mouse when the event was fired.