Commit a667caed by BellCodeEditor

save project

parent f5147e7c
Showing with 8 additions and 4 deletions
...@@ -2,9 +2,10 @@ import pygame ...@@ -2,9 +2,10 @@ import pygame
from pygame import locals from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
x,y=240,360
# 创建一个窗口 # 创建一个窗口
screen=pygame.display.set_mode((660,480)) screen=pygame.display.set_mode((660,480))
FPSCLOCK=pygame.time.Clock()
background=pygame.image.load('bg.png') background=pygame.image.load('bg.png')
right=pygame.image.load('right.png') right=pygame.image.load('right.png')
body=pygame.image.load('body.png') body=pygame.image.load('body.png')
...@@ -14,9 +15,12 @@ while True: ...@@ -14,9 +15,12 @@ while True:
print(event) print(event)
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
x+=30
screen.blit(background,(0,0)) screen.blit(background,(0,0))
screen.blit(right,(240,360)) screen.blit(right,(x,y))
screen.blit(food,(330,420)) screen.blit(food,(330,420))
screen.blit(body,(210,360)) screen.blit(body,(210,360))
screen.blit(body,(180,360)) screen.blit(body,(180,360))
screen.blit(body,(150,360)) screen.blit(body,(150,360))
\ No newline at end of file pygame.display.update()
FPSCLOCK.tick(3)
\ 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