Commit 1bdc1d7b by BellCodeEditor

auto save

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