Commit 8d92bff3 by BellCodeEditor

save project

parent 4b48b9ff
Showing with 29 additions and 6 deletions
......@@ -3,20 +3,32 @@ from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
FPSCLICK = pygame.time.Clock()
# 创建一个窗口
baclground = pygame.image.load("bg.png")
right = pygame.image.load("right.png")
apple = pygame.image.load("apple.png")
body = pygame.image.load("body.png")
x,y = 240,120
position = [(180,120),(180,270),(210,120),(x,y)]
screen = pygame.display.set_mode((660,480))
x,y = 240,120
while True:
for event in pygame.event.get():
if event.type == 12:
exit()
pos = [(210 + 30,120),(180 + 30,120)]
for i in pos:
screen.blit(body,(body,i))
pygame.display.update()
# if event.type == locals.KEYDOWN:
# if event.key == event.K_DOWN:
# y += 30
x += 30
position.append((x,y))
position.pop(0)
screen.blit(baclground,(0,0))
screen.blit(right,(x,y))
screen.blit(apple,(360,300))
screen.blit(body,(210,120))
pygame.display.update()
FPSCLICK.tick(3)
import pygame
from pygame import locals
pygame.init()
while True:
screen = pygame.display.set_mode((1920,1080))
while True:
for event in pygame.event.get():
if event.type == 12:
print(event)
\ No newline at end of file
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