Ejemplo n.º 1
0
 private bool CoinInfGauche(Barre barre)
 {
     bool rentre = false;
     if (((barre.Location.Y <= this.Location.Y + this.Height) && (this.Location.Y + this.Height <= barre.Location.Y + barre.Height)) &&
         ((barre.Location.X <= this.Location.X) && (this.Location.X <= barre.Location.X + barre.Width)))
     {
         rentre = true;
     }
     return rentre;
 }
Ejemplo n.º 2
0
 // Cette action sert à mettre en place la barre
 public void miseEnPlaceDeLaBarre()
 {
     barre = new Barre();
     this.Controls.Add(this.barre);
 }
Ejemplo n.º 3
0
 // Cette action sert à savoir si la balle touche la barre
 public void toucherBarre(Barre barre)
 {
     // TODO: utiliser les coins inf et gérer le cas ou la balle est directement dedans
     if (CoinInfDroit(barre)||CoinInfGauche(barre))
     {
         deplacementY = -1 * deplacementY;
     }
 }