Commit 42f1723b by BellCodeEditor

save project

parent 41af58d4
Showing with 5 additions and 3 deletions
import pygame import pygame
import random
from pygame import locals from pygame import locals
pygame.init() pygame.init()
screen = pygame.display.set_mode((660, 480)) screen = pygame.display.set_mode((660, 480))
...@@ -13,6 +14,7 @@ body = pygame.image.load('body.png') ...@@ -13,6 +14,7 @@ body = pygame.image.load('body.png')
zx='right' zx='right'
cx=right cx=right
x,y=240,120 x,y=240,120
x1,y1=360,300
lb=[(180,90),(180,120),(210,120),(x,y)] lb=[(180,90),(180,120),(210,120),(x,y)]
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -41,10 +43,11 @@ while True: ...@@ -41,10 +43,11 @@ while True:
y+=30 y+=30
lb.append((x,y)) lb.append((x,y))
lb.pop(0) lb.pop(0)
screen.blit(background, (0, 0)) screen.blit(background, (0, 0))
screen.blit(cx, (x, y)) screen.blit(cx, (x, y))
for i in range(len(lb)-1): for i in range(len(lb)-1):
screen.blit(body,lb[i]) screen.blit(body,lb[i])
screen.blit(food, (360, 300)) screen.blit(food, (x1, y1))
pygame.display.update() pygame.display.update()
e.tick(3) e.tick(3)
\ No newline at end of file
import random
import random
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