home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Diversos / FishyHop.swf / scripts / __Packages / manage / GameManage.as < prev    next >
Encoding:
Text File  |  2008-09-05  |  2.8 KB  |  141 lines

  1. class manage.GameManage extends MovieClip
  2. {
  3.    var keyManage;
  4.    var score;
  5.    var levelMax;
  6.    var level;
  7.    var level_l;
  8.    var runTime;
  9.    var money;
  10.    static var gameName = "fishy_hop";
  11.    static var frameSpeed = 32;
  12.    var isGameOver = false;
  13.    var isPause = false;
  14.    var isSelectLevel = false;
  15.    static var levelScoreArray = new Array(0,800,1600,2300,3500,4800,5500,6800,8000,10000);
  16.    static var levelMoneyArray = new Array(250,260,300,340,380,430,500,580,650,720);
  17.    function GameManage()
  18.    {
  19.       super();
  20.       this.isSelectLevel = false;
  21.       this.isPause = true;
  22.    }
  23.    function init()
  24.    {
  25.       this.keyManage = new manage.KeyManage();
  26.       this.isGameOver = false;
  27.       this.score = 0;
  28.       this.levelMax = 15;
  29.       this.level = 0;
  30.       this.level_l = 1;
  31.       this.runTime = 0;
  32.       this.nextLevel();
  33.       trace("σê¥σºïσîûGAMEσ»╣Φ▒í∩╝ü");
  34.    }
  35.    function onEnterFrame()
  36.    {
  37.       if(this.isGameOver == false)
  38.       {
  39.          if(this.isPause == false)
  40.          {
  41.          }
  42.       }
  43.    }
  44.    function nextLevel()
  45.    {
  46.       this.isPause = false;
  47.       this.clearAll();
  48.       this.addNextLevelScore();
  49.       this.level += 1;
  50.       if(this.level > this.levelMax)
  51.       {
  52.          this.win();
  53.          return undefined;
  54.       }
  55.       trace("Φ┐¢σàÑτ¼¼ " + this.level + " σà│∩╝ü");
  56.    }
  57.    function addNextLevelScore()
  58.    {
  59.    }
  60.    function clearAll()
  61.    {
  62.    }
  63.    function getLevel()
  64.    {
  65.       return this.level;
  66.    }
  67.    function win()
  68.    {
  69.       trace("Φâ£σê⌐Σ║å∩╝ü");
  70.       this.isGameOver = true;
  71.       this.runTime = 0;
  72.       Fade.start();
  73.       this.gotoAndStop("win");
  74.    }
  75.    function gameOver()
  76.    {
  77.       trace("gameover");
  78.       this.isGameOver = true;
  79.       this.runTime = 0;
  80.       Fade.start();
  81.       this.gotoAndStop("gameover");
  82.    }
  83.    function isAllOver()
  84.    {
  85.    }
  86.    function addScore(no)
  87.    {
  88.       if(!isNaN(no))
  89.       {
  90.          this.score += no;
  91.          if(this.score < 0)
  92.          {
  93.             this.score = 0;
  94.          }
  95.          else
  96.          {
  97.             this.score = int(this.score);
  98.          }
  99.          this.flashUpdateScore(no);
  100.       }
  101.    }
  102.    function reduceScore(no)
  103.    {
  104.       this.addScore(no * -1);
  105.    }
  106.    function clearScore()
  107.    {
  108.       this.score = 0;
  109.    }
  110.    function flashUpdateScore(no)
  111.    {
  112.    }
  113.    function addMoney(no)
  114.    {
  115.       if(!isNaN(no))
  116.       {
  117.          this.money += no;
  118.          if(this.money < 0)
  119.          {
  120.             this.money = 0;
  121.          }
  122.          else
  123.          {
  124.             this.money = int(this.money);
  125.          }
  126.          this.flashUpdateMoney(no);
  127.       }
  128.    }
  129.    function reduceMoney(no)
  130.    {
  131.       this.addMoney(no * -1);
  132.    }
  133.    function flashUpdateMoney(no)
  134.    {
  135.    }
  136.    function clearMoney()
  137.    {
  138.       this.money = 0;
  139.    }
  140. }
  141.