import pygame
import sys
pygame.init()
size = width,height = (950,600)
pygame.display.set_caption('测试')
screen = pygame.display.set_mode(size)
background = pygame.image.load('images/地图.png')
class Player:
def __init__(self):
self.image = pygame.image.load('111.png')
self.rect = self.image.get_rect()
player = Player()
FPS = 60
clock = pygame.time.Clock()
while True:
screen.blit(background,(0,0))
screen.blit(player.image,player.rect)
for a in pygame.event.get():
if a.type == pygame.QUIT:
pygame.quit()
sys.exit()
clock.tick(FPS)
pygame.display.update()