Commit 539088f5 by BellCodeEditor

save project

parent c6188a1e
Showing with 33 additions and 3 deletions
import random
a=random.randint(2,5)
print(a)
from random import randint
b=randint(2,5)
print(b)
import turtle
turtle.forward(199)
turtle.done()
from turtle import * #节省前缀
forward(199)
done()
import pygame
from pygame import locals
# 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口
??
\ No newline at end of file
screen=pygame.display.set_mode((660,480))
#载入图片
bg=pygame.image.load('bg.png')
apple=pygame.image.load('apple.png')
snake=pygame.image.load('right.png')
body=pygame.image.load('body.png')
while True:
for event in pygame.event.get( ):
if event.type==locals.QUIT:
exit( )
screen.blit(bg,(0,0))
screen.blit(apple,(120,150))
screen.blit(snake,(360,300))
screen.blit(body,(330,300))
screen.blit(body,(300,300))
screen.blit(body,(300,270))
pygame.display.update()
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