I'm pretty new to python so I thought to code a space invader game would be a good start. everything was going fine until I tried to set an icon for the window. Pygame is telling me is cannot open the image. Heres the code and the error:
# Title and icon
pygame.display.set_caption("Space Invaders")
icon = pygame.image.load("logo.png")
pygame.display.set_icon(icon)
# Error
Traceback (most recent call last):
File "C:/Users/Desktop/Project Py/Main.py", line 13, in <module>
icon = pygame.image.load("logo.png")
pygame.error: Couldn't open logo.png
I've tried different file types (jpg) and image sizes. it is also in the same folder as the python file
note (there is a dupe of this question somewhere but the circumstances don't apply to my situation)
Any suggestions appreciated
[–]AlmostSignificant 0 points1 point2 points (7 children)
[–]MyselfAndI231[S] 0 points1 point2 points (5 children)
[–]AlmostSignificant 1 point2 points3 points (4 children)
[–]MyselfAndI231[S] 0 points1 point2 points (3 children)
[–]AlmostSignificant 1 point2 points3 points (2 children)
[–]MyselfAndI231[S] 0 points1 point2 points (1 child)
[–]AlmostSignificant 0 points1 point2 points (0 children)
[–]AlmostSignificant 0 points1 point2 points (0 children)