void Init(IUserProfile user, IScore scores) { profile = user; img.sprite = Sprite.Create(profile.image, new Rect(0, 0, profile.image.width, profile.image.height), new Vector2(0.5f, 0.5f)); nameLabel.text = profile.userName; scoreLabel.text = scores.ToString(); rankLabel.text = scores.rank.ToString(); }
private void SetPanStuff(string time) { if (Level == 1) { ScoreTimePan.Location = new Point(800, 300); ScoreTimePan.Size = new Size(200, 250); ScoreTimePan.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; ScoreTimePan.BackColor = Color.Transparent; Time.Location = new Point(50, 50); Time.Font = new Font("murtuza", 20); Time.ForeColor = System.Drawing.Color.White; Time.Text = time; Time.Size = new Size(100, 40); Time.Location = new Point(55, 100); TScore.Location = new Point(55, 30); TScore.Font = new Font("murtuza", 15); TScore.ForeColor = System.Drawing.Color.White; TScore.Text = ("Score: " + IScore.ToString()); TScore.Size = new Size(90, 50); StartStop.Location = new Point(45, 150); StartStop.Font = new Font("murtuza", 20); StartStop.ForeColor = System.Drawing.Color.White; StartStop.BackColor = Color.Black; StartStop.Text = "Start"; StartStop.Size = new Size(100, 40); StartStop.Enabled = true; ScoreTimePan.Controls.Add(Time); ScoreTimePan.Controls.Add(TScore); ScoreTimePan.Controls.Add(StartStop); this.Controls.Add(ScoreTimePan); ScoreTimePan.Show(); ScoreTimePan.SendToBack(); } else { ScoreTimePan.Location = new Point(800, 300); ScoreTimePan.Size = new Size(200, 150); ScoreTimePan.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; ScoreTimePan.BackColor = Color.Transparent; TScore.Location = new Point(55, 30); TScore.Font = new Font("murtuza", 15); TScore.ForeColor = System.Drawing.Color.White; TScore.Text = ("Score: " + IScore.ToString()); TScore.Size = new Size(90, 50); StartStop.Location = new Point(45, 80); StartStop.Font = new Font("murtuza", 20); StartStop.ForeColor = System.Drawing.Color.White; StartStop.BackColor = Color.Black; StartStop.Text = "Start"; StartStop.Size = new Size(100, 40); StartStop.Enabled = true; ScoreTimePan.Controls.Add(TScore); ScoreTimePan.Controls.Add(StartStop); this.Controls.Add(ScoreTimePan); ScoreTimePan.Show(); ScoreTimePan.SendToBack(); } }
private void ScoreUpdater(PictureBox box) { if (box.ImageLocation == EnemiesPicsSrc[0]) { IScore += 300; } else if (box.ImageLocation == EnemiesPicsSrc[1]) { IScore += 200; } else if (box.ImageLocation == EnemiesPicsSrc[2]) { IScore += 100; } else if (box.ImageLocation == EnemiesPicsSrc[3]) { IScore += 400; } else if (box.ImageLocation == EnemiesBullets[0].ImageLocation) { IScore += 100; } TScore.Text = ("Score: " + IScore.ToString()); }
public string ToJson(IScore aJson) { return aJson.ToString(); }
public override string ToString() => _score.ToString();