相关疑难解决方法(0)

Pygame 运行缓慢

在此处输入图片说明 我正在创建一个名为“生存岛”的游戏,并且刚刚创建了开始屏幕。pygame 在执行一个事件后滞后太多(需要时间来响应)。

这是我的源代码:

#packages
import pygame
import sys
from sys import exit
#initialization
pygame.init()
#display surf
width = 600
height = 400
surface  = pygame.display.set_mode((width,height))
clock = pygame.time.Clock()#for fps
#caption
pygame.display.set_caption('Survival Island')

#variables
mousex = 0
mousey = 0
#booleans
play = True #entered playmode
canQuitOnStart = True     #game can be quitted on start
drawStartScreen = True #start screen drawed
running = True # game is running
#definitions
def quitOnStart():     #quitting the game
    #can be seen if rect is drawn …
Run Code Online (Sandbox Code Playgroud)

python pygame python-3.x pygame-surface

4
推荐指数
1
解决办法
470
查看次数

标签 统计

pygame ×1

pygame-surface ×1

python ×1

python-3.x ×1