I tried running this script on my RasPi, it should create a red rect on black background:
game.py:this is the output:
https://ibb.co/gFvk7sX
Does someone know, why this is?
game.py:
Code:
import pygameimport syspygame.init()screen = pygame.display.set_mode((0, 0), pygame.FULLSCREEN)screen_width, screen_height = screen.get_size()pygame.display.set_caption("RasPi")running = Truewhile running: for event in pygame.event.get(): if event.type == pygame.QUIT: running = False elif event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: running = False pygame.draw.rect(screen, (255, 0, 0), (20, 20, 20, 20)) pygame.display.flip() pygame.time.Clock().tick(60)pygame.quit()sys.exit()
https://ibb.co/gFvk7sX
Does someone know, why this is?
Statistics: Posted by TOTOskiller — Sat Oct 26, 2024 5:22 pm