Gemstone.cs 1.0 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 GemstoneHunter
  10. {
  11. public class Gemstone : GameObject
  12. {
  13. public Gemstone(ContentManager Content, int cellX, int cellY)
  14. {
  15. worldLocation.X = TileMap.TileWidth * cellX;
  16. worldLocation.Y = TileMap.TileHeight * cellY;
  17. frameWidth = TileMap.TileWidth;
  18. frameHeight = TileMap.TileHeight;
  19. animations.Add("idle",
  20. new AnimationStrip(
  21. Content.Load<Texture2D>(@"Textures\Gem"),
  22. 48,
  23. "idle"));
  24. animations["idle"].LoopAnimation = true;
  25. animations["idle"].FrameLength = 0.15f;
  26. PlayAnimation("idle");
  27. drawDepth = 0.875f;
  28. CollisionRectangle = new Rectangle(9, 24, 30, 24);
  29. enabled = true;
  30. }
  31. }
  32. }