下面是一个简单的飞机射击游戏的示例代码:
import pygame
# 初始化 Pygame
pygame.init()
# 设置窗口大小和标题
screen = pygame.display.set_mode((400, 300))
pygame.display.set_caption('飞机射击游戏')
# 加载飞机图像
plane_image = pygame.image.load('plane.png')
# 设置飞机的初始位置
plane_x = 200
plane_y = 250
# 设置帧率
