I'm trying to build the snake game using pygame. I'm following this tutorial.
I end up with the following error:
pygame.error: Couldn't open pygame.png
Are you facing the exact same error which is mentioned above while executing your code?
my code is like this
screen = pygame.display.set_mode([680, 480])
screen.fill([130, 0, 200])
img = pygame.image.load(file_name)
self.image = pygame.Surface([width,height])
self.rect = self.image.get_rect()
for event in pygame.event.get():
if event.type == pygame.QUIT:
So using this code you want to conclude that there is no error after executing it?
add import os at top of your ...READ MORE
Try installing libpng
You can do it with ...READ MORE
You need to download and install the ...READ MORE
pygame.Surface takes in integer values for building ...READ MORE
You must be trying this command in ...READ MORE
file = open('text.txt', 'w+)
You can also use the random library's ...READ MORE
colors = ['red', 'green', ...READ MORE
can you give an example using a ...READ MORE
You can simply the built-in function in ...READ MORE
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.