protected override void Initialize() { //Vector3 positionObjet1 = new Vector3(-2, 0, 0); //Vector3 positionObjet2 = new Vector3(0, 1.5f, 0); //Vector3 positionObjet3 = new Vector3(0, 0, 0); //Vector3 positionObjet4 = new Vector3(0, -1.5f, 0); //Vector3 positionObjet5 = new Vector3(2, 0, 0); //Vector3 positionLumière = new Vector3(0, 0f, 3f); Vector3 positionCaméra = new Vector3(0, 55, 15); Vector3 cibleCaméra = new Vector3(0, 0, 0); Vector2 dimensionDialogueMenu = new Vector2(Window.ClientBounds.Width / 3, Window.ClientBounds.Height); Vector2 dimensionDialogueInventaire = new Vector2(Window.ClientBounds.Width, Window.ClientBounds.Height); //a changer les dimensions //Vector2 dimensionDialogueSpells = new Vector2(Window.ClientBounds.Width/3f, Window.ClientBounds.Height / 7f); CaméraJeu = new CaméraSubjective(this, positionCaméra, cibleCaméra, -Vector3.UnitZ, INTERVALLE_MAJ_STANDARD); MenuAccueil = new DialogueMenu(this, dimensionDialogueMenu, _managerNetwork); MenuInventaire = new DialogueInventaire(this, dimensionDialogueInventaire); CréationDuPanierDeServices(); AfficheurFPS afficheurFPS = new AfficheurFPS(this, "Arial20", Color.Gold, INTERVALLE_CALCUL_FPS); afficheurFPS.DrawOrder = (int)OrdreDraw.AVANT_PLAN; Components.Add(afficheurFPS); ArrièrePlanDéroulant ArrièrePlan = new ArrièrePlanDéroulant(this, "WoodForest", INTERVALLE_MAJ_STANDARD); ArrièrePlan.DrawOrder = (int)OrdreDraw.ARRIÈRE_PLAN; Components.Add(ArrièrePlan); PlancheDeJeu = new Carte(this, 1f, Vector3.Zero, Vector3.Zero, new Vector2(120, 60), new Vector2(10, 5), "pierregazon", INTERVALLE_MAJ_STANDARD); PlancheDeJeu.DrawOrder = (int)OrdreDraw.ARRIÈRE_PLAN; PlancheDeJeu.Visible = false; Components.Add(PlancheDeJeu); AOE1 = new AOE(this, 1f, Vector3.Zero, Vector3.Zero, new Vector2(20), "AOE", INTERVALLE_MAJ_STANDARD); AOE1.Visible = false; AOE1.DrawOrder = (int)OrdreDraw.ARRIÈRE_PLAN; Components.Add(AOE1); AOE2 = new AOE(this, 1f, Vector3.Zero, Vector3.Zero, new Vector2(20), "AOE", INTERVALLE_MAJ_STANDARD); AOE2.Visible = false; AOE2.DrawOrder = (int)OrdreDraw.ARRIÈRE_PLAN; Components.Add(AOE2); AOE3 = new AOE(this, 1f, Vector3.Zero, Vector3.Zero, new Vector2(20), "AOE", INTERVALLE_MAJ_STANDARD); AOE3.Visible = false; AOE3.DrawOrder = (int)OrdreDraw.ARRIÈRE_PLAN; Components.Add(AOE3); TexteConnection = new TexteCentré(this, "En attente d'un autre joueur", "Arial20", new Rectangle(0, 0, Window.ClientBounds.Width, Window.ClientBounds.Height), Color.Red, 0.2f); TexteConnection.DrawOrder = (int)OrdreDraw.AVANT_PLAN; Components.Add(TexteConnection); TexteConnection.Visible = false; Components.Add(new Afficheur3D(this)); Components.Add(GestionInput); Components.Add(CaméraJeu); Components.Add(MenuAccueil); Components.Add(MenuInventaire); base.Initialize(); }
public IdentificateurPersonnage(Game jeu, Personnage personnage) : base(jeu) { PersonnageÀIdentifier = personnage; PtsVieMax = PersonnageÀIdentifier.PtsDeVie; PtsViePersonnage = PersonnageÀIdentifier.PtsDeVie; DéterminerNomImage(); DéterminerPosition(); ZoneAffichage = new Rectangle(0, 0, Game.Window.ClientBounds.Width, Game.Window.ClientBounds.Height / 15); AfficheurPtsVie = new TexteCentré(Game, ":" + PtsViePersonnage.ToString() + "/" + PtsVieMax.ToString(), "Arial20", new Rectangle((int)Position.X + 2 * Game.Window.ClientBounds.Width / (3 * NB_CASES), (int)Position.Y, Game.Window.ClientBounds.Width / NB_CASES, Game.Window.ClientBounds.Height / 15), Color.Red, 0); AfficheurPtsVie.DrawOrder = (int)OrdreDraw.AVANT_PLAN; Game.Components.Add(AfficheurPtsVie); }
public override void Initialize() { int hauteurBouton = RectangleDestination.Height / (NB_ZONES_DIALOGUE + 1); Police = Game.Content.Load <SpriteFont>("Fonts/" + "Arial20"); Vector2 positionBouton = new Vector2(RectangleDestination.X + RectangleDestination.Width / 2f, (NB_ZONES_DIALOGUE - 2) * hauteurBouton); BtnJouer = new BoutonDeCommande(Game, "Jouer", "Arial20", "BoutonRouge", "BoutonRouge", positionBouton, true, Jouer, INTERVALLE_MAJ_STANDARD); BtnJouer.DrawOrder = (int)OrdreDraw.AVANT_PLAN; positionBouton = new Vector2(RectangleDestination.X + RectangleDestination.Width / 2f, (NB_ZONES_DIALOGUE - 1) * hauteurBouton); BtnInventaire = new BoutonDeCommande(Game, "Inventaire", "Arial20", "BoutonRouge", "BoutonRouge", positionBouton, true, Inventaire, INTERVALLE_MAJ_STANDARD); BtnInventaire.DrawOrder = (int)OrdreDraw.AVANT_PLAN; Vector2 dimensionBouton = Police.MeasureString("Quitter"); positionBouton = new Vector2(dimensionBouton.X / 2, Game.Window.ClientBounds.Height - dimensionBouton.Y / 2); BtnQuitter = new BoutonDeCommande(Game, "Quitter", "Arial20", "BoutonRouge", "BoutonRouge", positionBouton, true, Quitter, INTERVALLE_MAJ_STANDARD); BtnQuitter.DrawOrder = (int)OrdreDraw.AVANT_PLAN; dimensionBouton = Police.MeasureString("Jeu de bataille"); NomJeu = new TexteCentré(Game, "Jeu de bataille", "Arial20", new Rectangle(100, 100, (int)dimensionBouton.X, (int)dimensionBouton.Y), Color.White, 0); NomJeu.DrawOrder = (int)OrdreDraw.AVANT_PLAN; dimensionBouton = Police.MeasureString("Retour au menu"); positionBouton = new Vector2(Game.Window.ClientBounds.Width - dimensionBouton.X / 2, Game.Window.ClientBounds.Height - dimensionBouton.Y / 2); BtnRetour = new BoutonDeCommande(Game, "Retour au menu", "Arial20", "BoutonRouge", "BoutonRouge", positionBouton, true, Retour, INTERVALLE_MAJ_STANDARD); BtnRetour.DrawOrder = (int)OrdreDraw.AVANT_PLAN; BtnRetour.Enabled = false; BtnRetour.Visible = false; Game.Components.Add(BtnJouer); Game.Components.Add(BtnInventaire); Game.Components.Add(BtnQuitter); Game.Components.Add(NomJeu); Game.Components.Add(BtnRetour); }