Commit 2e7b4231 by BellCodeEditor

save project

parent 8c8f001f
Showing with 6 additions and 37 deletions
import pygame import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init() pygame.init()
screen = pygame.drsplay.set_mode((640,480))
# 创建一个窗口 \ No newline at end of file
screen = pygame.display.set_mode((660,480))
FPSCLOCK=pygame.time.CIock(3)
x+=3
screen.blitbackgroud,(00))
screen.blitright,(240120
screen.blitbody,(210120))
screen.blitbody,(180120
screen.blitbody,(18090))
screen.blitfood,(360300)
pygame.display.update()
FPSCLOCK.tick(3)
if sethaeding == 'rigte'
x += 30
elif setgaeding == 'left':
x -=30
elif setgaeding =='up'
y -=30
elif:
y +=30
position.append((x,y))
if x== apple_x and y ==apple_y:
num1 =randint.randint1,22
num2 =randint.randint(1,16)
eise
apple_x =30* num1-30
apple_y =30* num2-30
screen.blitbackgroud,(00))
screen.blit snake_head,position[-1]
for i
\ 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