I'm trying to run this code:
import pygame
import os
WIDTH, HEIGHT = 900, 500
WIN = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("First Game!")
WHITE = (255, 255, 255)
FPS = 60
YELLOW_SPACESHIP_IMAGE = pygame.image.load(
os.path.join('Assets', 'spaceship_yellow.png'))
RED_SPACESHIP_IMAGE = pygame.image.load(
os.path.join('Assets', 'spaceship_red.png'))
def draw_window():
WIN.fill(WHITE)
WIN.blit(YELLOW_SPACESHIP_IMAGE, (300, 100))
pygame.display.update()
def main():
clock = pygame.time.Clock()
run = True
while run:
clock.tick(FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
draw_window()
if __name__ == "__main__":
main()
But it gave me this error:
Traceback (most recent call last):
File "/home/pi/Desktop/lalogame/main.py", line 13, in <module>
os.path.join('/home/pi/Desktop/lalogame/Assets', 'spaceship_yellow.png'))
pygame.error: File is not a Windows BMP file
I'm confused because I tried diferent things like used the convert function, algo reinstall the pygame. Basically the code is from a youtube begginers on pygame nothig really hard, but working with images is when the ploblems came. I need some help please.