研究一下google pacman的代碼
insertCoin()投幣,開始初始化游戲
newGame(),初始化單人游戲。
g.newGame = function () {
g.playerCount = 1;//玩家數
g.createChrome();
g.createPlayfield();//創建地圖
g.createActors();//創建玩家
g.startGameplay()
};
g.keyPressed//鍵盤響應函數