Commit 6df5d85b by BellCodeEditor

save project

parent a298c976
Showing with 28 additions and 7 deletions
import pygame import pygame
from pygame import locals from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
bg=pygame.image.load('bg.png') bg=pygame.image.load('bg.png')
apple=pygame.image.load('apple.png') apple=pygame.image.load('apple.png')
...@@ -11,17 +12,23 @@ down=pygame.image.load('down.png') ...@@ -11,17 +12,23 @@ down=pygame.image.load('down.png')
up=pygame.image.load('up.png') up=pygame.image.load('up.png')
# 创建一个窗口 # 创建一个窗口
screen=pygame.display.set_mode((660,480)) screen=pygame.display.set_mode((660,480))
FPS=pygame.time.Clock()
a=240
while True: while True:
a+=30
for event in pygame.event.get(): for event in pygame.event.get():
print(event)
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
screen.blit(bg,(0,0)) screen.blit(bg,(0,0))
screen.blit(right,(210,120)) screen.blit(right,(a,120))
screen.blit(body,(a-30,120))
screen.blit(body,(a-60,120))
screen.blit(body,(a-90,90))
screen.blit(apple,(a--30,120))
screen.blit(body,(180,120)) pygame.display.update()
screen.blit(body,(150,120)) FPS.tick(3)
screen.blit(body,(150,90))
screen.blit(apple,(360,90))
pygame.display.update()
\ No newline at end of file
import pygame
import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口
screen=pygame.display.set_mode((660,480))
for i in range(100):
for event in pygame.event.get():
print(event)
if event.type == locals.QUIT:
exit()
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