Hardware Reference
In-Depth Information
powerPlay=False
else:
powerPlay=True
else:
powerPlay=False
drawScreen(position,ghostPos[0],ghostPos[1])
kill(position,ghostPos[0],ghostPos[1])
#collision check
eat(position)
position = makeStep(position,pieDirection, ;
pieIncrement)
# move ghosts
if powerPlay :
ghostInc = 4
else:
ghostInc = 8
if time.time() > ghostRelease:
if gNumber < 2:
ghostRelease = time.time()+ 5.0 ;
# time for subsequent ghosts
gNumber += 1
for i in range(0,gNumber):
new = getNewDir(i)
ghostPos[i] = makeStep(ghostPos[i],new, ghostInc)
if not moved:
ghostPos[i] = makeStep(ghostPos[i], ;
ghostDirection[i], ghostInc)
while not moved:
ghostDirection[i] = random.randint(0,3)<<1
ghostPos[i] = makeStep(ghostPos[i], ;
ghostDirection[i], ghostInc)
else:
ghostDirection[i] = new
step ^= 1 # toggle pie animation
ppCount +=1 # increment power play count
gStep +=gIncrement
if gStep == 5 or gStep == 0:
gIncrement = -gIncrement
# game over
if score > hiScore : # new high score flash it
hiScore = score
for i in range (0,15):
continued
Search WWH ::




Custom Search