home *** CD-ROM | disk | FTP | other *** search
- class manage.GameManage extends MovieClip
- {
- var keyManage;
- var score;
- var levelMax;
- var level;
- var level_l;
- var runTime;
- var money;
- static var gameName = "fishy_hop";
- static var frameSpeed = 32;
- var isGameOver = false;
- var isPause = false;
- var isSelectLevel = false;
- static var levelScoreArray = new Array(0,800,1600,2300,3500,4800,5500,6800,8000,10000);
- static var levelMoneyArray = new Array(250,260,300,340,380,430,500,580,650,720);
- function GameManage()
- {
- super();
- this.isSelectLevel = false;
- this.isPause = true;
- }
- function init()
- {
- this.keyManage = new manage.KeyManage();
- this.isGameOver = false;
- this.score = 0;
- this.levelMax = 15;
- this.level = 0;
- this.level_l = 1;
- this.runTime = 0;
- this.nextLevel();
- trace("初始化GAME对象!");
- }
- function onEnterFrame()
- {
- if(this.isGameOver == false)
- {
- if(this.isPause == false)
- {
- }
- }
- }
- function nextLevel()
- {
- this.isPause = false;
- this.clearAll();
- this.addNextLevelScore();
- this.level += 1;
- if(this.level > this.levelMax)
- {
- this.win();
- return undefined;
- }
- trace("进入第 " + this.level + " 关!");
- }
- function addNextLevelScore()
- {
- }
- function clearAll()
- {
- }
- function getLevel()
- {
- return this.level;
- }
- function win()
- {
- trace("胜利了!");
- this.isGameOver = true;
- this.runTime = 0;
- Fade.start();
- this.gotoAndStop("win");
- }
- function gameOver()
- {
- trace("gameover");
- this.isGameOver = true;
- this.runTime = 0;
- Fade.start();
- this.gotoAndStop("gameover");
- }
- function isAllOver()
- {
- }
- function addScore(no)
- {
- if(!isNaN(no))
- {
- this.score += no;
- if(this.score < 0)
- {
- this.score = 0;
- }
- else
- {
- this.score = int(this.score);
- }
- this.flashUpdateScore(no);
- }
- }
- function reduceScore(no)
- {
- this.addScore(no * -1);
- }
- function clearScore()
- {
- this.score = 0;
- }
- function flashUpdateScore(no)
- {
- }
- function addMoney(no)
- {
- if(!isNaN(no))
- {
- this.money += no;
- if(this.money < 0)
- {
- this.money = 0;
- }
- else
- {
- this.money = int(this.money);
- }
- this.flashUpdateMoney(no);
- }
- }
- function reduceMoney(no)
- {
- this.addMoney(no * -1);
- }
- function flashUpdateMoney(no)
- {
- }
- function clearMoney()
- {
- this.money = 0;
- }
- }
-