Exemplo n.º 1
0
 private void Form1_Paint(object sender, PaintEventArgs e)
 {
     Rival.DrawRival(e.Graphics, r1, r2);
     p.DrawPlayer(p, e.Graphics);
     e.Graphics.DrawLine(pen, 0, 0, 180, 0);
     e.Graphics.DrawLine(pen, 0, 0, 0, 320);
     e.Graphics.DrawLine(pen, 180, 0, 180, 320);
     e.Graphics.DrawLine(pen, 60, 0, 60, 320);
     e.Graphics.DrawLine(pen, 120, 0, 120, 320);
     e.Graphics.DrawLine(pen, 0, 320, 180, 320);
     Lvl_Lbl.Text = "Độ khó: " + Level;
     Lvl_Lbl.Update();
     score_label.Text = "Điểm: " + score.ToString();
     score_label.Update();
     if (pause == false)
     {
         Invalidate();
     }
 }
Exemplo n.º 2
0
 public void Turn(params object[] rivals)
 {
     Rival[] r = new Rival[rivals.Length];
     for (int i = 0; i < rivals.Length; i++)
     {
         r[i] = (Rival)rivals[i];
     }
     if (r[0].Y > 400 && r[1].Y > 400)
     {
         Spawn(r);
         for (int i = 0; i < r.Length; i++)
         {
             r[i].Y = 0;
         }
     }
     else
     {
         return;
     }
 }