Beispiel #1
0
        public RGatheredBall(List <RBall> balls, City dockCity, List <City> path)
        {
            state      = State.WaitingGathering;
            subBalls   = balls;
            goPath     = path;
            sourceCity = dockCity;


            position = GetRGBallPosition(dockCity, dockCity.CurrentFacing);

            float lineCount = (float)Math.Sqrt(balls.Count);
            float span      = (MathEx.PIf * 2) / lineCount;

            ballOffsets = new List <Vector3>(balls.Count);
            for (int i = 0; i < balls.Count; i++)
            {
                float row = (float)i / lineCount;
                float col = (float)Math.IEEERemainder(i, lineCount);

                float radLng = col * span;
                float radLat = (2 * row - lineCount) * span;

                Vector3    positionInGBall = PlanetEarth.GetPosition(radLng, radLat, GBallRadius);
                Quaternion oriInGBall      = Quaternion.RotationMatrix(PlanetEarth.GetOrientation(radLng, radLat));
                ballOffsets.Add(positionInGBall);
                balls[i].Gather(this, positionInGBall + position, oriInGBall);
            }

            throwSound = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("throw", null, 1500);
            catchSound = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("catch", null, 1500);
        }
Beispiel #2
0
        public void InitializeGraphics(RenderSystem rs)
        {
            FileLocation fl = null;

            switch (Type)
            {
            case RBallType.Disease:
                fl = FileSystem.Instance.Locate("rb_virus_ball.mesh", GameFileLocs.Model);
                break;

            case RBallType.Education:
                fl = FileSystem.Instance.Locate("rb_school_ball.mesh", GameFileLocs.Model);
                break;

            case RBallType.Green:
                fl = FileSystem.Instance.Locate("rb_green_ball.mesh", GameFileLocs.Model);
                break;

            case RBallType.Health:
                fl = FileSystem.Instance.Locate("rb_hospital_ball.mesh", GameFileLocs.Model);
                break;

            case RBallType.Oil:
                fl = FileSystem.Instance.Locate("rb_oil_ball.mesh", GameFileLocs.Model);
                break;

            case RBallType.Volience:
                fl = FileSystem.Instance.Locate("rb_volient_ball.mesh", GameFileLocs.Model);
                break;
            }
            ModelL0 = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            ModelL0.CurrentAnimation.Clear();

            if (Type == RBallType.Oil)
            {
                ModelL0.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(1.6f, 1.6f, 1.6f) * Matrix.RotationX(-MathEx.PiOver2)));
            }
            else if (Type == RBallType.Volience)
            {
                ModelL0.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(2.0f, 2.0f, 2.0f) * Matrix.RotationX(-MathEx.PiOver2)));
            }
            else if (Type == RBallType.Education)
            {
                ModelL0.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(2.25f, 2.25f, 2.25f) * Matrix.RotationX(-MathEx.PiOver2)));
            }
            else if (Type == RBallType.Disease)
            {
                ModelL0.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(3.75f, 3.75f, 3.75f)
                                                                  * Matrix.RotationX(-MathEx.PiOver2) * Matrix.RotationY(MathEx.PiOver2)));
            }
            else
            {
                ModelL0.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(1.4f, 1.4f, 1.4f) * Matrix.RotationX(-MathEx.PiOver2)));
            }

            UpdateDisplayScale();

            fl       = FileSystem.Instance.Locate("rball_tail_red.mesh", GameFileLocs.Model);
            red_tail = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            red_tail.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.RotationX(-MathEx.PiOver2)));

            fl         = FileSystem.Instance.Locate("rball_tail_green.mesh", GameFileLocs.Model);
            green_tail = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            green_tail.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.RotationX(-MathEx.PiOver2)));

            soundObject = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("rball_die", null, 1800);
        }
