using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Content; using System; using System.Collections.Generic; using System.Text; namespace Sprint3_actual.Blocks { class BlockSprite : ISprite { private Texture2D Texture; private int SpriteWidth; private int SpriteHeight; private int SpriteX; private int SpriteY; private Rectangle sourceRectangle; private Rectangle destinationRectangle; private IBlock block; public BlockSprite(Texture2D texture, int posX, int posY, int width, int height, IBlock block) { this.Texture = texture; this.SpriteWidth = width; this.SpriteHeight = height; this.SpriteX = posX; this.SpriteY = posY; this.block = block; this.sourceRectangle = new Rectangle(this.SpriteX, this.SpriteY, this.SpriteWidth, this.SpriteHeight); this.destinationRectangle = block.getPos(); } public void draw() { this.destinationRectangle = block.getPos(); GlobalVars.spriteBatch.Draw(Texture, destinationRectangle, sourceRectangle, Color.White); } public void update(GameTime gameTime) { } } }