Commit 7ef98edc by BellCodeEditor

auto save

parent 81dc4c9a
Showing with 3 additions and 2 deletions
import pygame
from pygame import locals
import random
gamestate = True
pygame.init() # 初始化
# 创建一个窗口
class Block(pygame.sprite.Sprite):
......@@ -54,7 +54,7 @@ while True:
if jumpState == "runing":
if event.key == locals.K_SPACE:
jumpState = "up"
if gamestate== True:
if jumpState == "up": # 起跳状态
if t > 0:
y -= t
......@@ -110,6 +110,7 @@ while True:
if pygame.sprite.collide_rect(wukong,sprite):
gameover=pygame.image.load('gameover.png')
screen.blit(gameover,(400,200))
gamestate=False
pygame.display.update()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment