home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / small_my_fart.swf / scripts / frame_7 / DoAction.as
Encoding:
Text File  |  2008-09-02  |  950 b   |  35 lines

  1. function resetGame()
  2. {
  3.    trace("called");
  4.    _root.EMS = startEMS;
  5.    _root.score = 0;
  6.    _root.totalScore = 0;
  7.    _root.vars.enemyAmount = 1;
  8.    _root.vars.enemySpeed = 3;
  9.    _root.vars.enemiesKilled = 0;
  10.    _root.vars.maxCombo = 0;
  11.    _root.vars.scoreSquasher = 1;
  12.    _root.gotoAndStop("game");
  13. }
  14. _root.kongregateScores.submit(_root.totalScore);
  15. _root.kongregateStats.submit("HighScore",_root.totalScore);
  16. _root.kongregateStats.submit("GameComplete",1);
  17. _root.kongregateStats.submit("BestCombo",_root.vars.maxCombo);
  18. _root.kongregateStats.submit("MostKills",_root.vars.enemiesKilled);
  19. var keyListener_obj = new Object();
  20. keyListener_obj.onKeyDown = function()
  21. {
  22.    var _loc0_ = null;
  23.    if((_loc0_ = Key.getCode()) === 82)
  24.    {
  25.       resetGame();
  26.       Key.removeListener(keyListener_obj);
  27.    }
  28. };
  29. Key.addListener(keyListener_obj);
  30. trace(_root.totalScore);
  31. restart_btn.onRelease = function()
  32. {
  33.    resetGame();
  34. };
  35.