Exemplo n.º 1
0
        private void KiteBehavior_OnStateChanged(object sender, KiteStates newState)
        {
            switch (newState)
            {
            case KiteStates.CaptureStar:
                if (this.soundManager != null)
                {
                    this.soundManager.PlaySound(SoundManager.SOUNDS.Coin);
                }

                this.CurrentScore++;
                break;

            case KiteStates.Crash:
                if (this.soundManager != null)
                {
                    this.soundManager.PlaySound(SoundManager.SOUNDS.Crash);
                }

                // Crash Effect
                this.crashEffectComponent
                .DoEffect();

                //Dissable Scroll
                this.SetScrollEnable(false);
                break;

            case KiteStates.GameOver:
                this.SetState(GameplayStates.GameOver);
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
        public void SetState(KiteStates state)
        {
            switch (state)
            {
            case KiteStates.TakeOff:
                this.speed         = 0;
                this.transform2D.Y = WaveServices.ViewportManager.VirtualHeight / 2;
                break;

            case KiteStates.Gameplay:
                if (this.KiteState == KiteStates.Gameover)
                {
                    this.transform2D.Y = WaveServices.ViewportManager.VirtualHeight / 2;
                }

                this.speed = TAPPOWER;
                break;

            case KiteStates.Gameover:
                this.soundManager.PlaySound(SoundManager.SOUNDS.Crash);
                this.scene.SetState(GameScene.GameSceneStates.Crash);
                break;

            default:
                break;
            }

            this.KiteState = state;
        }
Exemplo n.º 3
0
        public void SetState(KiteStates state)
        {
            var previousState = this.KiteState;

            switch (state)
            {
            case KiteStates.TakeOff:
                this.speed         = 0;
                this.transform2D.Y = 180;
                break;

            case KiteStates.Gameplay:
                if (previousState == KiteStates.GameOver)
                {
                    this.SetNewColor();
                    this.transform2D.Y = 180;
                }

                if (previousState == KiteStates.TakeOff ||
                    previousState == KiteStates.GameOver)
                {
                    this.speed = TAPPOWER;
                }

                break;

            default:
                break;
            }

            this.KiteState = state;

            if (this.OnStateChanged != null)
            {
                this.OnStateChanged(this, this.KiteState);
            }
        }
Exemplo n.º 4
0
        public void SetState(KiteStates state)
        {
            var previousState = this.KiteState;

            switch (state)
            {
                case KiteStates.TakeOff:
                    this.speed = 0;
                    this.transform2D.Y = 180;
                    break;

                case KiteStates.Gameplay:
                    if (previousState == KiteStates.GameOver)
                    {
                        this.SetNewColor();
                        this.transform2D.Y = 180;
                    }

                    if (previousState == KiteStates.TakeOff
                     || previousState == KiteStates.GameOver)
                    {
                        this.speed = TAPPOWER;
                    }

                    break;

                default:
                    break;
            }

            this.KiteState = state;

            if (this.OnStateChanged != null)
            {
                this.OnStateChanged(this, this.KiteState);
            }
        }
Exemplo n.º 5
0
        private void KiteBehavior_OnStateChanged(object sender, KiteStates newState)
        {
            switch (newState)
            {
                case KiteStates.CaptureStar:
                    if (this.soundManager != null)
                    {
                        this.soundManager.PlaySound(SoundManager.SOUNDS.Coin);
                    }

                    this.CurrentScore++;
                    break;

                case KiteStates.Crash:
                    if (this.soundManager != null)
                    {
                        this.soundManager.PlaySound(SoundManager.SOUNDS.Crash);
                    }

                    // Crash Effect
                    this.crashEffectComponent
                        .DoEffect();

                    //Dissable Scroll
                    this.SetScrollEnable(false);
                    break;

                case KiteStates.GameOver:
                    this.SetState(GameplayStates.GameOver);
                    break;
                default:
                    break;
            }
        }
Exemplo n.º 6
0
        public void SetState(KiteStates state)
        {
            switch (state)
            {
                case KiteStates.TakeOff:
                    this.speed = 0;
                    this.transform2D.Y = WaveServices.ViewportManager.VirtualHeight / 2;
                    break;
                case KiteStates.Gameplay:
                    if (this.KiteState == KiteStates.Gameover)
                    {
                        this.transform2D.Y = WaveServices.ViewportManager.VirtualHeight / 2;
                    }

                    this.speed = TAPPOWER;
                    break;
                case KiteStates.Gameover:
                    this.soundManager.PlaySound(SoundManager.SOUNDS.Crash);
                    this.scene.SetState(GameScene.GameSceneStates.Crash);
                    break;
                default:
                    break;
            }

            this.KiteState = state;
        }