Beispiel #3
0
        public RGatheredBall(List<RBall> balls, City dockCity, List<City> path)
        {
            state = State.WaitingGathering;
            subBalls = balls;
            goPath = path;
            sourceCity = dockCity;


            position = GetRGBallPosition(dockCity, dockCity.CurrentFacing);

            float lineCount = (float)Math.Sqrt(balls.Count);
            float span = (MathEx.PIf * 2) / lineCount;

            ballOffsets = new List<Vector3>(balls.Count);
            for (int i = 0; i < balls.Count; i++)
            {
                float row = (float)i / lineCount;
                float col = (float)Math.IEEERemainder(i, lineCount);

                float radLng = col * span;
                float radLat = (2 * row - lineCount) * span;

                Vector3 positionInGBall = PlanetEarth.GetPosition(radLng, radLat, GBallRadius);
                Quaternion oriInGBall = Quaternion.RotationMatrix(PlanetEarth.GetOrientation(radLng, radLat));
                ballOffsets.Add(positionInGBall);
                balls[i].Gather(this, positionInGBall + position, oriInGBall);
            }

            throwSound = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("throw", null, 1500);
            catchSound = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("catch", null, 1500);
            
        }
Beispiel #4
0
        public void InitializeGraphics(RenderSystem rs)
        {
            FileLocation fl = null;
            switch (Type)
            {
                case RBallType.Disease:
                    fl = FileSystem.Instance.Locate("rb_virus_ball.mesh", GameFileLocs.Model);
                    break;
                case RBallType.Education:
                    fl = FileSystem.Instance.Locate("rb_school_ball.mesh", GameFileLocs.Model);
                    break;
                case RBallType.Green:
                    fl = FileSystem.Instance.Locate("rb_green_ball.mesh", GameFileLocs.Model);
                    break;
                case RBallType.Health:
                    fl = FileSystem.Instance.Locate("rb_hospital_ball.mesh", GameFileLocs.Model);
                    break;
                case RBallType.Oil:
                    fl = FileSystem.Instance.Locate("rb_oil_ball.mesh", GameFileLocs.Model);
                    break;
                case RBallType.Volience:
                    fl = FileSystem.Instance.Locate("rb_volient_ball.mesh", GameFileLocs.Model);
                    break;
            }
            ModelL0 = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            ModelL0.CurrentAnimation.Clear();

            if (Type == RBallType.Oil)
            {
                ModelL0.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(1.6f, 1.6f, 1.6f) * Matrix.RotationX(-MathEx.PiOver2)));
            }
            else if (Type == RBallType.Volience)
            {
                ModelL0.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(2.0f, 2.0f, 2.0f) * Matrix.RotationX(-MathEx.PiOver2)));
            }
            else if (Type == RBallType.Education)
            {
                ModelL0.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(2.25f, 2.25f, 2.25f) * Matrix.RotationX(-MathEx.PiOver2)));
            }
            else if (Type == RBallType.Disease)
            {
                ModelL0.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(3.75f, 3.75f, 3.75f)
                    * Matrix.RotationX(-MathEx.PiOver2) * Matrix.RotationY(MathEx.PiOver2)));
            }
            else
            {
                ModelL0.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(1.4f, 1.4f, 1.4f) * Matrix.RotationX(-MathEx.PiOver2)));
            }

            UpdateDisplayScale();

            fl = FileSystem.Instance.Locate("rball_tail_red.mesh", GameFileLocs.Model);
            red_tail = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            red_tail.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.RotationX(-MathEx.PiOver2) ));

            fl = FileSystem.Instance.Locate("rball_tail_green.mesh", GameFileLocs.Model);
            green_tail = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            green_tail.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.RotationX(-MathEx.PiOver2)));

            soundObject = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("rball_die", null, 1800);
        }
