Commit 2b884c94 by BellCodeEditor

save project

parent dd4210cc
Showing with 12 additions and 3 deletions
from pygame import *;
import random;
import sys;
positionX = 120;
positionY = 240;
setHeadingString = "right"
playerX = 0
playerY = 0
position = [(playerX, playerY)]
# 初始化pygame,为使用pygame做准备
init();
......@@ -13,13 +17,18 @@ snake = image.load('right.png');
body = image.load('body.png');
apple = image.load('apple.png');
setHeading = snake
# 创建一个窗口
screen = display.set_mode((800, 600));
screen = display.set_mode((660, 480));
while 1:
for events in event.get():
if events.type == QUIT:
sys.exit();
if events.type == KEYDOWN:
if events.key == K_w:
screen.blit(background, (0, 0));
screen.blit(snake, (240, 120));
......
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