black test_pygame_works
This commit is contained in:
parent
1eb9fa48fe
commit
0f7fbc2fca
@ -9,6 +9,7 @@ def draw_background_image(screen, filename):
|
|||||||
background = pygame.image.load(filename)
|
background = pygame.image.load(filename)
|
||||||
screen.blit(background, (0, 0))
|
screen.blit(background, (0, 0))
|
||||||
|
|
||||||
|
|
||||||
pygame.init()
|
pygame.init()
|
||||||
|
|
||||||
screen = pygame.display.set_mode((WIDTH, HEIGHT))
|
screen = pygame.display.set_mode((WIDTH, HEIGHT))
|
||||||
@ -17,8 +18,10 @@ pygame.display.set_caption("Тест Pygame")
|
|||||||
draw_background_image(screen, "assets/bg1k.png")
|
draw_background_image(screen, "assets/bg1k.png")
|
||||||
|
|
||||||
pygame.draw.line(screen, pygame.Color("Green"), [10, 100], [700, 700], 3)
|
pygame.draw.line(screen, pygame.Color("Green"), [10, 100], [700, 700], 3)
|
||||||
pygame.draw.rect(screen, pygame.Color("red"),(350, 20, 100, 175))
|
pygame.draw.rect(screen, pygame.Color("red"), (350, 20, 100, 175))
|
||||||
pygame.draw.polygon(screen, pygame.Color("red"), points=[(50,100), (100,50), (350,100)])
|
pygame.draw.polygon(
|
||||||
|
screen, pygame.Color("red"), points=[(50, 100), (100, 50), (350, 100)]
|
||||||
|
)
|
||||||
pygame.draw.circle(screen, pygame.Color("blue"), (500, 500), 100)
|
pygame.draw.circle(screen, pygame.Color("blue"), (500, 500), 100)
|
||||||
|
|
||||||
pygame.display.flip()
|
pygame.display.flip()
|
||||||
@ -26,4 +29,4 @@ pygame.display.flip()
|
|||||||
while pygame.event.wait().type != pygame.QUIT:
|
while pygame.event.wait().type != pygame.QUIT:
|
||||||
...
|
...
|
||||||
|
|
||||||
pygame.quit()
|
pygame.quit()
|
||||||
|
Loading…
Reference in New Issue
Block a user