RetroShip.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #region File Description
  2. //-----------------------------------------------------------------------------
  3. // RetroShip.cs
  4. //
  5. // Microsoft XNA Community Game Platform
  6. // Copyright (C) Microsoft Corporation. All rights reserved.
  7. //-----------------------------------------------------------------------------
  8. #endregion
  9. #region Using Statements
  10. using Microsoft.Xna.Framework;
  11. using Microsoft.Xna.Framework.Graphics;
  12. using System;
  13. #endregion
  14. namespace Spacewar
  15. {
  16. /// <summary>
  17. /// The shape that is drawn for the retro ship
  18. /// </summary>
  19. public class RetroShip : VectorShape
  20. {
  21. public RetroShip(Game game)
  22. : base(game)
  23. {
  24. }
  25. /// <summary>
  26. /// Load up the data for the retro ship
  27. /// </summary>
  28. /// <param name="data">The vertex buffer</param>
  29. protected override void FillBuffer(VertexPositionColor[] data)
  30. {
  31. data[0] = new VertexPositionColor(new Vector3(0f, 1.5f, 0f), Color.White);
  32. data[1] = new VertexPositionColor(new Vector3(-1f, -1.5f, 0f), Color.White);
  33. data[2] = data[1];
  34. data[3] = new VertexPositionColor(new Vector3(0f, -1f, 0f), Color.White);
  35. data[4] = data[3];
  36. data[5] = new VertexPositionColor(new Vector3(1f, -1.5f, 0f), Color.White);
  37. data[6] = data[5];
  38. data[7] = data[0];
  39. }
  40. /// <summary>
  41. /// Number of vectors in retro ship
  42. /// </summary>
  43. protected override int NumberOfVectors
  44. {
  45. get
  46. {
  47. return 4;
  48. }
  49. }
  50. public override void Render()
  51. {
  52. base.Render();
  53. }
  54. }
  55. }