Commit 975ce430 by BellCodeEditor

auto save

parent 2742489a
Showing with 4 additions and 4 deletions
import pygame
from pygame import locals
import random
import random
class Block(pygame.sprite.Sprite):
def __init__(self,image1,image2,image3):
......@@ -33,9 +33,11 @@ jumpState = "runing"
t = 30
aa=Block(bush,cacti,stone)
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
if event.type == locals.KEYDOWN:
......@@ -78,8 +80,6 @@ while True:
# 创建障碍物对象
aa=Block(bush,cacti,stone)
aa.rect.x -= 8
screen.blit(aa.image, (aa.rect.x, aa.rect.y))
# 刷新画面
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