Commit f8fb79cc by BellCodeEditor

save project

parent 4b866ed3
Showing with 23 additions and 5 deletions
import pygame
from pygame import locals
from random import randint
# 初始化pygame,为使用pygame做准备
pygame.init()
# 创建一个窗口\
screen = pygame.display.set_mode((660,480))
bb = pygame.image.load("bg.png")
rr = pygame.image.load("right.png")
ff = pygame.image.load("apple.png")
oo = pygame.image.load("body.png")
x1 = randint(0,21)*30
y1 = randint(0,15)*30
x2 = randint(0,21)*30
y2 = randint(0,15)*30
screen = pygame.display.set_mode((660,480))
while True:
for event in pygame.event.get():
# print(event)
if event.type == locals.QUIT:
exit()
screen.blit(bb,(0,0))
screen.blit(rr,(x1,y1))
screen.blit(ff,(x2,y2))
screen.blit(oo,(x1-30,y1))
screen.blit(oo,(x1-60,y1))
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