Exemplo n.º 1
0
 //Elements graphiques nécessaires au mode WIN initialisés
 public Win(Pong game, Conf.TeamSide teamSide)
 {
     this.game = game;
     this.teamWin = teamSide;
     String name = "Right";
     if (teamSide == Conf.TeamSide.LEFT) { name = "Left"; }
     name = name + " team wins !";
     winSprites.Add(new SpriteText(new Vector2(Conf.WINDOW_WIDTH/2 - 160, 160), Color.White, name));
     winSprites.Add(new SpriteText(new Vector2(200, Conf.WINDOW_HEIGHT - 100), Color.White, "Press R to replay or M to menu"));
 }
Exemplo n.º 2
0
 // Initilisation d'un joueur
 public Player(Team team, Conf.PlayerPosition playerPosition, Conf.InteligenceType type)
     : base(Vector2.Zero,Conf.BAT_WIDTH,Conf.BAT_HEIGHT)
 {
     this.Team = team;
     this.CurrentSpeed = Conf.PLAYER_INIT_SPEED;
     HitBox = new Rectangle();
     HitBox.Width = this.width;
     HitBox.Height = this.height;
     HitBox.X = (int)this.position.X;
     HitBox.Y = (int)this.position.Y;
     this.PlayerPosition = playerPosition;
     this.Type = type;
     this.setInital();
     this.setHitBox();
     this.IsAccelerating = false;
 }
Exemplo n.º 3
0
 //Initialisation d'une équipe
 public Team(Conf.TeamSide side,int nbPlayer, Conf.InteligenceType type, Pong pong)
 {
     this.Players = new List<Player>();
     if (side == Conf.TeamSide.LEFT)
     {
         this.Score = new Score(new Vector2(Conf.TEAM_LEFT_SCORE_POSITION_X, Conf.TEAM_SCORE_POSITION_Y));
     }
     else
     {
         this.Score = new Score(new Vector2(Conf.TEAM_RIGHT_SCORE_POSITION_X, Conf.TEAM_SCORE_POSITION_Y));
     }
     this.Pong = pong;
     this.Side = side;
     this.Players.Add(new Player(this, Conf.PlayerPosition.BACK, type));
     if (nbPlayer == 2)
     {
         this.Players.Add(new Player(this, Conf.PlayerPosition.FRONT, type));
     }
 }
Exemplo n.º 4
0
 public Button(Vector2 position, string label, int nbPlayer, Conf.InteligenceType intelligenceType)
     : this(position, label)
 {
     this.nbPlayer = nbPlayer;
     this.intelligenceType = intelligenceType;
 }