this is my code idk why it runs so slow why is my code running so slow plz help me! thank you in advance
import pygame
from rgb import *
from pygame.constants import *
pygame.init()
height=700
width=1500
center=(780, 450)
ball_pos=[500,550]
sky_pos=[0,-1000]
screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)
pygame.display.update()
running=True
while running:
for event in pygame.event.get():
keys = pygame.key.get_pressed()
if keys[K_SPACE]:
running=False
pygame.display.update()
sky=pygame.image.load("sky.jpg")
if keys[K_RIGHT]:
sky_pos[0]-=1
screen.blit(sky, sky_pos)
class Circle:
pygame.draw.circle(screen, green, ball_pos, 50)
pygame.display.update()
screen.fill(black)
pygame.quit()
I tried doing everything but nothing is working i want the sky to move to the left with smoothness though i dont know how!