Commit 1bdc1d7b by BellCodeEditor

auto save

parent f2a18749
Showing with 29 additions and 24 deletions
import pygame import turtle
from pygame import locals pen = turtle.Pen()
#初始化pygame,为使用pygame做准备 pen.goto(0,0)
pygame.init() pen.right(180)
for i in range(3):
background = pygame.image.load("bg.png") pen.forward(100)
food = pygame.image.load("apple.png") pen.right(120)
body = pygame.image.load("body.png") pen.pencolor('olive')
right = pygame.image.load("right.png") pen.penup()
pen.goto(20,-10)
pen.pendown()
# 创建一个窗口 pen.setheading(100)
screen = pygame.display.set_mode((660, 480), 0, 32) pen.forward(150)
while True: pen.pencolor('green')
for event in pygame.event.get(): for i in range(5):
if event.type == locals.QUIT: pen.forward(50)
exit() pen.forward(-50)
screen.blit(background,(0,0)) pen.left(75)
screen.blit(food,(240,240)) pen.penup()
screen.blit(body,(180,120)) pen.pencolor('blue')
screen.blit(right,(180,90)) pen.goto(50,50)
pen.pendown()
pygame.display.update() pen.fillcolor('blue')
\ No newline at end of file pen.begin_fill()
pen.setheading(180)
pen.circle(20,360)
pen.end_fill()
turtle.done()
\ 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