Game-Design / Sprint3_actual / Items / SmallKeyItem.cs
SmallKeyItem.cs
Raw
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Sprint3_actual.SoundManagement;
using System;
using System.Collections.Generic;
using System.Text;
using Sprint3_actual.ActiveItems;
using Sprint3_actual.StateFiles;

namespace Sprint3_actual
{
    class SmallKeyItem : IStageItem
    {

        private ISprite SmallKeySprite;
        private Rectangle posRectangle;
        private bool removed;

        public bool hasActiveItem => false;
        public bool isStoreableItem => false;

        public SmallKeyItem(int xPos, int yPos)
        {
            this.removed = false;
            this.posRectangle = new Rectangle(xPos, yPos, 16, 32);
            this.SmallKeySprite = ItemSpriteFactory.Instance.CreateSmallKeyItem(this);

        }

        public void setPos(int destx, int desty)
        {
            posRectangle = new Rectangle(destx, desty, 16, 32);
            SmallKeySprite = ItemSpriteFactory.Instance.CreateSmallKeyItem(this);
        }

        public Rectangle getPos()
        {
            return posRectangle;

        }

        public void DrawItem()
        {
            SmallKeySprite.draw();

        }

        public void UpdateItem(GameTime gameTime)
        {

        }

        public void Collide()
        {
            removed = true;
            Inventory.Instance.KeyCount++;
            SoundEngine.Instance.playHeartOrKeyGet();
        }

        public bool IsRemoved()
        {
            return removed;
        }

        public IActiveItem ReturnItem(ILink link, Game1 game)
        {
            return null;
        }
    }
}