home *** CD-ROM | disk | FTP | other *** search
- class MainBall extends Ball
- {
- var nCurrentCombo;
- static var sSTATE_APPEARS = "Appears";
- function MainBall(_mcRef)
- {
- super(_mcRef);
- this.nCurrentCombo = 0;
- this.setState(MainBall.sSTATE_APPEARS);
- }
- function doAppears()
- {
- if(this.isStateComplete())
- {
- this.setState(Ball.sSTATE_LAUNCH_WAIT);
- }
- }
- function doSpecificTrailStar()
- {
- var _loc2_ = undefined;
- switch(this.CurrentState)
- {
- case Ball.sSTATE_MOVING:
- _loc2_ = "Normal";
- break;
- case Ball.sSTATE_MOVING_PASSTHROUGH:
- _loc2_ = "Suit";
- break;
- case Ball.sSTATE_MOVING_CHEWINGGUM:
- _loc2_ = "Gum";
- break;
- case Ball.sSTATE_MOVING_PASSPLUSGUM:
- _loc2_ = "Gum";
- }
- if(_loc2_ != undefined)
- {
- LevelManager.Instance.doNewTimmyTrail(this.Ref._x,this.Ref._y,_loc2_);
- }
- }
- function onPaddleTouch(_oPaddle, _bBounceTop)
- {
- this.nCurrentCombo = 0;
- if(_oPaddle instanceof PlayerPaddle && _bBounceTop)
- {
- switch(_oPaddle.CurrentState)
- {
- case PlayerPaddle.sPADDLE_STATE_NORMAL:
- case PlayerPaddle.sPADDLE_STATE_NORMAL_BOUNCE:
- Library.Sound.SoundManager.doPlaySoundInCat(Main.sSOUND_CAT_SOUND,"Timmy_Bounce_Normal.mp3");
- break;
- case PlayerPaddle.sPADDLE_STATE_SHORT:
- case PlayerPaddle.sPADDLE_STATE_SHORT_BOUNCE:
- Library.Sound.SoundManager.doPlaySoundInCat(Main.sSOUND_CAT_SOUND,"Timmy_Bounce_JackBox.mp3");
- break;
- case PlayerPaddle.sPADDLE_STATE_LARGE:
- case PlayerPaddle.sPADDLE_STATE_LARGE_BOUNCE:
- Library.Sound.SoundManager.doPlaySoundInCat(Main.sSOUND_CAT_SOUND,"Timmy_Bounce_Trampoline.mp3");
- }
- }
- }
- function onBounceSides()
- {
- Library.Sound.SoundManager.doPlaySoundInCat(Main.sSOUND_CAT_SOUND,"Timmy_Bounce_Sides.mp3",35);
- }
- function onBlockDestroy()
- {
- this.nCurrentCombo = this.nCurrentCombo + 1;
- Game.Instance.Status.onNewCombo(this.nCurrentCombo);
- }
- }
-