Пример #1
0
        /// <summary>
        /// Zeigt das nächste Teil an
        /// </summary>
        /// <param name="t">Das nächste Teil</param>
        /// <param name="c">Die Farbe des nächsten Teils</param>
        public override void displayNext(TTeil t, Color c)
        {
            this._Form.paNext.Refresh();
            Graphics g = this._Form.paNext.CreateGraphics();

            TVisualTeil.drawTeil(g, t, c, this._Segment);
        }
Пример #2
0
        /// <summary>
        /// Wird aufgerufen, wenn das Panel neu gezeichnet wird
        /// </summary>
        void myPanel_Paint(object sender, PaintEventArgs e)
        {
            if (!this.myArena.isRunning)
            {
                return;
            }

            if (this.myArena.isPause)
            {
                this.laPause.Visible = true;
                return;
            }
            else
            {
                this.laPause.Visible = false;
            }

            //Alle Segmente zeichen
            for (int i = TArena.AnzahlSchichten - 1; i >= 1; i--)
            {
                for (int k = 0; k < TArena.AnzahlSektoren; k++)
                {
                    if (this.myArena.hasSegment(k, i))
                    {
                        Color c = this.SpielfeldFarben[k, i];
                        this._MeinSegment.drawSegment(k, i, e.Graphics, c);
                    }
                }
            }

            TVisualTeil.drawTeil(e.Graphics, this._SharedData.FallingTeil, this._SharedData.FallingColor, this._MeinSegment);
            this._MeinSegment.reclearTrapez(e.Graphics);
        }         //Ende Methode myPanel_Paint
Пример #3
0
        /// <summary>
        /// Zeichnet das fallende Teil an der neuen Position
        /// </summary>
        /// <param name="newSektor">neuer Sektor</param>
        /// <param name="newSchicht">neue Schicht</param>
        public void updateFallingTeil(int newSektor, int newSchicht)
        {
            Graphics g = this.myPanel.CreateGraphics();

            TVisualTeil.deleteTeil(g, this._SharedData.FallingTeil, this.myPanel.BackColor, this, this._MeinSegment);

            this._SharedData.FallingTeil.move(newSektor, newSchicht);
            TVisualTeil.drawTeil(g, this._SharedData.FallingTeil, this._SharedData.FallingColor, this._MeinSegment);
        }
Пример #4
0
 /// <summary>
 /// Wird aufgerufen, wenn das Panel mit der Anzeige des nächsten Teils neu gezeichnet wird
 /// </summary>
 void paNext_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
 {
     if (this._Arena != null && !this._Arena.myArena.isPause)
     {
         Graphics g = e.Graphics;
         TTeil    t = this._Data.NextFallingTeil;
         Color    c = this._Data.NextFallingColor;
         TVisualTeil.drawTeil(g, t, c, this._Segment);
     }
 }
Пример #5
0
        /// <summary>
        /// Zeichnet das fallende Teil.
        /// Zeigt auch das Spielende an, wenn das fallende Teil beim Erzeugen kollidiert
        /// </summary>
        /// <param name="ok">Ist <c>true</c>, wenn das Teil Platz hat,
        /// ist <c>false</c> bei Kollision</param>
        public void drawFallendesTeil(bool ok)
        {
            //if (this.myArena.isRunning && !this.myArena.isPause)
            //if (!this.myArena.isPause || !ok)
            if ((this.myArena.isRunning || (!this.myArena.isRunning && !ok)) && !this.myArena.isPause)
            {
                Graphics g = this.myPanel.CreateGraphics();
                TVisualTeil.drawTeil(g, this._SharedData.FallingTeil, this._SharedData.FallingColor, this._MeinSegment);
            }

            if (!ok)
            {
                Form fo = this.myPanel.FindForm();
                MessageBox.Show(fo, "Game Over", fo.Text);
            }
        }