Hardware Reference
In-Depth Information
screenHeight =636
playWidth = 800
screenOffset = (screenWidth - playWidth) / 2
screen = pygame.display.set_mode([screenWidth,screenHeight],;
0,32)
background = pygame.Surface((playWidth,screenHeight))
pillsLayer = pygame.Surface((playWidth,screenHeight))
picName = [ “pie1left”, “pie2left”, “pie1right”, ;
“pie2right”, “pie1up”, “pie2up”, “pie1down”, “pie2down” ]
piPicture = [ pygame.image.load(“pies/”+picName[frame];
+”.png”).convert_alpha() for frame in range(0,8)]
ghost2Picture = [ pygame.image.load(“pies/g”+str(frame);
+”o.png”).convert_alpha() for frame in range(1,7)]
ghost1Picture = [ pygame.image.load(“pies/g”+str(frame);
+”r.png”).convert_alpha() for frame in range(1,7)]
ghostbPicture = [ pygame.image.load(“pies/g”+str(frame);
+”b.png”).convert_alpha() for frame in range(1,7)]
ghostdPicture = [ pygame.image.load(“pies/g”+str(frame);
+”d.png”).convert_alpha() for frame in range(1,9)]
# define the colours to use for the user interface
cBackground =(0,0,0)
cText = (255,255,255)
cBlock = (0,0,0)
blue = (0,0,255,255)
pillColour =(255,255,0,255)
box = [screenWidth-100,screenHeight-40]
hw = screenWidth / 2
hh = screenHeight /2
pieIncrement = 8 # speed of pie man
pieDirection = 2
step = 0 # changing image of pie
gStep = 0 # changing image of ghost
gIncrement = 1
score = 0
hiScore = 0
eaten = 0 # number of pills eaten
ppill = False
maxLives = 3
lives = maxLives
pieMan = 48 # size in pixels each side of the pie man
continued
Search WWH ::




Custom Search