Commit f8e53ffc by BellCodeEditor

save project

parent c32c88dc
Showing with 438 additions and 33 deletions
This source diff could not be displayed because it is too large. You can view the blob instead.
import pygame # import pygame
from pygame import locals # from pygame import locals
# 初始化pygame,为使用硬件做准备
pygame.init() # # 初始化pygame,为使用硬件做准备
# 创建一个窗口 # pygame.init()
screen = pygame.display.set_mode((660, 480)) # # 创建一个窗口
FPSCLOCK = pygame.time.Clock() # screen = pygame.display.set_mode((660, 480))
# 背景 # FPSCLOCK = pygame.time.Clock()
background = pygame.image.load('bg.png') # # 背景
right = pygame.image.load('right.png') # background = pygame.image.load('bg.png')
food = pygame.image.load('apple.png') # right = pygame.image.load('right.png')
body = pygame.image.load('body.png') # food = pygame.image.load('apple.png')
x=240 # body = pygame.image.load('body.png')
y=120 # x=240
while True: # y=120
for event in pygame.event.get(): # rrw = [(180,90),(180,120),(210,120),(x,y)]
if event.type == locals.QUIT: # while True:
# 接收到退出事件后退出程序 # for event in pygame.event.get():
exit() # if event.type == locals.QUIT:
x += 30 # # 接收到退出事件后退出程序
# 将背景图画上去 # exit()
screen.blit(background, (0, 0)) # x += 30
# 将贪吃蛇画上去 # rrw.append((x,y))
screen.blit(right, (240, 120)) # rrw.pop(0)
# 将贪吃蛇的身体画上去 # # 将背景图画上去
screen.blit(body, (210, 120)) # screen.blit(background, (0, 0))
screen.blit(body, (180, 120)) # # 将贪吃蛇画上去
screen.blit(body, (180, 90)) # screen.blit(right, (x, y))
# 将果实画上去 # # 将贪吃蛇的身体画上去
screen.blit(food, (360, 300)) # for i in range(len(rrw)-1):
# 刷新画面 # screen.blit(body,rrw[i])
pygame.display.update() # # 将果实画上去
FPSCLOCK.tick(3) # screen.blit(food, (360, 300))
# # 刷新画面
# pygame.display.update()
# FPSCLOCK.tick(7)
for i in range(1,10):
for j in range(1,i+1):
print(j,'*',i,'=',(j*i),end=' ')
print()
......
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