fps limit

This commit is contained in:
2025-07-04 16:00:36 +02:00
parent 831bebda07
commit 73309cb310

View File

@@ -16,6 +16,8 @@ def main():
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
time = pygame.time.Clock()
dt = 0
while True:
for event in pygame.event.get():
@@ -23,8 +25,9 @@ def main():
return
pygame.Surface.fill(screen, (0,0,0))
pygame.display.flip() #refresh screen
pygame.display.flip() #this is the last in loop | refresh screen
dt = time.tick(60) / 1000 #conveted to ms
if __name__ == "__main__":
main()