Entity.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. //---------------------------------------------------------------------------------
  2. // Written by Michael Hoffman
  3. // Find the full tutorial at: http://gamedev.tutsplus.com/series/vector-shooter-xna/
  4. //----------------------------------------------------------------------------------
  5. using AtomicEngine;
  6. namespace AtomicBlaster
  7. {
  8. abstract class Entity
  9. {
  10. protected Texture2D image;
  11. // The tint of the image. This will also allow us to change the transparency.
  12. protected Color color = Color.White;
  13. public Vector2 Position, Velocity;
  14. public float Orientation;
  15. public float Radius = 20; // used for circular collision detection
  16. public bool IsExpired; // true if the entity was destroyed and should be deleted.
  17. public Vector2 Size
  18. {
  19. get
  20. {
  21. return image == null ? Vector2.Zero : new Vector2(image.Width, image.Height);
  22. }
  23. }
  24. public abstract void Update();
  25. public virtual void Draw(/*SpriteBatch spriteBatch*/)
  26. {
  27. //SpriteBatch.Draw(image, Position, null, color, Orientation, Size / 2f, 1f, 0);
  28. }
  29. }
  30. }