Commit 55dfeb04 by BellCodeEditor

save project

parent 52f26819
apple.png

2.05 KB

bg.png

22.5 KB

body.png

1.4 KB

down.png

2.01 KB

left.png

2.07 KB

File added
right.png

2.05 KB

up.png

2.05 KB

import pygame
import pygame
from pygame import locals
pygame.init()
b = pygame.time.Clock()
screen = pygame.display.set_mode((660,480))
screen2 = pygame.image.load("bg.png")
apple = pygame.image.load("apple.png")
snackR = pygame.image.load("right.png")
body = pygame.image.load("body.png")
x,y = 240,120
position = [(180,90),(180,120),(210,120),(x,y)]
while True:
for i in pygame.event.get():
if i.type == locals.QUIT:
exit()
x+=30
position.append((x,y))
position.pop(0)
screen.blit(screen2,(0,0))
screen.blit(apple,(360,300))
screen.blit(snackR,(x,y))
for j in range(len(position)-1):
screen.blit(body,position[j])
b.tick(3)
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