-
Notifications
You must be signed in to change notification settings - Fork 1
/
time.py
34 lines (34 loc) · 947 Bytes
/
time.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
#Day and Night
from pygame import*
from time import time as tm
screen=display.set_mode((800,600))
screen.fill((0,0,0))
background=image.load("background.png").convert()
clock=time.Clock()
clockCount=0
positive=True
filler=0
running=True
while running:
for evt in event.get():
if evt.type==QUIT:
running=False
#-------------------------------------------------------
clock.tick(60)
if clockCount<255 and positive:
clockCount+=1
else:
positive=False
if clockCount>0 and not positive:
clockCount-=1
else:
positive=True
screen.fill(0)
background.set_alpha(clockCount)
screen.blit(background,(0,0))
print(background.get_alpha())
display.set_caption("dank example fps = {0:.0f}".format(clock.get_fps()))
print((background.get_alpha()))
#-------------------------------------------------------
display.flip()
quit()