Commit 95df5f6b by BellCodeEditor

auto save

parent cb5a9203
Showing with 12 additions and 0 deletions
import pygame
cacti=pygame.image.load('cacti.png')
rect=cacti.get_rect()
print(rect)
print(rect.x)
print(rect.y)
print(rect.width)
print(rect.height)
\ No newline at end of file
import pygame import pygame
from pygame import locals from pygame import locals
import random
pygame.init() # 初始化 pygame.init() # 初始化
# 创建一个窗口 # 创建一个窗口
...@@ -21,6 +22,8 @@ index = 0 ...@@ -21,6 +22,8 @@ index = 0
y=400 y=400
jumpState = 'running' jumpState = 'running'
t=30 t=30
obstacle = random.choice([])
rect = obstacle.get
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:
......
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