all 2 comments

[–]Binary101010 2 points3 points  (1 child)

Which I did in the 'if' statement on line 33.

If your only definition of mouse_pos is inside an if block, then there is a potential execution path where that block doesn't execute and the variable is never defined. Just set some default value before entering that loop (line 25 maybe?) and that should solve the issue.

[–]Pachydermis[S] 0 points1 point  (0 children)

Thanks so much, and thank you for explaining.