public InfoJoueurMultijoueur(Personnage avatar, string gamertag, Texture2D imageJoueur, GestionPartie gestionnairePartie, bool estActif, NetConnection ip)
 {
     Gamertag = gamertag;
     if(imageJoueur != null)
         ImageJoueur = imageJoueur.Name;
     InfoGestionnairePartie = new InfoGestionPartie();
     EstActif = estActif;
     IP = ip.ToString();
 }
예제 #2
0
 public Joueur(Game game, Personnage avatar, Texture2D imageJoueur, GestionPartie gestionnaireDeLaPartie, Viewport écranDeJeu, string gamerTag)
     : base(game)
 {
     Avatar = avatar;
      ImageJoueur = imageJoueur;
      GestionnaireDeLaPartie = gestionnaireDeLaPartie;
      ÉcranDeJeu = écranDeJeu;
      GamerTag = gamerTag;
      EstActif = true; //active le joueur
 }
예제 #3
0
        public void ChangerAnimation(TypeActionPersonnage typeAnimation, Personnage personnage)
        {
            string action = "";

             switch (typeAnimation)
             {
            case TypeActionPersonnage.Rien:
               action = "superBoy";
               break;
            case TypeActionPersonnage.Boire:
               action = "superBoyBoire";
               break;
            case TypeActionPersonnage.Lancer:
               action = "superBoyLancer";
               break;
            case TypeActionPersonnage.ApresLancer:
               action = "superBoyApresLancer";
               break;
            case TypeActionPersonnage.ApresBoire:
               action = "superBoyApresBoire";
               break;

             }
             Game.Components.Remove(personnage);
             Game.Components.Insert(14, new Personnage(Game, action, personnage.NomTexture, personnage.NomEffet, personnage.Échelle, personnage.Rotation, personnage.Position));
        }
        public override void Initialize()
        {
            GestionClavier = Game.Services.GetService(typeof(InputManager)) as InputManager;

             RotationInitialePersonnagePrincipal = new Vector3(-MathHelper.PiOver2, 0, 0);
             PositionInitialePersonnagePrincipal = new Vector3(0.182f, 0, -DimensionTable.Z / 2 - 0.1f - 0.546f);
             RotationInitialePersonnageSecondaire = new Vector3(-MathHelper.PiOver2, MathHelper.Pi, 0);
             PositionInitialePersonnageSecondaire = new Vector3(-0.182f, 0, DimensionTable.Z / 2 + 0.1f + 0.546f);

             //Initialise les murs (plans texturés) avec la texture nécessaire
             Gauche = new PlanTexturé(Game, 1f, new Vector3(0, MathHelper.PiOver2, 0), new Vector3((float)-DIMENSION_TERRAIN / 2, ((float)DIMENSION_TERRAIN - 4) / 2, 0), étenduePlanMur, charpentePlan, NomGauche, INTERVALLE_MAJ_STANDARD);
             Droite = new PlanTexturé(Game, 1f, new Vector3(0, -MathHelper.PiOver2, 0), new Vector3((float)DIMENSION_TERRAIN / 2, ((float)DIMENSION_TERRAIN - 4) / 2, 0), étenduePlanMur, charpentePlan, NomDroite, INTERVALLE_MAJ_STANDARD);
             Plafond = new PlanTexturé(Game, 1f, new Vector3(MathHelper.PiOver2, 0, 0), new Vector3(0, DIMENSION_TERRAIN - 4, 0), étenduePlanPlafond, charpentePlan, NomPlafond, INTERVALLE_MAJ_STANDARD);
             Plancher = new PlanTexturé(Game, 1f, new Vector3(-MathHelper.PiOver2, 0, 0), new Vector3(0, 0, 0), étenduePlanPlafond, charpentePlan, NomPlancher, INTERVALLE_MAJ_STANDARD);
             Avant = new PlanTexturé(Game, 1f, Vector3.Zero, new Vector3(0, (float)(DIMENSION_TERRAIN - 4) / 2, (float)-DIMENSION_TERRAIN / 2), étenduePlanMur, charpentePlan, NomAvant, INTERVALLE_MAJ_STANDARD);
             Arrière = new PlanTexturé(Game, 1f, new Vector3(0, -MathHelper.Pi, 0), new Vector3(0, (float)(DIMENSION_TERRAIN - 4) / 2, (float)DIMENSION_TERRAIN / 2), étenduePlanMur, charpentePlan, NomArrière, INTERVALLE_MAJ_STANDARD);
             //Ajoutes les murs aux composantes
             Game.Components.Add(Gauche);
             Game.Components.Add(Droite);
             Game.Components.Add(Plafond);
             Game.Components.Add(Plancher);
             Game.Components.Add(Avant);
             Game.Components.Add(Arrière);

             ListePositionVerres = new List<Vector3>();
             ListePositionVerresAdv = new List<Vector3>();
             FixerLesPositions();
             AjouterBiere();

             BoundingTable = new BoundingBox(new Vector3(-DimensionTable.X / 2, DimensionTable.Y - 0.1f, -DimensionTable.Z / 2), new Vector3(DimensionTable.X / 2, DimensionTable.Y, DimensionTable.Z / 2));
             BoundingBonhommePrincipal = new BoundingBox(new Vector3(PositionInitialePersonnagePrincipal.X - DIMENSION_BONHOMMME.X / 2, 0, PositionInitialePersonnagePrincipal.Z - DIMENSION_BONHOMMME.Z), new Vector3(PositionInitialePersonnagePrincipal.X + DIMENSION_BONHOMMME.X / 2, DIMENSION_BONHOMMME.Y, PositionInitialePersonnagePrincipal.Z));
             BoundingBonhommeSecondaire = new BoundingBox(new Vector3(PositionInitialePersonnageSecondaire.X - DIMENSION_BONHOMMME.X / 2, 0, PositionInitialePersonnageSecondaire.Z - DIMENSION_BONHOMMME.Z), new Vector3(PositionInitialePersonnageSecondaire.X + DIMENSION_BONHOMMME.X / 2, DIMENSION_BONHOMMME.Y, PositionInitialePersonnageSecondaire.Z));

             CréerLesVerres();
             Game.Components.Add(new GestionÉvénements(Game, ListePositionVerres, ListePositionVerresAdv, ListeBiereJoueur, ListeBiereAdv, VerresJoueur, VerresAdversaire, DimensionTable,BoundingTable,BoundingBonhommePrincipal,BoundingBonhommeSecondaire));

             //Pour personnages
             PersonnagePrincipal = new Personnage(Game, PersonnageJoueurPrincipalModel, PersonnageJoueurPrincipalTexture, "Shader", 1, RotationInitialePersonnagePrincipal, PositionInitialePersonnagePrincipal);
             PersonnageSecondaire = new Personnage(Game, PersonnageJoueurSecondaireModel, PersonnageJoueurSecondaireTexture, "Shader", 1, RotationInitialePersonnageSecondaire, PositionInitialePersonnageSecondaire);

             //Ajout des objets dans la liste de Components
             Game.Components.Add(PersonnagePrincipal);
             Game.Components.Add(PersonnageSecondaire);

             InitialiserModèles();
             base.Initialize();
        }