Exemplo n.º 1
0
        public void OnSuccess()
        {
            MotionDelegator motionDelegator = Mgr <CatProject> .Singleton.MotionDelegator;
            MovieClip       movieClip       = motionDelegator.AddMovieClip();

            movieClip.AppendMotion(Mgr <GameEngine> .Singleton.TimeScaleRef, new CatFloat(1.0f), 1000);
            PostProcessMotionBlur motionBlur =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessMotionBlur).ToString())
                as PostProcessMotionBlur;

            int time = movieClip.GetStartTick();

            if (motionBlur != null)
            {
                movieClip.AddMotion(motionBlur.BlurIntensityRef, new CatFloat(0.2f), time,
                                    1000);
            }
            PostProcessColorAdjustment colorAdjustment =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessColorAdjustment).ToString())
                as PostProcessColorAdjustment;

            if (colorAdjustment != null)
            {
                movieClip.AddMotion(colorAdjustment.IllumiateRef, new CatFloat(0.0f), time, 1000);
            }
            PostProcessVignette vignette =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessVignette).ToString())
                as PostProcessVignette;

            if (vignette != null)
            {
                movieClip.AddMotion(vignette.RadiusRef, new CatVector2(0.0f, 1.6f), time, 1000);
            }
            movieClip.Initialize();
        }
Exemplo n.º 2
0
        public void OnFail()
        {
            m_isInQTE = false;
            MotionDelegator motionDelegator = Mgr <CatProject> .Singleton.MotionDelegator;
            MovieClip       movieClip       = motionDelegator.AddMovieClip();

            movieClip.AppendMotion(Mgr <GameEngine> .Singleton.TimeScaleRef, new CatFloat(1.0f), 500);
            PostProcessMotionBlur motionBlur =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessMotionBlur).ToString())
                as PostProcessMotionBlur;

            int time = movieClip.GetStartTick();

            if (motionBlur != null)
            {
                movieClip.AddMotion(motionBlur.BlurIntensityRef, new CatFloat(0.2f), time,
                                    500);
            }
            PostProcessVignette vignette =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessVignette).ToString())
                as PostProcessVignette;

            if (vignette != null)
            {
                movieClip.AddMotion(vignette.RadiusRef, new CatVector2(0.0f, 1.4f), time, 500);
            }
            movieClip.Initialize();
        }
Exemplo n.º 3
0
        protected override bool Enter(Fixture _fixtureA, Fixture _fixtureB, Contact _contact)
        {
            if (m_player != null)
            {
                return(true);
            }

            if (_fixtureA.UserData == null && _fixtureB.UserData == null)
            {
                return(true);
            }

            m_player = Mgr <Scene> .Singleton._gameObjectList.
                       GetOneGameObjectByName(m_playerGameObjectName);

            QTE qte = m_player.GetComponent(typeof(QTE).ToString()) as QTE;

            if (qte.IsInQTE())
            {
                return(true);
            }
            // slow down and blur
            MotionDelegator motionDelegator = Mgr <CatProject> .Singleton.MotionDelegator;
            MovieClip       movieClip       = motionDelegator.AddMovieClip();

            movieClip.AppendMotion(Mgr <GameEngine> .Singleton.TimeScaleRef, new CatFloat(0.1f), 200);
            PostProcessMotionBlur motionBlur =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessMotionBlur).ToString())
                as PostProcessMotionBlur;

            int time = movieClip.GetStartTick();

            if (motionBlur != null)
            {
                movieClip.AddMotion(motionBlur.BlurIntensityRef, new CatFloat(0.98f), time,
                                    200);
            }
            PostProcessVignette vignette =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessVignette).ToString())
                as PostProcessVignette;

            if (vignette != null)
            {
                movieClip.AddMotion(vignette.RadiusRef, new CatVector2(0.0f, 0.9f), time, 200);
            }
            movieClip.Initialize();
            // qte
            int qteNum = 1 + m_random.Next(4);

            for (int i = 0; i < qteNum; ++i)
            {
                int     randKey = 65 + m_random.Next(90 - 65 + 1);
                QTEPack qtePack = new QTEPack((Keys)randKey, 800);
                qte.AppendEvent(qtePack);
            }
            qte.StartQTE(this);
            m_isInQTE = true;
            return(true);
        }
