public void EnvoyerInfoAnimationJoueur(bool estJoueurPrincipal, TypeActionPersonnage nomAnimation) { byte[] message = new byte[2]; message[0] = (byte)Convert.ToByte(estJoueurPrincipal); message[1] = (byte)nomAnimation; EnvoyerMessageServeur(PacketTypes.ANIMATION, message); }
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)); }
void ChangerAnimationPersonnage(TypeActionPersonnage action,int bord1ouMoins1) { Joueur joueur = new Joueur(Game); List<Personnage> ListePerso = new List<Personnage>(); foreach (Personnage perso in Game.Components.Where(person => person is Personnage)) { ListePerso.Add(perso); } if (bord1ouMoins1 * gestionEnviro.CaméraJeu.Position.Z > 0) { joueur.ChangerAnimation(action, ListePerso.Find(peros => peros.Position.Z < 0)); } else { joueur.ChangerAnimation(action, ListePerso.Find(peros => peros.Position.Z > 0)); } }