Beispiel #5
0
        public override void InitalizeGraphics(RenderSystem rs)
        {
            FileLocation fl = FileSystem.Instance.Locate("citybase.mesh", GameFileLocs.Model);
            cityBase = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            cityBase.CurrentAnimation.Clear();
            cityBase.CurrentAnimation.Add(new NoAnimaionPlayer(Matrix.Scaling(2, 2, 0.25f) * Matrix.RotationX(-MathEx.PiOver2)));


            catching = new Model[2];
            catchingRelease = new Model[2];
            throwing = new Model[2];
            throwingPrepare = new Model[2];
            fear = new Model[2];
            idle = new Model[2];
            laugh = new Model[2];
            sleeping = new Model[2];
            stopped = new Model[2];
            wakeingUp = new Model[2];

            currentForm = Randomizer.GetRandomBool() ? 1 : 0;

            switch (Type)
            {
                case CityType.Oil:
                case CityType.Green:
                    {
                        NoAnimaionPlayer scaling = new NoAnimaionPlayer(Matrix.Scaling(0.67f, 0.67f, 0.67f));
                        #region Oil
                        fl = FileSystem.Instance.Locate("ch_oil_catch.mesh", GameFileLocs.Model);
                        catching[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catching[0].AnimationCompeleted += Animation_Completed;
                        catching[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_oil_catchrelease.mesh", GameFileLocs.Model);
                        catchingRelease[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catchingRelease[0].AnimationCompeleted += Animation_Completed;
                        catchingRelease[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_oil_throwrelease.mesh", GameFileLocs.Model);
                        throwing[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwing[0].AnimationCompeleted += Animation_Completed;
                        throwing[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_oil_throw.mesh", GameFileLocs.Model);
                        throwingPrepare[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwingPrepare[0].AnimationCompeleted += Animation_Completed;
                        throwingPrepare[0].CurrentAnimation.Insert(0, scaling);


                        fl = FileSystem.Instance.Locate("ch_oil_fear.mesh", GameFileLocs.Model);
                        fear[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        fear[0].AnimationCompeleted += Animation_Completed;
                        fear[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_oil_idle.mesh", GameFileLocs.Model);
                        idle[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        idle[0].AnimationCompeleted += Animation_Completed;
                        idle[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_oil_laugh.mesh", GameFileLocs.Model);
                        laugh[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        laugh[0].AnimationCompeleted += Animation_Completed;
                        laugh[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_oil_sleeping.mesh", GameFileLocs.Model);
                        sleeping[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        sleeping[0].AnimationCompeleted += Animation_Completed;
                        sleeping[0].CurrentAnimation.Insert(0, scaling);
                        sleeping[0].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_oil_stopped.mesh", GameFileLocs.Model);
                        stopped[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        stopped[0].AnimationCompeleted += Animation_Completed;
                        stopped[0].CurrentAnimation.Insert(0, scaling);
                        stopped[0].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_oil_wakeup.mesh", GameFileLocs.Model);
                        wakeingUp[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        wakeingUp[0].AnimationCompeleted += Animation_Completed;
                        wakeingUp[0].CurrentAnimation.Insert(0, scaling);
                        #endregion

                        #region Green

                        fl = FileSystem.Instance.Locate("ch_green_catch.mesh", GameFileLocs.Model);
                        catching[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catching[1].AnimationCompeleted += Animation_Completed;
                        catching[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_green_catchrelease.mesh", GameFileLocs.Model);
                        catchingRelease[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catchingRelease[1].AnimationCompeleted += Animation_Completed;
                        catchingRelease[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_green_throwrelease.mesh", GameFileLocs.Model);
                        throwing[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwing[1].AnimationCompeleted += Animation_Completed;
                        throwing[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_green_throw.mesh", GameFileLocs.Model);
                        throwingPrepare[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwingPrepare[1].AnimationCompeleted += Animation_Completed;
                        throwingPrepare[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_green_fear.mesh", GameFileLocs.Model);
                        fear[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        fear[1].AnimationCompeleted += Animation_Completed;
                        fear[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_green_idle.mesh", GameFileLocs.Model);
                        idle[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        idle[1].AnimationCompeleted += Animation_Completed;
                        idle[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_green_laugh.mesh", GameFileLocs.Model);
                        laugh[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        laugh[1].AnimationCompeleted += Animation_Completed;
                        laugh[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_green_sleeping.mesh", GameFileLocs.Model);
                        sleeping[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        sleeping[1].AnimationCompeleted += Animation_Completed;
                        sleeping[1].CurrentAnimation.Insert(0, scaling);
                        sleeping[1].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_green_stopped.mesh", GameFileLocs.Model);
                        stopped[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        stopped[1].AnimationCompeleted += Animation_Completed;
                        stopped[1].CurrentAnimation.Insert(0, scaling);
                        stopped[1].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_green_wakeup.mesh", GameFileLocs.Model);
                        wakeingUp[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        wakeingUp[1].AnimationCompeleted += Animation_Completed;
                        wakeingUp[1].CurrentAnimation.Insert(0, scaling);
                        #endregion
                        break;
                    }
                case CityType.Education:
                case CityType.Volience:
                    {

                        NoAnimaionPlayer scaling = new NoAnimaionPlayer(Matrix.Scaling(40, 40, 40));
                        #region Volience
                        fl = FileSystem.Instance.Locate("ch_volience_catch.mesh", GameFileLocs.Model);
                        catching[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catching[0].AnimationCompeleted += Animation_Completed;
                        catching[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_volience_catchrelease.mesh", GameFileLocs.Model);
                        catchingRelease[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catchingRelease[0].AnimationCompeleted += Animation_Completed;
                        catchingRelease[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_volience_throwrelease.mesh", GameFileLocs.Model);
                        throwing[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwing[0].AnimationCompeleted += Animation_Completed;
                        throwing[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_volience_throw.mesh", GameFileLocs.Model);
                        throwingPrepare[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwingPrepare[0].AnimationCompeleted += Animation_Completed;
                        throwingPrepare[0].CurrentAnimation.Insert(0, scaling);


                        fl = FileSystem.Instance.Locate("ch_volience_fear.mesh", GameFileLocs.Model);
                        fear[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        fear[0].AnimationCompeleted += Animation_Completed;
                        fear[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_volience_idle.mesh", GameFileLocs.Model);
                        idle[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        idle[0].AnimationCompeleted += Animation_Completed;
                        idle[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_volience_laugh.mesh", GameFileLocs.Model);
                        laugh[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        laugh[0].AnimationCompeleted += Animation_Completed;
                        laugh[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_volience_sleeping.mesh", GameFileLocs.Model);
                        sleeping[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        sleeping[0].AnimationCompeleted += Animation_Completed;
                        sleeping[0].CurrentAnimation.Insert(0, scaling);
                        sleeping[0].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_volience_stopped.mesh", GameFileLocs.Model);
                        stopped[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        stopped[0].AnimationCompeleted += Animation_Completed;
                        stopped[0].CurrentAnimation.Insert(0, scaling);
                        stopped[0].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_volience_wakeup.mesh", GameFileLocs.Model);
                        wakeingUp[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        wakeingUp[0].AnimationCompeleted += Animation_Completed;
                        wakeingUp[0].CurrentAnimation.Insert(0, scaling);
                        #endregion

                        scaling = new NoAnimaionPlayer(Matrix.Translation(0, -2.5f, 0) * Matrix.Scaling(40, 40, 40));
                        #region Education

                        fl = FileSystem.Instance.Locate("ch_school_catch.mesh", GameFileLocs.Model);
                        catching[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catching[1].AnimationCompeleted += Animation_Completed;
                        catching[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_school_catchrelease.mesh", GameFileLocs.Model);
                        catchingRelease[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catchingRelease[1].AnimationCompeleted += Animation_Completed;
                        catchingRelease[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_school_throwrelease.mesh", GameFileLocs.Model);
                        throwing[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwing[1].AnimationCompeleted += Animation_Completed;
                        throwing[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_school_throw.mesh", GameFileLocs.Model);
                        throwingPrepare[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwingPrepare[1].AnimationCompeleted += Animation_Completed;
                        throwingPrepare[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_school_fear.mesh", GameFileLocs.Model);
                        fear[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        fear[1].AnimationCompeleted += Animation_Completed;
                        fear[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_school_idle.mesh", GameFileLocs.Model);
                        idle[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        idle[1].AnimationCompeleted += Animation_Completed;
                        idle[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_school_laugh.mesh", GameFileLocs.Model);
                        laugh[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        laugh[1].AnimationCompeleted += Animation_Completed;
                        laugh[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_school_sleeping.mesh", GameFileLocs.Model);
                        sleeping[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        sleeping[1].AnimationCompeleted += Animation_Completed;
                        sleeping[1].CurrentAnimation.Insert(0, scaling);
                        sleeping[1].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_school_stopped.mesh", GameFileLocs.Model);
                        stopped[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        stopped[1].AnimationCompeleted += Animation_Completed;
                        stopped[1].CurrentAnimation.Insert(0, scaling);
                        stopped[1].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_school_wakeup.mesh", GameFileLocs.Model);
                        wakeingUp[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        wakeingUp[1].AnimationCompeleted += Animation_Completed;
                        wakeingUp[1].CurrentAnimation.Insert(0, scaling);
                        #endregion
                        break;
                    }
                case CityType.Disease:
                case CityType.Health:
                    {
                        NoAnimaionPlayer scaling = new NoAnimaionPlayer(Matrix.Scaling(50, 50, 50) * Matrix.RotationY(-MathEx.PiOver2));
                        #region Disease
                        fl = FileSystem.Instance.Locate("ch_virus_catch.mesh", GameFileLocs.Model);
                        catching[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catching[0].AnimationCompeleted += Animation_Completed;
                        catching[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_virus_catchRelease.mesh", GameFileLocs.Model);
                        catchingRelease[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catchingRelease[0].AnimationCompeleted += Animation_Completed;
                        catchingRelease[0].CurrentAnimation.Insert(0, scaling);


                        fl = FileSystem.Instance.Locate("ch_virus_throw.mesh", GameFileLocs.Model);
                        throwingPrepare[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwingPrepare[0].AnimationCompeleted += Animation_Completed;
                        throwingPrepare[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_virus_throwRelease.mesh", GameFileLocs.Model);
                        throwing[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwing[0].AnimationCompeleted += Animation_Completed;
                        throwing[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_virus_fear.mesh", GameFileLocs.Model);
                        fear[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        fear[0].AnimationCompeleted += Animation_Completed;
                        fear[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_virus_idle.mesh", GameFileLocs.Model);
                        idle[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        idle[0].AnimationCompeleted += Animation_Completed;
                        idle[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_virus_laugh.mesh", GameFileLocs.Model);
                        laugh[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        laugh[0].AnimationCompeleted += Animation_Completed;
                        laugh[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_virus_sleeping.mesh", GameFileLocs.Model);
                        sleeping[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        sleeping[0].AnimationCompeleted += Animation_Completed;
                        sleeping[0].CurrentAnimation.Insert(0, scaling);
                        sleeping[0].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_virus_stopped.mesh", GameFileLocs.Model);
                        stopped[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        stopped[0].AnimationCompeleted += Animation_Completed;
                        stopped[0].CurrentAnimation.Insert(0, scaling);
                        stopped[0].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_virus_wakeup.mesh", GameFileLocs.Model);
                        wakeingUp[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        wakeingUp[0].AnimationCompeleted += Animation_Completed;
                        wakeingUp[0].CurrentAnimation.Insert(0, scaling);
                        #endregion


                        scaling = new NoAnimaionPlayer(Matrix.Scaling(26, 26, 26));
                        #region Health

                        fl = FileSystem.Instance.Locate("ch_hospital_catch.mesh", GameFileLocs.Model);
                        catching[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catching[1].AnimationCompeleted += Animation_Completed;
                        catching[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_hospital_catchRelease.mesh", GameFileLocs.Model);
                        catchingRelease[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catchingRelease[1].AnimationCompeleted += Animation_Completed;
                        catchingRelease[1].CurrentAnimation.Insert(0, scaling);


                        fl = FileSystem.Instance.Locate("ch_hospital_throwRelease.mesh", GameFileLocs.Model);
                        throwing[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwing[1].AnimationCompeleted += Animation_Completed;
                        throwing[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_hospital_throw.mesh", GameFileLocs.Model);
                        throwingPrepare[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwingPrepare[1].AnimationCompeleted += Animation_Completed;
                        throwingPrepare[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_hospital_fear.mesh", GameFileLocs.Model);
                        fear[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        fear[1].AnimationCompeleted += Animation_Completed;
                        fear[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_hospital_idle.mesh", GameFileLocs.Model);
                        idle[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        idle[1].AnimationCompeleted += Animation_Completed;
                        idle[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_hospital_laugh.mesh", GameFileLocs.Model);
                        laugh[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        laugh[1].AnimationCompeleted += Animation_Completed;
                        laugh[1].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_hospital_sleeping.mesh", GameFileLocs.Model);
                        sleeping[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        sleeping[1].AnimationCompeleted += Animation_Completed;
                        sleeping[1].CurrentAnimation.Insert(0, scaling);
                        sleeping[1].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_hospital_stopped.mesh", GameFileLocs.Model);
                        stopped[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        stopped[1].AnimationCompeleted += Animation_Completed;
                        stopped[1].CurrentAnimation.Insert(0, scaling);
                        stopped[1].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_hospital_wakeup.mesh", GameFileLocs.Model);
                        wakeingUp[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        wakeingUp[1].AnimationCompeleted += Animation_Completed;
                        wakeingUp[1].CurrentAnimation.Insert(0, scaling);
                        #endregion
                        break;
                    }
                case CityType.Neutral:
                    {
                        NoAnimaionPlayer scaling = new NoAnimaionPlayer(Matrix.Scaling(0.67f, 0.67f, 0.67f));

                        #region Neutral
                        fl = FileSystem.Instance.Locate("ch_neutral_catch.mesh", GameFileLocs.Model);
                        catching[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catching[0].AnimationCompeleted += Animation_Completed;
                        catching[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_neutral_catchrelease.mesh", GameFileLocs.Model);
                        catchingRelease[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        catchingRelease[0].AnimationCompeleted += Animation_Completed;
                        catchingRelease[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_neutral_throwrelease.mesh", GameFileLocs.Model);
                        throwing[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwing[0].AnimationCompeleted += Animation_Completed;
                        throwing[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_neutral_throw.mesh", GameFileLocs.Model);
                        throwingPrepare[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        throwingPrepare[0].AnimationCompeleted += Animation_Completed;
                        throwingPrepare[0].CurrentAnimation.Insert(0, scaling);


                        fl = FileSystem.Instance.Locate("ch_neutral_fear.mesh", GameFileLocs.Model);
                        fear[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        fear[0].AnimationCompeleted += Animation_Completed;
                        fear[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_neutral_idle.mesh", GameFileLocs.Model);
                        idle[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        idle[0].AnimationCompeleted += Animation_Completed;
                        idle[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_neutral_laugh.mesh", GameFileLocs.Model);
                        laugh[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        laugh[0].AnimationCompeleted += Animation_Completed;
                        laugh[0].CurrentAnimation.Insert(0, scaling);

                        fl = FileSystem.Instance.Locate("ch_neutral_sleeping.mesh", GameFileLocs.Model);
                        sleeping[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        sleeping[0].AnimationCompeleted += Animation_Completed;
                        sleeping[0].CurrentAnimation.Insert(0, scaling);
                        sleeping[0].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_neutral_stopped.mesh", GameFileLocs.Model);
                        stopped[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        stopped[0].AnimationCompeleted += Animation_Completed;
                        stopped[0].CurrentAnimation.Insert(0, scaling);
                        stopped[0].AutoLoop = true;

                        fl = FileSystem.Instance.Locate("ch_neutral_wakeup.mesh", GameFileLocs.Model);
                        wakeingUp[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
                        wakeingUp[0].AnimationCompeleted += Animation_Completed;
                        wakeingUp[0].CurrentAnimation.Insert(0, scaling);
                        #endregion

                        catching[1] = catching[0];
                        catchingRelease[1] = catchingRelease[0];
                        throwing[1] = throwing[0];
                        throwingPrepare[1] = throwingPrepare[0];
                        fear[1] = fear[0];
                        idle[1] = idle[0];
                        laugh[1] = laugh[0];
                        sleeping[1] = sleeping[0];
                        stopped[1] = stopped[0];
                        wakeingUp[1] = wakeingUp[0];

                        break;
                    }
            }

            Matrix wordTransform = Matrix.Scaling(2, 2, 2) * Matrix.RotationX(-MathEx.PIf / 5.0f) * Matrix.RotationY(MathEx.PIf - MathEx.PiOver4);
            wordTransform.TranslationValue = new Vector3(-200, 200, 200);

            happyWords = new Model[3];
            fl = FileSystem.Instance.Locate("pop_haha.mesh", GameFileLocs.Model);
            happyWords[0] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            happyWords[0].CurrentAnimation.Clear();
            happyWords[0].CurrentAnimation.Add(new NoAnimaionPlayer(wordTransform));

            fl = FileSystem.Instance.Locate("pop_ouch.mesh", GameFileLocs.Model);
            happyWords[1] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            happyWords[1].CurrentAnimation.Clear();
            happyWords[1].CurrentAnimation.Add(new NoAnimaionPlayer(wordTransform));


            fl = FileSystem.Instance.Locate("pop_yeah.mesh", GameFileLocs.Model);
            happyWords[2] = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            happyWords[2].CurrentAnimation.Clear();
            happyWords[2].CurrentAnimation.Add(new NoAnimaionPlayer(wordTransform));

            fl = FileSystem.Instance.Locate("pop_woot.mesh", GameFileLocs.Model);
            ouchWord = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            ouchWord.CurrentAnimation.Clear();
            ouchWord.CurrentAnimation.Add(new NoAnimaionPlayer(wordTransform));


            wordTransform = Matrix.Scaling(1.67f, 1.67f, 1.67f) * Matrix.RotationX(-MathEx.PIf / 5.0f) * Matrix.RotationY(MathEx.PIf - MathEx.PiOver4);
            wordTransform.TranslationValue = new Vector3(-200, 200, 200);

            fl = FileSystem.Instance.Locate("pop_levelup.mesh", GameFileLocs.Model);
            levelUpWord = new Model(ModelManager.Instance.CreateInstance(rs, fl));
            levelUpWord.CurrentAnimation.Clear();
            levelUpWord.CurrentAnimation.Add(new NoAnimaionPlayer(wordTransform));

            smoke = new Smokes(this, rs);
            splashSmoke = new SplashSmokes(this, rs);
            ChangeState(CityState.Sleeping);

            sound = SoundManager.Instance.MakeSoundObjcet("snore", null, CityRadius * 2.5f);
            sound.Position = position;

            const float SoundRadius = 1500;


            popSound = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("pop", null, SoundRadius);
            popSound.Position = position;

            laughSound = new Normal3DSoundObject[2];
            fearSound = new Normal3DSoundObject[2];
            switch (Type)
            {
                case CityType.Green:
                case CityType.Oil:
                    laughSound[0] = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("oil_laugh", null, SoundRadius);
                    fearSound[0] = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("oil_fear", null, SoundRadius);
                    laughSound[0].Position = position;
                    fearSound[0].Position = position;

                    laughSound[1] = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("green_laugh", null, SoundRadius);
                    laughSound[1].Position = position;
                   
                    break;
                case CityType.Neutral:
                    fearSound[0] = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("neutral_fear", null, SoundRadius);
                    fearSound[0].Position = position;
                    fearSound[1] = fearSound[0];
                    break;
                case CityType.Education:
                case CityType.Volience:
                    laughSound[0] = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("volience_laugh", null, SoundRadius);
                    fearSound[0] = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("volience_fear", null, SoundRadius);
                    laughSound[0].Position = position;
                    fearSound[0].Position = position;
                    break;
                case CityType.Disease:
                case CityType.Health:
                    laughSound[1] = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("hosp_laugh", null, SoundRadius);
                    fearSound[1] = (Normal3DSoundObject)SoundManager.Instance.MakeSoundObjcet("hosp_fear", null, SoundRadius);
                    laughSound[1].Position = position;
                    fearSound[1].Position = position;
                    break;
            }
        }