一、效果图
二、部分代码
import pygame
import time
import random
import math
pygame.init()
WIDTH, HEIGHT = 600, 500
win = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Fireworks!")
FPS = 60
COLORS = [
(255, 0, 0),
(0, 255, 0),
(0, 0, 255),
(0, 255, 255),
(255, 165, 0),
(255, 255, 255),
(230, 230, 250),
(255, 192, 203)
]