I have been attempting a shooter game in pygame but I have come across some difficulties with the fps. As I play the game the majority of the time the fps is clearly much less than what I have set it too. It doesn't seem to go above 50. If I test a high fps (100) it seems to go less than 50 fps. I appreciate any help, thanks.
screen.fill((0,0,0))
screen.blit(space,(0,0))
if activate == False:
pygame.draw.rect(screen,(0,0,0),(x+50,590,10,50))
elif activate == True:
y1-=5
pygame.draw.rect(screen,red,(x1,y1,10,50))
screen.blit(ship,(x,550))
if hit == False:
screen.blit(tie,(x2,y2))
screen.blit(tie,(x3,y3))
screen.blit(messenger(str(score),green,72),(20,20))
pygame.draw.rect(screen,healthColour,(600,0,health*4,20))
screen.blit(messenger("Health:",green,20),(525,-5))
pygame.display.update()
clock.tick(50)
pygame.quit()
I think it could be due to my images. The 'space' image (background) is my primary concern as when I remove it the code runs smoothly. It is very high definition. I do not think it is because of my computer performance(i5 processor), after all it is a very basic program.
ship = pygame.transform.scale(pygame.image.load("xwing.png"),(100,100))
space = pygame.transform.scale(pygame.image.load("space.jpg"),(1000,700))
tie = pygame.transform.scale(pygame.image.load("tie.png"),(100,100))