用户:二千子查看:0 回复:0 评论:0 创建时间:2020-03-16T11:38:26
【作品展示】

【作品介绍】
pygame
【作品源代码】
#1引入需要的模块
import pygame
import random
#1配置图片地址
IMAGE_PATH = 'imgs/'
#1设置页面宽高
scrrr_width=800
scrrr_height =560
#1创建控制游戏结束的状态
GAMEOVER = False
#1主程序
class MainGame():
#1加载游戏窗口
def init_window(self):
#1调用显示模块的初始化
pygame.display.init()
#1创建窗口
MainGame.window = pygame.display.set_mode([scrrr_width,scrrr_height]) #
#1开始游戏
def start_game(self):
#1初始化窗口
self.init_window()
#1只要游戏没结束,就一直循环
while not GAMEOVER:
#1渲染白色背景
MainGame.window.fill((255, 255, 255))
#1实时更新
pygame.display.update()
#1启动主程序
if __name__ == '__main__':
game = MainGame()
game.start_game()
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn