home *** CD-ROM | disk | FTP | other *** search
Wrap
function initializeLevels() { i = 1; while(i <= 11) { setBlip("band",i,bandPrices,bandLevel); setBlip("launch",i,launcherPrices,launcherLevel); setBlip("rocket",i,rocketPackPrices,rocketPackLevel); setBlip("lRocket",i,rocketSidesPrices,leftRocketLevel); setBlip("rRocket",i,rocketSidesPrices,rightRocketLevel); i++; } i = 1; while(i <= 6) { setBlip("magnet",i,magnetPrices,magnetLevel); i++; } i = 1; while(i <= 4) { setBlip("eRocket",i,eRocketPrices,eRocketLevel); setBlip("parachute",i,parachutePrices,parachuteLevel); setBlip("goggles",i,gogglePrices,gogglesLevel); setBlip("radar",i,radarPrices,radarLevel); i++; } } function setBlip(str, num, arr, lev) { if(arr[num - 1] < totalCash) { _root[str + num].gotoAndStop(1); } else { _root[str + num].gotoAndStop(3); } if(lev >= num) { _root[str + num].gotoAndStop(2); } } function disp() { cashDisp = "$" + commaMonger(Math.floor(totalCash)) + formatCents(totalCash - Math.floor(totalCash)); } function roll() { i = 1; while(i <= 11) { detectRoll("band",i,bandPrices,bandLevel); detectRoll("launch",i,launcherPrices,launcherLevel); detectRoll("rocket",i,rocketPackPrices,rocketPackLevel); detectRoll("lRocket",i,rocketSidesPrices,leftRocketLevel); detectRoll("rRocket",i,rocketSidesPrices,rightRocketLevel); i++; } i = 1; while(i <= 6) { detectRoll("magnet",i,magnetPrices,magnetLevel); i++; } i = 1; while(i <= 4) { detectRoll("eRocket",i,eRocketPrices,rRocketLevel); detectRoll("parachute",i,parachutePrices,parachuteLevel); detectRoll("goggles",i,gogglePrices,gogglesLevel); detectRoll("radar",i,radarPrices,radarLevel); i++; } costDisp = "$" + commaMonger(dollars) + formatCents(cents); } function detectRoll(str, num, arr, lev) { if(_root[str + i].hitTest(_xmouse,_ymouse)) { cost = arr[i - 1]; dollars = Math.floor(cost); cents = cost - dollars; curText = _root[str + "Desc"][i - 1]; _root[str + i].frame._visible = true; focusPoint = _root[str + i]; focusCost = cost; focusNum = i; focusItem = str; biddy._visible = true; } else { _root[str + i].frame._visible = false; } } function formatCents(num) { tempNumber = Math.floor(num * 100); if(tempNumber < 10) { return ".0" + tempNumber; } if(tempNumber == 0) { return undefined; } return "." + tempNumber; } function commaMonger(num) { if(num < 1000) { return String(num); } len = String(num).length; var _loc1_ = new Array(); i = 0; while(i < len) { _loc1_.push(String(num).charAt(len - 1 - i)); i++; } tempString = ""; i = 0; while(i < len) { if(i % 3 == 0 && i != 0) { tempString = _loc1_[i] + "," + tempString; } else { tempString = _loc1_[i] + tempString; } i++; } return tempString; } stop(); Mouse.hide(); startDrag(cursor,1,15,55,530,430); var dayDisp = "Day " + day; var bandColors = new Array(0,2957663,1730103,811124,7503106,6626075,3431970,6952273,5189937,7948806,4210752); var bandPrices = new Array(3.25,24.5,54,124,213.25,430.75,890,1639,4592.5,9384.25); var launcherPrices = new Array(7.25,24.25,48.75,96.5,192.25,384.75,768.5,1536.25,3072,6839.25); var rocketPackPrices = new Array(15.25,56.25,133,210.75,520.75,760.25,1492.25,2034.75,3012.5,4148.25); var rocketSidesPrices = new Array(10.25,20.25,40.75,80.25,170.25,350.5,555.5,986,1200.5,1575.75); var eRocketPrices = new Array(500,1000,1500); var parachutePrices = new Array(250,500,750); var magnetPrices = new Array(500,1000,1500,2000,5000); var gogglePrices = new Array(12.5,46.25,150); var radarPrices = new Array(250,1000,2000); var bandDesc = new Array(); bandDesc.push("Band Level 1: Increases overall elasticity 10%"); bandDesc.push("Band Level 2: Increases overall elasticity 20%"); bandDesc.push("Band Level 3: Increases overall elasticity 30%"); bandDesc.push("Band Level 4: Increases overall elasticity 40%"); bandDesc.push("Band Level 5: Increases overall elasticity 50%"); bandDesc.push("Band Level 6: Increases overall elasticity 60%"); bandDesc.push("Band Level 7: Increases overall elasticity 70%"); bandDesc.push("Band Level 8: Increases overall elasticity 80%"); bandDesc.push("Band Level 9: Increases overall elasticity 90%"); bandDesc.push("Band Level 10: Increases overall elasticity 100%"); var bandPower = new Array(0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.1); var launchDesc = new Array(); launchDesc.push("Launcher Level 1: Increases launcher height to about 15 feet"); launchDesc.push("Launcher Level 2: Increases launcher height to about 20 feet"); launchDesc.push("Launcher Level 3: Increases launcher height to about 25 feet"); launchDesc.push("Launcher Level 4: Increases launcher height to about 30 feet"); launchDesc.push("Launcher Level 5: Increases launcher height to about 35 feet"); launchDesc.push("Launcher Level 6: Increases launcher height to about 40 feet"); launchDesc.push("Launcher Level 7: Increases launcher height to about 45 feet"); launchDesc.push("Launcher Level 8: Increases launcher height to about 50 feet"); launchDesc.push("Launcher Level 9: Increases launcher height to about 60 feet"); launchDesc.push("Launcher Level 10: Increases launcher height to about 70 feet"); var launchSize = new Array(0,15,20,25,30,35,40,45,50,60,70); var rocketDesc = new Array(); rocketDesc.push("Rocket Pack Level 1: Decrease fuel consumption at a rate of 10% less"); rocketDesc.push("Rocket Pack Level 2: Decrease fuel consumption at a rate of 20% less"); rocketDesc.push("Rocket Pack Level 3: Decrease fuel consumption at a rate of 35% less"); rocketDesc.push("Rocket Pack Level 4: Decrease fuel consumption at a rate of 60% less"); rocketDesc.push("Rocket Pack Level 5: Decrease fuel consumption at a rate of 100% less"); rocketDesc.push("Rocket Pack Level 6: Decrease fuel consumption at a rate of 200% less"); rocketDesc.push("Rocket Pack Level 7: Decrease fuel consumption at a rate of 300% less"); rocketDesc.push("Rocket Pack Level 8: Decrease fuel consumption at a rate of 400% less"); rocketDesc.push("Rocket Pack Level 9: Decrease fuel consumption at a rate of 500% less"); rocketDesc.push("Rocket Pack Level 10: Decrease fuel consumption at a rate of 800% less"); var rocketSize = new Array(0,0.1,0.2,0.35,0.6,1,2,3,4,5,8); var lRocketDesc = new Array(); lRocketDesc.push("Left Rocket Level 1: Increase thrust 25%"); lRocketDesc.push("Left Rocket Level 2: Increase thrust 50%"); lRocketDesc.push("Left Rocket Level 3: Increase thrust 75%"); lRocketDesc.push("Left Rocket Level 4: Increase thrust 100%"); lRocketDesc.push("Left Rocket Level 5: Increase thrust 150%"); lRocketDesc.push("Left Rocket Level 6: Increase thrust 200%"); lRocketDesc.push("Left Rocket Level 7: Increase thrust 250%"); lRocketDesc.push("Left Rocket Level 8: Increase thrust 300%"); lRocketDesc.push("Left Rocket Level 9: Increase thrust 350%"); lRocketDesc.push("Left Rocket Level 10: Increase thrust 400%"); var lRocketSize = new Array(0,0.25,0.5,0.75,1,1.5,2,2.5,3,3.5,4); var rRocketSize = new Array(0,0.25,0.5,0.75,1,1.5,2,2.5,3,3.5,4); var rRocketDesc = new Array(); rRocketDesc.push("Right Rocket Level 1: Increase thrust 25%"); rRocketDesc.push("Right Rocket Level 2: Increase thrust 50%"); rRocketDesc.push("Right Rocket Level 3: Increase thrust 75%"); rRocketDesc.push("Right Rocket Level 4: Increase thrust 100%"); rRocketDesc.push("Right Rocket Level 5: Increase thrust 150%"); rRocketDesc.push("Right Rocket Level 6: Increase thrust 200%"); rRocketDesc.push("Right Rocket Level 7: Increase thrust 250%"); rRocketDesc.push("Right Rocket Level 8: Increase thrust 300%"); rRocketDesc.push("Right Rocket Level 9: Increase thrust 350%"); rRocketDesc.push("Right Rocket Level 10: Increase thrust 400%"); var magnetDesc = new Array(); magnetDesc.push("Magnet Level 1: Attract cash 1 foot away"); magnetDesc.push("Magnet Level 2: Attract cash 2 feet away"); magnetDesc.push("Magnet Level 3: Attract cash 3 feet away"); magnetDesc.push("Magnet Level 4: Attract cash 4 feet away"); magnetDesc.push("Magnet Level 5: Attract cash 5 feet away"); var magnetSize = new Array(0,1,2,3,4,5); var gogglesDesc = new Array(); gogglesDesc.push("Goggles Level 1: Look stylish"); gogglesDesc.push("Goggles Level 2: Look attractive"); gogglesDesc.push("Goggles Level 3: Look stylish and attractive"); var radarDesc = new Array(); radarDesc.push("Radar Level 1: See nearby blue launchers"); radarDesc.push("Radar Level 2: See all nearby launchers"); radarDesc.push("Radar Level 3: See all nearby launchers in colour"); var eRocketDesc = new Array(); eRocketDesc.push("Emergency Rocket Level 1: Utilize a backup rocket to launch about 200 feet in the air. Deploy with up key. One use. Recharges each day."); eRocketDesc.push("Emergency Rocket Level 2: Use the emergency rocket up to 2 times. Deploy with up key. Recharges each day."); eRocketDesc.push("Emergency Rocket Level 3: Use the emergency rocket up to 3 times. Deploy with up key. Recharges each day."); var parachuteDesc = new Array(); parachuteDesc.push("Parachute Level 1: Deploy a parachute to slow descent. Deploy with down key. Recharges each day."); parachuteDesc.push("Parachute Level 2: Gain a second use of the parachute. Deploy with down key. Recharges each day."); parachuteDesc.push("Parachute Level 3: Gain a third use of the parachute. Deploy with down key. Recharges each day."); onMouseDown = function() { if(focusPoint.hitTest(_xmouse,_ymouse)) { if(focusCost < totalCash) { switch(focusItem) { case "band": if(bandLevel < focusNum) { bandLevel = focusNum; totalCash -= focusCost; cashIn.start(0,1); initializeLevels(); } break; case "launch": if(launcherLevel < focusNum) { launcherLevel = focusNum; totalCash -= focusCost; cashIn.start(0,1); initializeLevels(); } break; case "rocket": if(rocketPackLevel < focusNum) { rocketPackLevel = focusNum; totalCash -= focusCost; cashIn.start(0,1); initializeLevels(); } break; case "lRocket": if(leftRocketLevel < focusNum) { leftRocketLevel = focusNum; totalCash -= focusCost; cashIn.start(0,1); initializeLevels(); } break; case "rRocket": if(rightRocketLevel < focusNum) { rightRocketLevel = focusNum; totalCash -= focusCost; cashIn.start(0,1); initializeLevels(); } break; case "eRocket": if(eRocketLevel < focusNum) { eRocketLevel = focusNum; totalCash -= focusCost; cashIn.start(0,1); initializeLevels(); } break; case "parachute": if(parachuteLevel < focusNum) { parachuteLevel = focusNum; totalCash -= focusCost; cashIn.start(0,1); initializeLevels(); } break; case "magnet": if(magnetLevel < focusNum) { magnetLevel = focusNum; totalCash -= focusCost; cashIn.start(0,1); initializeLevels(); } break; case "radar": if(radarLevel < focusNum) { radarLevel = focusNum; totalCash -= focusCost; cashIn.start(0,1); initializeLevels(); } break; case "goggles": if(gogglesLevel < focusNum) { gogglesLevel = focusNum; totalCash -= focusCost; cashIn.start(0,1); initializeLevels(); } } } else { clicker.start(0,1); } } }; var cashIn = new Sound(this); cashIn.attachSound("cashin"); var clicker = new Sound(this); clicker.attachSound("click_x"); initializeLevels(); onEnterFrame = function() { roll(); disp(); }; biddy._visible = false;