home *** CD-ROM | disk | FTP | other *** search
- function cleanUpMoney(num)
- {
- gotta = Math.round((Math.floor(num * 100) / 100 - Math.floor(num)) * 100);
- if(gotta == 0)
- {
- return Math.floor(num) + ".00";
- }
- if(gotta % 10 == 0)
- {
- return Math.floor(num) + "." + gotta;
- }
- return Math.floor(num) + "." + gotta;
- }
- totalElevationBonus = Math.floor(_root.levelElevation * 10 / 100) / 10;
- runTimeBonus = Math.floor((10 + (_root.seconds + _root.minutes * 60)) / 10);
- totalMoney = _root.levelCash * totalElevationBonus * runTimeBonus;
- countStage = 0;
- counter = 0;
- monDiv = _root.levelCash / 50;
- trace("------------");
- trace(_root.totalCash);
- _root.totalCash += totalMoney;
- trace(_root.totalCash);
- onEnterFrame = function()
- {
- switch(countStage)
- {
- case 0:
- counter += monDiv;
- tiger.text = "$" + cleanUpMoney(counter);
- if(counter >= _root.levelCash)
- {
- tiger.text = "$" + cleanUpMoney(_root.levelCash);
- monDiv = totalElevationBonus / 30;
- counter = 0;
- countStage = 1;
- }
- break;
- case 1:
- counter += monDiv;
- bear.text = "x" + cleanUpMoney(counter);
- if(counter >= totalElevationBonus)
- {
- bear.text = "x" + cleanUpMoney(totalElevationBonus);
- monDiv = runTimeBonus / 30;
- counter = 0;
- countStage = 2;
- }
- break;
- case 2:
- counter += monDiv;
- moxre.text = "x" + cleanUpMoney(counter);
- if(counter >= runTimeBonus)
- {
- moxre.text = "x" + cleanUpMoney(runTimeBonus);
- monDiv = totalMoney / 30;
- counter = 0;
- countStage = 3;
- }
- break;
- case 3:
- counter += monDiv;
- toal.text = "$" + cleanUpMoney(counter) + " Total";
- if(counter >= totalMoney)
- {
- toal.text = "$" + cleanUpMoney(totalMoney) + " Total";
- countStage = 4;
- }
- break;
- case 4:
- }
- };
-