此篇文章繼第一篇https://segmentfault.com/a/1190000021950818(第一篇)
你們能夠前去查看。segmentfault
runGame()
函數——遊戲的核心:在遊戲開始前的一些變量設置也在runGame()
函數裏,具體以下:ide
def runGame(): board = getBlankBoard() lastMoveDownTime = time.time() lastMoveSideways = time.time() lastFallTime = time.time() movingDown = False movingLeft = False movingRight = False score = 0 level, fallFreq = calculateLevelAndFallFreq(score) fallingPiece = getNewPiece() nextPiece = getNewPiece()