Commit 3054875f by BellCodeEditor

save project

parent 0b16b521
Showing with 23 additions and 0 deletions
import pygame import pygame
from pygame import locals
pygame.init() pygame.init()
screen = pygame.display.set_mode((800,600)) screen = pygame.display.set_mode((800,600))
bg = pygame.image.load('bg.png')
snake_right = pygame.image.load('right.png')
apple = pygame.image.load('apple.png')
snake_x = 120
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
exit()
if event.type == 3:
if event.key == 275:
if snake_x < 740:
snake_x += 30
screen.blit(bg,(0,0))
screen.blit(snake_right,(snake_x,120))
screen.blit(apple,(480,180))
pygame.display.update()
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