Commit 881b17b1 by BellCodeEditor

auto save

parent 52fa7fa6
Showing with 30 additions and 0 deletions
import turtle
pen=turtle.Pen()
pen.pencolor('black')
for y in range(10):
for i in range(5):
pen.right(72)
pen.forward(100)
pen.right(36)
turtle.done()
num1=int(input('请输入一个整数'))
if num1>=90:
g='A'
elif 60<=num1<=89:
g='B'
else
\ No newline at end of file
......@@ -17,6 +17,19 @@ while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
elif event.type==locals.KEYDOWN:
if event.key == locals.K_RIGHT and setheading!='left':
setheading='right'
snake_head=right
if event.key == locals.K_LEFT and setheading!='right':
setheading='left'
snake_head=left
if event.key == locals.K_RIGHT and setheading!='down':
setheading='up'
snake_head=right
if event.key == locals.K_LEFT and setheading!='up':
setheading='down'
snake_head=left
screen.blit(background, (0, 0))
screen.blit(right, (240, 120))
screen.blit(body, (210, 120))
......
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