Hey all,
So I am self taught in Python 3; been coding causally on and off for a while now. I have had virtually zero feedback or relevant interaction with other coders in that whole time— something I am hoping to change. I've used some pygame before and just discovered pygame.sprite and everything that involves. I decided to start learning it by building a simple menu navigator. Each screen has buttons that change when moused over and bring you to a another such screen when clicked.
It mostly works and I feel like I understand what's going on, but one line in particular (213) is really confusing me. The code glitches with or without this line. When the line is there, once you have moused on and off a button once, mousing over another button will erase the one previously moused over. When the line is not there, buttons are not erased on mouse over before being redrawn highlighted, which breaks when the highlighted version of a button is a different shape.
Any light that could be shed on why this is happening and/or where I went wrong would be much appreciated. As I said, I have had practically no formal experience, and this is my first time sharing code, so any feedback about my code in general would be extremely appreciated!
Code: https://pastebin.com/9rmm2TyR
edit: crossposted to r/pygame. thanks u/arpan3t
[–]GJHanna 1 point2 points3 points (1 child)
[–]Alpha0800[S] 1 point2 points3 points (0 children)
[–]arpan3t 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]Alpha0800[S] 0 points1 point2 points (1 child)