Exemplo n.º 1
0
        public Spieler(SpielerPosition spielerposition, int xMax, int yMax, string name)
        {
            // Erzeuge neues Paddel für den Spieler
            this.paddel = new Paddel(xMax, yMax, spielerposition);
            // Setze Punkte auf startwert
            this.punkte = 0;
            // Setze den Namen
            this.name = name;
            // Speichere spielerposition
            switch (spielerposition)
            {
            case SpielerPosition.Links:
                this.scorePosition = new PointF(xMax / 2 - 50, 30);
                break;

            case SpielerPosition.Rechts:
                this.scorePosition = new PointF(xMax / 2 + 50, 30);
                break;
            }
        }
Exemplo n.º 2
0
        public Paddel(int xMax, int yMax, SpielerPosition position)
        {
            // Höhe, breite und yMax setzen
            this.höhe     = 120;
            this.breite   = 20;
            this.yMax     = yMax;
            this.position = position;

            // Position entsprechen des Spielers einstellen
            switch (position)
            {
            case SpielerPosition.Links:
                this.XPos = breite;
                this.YPos = yMax / 2 - this.höhe / 2;
                break;

            case SpielerPosition.Rechts:
                this.XPos = xMax - breite * 2;
                this.YPos = yMax / 2 - this.höhe / 2;
                break;
            }
        }
Exemplo n.º 3
0
 public void SpielerInput(SpielerPosition spieler, PaddelBewegung richtung) => throw new System.NotImplementedException();
Exemplo n.º 4
0
 public Spieler(SpielerPosition spielerposition, Size size, string name) : this(spielerposition, size.Width, size.Height, name)
 {
 }