ScoreZooms.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Microsoft.Xna.Framework.Graphics;
  6. using Microsoft.Xna.Framework;
  7. namespace Flood_Control
  8. {
  9. class ScoreZoom
  10. {
  11. public string Text;
  12. public Color DrawColor;
  13. public int displayCounter;
  14. public int MaxDisplayCount = 30;
  15. private float scale = 0.4f;
  16. private float lastScaleAmount = 0.0f;
  17. private float scaleAmount = 0.4f;
  18. public float Scale
  19. {
  20. get { return scaleAmount * displayCounter; }
  21. }
  22. public bool IsCompleted
  23. {
  24. get { return (displayCounter > MaxDisplayCount); }
  25. }
  26. public ScoreZoom(string displayText, Color fontColor)
  27. {
  28. Text = displayText;
  29. DrawColor = fontColor;
  30. displayCounter = 0;
  31. }
  32. public void Update()
  33. {
  34. scale += lastScaleAmount + scaleAmount;
  35. lastScaleAmount += scaleAmount;
  36. displayCounter++;
  37. }
  38. }
  39. }