Beispiel #1
0
 public void DrawScene(Pen pen, Graphics g, SceneForm sceneForm)
 {
     ActualScene.Draw(pen, g);
     ActualScene.DrawOtherElements(sceneForm);
     Player1.Draw(g);
     Player2.Draw(g);
 }
Beispiel #2
0
        public override void DrawOtherElements(SceneForm sceneForm)
        {
            base.DrawOtherElements(sceneForm);

            int left = 200;
            int top  = 500;

            PictureBoxPlayer1.Location = new Point(left, top);

            LabelPlayer1Name.Location = new Point(left + 10, top + 20);

            PictureBoxPlayer2.Location = new Point(left + 400, top);

            LabelPlayer2Name.Location = new Point(left + 400 + 10, top + 20);

            LabelPlayer1Result.Location = new Point(left + 10 + 165 + 10, top + 20);

            LabelPlayer2Result.Location = new Point(left + 10 + 165 + 10 + 400, top + 20);


            // ADD CONTROLS
            sceneForm.Controls.Add(LabelPlayer1Name);
            sceneForm.Controls.Add(LabelPlayer1Result);
            sceneForm.Controls.Add(PictureBoxPlayer1);
            sceneForm.Controls.Add(LabelPlayer2Name);
            sceneForm.Controls.Add(LabelPlayer2Result);
            sceneForm.Controls.Add(PictureBoxPlayer2);
        }
 //QIKY ASHT BUTONI SHKA KLIKOHET.. QAJ MA NALT U KON TJETER E KAM FSHI
 private void btnPlayM_Click(object sender, EventArgs e)
 {
     this.Hide();
     SceneForm sceneForm = new SceneForm(Player1Name, Player2Name);
     //MessageBox.Show(Player1Name, Player2Name);
     DialogResult result = sceneForm.ShowDialog();
 }
Beispiel #4
0
 private void pictureBox3_Click_1(object sender, EventArgs e)
 {
     Player1Name = "Player 1";
     Player2Name = "Player 2";
     SceneForm sceneForm = new SceneForm(Player1Name, Player2Name);
     //MessageBox.Show(Player1Name, Player2Name);
     DialogResult result = sceneForm.ShowDialog();
 }
Beispiel #5
0
        //2Player PictureBox
        //private void PictureBox2_MouseLeave(object sender, EventArgs e)
        //{
        //    if (clicked == false)
        //    {
        //        pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;
        //        pictureBox2.Cursor = Cursors.Default;
        //    }
        //    else
        //    {
        //        pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;
        //        pictureBox2.Cursor = Cursors.Default;
        //    }

        //}

        //1Player PictureBox
        //private void PictureBox1_MouseLeave(object sender, EventArgs e)
        //{
        //    if(clicked == false)
        //    {
        //        pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
        //        pictureBox1.Cursor = Cursors.Default;
        //    }
        //    else
        //    {
        //        pictureBox2.SizeMode = PictureBoxSizeMode.Zoom;
        //        pictureBox2.Cursor = Cursors.Default;

        //    }
        //}

        //Play -PcitureBox
        private void PictureBox3_Click(object sender, EventArgs e)
        {
            SceneForm sceneForm = new SceneForm(Player1Name, Player2Name);

            if (sceneForm.ShowDialog() == DialogResult.OK)
            {
                sceneForm.AddOwnedForm(sceneForm);
            }
        }
Beispiel #6
0
        public virtual void DrawOtherElements(SceneForm sceneForm)
        {
            string FontFamily = "Bradley Hand ITC";
            float  FontSize   = 20F;

            PictureBoxPlayer1.Image = Resources.Reslts_Panel263x76;
            PictureBoxPlayer1.Size  = new Size(263, 76);

            // MAX NUMBER OF CHARACTERS: 10
            LabelPlayer1Name.Text      = NewGame.Player1.Name;
            LabelPlayer1Name.Size      = new Size(165, 40);
            LabelPlayer1Name.TextAlign = ContentAlignment.MiddleCenter;
            LabelPlayer1Name.BackColor = Color.FromArgb(0, 80, 126);
            LabelPlayer1Name.Font      = new Font(FontFamily, FontSize, FontStyle.Bold);
            LabelPlayer1Name.ForeColor = Color.FromArgb(128, 255, 0);

            PictureBoxPlayer2.Image = Resources.Reslts_Panel263x76;
            PictureBoxPlayer2.Size  = new Size(263, 76);

            // MAX NUMBER OF CHARACTERS: 10
            LabelPlayer2Name.Text      = NewGame.Player2.Name;
            LabelPlayer2Name.Size      = new Size(165, 40);
            LabelPlayer2Name.TextAlign = ContentAlignment.MiddleCenter;
            LabelPlayer2Name.BackColor = Color.FromArgb(0, 80, 126);
            LabelPlayer2Name.Font      = new Font(FontFamily, FontSize, FontStyle.Bold);
            LabelPlayer2Name.ForeColor = Color.FromArgb(255, 0, 255);


            LabelPlayer1Result.Text        = string.Format("{0:D2}", NewGame.Player1.Points);
            LabelPlayer1Result.BorderStyle = BorderStyle.None;
            LabelPlayer1Result.Size        = new Size(60, 40);
            LabelPlayer1Result.TextAlign   = ContentAlignment.MiddleCenter;
            LabelPlayer1Result.BackColor   = Color.FromArgb(0, 53, 90);
            LabelPlayer1Result.Font        = new Font(FontFamily, FontSize, FontStyle.Bold);
            LabelPlayer1Result.ForeColor   = Color.FromArgb(128, 255, 0);


            // MAX NUMBER OF CHARACTERS: 10
            LabelPlayer2Result.Text        = string.Format("{0:D2}", NewGame.Player2.Points);
            LabelPlayer2Result.BorderStyle = BorderStyle.None;
            LabelPlayer2Result.Size        = new Size(60, 40);
            LabelPlayer2Result.TextAlign   = ContentAlignment.MiddleCenter;
            LabelPlayer2Result.BackColor   = Color.FromArgb(0, 53, 90);
            LabelPlayer2Result.Font        = new Font(FontFamily, FontSize, FontStyle.Bold);
            LabelPlayer2Result.ForeColor   = Color.FromArgb(255, 0, 255);
        }
 private void btnPlay_Click(object sender, EventArgs e)
 {
     SceneForm    sceneForm = new SceneForm(Player1Name, Player1Name);
     DialogResult result    = sceneForm.ShowDialog();
     //this.Close();
 }