import sys
import time,sched
from threading import Timer
import datetime
import numpy as np
import pygame
from pygame import surface
import threading
pygame.init()
size = width, height = 600, 600
screen = pygame.display.set_mode(size)
color = (255, 255, 255)
fcclock = pygame.time.Clock()
'''zsx = 220
zsy = 100
zenx = 70
zeny = 600
ysx = 320
ysy = 100
yenx = 570
yeny = 600
############################################
f = False
l=False
r=False
cjshuzu = []
xsshuzu = []
o = 5
def you(screen, ystx, ysty, yenx, yeny):
hei = (0, 0, 0)
start = (ystx, ysty)
end = (yenx, yeny)
width = 1222
pygame.draw.line(screen, hei, start, end, 10)
def zuo(screen, zstx, zsty, zenx, zeny):
hei = (0, 0, 0)
start = (zstx, zsty)
end = (zenx, zeny)
width = 1262
pygame.draw.line(screen, hei, start, end, 10) # aaline抗锯齿
'''
lux=0
luy=600
lw=600
while True:
s = sched.scheduler(time.time, time.sleep)
screen.fill(color)
fcclock.tick(9)
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
pygame.quit()
exit()
keys = pygame.key.get_pressed()
if keys[pygame.K_UP]:
f = True
if keys[pygame.K_LEFT]:
l = True
if keys[pygame.K_RIGHT]:
r = True
if event.type == pygame.KEYUP:
f = False
l=False
if event.type == pygame.KEYDOWN:
r = False
'''zuo(screen, 230, 105, -60, 610)
you(screen, 310, 105, 720, 610)'''
pygame.draw.rect(screen, (116, 194, 243), (0, 0, 620, 300), 0)
pygame.draw.rect(screen, (0, 244, 0), (0, 300, 620, 400), 0)
for i in range(150):
y=i*2
x=i*2
w=i*4
zw=35
zx=i*0.2
pygame.draw.rect(screen, (220, 224, 234), (lux+x, luy-y, lw-w, 2), 0)
pygame.draw.rect(screen, (250, 0, 0), (lux + x, luy - y, zw-zx , 2), 0)
pygame.draw.rect(screen, (250, 0, 0), (lw-x , luy - y, zw-zx , 2), 0)
dcar = pygame.image.load("d3.png")
car = pygame.transform.scale(dcar, (80, 80))
screen.blit(car, (250, 450))
pygame.display.update()
pygame.display.flip()