Game-Design / Sprint3_actual / Concrete_ISprites / StaticStillSprite.cs
StaticStillSprite.cs
Raw
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Text;

namespace Sprint3_actual
{
    class StaticStillSprite : ISprite
    {
        public Texture2D Texture { get; set; }
        public int SpriteWidth { get; set; }
        public int SpriteX { get; set; }
        public int SpriteY { get; set; }
        public Vector2 pos;

        public StaticStillSprite(Texture2D texture, int spriteWidth, int startingSpriteX, int startingSpriteY, int startingPosX, int startingPosY)
        {
            Texture = texture;
            SpriteWidth = spriteWidth;
            SpriteX = startingSpriteX;
            SpriteY = startingSpriteY;
            pos = new Vector2(startingPosX, startingPosY);
        }
        public void draw()
        {
            Rectangle sourceRectangle = new Rectangle(SpriteX, SpriteY, SpriteWidth, SpriteWidth);
            Rectangle destinationRectangle = new Rectangle((int)pos.X, (int)pos.Y, SpriteWidth, SpriteWidth);

            GlobalVars.spriteBatch.Draw(Texture, destinationRectangle, sourceRectangle, Color.White);
        }

        public void update(GameTime gameTime)
        {

        }
    }
}