diff options
author | Thomas Leyh <leyh.thomas@web.de> | 2016-07-24 08:14:18 +0200 |
---|---|---|
committer | Thomas Leyh <leyh.thomas@web.de> | 2016-07-24 08:14:18 +0200 |
commit | ced3d03bdb3ce866d832e03fb212865140905a9a (patch) | |
tree | 2a16c2063a46d3c354ce1585029dda3124f6ad93 /V3/Objects/Sprite/ArrowSprite.cs | |
parent | 0394dccaf06e1009e591a6ff4d645895574724c1 (diff) | |
download | V3-release.tar.gz V3-release.tar.bz2 |
Diffstat (limited to 'V3/Objects/Sprite/ArrowSprite.cs')
-rw-r--r-- | V3/Objects/Sprite/ArrowSprite.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/V3/Objects/Sprite/ArrowSprite.cs b/V3/Objects/Sprite/ArrowSprite.cs new file mode 100644 index 0000000..76e34b7 --- /dev/null +++ b/V3/Objects/Sprite/ArrowSprite.cs @@ -0,0 +1,42 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; + +namespace V3.Objects.Sprite +{ + /// <summary> + /// A simple arrow from different directions without animations. + /// </summary> + public sealed class ArrowSprite : ISpriteCreature + { + private Texture2D mTexture; + private const int Size = 64; + + public void Load(ContentManager contentManager) + { + mTexture = contentManager.Load<Texture2D>("Sprites/arrows"); + } + + public void Draw(SpriteBatch spriteBatch, Vector2 position, MovementState movementState, MovementDirection movementDirection) + { + spriteBatch.Draw(mTexture, position - new Vector2(Size / 2f), new Rectangle(0, Size * (int) movementDirection, Size, Size), Color.White); + } + + public void DrawStatic(SpriteBatch spriteBatch, + Point position, + MovementState movementState, + MovementDirection movementDirection) + { + Draw(spriteBatch, position.ToVector2(), movementState, movementDirection); + } + + public void PlayAnimation(GameTime gameTime) + { + } + + public void PlayOnce(MovementState animation, TimeSpan duration) + { + } + } +}
\ No newline at end of file |