Commit 3e3b8bdb by BellCodeEditor

auto save

parent e4af8f1d
Showing with 50 additions and 0 deletions
#import pygame
"""
import random
x,y=240,120
pygame.init()
po=[(180,240),(210,240),(x,y)]
g=pygame.time.Clock()
a=pygame.display.set_mode((660,480))
c=pygame.image.load("bg.png")
b=pygame.image.load("right.png")
e=pygame.image.load("body.png")
"""
ap=pygame.image.load("apple.png")
b2=pygame.image.load("up.png")
b3=pygame.image.load("down.png")
b4=pygame.image.load("left.png")
sett2==b
while True:
for event in pygame.event.get():
if event.type==pygame.QUIT:
o=random.randint(0,1)
if o==1:
exit()
else:
continue
if event.key==pygame.LEFT and sett2!=b:
sett2==b4
if event.key==pygame.RIGHT and sett2!=b4:
sett2==b
if event.key==pygame.RIGHT and sett2!=b4:
sett2==b
a.blit(c,(0,0))
a.blit(ap,(300,240))
x+=30
po.append((x,y))
po.pop(0)
a.blit(b,(x,y))
for i in range(len(po)-1):
a.blit(e,po[i])
if x>=660:
x=0
pygame.display.update()
g.tick(3)
\ 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