Ejemplo n.º 1
0
        public override void Initialize()
        {
            //EstPremierSaut = true;
            //Tps = 0;

            //Vector3 positionTmp = new Vector3(0, 0, 0);

            //ListePositionsRandom = new List<Vector3>();
            //ListePositionsRandom.Add(positionTmp);

            générateurAléatoire = new Random();
            Vector3 positionObjet = new Vector3(96, 16.37255f, -96);

            //Vector3 positionObjet = new Vector3(100, 20, -100);
            ÉtatJeu      = ÉtatsJeu.JEU3D;
            ÉtatJeuTexte = new TexteFixe(Game, new Vector2(5, 5), "GameState : " + ÉtatJeu.ToString());
            //LoadSauvegarde();
            Game.Components.Add(new ArrièrePlan(Game, "BackGroundNuage"));
            Game.Components.Add(new Afficheur3D(Game));
            TerrainDeJeu = new TerrainAvecBase(Game, 1f, Vector3.Zero, Vector3.Zero, new Vector3(256, 17, 256), "TerrainPokemon", "DétailsTerrain", 5, INTERVALLE_MAJ_STANDARD);
            Game.Components.Add(TerrainDeJeu);
            Game.Services.AddService(typeof(TerrainAvecBase), TerrainDeJeu);

            //Game.Services.AddService(typeof(Pokeball), Projectile);

            Game.Components.Add(LeJoueur);
            Game.Services.AddService(typeof(Player), LeJoueur);
            GestionInput = Game.Services.GetService(typeof(InputManager)) as InputManager;
            CaméraJeu    = Game.Services.GetService(typeof(Caméra)) as CaméraSubjective;
            (CaméraJeu as CaméraSubjective).Cible = new Vector3(LeJoueur.Position.X, LeJoueur.Position.Y + 5, LeJoueur.Position.Z);
            PositionBoxMessage = new Vector2(0, Game.Window.ClientBounds.Height - Cadre.TAILLE_TILE * 6);
            HauteurBoxMessage  = Cadre.HAUTEUR_BOX_STANDARD;
            LargeurBoxMessage  = Game.Window.ClientBounds.Width / Cadre.TAILLE_TILE;
            Game.Components.Add(ÉtatJeuTexte);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Fonction qui ajoute les textes de vie et de nom des pokémons en combat.
        /// </summary>
        private void AjouterLesTextesFixes()
        {
            PositionInfoUserPokemon     = new Vector2(Game.Window.ClientBounds.Width - (UserPokemon.ToString().Count() + 3) * Cadre.TAILLE_TILE, Game.Window.ClientBounds.Height - Cadre.TAILLE_TILE * 9);
            PositionInfoOpponentPokemon = new Vector2(Cadre.TAILLE_TILE, Game.Window.ClientBounds.Height / 10);

            NomOpponentPokemon = new TexteFixe(Game, PositionInfoOpponentPokemon, OpponentPokemon.ToString());
            Game.Components.Add(NomOpponentPokemon);

            NomUserPokemon = new TexteFixe(Game, PositionInfoUserPokemon, UserPokemon.ToString());
            Game.Components.Add(NomUserPokemon);

            VieOpponentPokemon = new TexteFixe(Game, new Vector2(PositionInfoOpponentPokemon.X, PositionInfoOpponentPokemon.Y + Cadre.TAILLE_TILE), OpponentPokemon.VieToString());
            Game.Components.Add(VieOpponentPokemon);

            VieUserPokemon = new TexteFixe(Game, new Vector2(PositionInfoUserPokemon.X, PositionInfoUserPokemon.Y + Cadre.TAILLE_TILE), UserPokemon.VieToString());
            Game.Components.Add(VieUserPokemon);


            NomOpponentPokemon.Visible = false;
            NomUserPokemon.Visible     = false;
            VieOpponentPokemon.Visible = false;
            VieUserPokemon.Visible     = false;
        }