示例#1
0
        public override void Init()
        {
            camera = new Libraries.Camera(TurkeySmashGame.manager);

            #region player1
            model = new Joueur(PlayerIndex.One, MathHelper.ToRadians(-90), MathHelper.ToRadians(180));
            model.Load("Models\\dude", TurkeySmashGame.content);
            walk = new AnimatedModel();
            walk.Load("Models\\dude-walk", TurkeySmashGame.content);
            AnimationClip clip = walk.Clips[0];
            AnimationPlayer player = model.PlayClip(clip);
            player.Looping = true;
            model.Size = new Vector2(50, 350);

            elements[0] = model;
            #endregion

            #region IA1
            dude2 = new IA(PlayerIndex.Two, MathHelper.ToRadians(-90), MathHelper.ToRadians(180));
            dude2.Load("Models\\dude", TurkeySmashGame.content);
            walk = new AnimatedModel();
            walk.Load("Models\\dude-walk", TurkeySmashGame.content);
            AnimationClip clip2 = walk.Clips[0];
            AnimationPlayer player2 = dude2.PlayClip(clip2);
            player2.Looping = true;
            dude2.Size = new Vector2(50, 350);

            elements[1] = dude2;
            #endregion

            if (SelectionNiveau.niveauSelect == "spacefarm")
                level = new Level("Jeu\\space", "Models\\farm", elements, TurkeySmashGame.content);
            else
                level = new Level("Jeu\\citybackground", "Models\\MapCity2", elements, TurkeySmashGame.content);

            hud.Load(elements);
            camera.Initialize();

            sonInstance.Volume = 0.5f;
            sonInstance.IsLooped = true;
            sonInstance.Resume();
        }