Commit 56dde7fc by BellCodeEditor

save project

parent c6188a1e
Showing with 26 additions and 4 deletions
piggy.jpg

44.4 KB

import pygame import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
WIDHT = 549
HEIGHT = 549
# 创建一个窗口 # 创建一个窗口
?? screen = pygame.display.set_mode((WIDHT,HEIGHT))
\ No newline at end of file background = pygame.image.load("piggy.jpg")
right = pygame.image.load("right.png")
left = pygame.image.load("left.png")
down = pygame.image.load("down.png")
up = pygame.image.load("up.png")
body = pygame.image.load("body.png")
apple = pygame.image.load("apple.png")
while True:
for event in pygame.event.get():
if event.type ==locals.QUIT:
exit()
screen.blit(background,(0,0))
screen.blit(apple,(270,270))
screen.blit(right,(210,210))
screen.blit(body,(180,210))
screen.blit(body,(150,210))
screen.blit(body,(150,180))
pygame.display.update()
\ 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