Commit b0c22127 by BellCodeEditor

save project

parent 241620a6
Showing with 43 additions and 0 deletions
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
elif.type == locals.KEYDOWN:
if event.key == locals.K_RIGHT and setheading !="right":setheading = 'left'
setheading = 'range'
snake_head = range
if event.key == locals.K_LEFT and setheading !="right":setheading = 'left'
setheading = 'left'
snake_head = left
if event.key == locals.K_UP and setheading !="right":setheading = 'down'
setheading = 'up'
snake_head = up
if event.key == locals.K_DOWN and setheading !="right":setheading = 'up'
setheading = 'down'
snake_head = down
if setheading == "right"
x += 30
elit setheading == "left"
x -= 30
elit setheading == "up"
y -= 30
else:
y += 30
position.append((x,y))
position.pop(0)
screen.blit(position,(0,0))
screen.blit
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