private void Inicjuj() { level = 1; punkty = 0; gra = false; pauza = false; licznik.Interval = 1000; szybka = false; this.Plansza_do_gry = new Plansza_Tetris(10, 18); this.nastepny = new Plansza_Tetris(4, 4); this.Plansza_do_gry.Location = new System.Drawing.Point(15, 15); this.Plansza_do_gry.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.Plansza_do_gry.Name = "Plansza_do_gry"; this.Plansza_do_gry.TabIndex = 0; this.Plansza_do_gry.Paint += new PaintEventHandler(this.Plansza_Paint); this.nastepny.Location = new System.Drawing.Point(180, 15); this.nastepny.Name = "nastepny"; this.nastepny.TabIndex = 0; this.nastepny.Paint += new PaintEventHandler(this.Plansza_Paint); this.Controls.Add(this.nastepny); this.Controls.Add(this.Plansza_do_gry); this.lblPkt = new Label(); this.lblPoziom = new Label(); this.Pkt = new Label(); this.Poziom = new Label(); this.info = new Label(); this.lblPkt.AutoSize = true; this.lblPkt.Location = new System.Drawing.Point(180, 120); this.lblPkt.Name = "lblPkt"; this.lblPkt.Size = new System.Drawing.Size(35, 13); this.lblPkt.TabIndex = 0; this.lblPkt.Text = "Punkty:"; this.lblPoziom.AutoSize = true; this.lblPoziom.Location = new System.Drawing.Point(180, 100); this.lblPoziom.Name = "lblPoziom"; this.lblPoziom.Size = new System.Drawing.Size(35, 13); this.lblPoziom.TabIndex = 0; this.lblPoziom.Text = "Poziom:"; this.Pkt.AutoSize = true; this.Pkt.Location = new System.Drawing.Point(230, 120); this.Pkt.Name = "Pkt"; this.Pkt.Size = new System.Drawing.Size(35, 13); this.Pkt.TabIndex = 0; this.Pkt.Text = "0"; this.Poziom.AutoSize = true; this.Poziom.Location = new System.Drawing.Point(230, 100); this.Poziom.Name = "Poziom"; this.Poziom.Size = new System.Drawing.Size(35, 13); this.Poziom.TabIndex = 0; this.Poziom.Text = "1"; this.info.AutoSize = true; this.info.Location = new System.Drawing.Point(180, 140); this.info.Name = "info"; this.info.Size = new System.Drawing.Size(50, 50); this.info.TabIndex = 0; this.info.Text = "Enter - Start\n" + "Esc - Koniec\n" + "Spacja - Pauza\n" + "<- -> - lewo / prawo\n" + "strzalka w gore - obrot w prawo\n\n" + "strzalka w dol - przyspieszenie\n" + " (nacisnac raz zeby przyspieszyc\n" + " i drugi raz zeby zwolnic)\n\n" + "W / Q - obrĂ³t w prawo / lewo"; this.Controls.Add(this.lblPoziom); this.Controls.Add(this.lblPkt); this.Controls.Add(this.Pkt); this.Controls.Add(this.Poziom); this.Controls.Add(this.info); }
private void Plansza_Paint(object sender, PaintEventArgs e) { Plansza_Tetris p = (Plansza_Tetris)sender; p.odswiez(); }