|
Projects -
Flash CS3
|
|
Written by drooza
|
|
Tuesday, 23 September 2008 19:02 |
|
Page 7 of 9 End Of Level / Game Functions /** If the user has cleared all the blocks they get a huge bonus! * **/ private function calculateBonus(tilesLeft:int):Number { switch(tilesLeft) { case 0: return 500; case 1: return 250; case 2: return 200; case 3: return 150; case 4: return 100; case 5: return 50; } return 0; }
private function nextLevelPopUp():void { removeEventListener(Event.ENTER_FRAME, onEnterFrame); nextLevel_mc = new NextLevelButton; nextLevel_mc.x = 290 - nextLevel_mc.width; nextLevel_mc.y = 50; addChild(nextLevel_mc); nextLevel_mc.addEventListener(MouseEvent.CLICK, startNextLevel); }
private function showEndPopUp():void { removeEventListener(Event.ENTER_FRAME, onEnterFrame); playAgain_mc = new PlayAgainButton(); playAgain_mc.x = 290 - playAgain_mc.width; playAgain_mc.y = 50; addChild(playAgain_mc); playAgain_mc.addEventListener(MouseEvent.CLICK, restartGame); }
private function restartGame(e:Event):void { resetGameVariables(); destroyAll(); fillArray(types); showTiles(); gameState = CONTINUE; removeChild(playAgain_mc); addEventListener(Event.ENTER_FRAME, onEnterFrame); }
|
|
Last Updated ( Saturday, 22 November 2008 13:05 )
|