-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtesting.py
More file actions
39 lines (32 loc) · 935 Bytes
/
testing.py
File metadata and controls
39 lines (32 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import pygame
import sys
import os
import random
import math
pygame.init()
size = width, height = 600, 600 # касаемо экрана
screen = pygame.display.set_mode(size)
def terminate():
pygame.quit()
sys.exit()
def load_image(name, colorkey=None): # загрузка картинки
fullname = os.path.join('data', name)
if not os.path.isfile(fullname):
print(f"Файл с изображением '{fullname}' не найден")
sys.exit()
image = pygame.image.load(fullname)
if colorkey is not None:
image = image.convert()
if colorkey == -1:
colorkey = image.get_at((0, 0))
image.set_colorkey(colorkey)
else:
image = image.convert_alpha()
return image
a = list(range(0, 11))
print(a)
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
terminate()
pygame.display.flip()