"""
精灵测试
"""
import time
import pygame
from random import randint
from sys import exit
from pygame.locals import *
SCREEN_WIDTH = 1200
SCREEN_HEIGHT = 800
# 初始化pygame
pygame.init()
# 初始化窗口
screen = pygame.display.set_mode([SCREEN_WIDTH, SCREEN_HEIGHT])
# 窗口标题
pygame.display.set_caption('精灵类测试')
# 建立精灵组
#group = pygame.sprite.Group()
# 主循环
while True:
# 绘制背景
x = 0
y = 60
def zidan(x,y):
import pygame
pygame.draw.circle(screen, [255, 0, 0], [x, y], 30, 0)
for j in range(0,20):
y = y+60
for i in range(0, 20):
x = x + 50
zidan(x, y)
x = 0
#time.sleep(1)
#screen.fill((255, 255, 255))
#time.sleep(10)
#screen.fill((255, 255, 255))
# 界面更新
pygame.display.update()
# 退出
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
exit()
pygame用圆画矩阵
最新推荐文章于 2022-10-22 23:48:08 发布