Commit 4695645d by BellCodeEditor

save project

parent 2b2bf3b2
Showing with 21 additions and 2 deletions
......@@ -20,8 +20,27 @@ while True:
if event.type == locals.QUIT:
exit()
elif event.type == locals.KEYDOWN:
if event.key ==
x+=30
if event.key ==locals.K_d and set !='left':
set='right'
snake_head=right
if event.key ==locals.K_a and set !='right':
set='left'
snake_head=left
if event.key ==locals.K_w and set !='down':
set='up'
snake_head=up
if event.key ==locals.K_s and set !='up':
set='down'
snake_head=down
if set =='right':
x+=30
elif set == 'left':
x-=30
elif set == 'up':
y-=30
else:
y+=30
pos.append((x,y))
pos.pop(0)
screen.blit(background,(0,0))
......
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