Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Input;
- using Microsoft.Xna.Framework.Content;
- using Microsoft.Xna.Framework.Graphics;
- namespace atan_proj06
- {
- class Barrack : Sprite
- {
- const string BARRACK_ASSETNAME = "barrack";
- const int START_POSITION_X = 15;
- const int START_POSITION_Y = 0;
- const int FRAME_COUNT = 1;
- TimeSpan FrameLength = TimeSpan.FromSeconds(0.25 / (double) FRAME_COUNT);
- TimeSpan FrameTimer = TimeSpan.Zero;
- ContentManager mContentManager;
- Enemy enemeyRef;
- private int FrameNum = 0;
- public Barrack(GraphicsDevice gDevice)
- {
- FrameSize = 150;
- }
- public void LoadContent(ContentManager theContentManager)
- {
- mContentManager = theContentManager;
- Position = new Vector2(50, 300);
- base.LoadContent(theContentManager, BARRACK_ASSETNAME);
- Size = new Rectangle(new Point(0, 0), new Point(FrameSize));
- }
- public override void Draw(SpriteBatch theSpriteBatch)
- {
- theSpriteBatch.Begin(SpriteSortMode.FrontToBack, BlendState.Opaque, SamplerState.LinearWrap,
- DepthStencilState.Default, RasterizerState.CullNone);
- theSpriteBatch.Draw(mSpriteTexture, Position,
- new Rectangle(0 + (FrameSize * FrameNum), 0, FrameSize, mSpriteTexture.Height), Color.White,
- 0.0f, Vector2.One, Scale, SpriteEffects.None, 0);
- theSpriteBatch.End();
- }
- public void Update(GameTime theGameTime)
- {
- Size.X = (int) Position.X;
- Size.Y = (int) Position.Y;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement