-
Notifications
You must be signed in to change notification settings - Fork 0
/
snow.py
50 lines (34 loc) · 1.1 KB
/
snow.py
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
40
41
42
43
44
45
46
47
48
49
50
import pygame
import random
pygame.init()
black = (0 ,0, 0)
white = (255, 255, 255)
myDisplay = pygame.display.set_mode((1110, 600))
pygame.display.set_caption("Keyboard qwerty")
SnowFlakes =[]
#=====================================================
for q in range(100):
x = random.randrange(0, 1110)
y = random.randrange(0,590)
SnowFlakes.append([x, y])
#=====================================================
cloack = pygame.time.Clock()
farm = false
background_position = [0, 0]
background_image = pygame.image.load("qwerty.png").convert()
while not farm:
for event in pygame.event.get():
if event.type ==pygame.QUIT:
farm = True
myDisplay.blit(background_image, background_position)
#============================================================
for i in SnowFlakes:
i[1]+= 1
pygame.draw.circle(myDisplay, white, i, 7)
if i[1] > 590:
i[1]= random.randrange(-50 , -5)
i[0] = random.randrange(1110)
#==================================================
pygame.display.flip()
clock.tick(600)
pygame.quit()