示例#1
0
 /// <summary>
 /// Instantiates a player, puts him in the level, and remembers where to put him when he is resurrected.
 /// </summary>
 private Tile LoadStartTile(int x, int y)
 {
     //if (Player != null)
     //    throw new NotSupportedException("A level may only have one starting point.");
     start = RectangleExtensions.GetBottomCenter(CollisionRetrieve.GetBounds(x, y));
     return(new Tile(null, TileCollision.Passable));
 }
示例#2
0
        /// <summary>
        /// Instantiates an enemy and puts him in the level.
        /// </summary>
        private Tile LoadEnemyTile(int x, int y, string spriteSet)
        {
            Vector2 position = RectangleExtensions.GetBottomCenter(GetBounds(x, y));

            enemies.Add(new Enemy(this, position, spriteSet));

            return(new Tile(null, TileCollision.Passable));
        }
示例#3
0
        /// <summary>
        /// Instantiates a player, puts him in the level, and remembers where to put him when he is resurrected.
        /// </summary>
        private Tile LoadStartTile(int x, int y)
        {
            StartLocation = RectangleExtensions.GetBottomCenter(GetBounds(x, y));

            return(LoadTile("Exit", new Vector2(x, y) * Tile.Size, TileCollision.Passable));
        }