Mario-Level-1
Mario-Level-1 copied to clipboard
pygame.error: File is not a Windows BMP file
i got the following error with the recent version from github:
jojoo@soy% python mario_level_1.py
Traceback (most recent call last):
File "mario_level_1.py", line 10, in <module>
from data.main import main
File "/private/tmp/Mario-Level-1/data/main.py", line 3, in <module>
from . import setup,tools
File "/private/tmp/Mario-Level-1/data/setup.py", line 25, in <module>
GFX = tools.load_all_gfx(os.path.join("resources","graphics"))
File "/private/tmp/Mario-Level-1/data/tools.py", line 115, in load_all_gfx
img = pg.image.load(os.path.join(directory, pic))
pygame.error: File is not a Windows BMP file
Try reinstalling pygame. Make sure both python and pygame are 32 bit. Also, you can check if each dependency installed correctly.
your pygame is install not comolete, I have meet this problem months ago
you can try sudo apt-get install python-pygame if your system is ubuntu/debian
All the images used are png files, so it's fine. But BMP might face a problem based on the code below: def load_all_gfx(directory, colorkey=(255,0,255), accept=('.png', 'jpg', 'bmp')):
jpg and bmp don't have '.' and will not be accepted
self.image = pygame.image.load('images/player.png') pygame.error: File is not a Windows BMP file I tried to uninstall pygame completely under pip site-packages, and then reinstalled, but the error still appeared