Exemplo n.º 4
0
        protected override bool Enter(Fixture _fixtureA, Fixture _fixtureB, Contact _contact)
        {
            if (_fixtureA.UserData == null && _fixtureB.UserData == null)
            {
                return(true);
            }

            UIMessageBox msgBox =
                m_gameObject.GetComponent(typeof(UIMessageBox).ToString())
                as UIMessageBox;

            if (msgBox != null)
            {
                msgBox.DoShow(this);
                // do pause
                MotionDelegator motionDelegator = Mgr <CatProject> .Singleton.MotionDelegator;
                MovieClip       movieClip       = motionDelegator.AddMovieClip();
                movieClip.AppendMotion(Mgr <GameEngine> .Singleton.TimeScaleRef, new CatFloat(0.1f), 1000);
                PostProcessMotionBlur motionBlur =
                    Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessMotionBlur).ToString())
                    as PostProcessMotionBlur;

                int time = movieClip.GetStartTick();
                if (motionBlur != null)
                {
                    movieClip.AddMotion(motionBlur.BlurIntensityRef, new CatFloat(0.94f), time,
                                        1000);
                }
                PostProcessColorAdjustment colorAdjustment =
                    Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessColorAdjustment).ToString())
                    as PostProcessColorAdjustment;

                if (colorAdjustment != null)
                {
                    movieClip.AddMotion(colorAdjustment.IllumiateRef, new CatFloat(-0.6f), time, 1000);
                }
                PostProcessVignette vignette =
                    Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessVignette).ToString())
                    as PostProcessVignette;

                if (vignette != null)
                {
                    movieClip.AddMotion(vignette.RadiusRef, new CatVector2(0.0f, 0.6f), time, 1000);
                }
                movieClip.Initialize();
            }

            // barrier on
            GameObject barrierGenerater =
                Mgr <Scene> .Singleton._gameObjectList.GetOneGameObjectByName(m_barrierGeneraterName);

            if (barrierGenerater != null)
            {
                EndlessBlock eb =
                    barrierGenerater.GetComponent(typeof(EndlessBlock).ToString())
                    as EndlessBlock;
                if (eb != null)
                {
                    eb.BarrierOn = true;
                }
            }

            return(true);
        }
Exemplo n.º 5
0
        public void OnSuccess()
        {
            m_isInQTE = false;
            m_sucess  = true;
            // go normal
            MotionDelegator motionDelegator = Mgr <CatProject> .Singleton.MotionDelegator;
            MovieClip       movieClip       = motionDelegator.AddMovieClip();

            movieClip.AppendMotion(Mgr <GameEngine> .Singleton.TimeScaleRef, new CatFloat(1.0f), 500);
            PostProcessMotionBlur motionBlur =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessMotionBlur).ToString())
                as PostProcessMotionBlur;

            int time = movieClip.GetStartTick();

            if (motionBlur != null)
            {
                movieClip.AddMotion(motionBlur.BlurIntensityRef, new CatFloat(0.2f), time,
                                    500);
            }
            PostProcessVignette vignette =
                Mgr <Scene> .Singleton.PostProcessManager.GetPostProcess(typeof(PostProcessVignette).ToString())
                as PostProcessVignette;

            if (vignette != null)
            {
                movieClip.AddMotion(vignette.RadiusRef, new CatVector2(0.0f, 1.4f), time, 500);
            }
            movieClip.Initialize();
            // change color
            Random   random = new Random();
            CatColor color  = new CatColor();

            color.SetFromHSV(new Vector4((float)random.NextDouble(), 0.9f, 0.8f, 0.0f));
            ModelComponent parentModel = m_gameObject.GetComponent(typeof(ModelComponent).ToString())
                                         as ModelComponent;

            if (parentModel != null)
            {
                parentModel.GetCatModelInstance().GetMaterial().SetParameter("BiasColor", color);
            }
            // long tail
            if (m_gameObject.Children != null && m_gameObject.Children.Count > 0)
            {
                GameObject      emit    = m_gameObject.Children[0];
                ParticleEmitter emitter = emit.GetComponent(
                    typeof(ParticleEmitter).ToString()) as ParticleEmitter;
                emitter.ParticleLifetimeInMS = 400;

                ModelComponent childModel = emit.GetComponent(typeof(ModelComponent).ToString())
                                            as ModelComponent;
                if (childModel != null)
                {
                    childModel.GetCatModelInstance().GetMaterial().SetParameter("BiasColor", color);
                }
            }
            // add score
            GameObject scoreboardGameObject = Mgr <Scene> .Singleton._gameObjectList.
                                              GetOneGameObjectByName(m_scoreboardGameObjectName);

            if (scoreboardGameObject != null)
            {
                HorseScoreboard scoreboard =
                    scoreboardGameObject.GetComponent(typeof(HorseScoreboard).ToString())
                    as HorseScoreboard;
                if (scoreboard != null)
                {
                    scoreboard.AddScore();
                }
            }
        }