0

I'm currently making submarine game using pygame and I came across strange problem. When I tried to run menu program, background image won't render. And I don't get any syntax error. I tried to determine fps, use convert(), but nothing helped. When I searched for mistake on google I didn't find anything useful either. Here's the code:

import pygame
pygame.init()
screen = pygame.display.set_mode((600, 500))
pygame.display.set_caption('Podmornca')
run = True
background = pygame.image.load('meni.png').convert()
clock = pygame.time.Clock()
def graphics():
    clock.tick(60)
    screen.blit(background, (0,0))  
while run:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False
    graphics()
pygame.quit()
Rabbid76
  • 177,135
  • 25
  • 101
  • 146

1 Answers1

0

You have to update the display by either pygame.display.update() or pygame.display.flip():

while run:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False
    grafika()
    pygame.display.update()
Rabbid76
  • 177,135
  • 25
  • 101
  • 146