Gemstone.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Microsoft.Xna.Framework;
  6. using Microsoft.Xna.Framework.Content;
  7. using Microsoft.Xna.Framework.Graphics;
  8. using Tile_Engine;
  9. namespace Gemstone_Hunter
  10. {
  11. public class Gemstone : GameObject
  12. {
  13. #region Constructor
  14. public Gemstone(ContentManager Content, int cellX, int cellY)
  15. {
  16. worldLocation.X = TileMap.TileWidth * cellX;
  17. worldLocation.Y = TileMap.TileHeight * cellY;
  18. frameWidth = TileMap.TileWidth;
  19. frameHeight = TileMap.TileHeight;
  20. animations.Add("idle",
  21. new AnimationStrip(
  22. Content.Load<Texture2D>(@"Textures\Gem"),
  23. 48,
  24. "idle"));
  25. animations["idle"].LoopAnimation = true;
  26. animations["idle"].FrameLength = 0.15f;
  27. PlayAnimation("idle");
  28. drawDepth = 0.875f;
  29. CollisionRectangle = new Rectangle(9, 24, 30, 24);
  30. enabled = true;
  31. }
  32. #endregion
  33. }
  34. }