源代码:
import random
import sys
import pygame
from pygame.sprite import Group, Sprite
pygame.init()
pygame.mixer.init()
photo1 = pygame.image.load("photo1.png")
tryto = 35
now_block = []
flag1 = [False, 0]
class Music:
music1 = pygame.mixer.Sound("music1.mp3")
music2 = pygame.mixer.Sound("music2.mp3")
music2.set_volume(0.6)
music3 = pygame.mixer.Sound("music3.mp3")
music3.set_volume(0.6)
music4 = pygame.mixer.Sound("music4.mp3")
music4.set_volume(0.6)
music5 = pygame.mixer.Sound("music5.mp3")
music5.set_volume(0.8)
class Color:
color1 = (196, 197, 202)
render_color = (72, 95, 249)
screen_color = (157, 159, 164)
def game_over(screen, score):
pygame.time.wait(1000)
gamefont = pygame.font.SysFont("宋体", 40)
scorerender = gamefont.render(f"score:{score}", True, Color.render_color)
screen.fill(Color.screen_color)
gameover_Render = gamefont.render("Game Over", True, Color.render_c