Commit 975ce430 by BellCodeEditor

auto save

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