Mario game file can't find image in pygame.image.load()

Question:
How can I make it so that replit won’t FileNotFound me? This may also happen to multiple other cases of my game since it uses the same method to get images.
Repl link:
https://replit.com/@creaternet101/Mario-Game#main.py

code snippet
import pygame

cactus_img = pygame.image.load('cactus_bricks.png')

Hi @creaternet101 !
You’ll need to upload all the files into the repl.

Dots

Then, click the Upload File button and upload the image files into the repl.
Hope this helps!

2 Likes

@NateDhaliwal
I did what you said but the repl said that there was a new error after I started the game and pressed a key. In the consle it said the ‘mixer’ was not iniciated. Please help.
The images are (hopefully) all uploaded. The functions and the music won’t work.

Hi @creaternet101 !
I ran your repl and everything seems fine, the Output window loads.

see this topic

3 Likes

Sorry @NateDhaliwal
The output window loads but after you click the window and press start, the window just ends.
Can you find the reason?

The reason the window ends is because of a mixer error. To fix this, go to the topic linked below and go through the entire thread (there are two things you have to do).

1 Like

Ok thanks.
I will try the module.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.