add pygame test
This commit is contained in:
parent
0bc9777bfb
commit
860f7bd0ad
24
mod_pygame/test_pygame_works.py
Normal file
24
mod_pygame/test_pygame_works.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import pygame
|
||||||
|
|
||||||
|
|
||||||
|
WIDTH = 1000
|
||||||
|
HEIGHT = 1000
|
||||||
|
|
||||||
|
|
||||||
|
def draw_background_image(screen, filename):
|
||||||
|
background = pygame.image.load(filename)
|
||||||
|
screen.blit(background, (0, 0))
|
||||||
|
|
||||||
|
pygame.init()
|
||||||
|
|
||||||
|
screen = pygame.display.set_mode((WIDTH, HEIGHT))
|
||||||
|
pygame.display.set_caption("Тест Pygame")
|
||||||
|
|
||||||
|
draw_background_image(screen, "assets/bg1k.png")
|
||||||
|
|
||||||
|
pygame.display.flip()
|
||||||
|
|
||||||
|
while pygame.event.wait().type != pygame.QUIT:
|
||||||
|
...
|
||||||
|
|
||||||
|
pygame.quit()
|
Loading…
x
Reference in New Issue
Block a user