home *** CD-ROM | disk | FTP | other *** search
- initGame();
- saloon_mc.animateLight();
- switch_mc.animateLight();
- bonus_mc.animateLight();
- BG_leftWindows.animateLight();
- BG_rightWindows.animateLight();
- BG_saloonWindows.animateLight();
- BG_pepsiTitle.animateLightOnce();
- playSound(T_musicMainTheme_snd);
- starter = setInterval(function()
- {
- if(debug)
- {
- ball.mode = "table";
- ball.vel.x = 0;
- ball.vel.y = -6;
- }
- else
- {
- launchNewBall();
- }
- saloon_mc.setLightOff();
- switch_mc.setLightOff();
- bonus_mc.setLightOff();
- BG_leftWindows.setLightOff();
- BG_rightWindows.setLightOff();
- BG_saloonWindows.setLightOff();
- clearInterval(starter);
- }
- ,5000);
- _root.onEnterFrame = function()
- {
- ballmode = ball.mode;
- switch(ball.mode)
- {
- case "stop":
- break;
- case "table":
- moveBall();
- scaleBall();
- checkWalls();
- checkFlippers();
- checkBumpers();
- checkLargeBumpers();
- checkTargets();
- checkSwitches();
- checkCart();
- checkOutScreen();
- checkRightRamp();
- break;
- case "rampDown" || "idle":
- break;
- case "rampUp":
- moveBall();
- scaleBall();
- checkMainRamp();
- break;
- case "saloonEntrance":
- moveBall();
- scaleBall();
- var velocity = new tVector(ball.vel.x,ball.vel.y);
- ball.vel = new Position((- 0.707) * velocity.norm,(- 0.707) * velocity.norm);
- if(ball.pos.x < 237 || ball.pos.y < 155)
- {
- fadeSound(M_saloonDoor_snd);
- ball.mode = "stop";
- ball.mc._visible = false;
- saloon_mc.animateLight();
- BG_saloonWindows.animateLight();
- stopSound(T_musicIntro_snd);
- playSound(T_musicMainTheme_snd);
- starter = setInterval(function()
- {
- saloon_mc.setLightOff();
- BG_saloonWindows.setLightOff();
- _root.attachMovie("breakOut","breakOut",10000);
- breakOutMode = true;
- clearInterval(starter);
- }
- ,1500);
- }
- break;
- case "cartEntrance":
- cartRamp.startPos = new Position(ball.pos.x - cartRamp._x,ball.pos.y - cartRamp._y);
- cartRamp.endPos = new Position(cart.pos.x - 6 - cartRamp._x,cart.pos.y - 15 - cartRamp._y);
- cartRamp.move();
- ball.mode = "idle";
- while(soundIndice > 4)
- {
- soundIndice -= 5;
- }
- playSound(cartSoundArr[soundIndice]);
- soundIndice++;
- break;
- case "rightRamp":
- ball.vel.x = 2;
- ball.vel.y = 0;
- moveBall();
- scaleBall();
- if(ball.pos.x > 537)
- {
- playSound(M_wolf_snd);
- ball.mode = "idle";
- rightRamp.start();
- }
- }
- };
-