private void WeltFuellen()
        {
            Random rand = new Random();

            for (int i = 1; i <= 5; i++)
            {
                Ball b = new Ball();
                b.position.X = rand.Next(pbWelt.Width - 20);
                b.position.Y = rand.Next(pbWelt.Height - 20);

                welt.BallHinzufuegen(b);
            }
        }
Пример #2
0
        public void KollidiereMit(Ball that)
        {
            if (this == that)
                return;

            this.RichtungUm180GradDrehen();
        }
Пример #3
0
 public bool FindetKollisionStatt(Ball andererBall)
 {
     return ErstelleBoundingBox().IntersectsWith(andererBall.ErstelleBoundingBox());
 }
Пример #4
0
 private bool KollidiertMitRechterWand(Ball b)
 {
     return b.position.X > groesse.Width;
 }
Пример #5
0
 private bool KollidiertMitLinkerWand(Ball b)
 {
     return b.position.X < 0;
 }
Пример #6
0
 private bool KollidiertMitBoden(Ball b)
 {
     return b.position.Y > groesse.Height;
 }
Пример #7
0
 public void BallHinzufuegen(Ball b)
 {
     baelle.Add(b);
 }