示例#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
 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;
 }