示例#1
0
        public Tile(int frameX, int frameY, Vector2 position, bool isPassable, string path)
        {
            this.TileFrameX = frameX;
            this.TileFrameY = frameY;
            this.isPassable = isPassable;

            if (!isPassable)
            {
                this.BoundingBox = new Rectangle((int)position.X - 16, (int)position.Y - 16, 32, 32);
            }
            else
            {
                this.BoundingBox = Rectangle.Empty;
            }

            TileSprite = new SpriteSheet(8, 8, position, path)
            {
                CurrentFrame =
                {
                    X = TileFrameX,
                    Y = TileFrameY
                }
            };      
            TileSprite.LoadContent(ScreenManager.Instance.Content);
        }
示例#2
0
 protected Item(Vector2 position)
 {
     this.Position = position;
     this.Sprite = new SpriteSheet(framesX, framesY, Position, path);
     this.Sprite.LoadContent(ScreenManager.Instance.Content);
     this.GotPicked = false;
 }
示例#3
0
 public override void LoadContent()
 {
     base.LoadContent();
     Map.Initialize();
     Clearance = new TimeSpan();
     this.gameOver = new SpriteSheet(1, 1, Vector2.Zero, "gameover");
     gameOver.LoadContent(ScreenManager.Instance.Content);
     gameOver.Origin = Vector2.Zero;
 }
示例#4
0
        public HealthBar(Vector2 position)
        {
            this.redBar = new SpriteSheet(1, 1, position, "statsbars/red_bar");
            this.greenBar = new SpriteSheet(60, 1, position, "statsbars/green_bar");
            this.redBar.LoadContent(ScreenManager.Instance.Content);
            this.greenBar.LoadContent(ScreenManager.Instance.Content);
            this.greenBar.Origin = Vector2.Zero;
            this.redBar.Origin = Vector2.Zero;

        }