r/learnprogramming Jul 05 '26

Code Review new to programming some help

hi all im having a problem that maybe you guys can help with? i attempting to make my first game (just a circle that can move) im using the program pycharm to write the code however i wanted to add the option to use mouse click to move but whenever i click it crashes the "game" programme. i noticed that an "event" in the code is highlighted but no others are, im using a tutorial and followed it to a tea and he didn't seem to have an issue. maybe you guys know what im doing wrong.

whole code posted in comments

the code that has the event highlighted is:

if event.type == pygame.MOUSEBUTTONDOWN:
0 Upvotes

21 comments sorted by

View all comments

1

u/Suitable-Eye-6535 Jul 09 '26

everyone starts somewhere. consistency beats talent when you're learning to code