Commit b3d617b5 by BellCodeEditor

save project

parent de29e5a7
Showing with 18 additions and 16 deletions
import pygame import pygame
from pygame import locals
import random
pygame.init() pygame.init()
screen=pygame.display.set_mode((800,600)) screen=pygame.display.set_mode((660,480))
while True: FPSCLOCK = pygame.time.Clock()
\ No newline at end of file background = pygame.image.load('bg.png')
right = pygame.image.load('right.png')
food = pygame.image.load('apple.png')
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
import pygame import pygame
from pygame import locals from pygame import locals
import random import random
# 初始化pygame,为使用硬件做准备
pygame.init() pygame.init()
# 创建一个窗口
screen = pygame.display.set_mode((660, 480)) screen = pygame.display.set_mode((660, 480))
FPSCLOCK = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数) # 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')
food = pygame.image.load('apple.png') # 食物 苹果 food = pygame.image.load('apple.png')
body = pygame.image.load('body.png') # 身体 # body = pygame.image.load('body.png')
left = pygame.image.load('left.png') # 头 朝左 # left = pygame.image.load('left.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')
my_font=pygame.font.Font('neuropol.ttf',18) my_font=pygame.font.Font('neuropol.ttf',18)
food_x,food_y = 360,300 food_x,food_y = 360,300
......
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