Commit ef079a7b by BellCodeEditor

save project

parent 6f3caebc
Showing with 18 additions and 1 deletions
......@@ -13,14 +13,30 @@ body=pygame.image.load('body.png')
up=pygame.image.load('up.png')
down=pygame.image.load('down.png')
left=pygame.image.load('left.png')
setheading='right'
s_head=right
while True:
for event in pygame.event.get():
if event.type==QUIT:
exit()
elif event.type==KEYDOWN:
if event.key==K_RIGHT and setheading!='left':
setheading='right'
s_head=right
if event.key==K_LEFT and setheading!='right':
setheading='left'
s_head=left
if event.key==K_UP and setheading!='down':
setheading='up'
s_head=up
if event.key==K_DOWN and setheading!='up':
setheading='down'
s_head=down
if
screen.blit(bj,(0,0))
screen.blit(right,(240,120))
screen.blit(body,(210,120))
screen.blit(body,(180,120))
screen.blit(body,(180,90))
screen.blit(food,(360,300))
pygame.display.update()
pygame.display.update()
\ 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