public override void Init() { PlayerData.Score += PlayerData.CurrentScore; PlayerData.AllTime += PlayerData.Time; int witdhCenterForm = (gsm.Form.Width / 2) - ButtonMenu.w / 2; int heightCenterForm = (gsm.Form.Height / 2) - ButtonMenu.h / 2 - 30; base.Init(); continueButton = new ButtonMenu() { Location = new System.Drawing.Point(witdhCenterForm, heightCenterForm + 290) }; for (int i = 0; i < 5; i++) { controls.Add(new CustomLabel()); controls[i].ForeColor = System.Drawing.Color.White; gsm.Form.Controls.Add(controls[i]); } continueButton.Click += optionsClick; controls.Add(continueButton); gsm.Form.Controls.Add(continueButton); controls.Add(txtName); gsm.Form.Controls.Add(txtName); continueButton.Text = "Continue"; controls[0].Width = 400; controls[0].Text = "Level " + PlayerData.CurrentLevel; controls[0].Location = new System.Drawing.Point(witdhCenterForm, 50); controls[1].Text = PlayerData.Score.ToString(); controls[1].Location = new System.Drawing.Point(440, 156); controls[2].Text = PlayerData.Lifes.ToString(); controls[2].Location = new System.Drawing.Point(440, 255); controls[3].Text = PlayerData.AllTime.ToString(); controls[3].Location = new System.Drawing.Point(440, 352); controls[4].Text = "Enter Name"; controls[4].Width = 400; controls[4].Location = new System.Drawing.Point(350, 452); txtName.Location = new System.Drawing.Point(362, 520); txtName.Width = 245; txtName.Font = new Font("Crimson Text", 26); txtName.Text = "Player"; txtName.Height = 200; controls[4].Visible = false; txtName.Visible = false; if (PlayerData.CurrentLevel == PlayerData.Levels || PlayerData.Lifes <= 0) { controls[4].Visible = true; txtName.Visible = true; } }
public override void Init() { base.Init(); int witdhCenterForm = (gsm.Form.Width / 2) - ButtonMenu.w / 2; int heightCenterForm = (gsm.Form.Height / 2) - ButtonMenu.h / 2 - 30; backButton = new ButtonMenu() { Location = new System.Drawing.Point(witdhCenterForm, heightCenterForm + 290) }; backButton.Text = "Back"; loadDataScore(); listNames.Location = new System.Drawing.Point(250, 200); listScores.Location = new System.Drawing.Point(520, 200); listScores.Width = 100; listTime.Location = new System.Drawing.Point(620, 200); listTime.Width = 100; controls.Add(listNames); gsm.Form.Controls.Add(listNames); controls.Add(listScores); gsm.Form.Controls.Add(listScores); controls.Add(listTime); gsm.Form.Controls.Add(listTime); controls.Add(backButton); gsm.Form.Controls.Add(backButton); backButton.Click += back; lblNames.Text = "Name"; lblNames.Font = new Font("Crimson Text", 24); lblNames.Location = new System.Drawing.Point(245, 160); lblScores.Text = "Score"; lblScores.Font = new Font("Crimson Text", 24); lblScores.Location = new System.Drawing.Point(515, 160); lblScores.Width = 100; lblTime.Text = "Time"; lblTime.Font = new Font("Crimson Text", 24); lblTime.Location = new System.Drawing.Point(615, 160); controls.Add(lblNames); gsm.Form.Controls.Add(lblNames); controls.Add(lblScores); gsm.Form.Controls.Add(lblScores); controls.Add(lblTime); gsm.Form.Controls.Add(lblTime); }