Python-game-code:使用pygame在python中进行平台游戏

时间:2021-04-04 04:14:24
【文件属性】:
文件名称:Python-game-code:使用pygame在python中进行平台游戏
文件大小:1KB
文件格式:ZIP
更新时间:2021-04-04 04:14:24
Python游戏代码 导入pygame #Initialise pygame pygame.init() #创建游戏窗口Width = 800 Length = 600 Window = pygame.display.set_mode((Width,Length)) #字符的位置,大小和速度变化char_Width = 40 char_Length = 80 char_X = 20 char_Y = 520 delta_X = 1 char_X_change = 0 jump_velocity = 10重力= 0.9 计数器= 0跳=假 running =运行时为True:#Background color Window.fill((255,0,0)) for event in pygame.event.get(): #Closes game if you click
【文件预览】:
Python-game-code-main
----README.md(2KB)

网友评论