Commit 5b137ef2 by BellCodeEditor

save project

parent 4eb1370b
Showing with 18 additions and 7 deletions
import pygame import pygame
j="runing"
t=30
cacti=pygame.image.load('cacti.png') y=400
rect=cacti.get_rect() while True:
print(rect) if j=="up":
print(rect.x) if t>0:
\ No newline at end of file y-=t
t-=2
else:
j='down'
print(y)
if t<=30:
y+=t
t+=2
else:
j='runing'
\ No newline at end of file
...@@ -6,6 +6,7 @@ pygame.init() # 初始化 ...@@ -6,6 +6,7 @@ pygame.init() # 初始化
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数) FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
# 载入图片 # 载入图片
pygame.display.
background = pygame.image.load('bg.png') # 背景 background = pygame.image.load('bg.png') # 背景
road = pygame.image.load('road.png') # 路 road = pygame.image.load('road.png') # 路
stone = pygame.image.load('stone.png') # 石头 stone = pygame.image.load('stone.png') # 石头
......
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