Score.cs 660 B

1234567891011121314151617181920212223242526272829
  1. using Microsoft.Xna.Framework;
  2. using Microsoft.Xna.Framework.Graphics;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace Tutorial010
  9. {
  10. public class Score
  11. {
  12. public int Score1;
  13. public int Score2;
  14. private SpriteFont _font;
  15. public Score(SpriteFont font)
  16. {
  17. _font = font;
  18. }
  19. public void Draw(SpriteBatch spriteBatch)
  20. {
  21. spriteBatch.DrawString(_font, Score1.ToString(), new Vector2(320, 70), Color.White);
  22. spriteBatch.DrawString(_font, Score2.ToString(), new Vector2(430, 70), Color.White);
  23. }
  24. }
  25. }