pygame验证性作业
3 月,跳不动了?>>> import pygame,sys,time,random from pygame.locals import * pygame.init() fpsClock = pygame.time.Clock() playSurface = pygame.display.set_mode((640,480)) pygame.display.set_caption('贪吃蛇游戏') # 定义一些颜色 redColour = pygame.Color(255,0,0) blackColour = pygame.Color(0,0,0) whiteColour = pygame.Color(255,255,255) greyColour = pygame.Color(150,150,150) # 初始化了一些程序中用到的变量 snakePosition = [100, 100] snakeSegments = [[100, 100], [80, 100], [60, 100]] raspberryPosition = [300, 300] #位置 raspberrySpawned = 1 #是否吃到树莓 direction = 'right' changeDirection = direction def gameOver(): gameOverFont =