Commit e4cbdff1 by BellCodeEditor

save project

parent 0a7e7b6b
Showing with 5 additions and 0 deletions
...@@ -2,6 +2,9 @@ import pygame ...@@ -2,6 +2,9 @@ import pygame
from pygame import locals from pygame import locals
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
a=pygame.display.set_caption("SB玩的游戏")
tubiao = pygame.image.load("xuanwu3.png")
pygame.display.set_icon(tubiao)
bg = pygame.image.load("bg.png") bg = pygame.image.load("bg.png")
apple = pygame.image.load("apple.png") apple = pygame.image.load("apple.png")
right = pygame.image.load("right.png") right = pygame.image.load("right.png")
...@@ -9,12 +12,14 @@ body = pygame.image.load("body.png") ...@@ -9,12 +12,14 @@ body = pygame.image.load("body.png")
up = pygame.image.load("up.png") up = pygame.image.load("up.png")
down = pygame.image.load("down.png") down = pygame.image.load("down.png")
left = pygame.image.load("left.png") left = pygame.image.load("left.png")
# 创建一个窗口 # 创建一个窗口
abc = pygame.display.set_mode((800,600)) abc = pygame.display.set_mode((800,600))
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
exit() exit()
abc.blit(bg,(0,0)) abc.blit(bg,(0,0))
abc.blit(apple,(690,540)) abc.blit(apple,(690,540))
abc.blit(right,(240,210)) abc.blit(right,(240,210))
......
xuanwu3.png

37.7 KB

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