Commit bab2e2e0 by BellCodeEditor

save project

parent 1c037d07
Showing with 5 additions and 0 deletions
import pygame import pygame
from pygame import locals from pygame import locals
import random import random
score=0
# 初始化pygame,为使用pygame做准备 # 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
background=pygame.image.load('bg.png') background=pygame.image.load('bg.png')
...@@ -8,6 +9,10 @@ food=pygame.image.load('apple.png') ...@@ -8,6 +9,10 @@ food=pygame.image.load('apple.png')
right=pygame.image.load('right.png') right=pygame.image.load('right.png')
st=pygame.image.load('body.png') st=pygame.image.load('body.png')
# 创建一个窗口 # 创建一个窗口
my_font=pygame.font.Font("neuropol,ttf,13")
info="score"+str(score)
test=my_font.render(info,True,(0,0,0))
score.blit(test,(540,10))
screen=pygame.display.set_mode((660,480)) screen=pygame.display.set_mode((660,480))
apple_x=360 apple_x=360
......
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