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; } }
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; } }
public void SpielerInput(SpielerPosition spieler, PaddelBewegung richtung) => throw new System.NotImplementedException();
public Spieler(SpielerPosition spielerposition, Size size, string name) : this(spielerposition, size.Width, size.Height, name) { }