import pygame
pygame.init()
screen = pygame.display.set_mode((512,927))
bg=pygame.image.load("./images/bg_01.jpg")
screen.blit(bg,(0,0))
pygame.display.update()
while True:
pass
pygame.quit()
clock = pygame.time.Clock()
while True:
clock.tick(60)
表示间隔60帧
在游戏循环中监听事件
注意:常量全是大写
静态方法上面加@staticmethod
python 中如何选择位置的随机