dille12 / OVRDOZE

OVRDOZE: WIP python/pygame 2D zombie shooter
Other
5 stars 2 forks source link

referenced before assignment 'fps_counter' and 'clicked' #4

Closed altruios closed 2 years ago

altruios commented 2 years ago

attempting to run: got to the menu - tried single player: was hit with this exception.


Exception has occurred: UnboundLocalError
local variable 'clicked' referenced before assignment
  File "2dshooter/game.py", line 562, in main
    if pygame.mouse.get_pressed()[0] and clicked == False:
  File "2dshooter/RUN.py", line 138, in start_sp
    game.main(difficulty = arg, draw_los = draw_los, dev_tools = dev, skip_intervals = check_box_inter.__dict__["checked"], map = maps_dict[selected_map]["map"])
  File "2dshooter/RUN.py", line 235, in tick
    return self.action(self.args)
  File "2dshooter/RUN.py", line 521, in <module>
    s7_2 = button7_2.tick(screen, mouse_pos, mouse_single_tick, glitch)

as well as this:


EXCEPTION local variable 'fps_counter' referenced before assignment
Traceback (most recent call last):
  File "2dshooter/RUN.py", line 521, in <module>
    s7_2 = button7_2.tick(screen, mouse_pos, mouse_single_tick, glitch)
  File "2dshooter/RUN.py", line 235, in tick
    return self.action(self.args)
  File "2dshooter/RUN.py", line 138, in start_sp
    game.main(difficulty = arg, draw_los = draw_los, dev_tools = dev, skip_intervals = check_box_inter.__dict__["checked"], map = maps_dict[selected_map]["map"])
  File "2dshooter/game.py", line 562, in main
    if pygame.mouse.get_pressed()[0] and clicked == False:
UnboundLocalError: local variable 'clicked' referenced before assignment

I am running Linux. manjaro, and I3.

will look more into it when I've had some sleep :)

Both look like a similar issue, so I wouldn't be surprised if there were more examples of this issue.

followed the requirements of the txt file.

python 3.10.4.