Exemplo n.º 1
0
        /// <summary>
        /// draw tile map and entities
        /// </summary>
        /// <param name="gameTime"></param>
        public virtual void Draw(GameTime gameTime)
        {
            ScreenManager.StartCameraSpriteBatch();
            DrawTiles(gameTime);
            Player.Draw(gameTime);

            if (grabberEnemies.Count != 0)
            {
                foreach (GrabberEnemy enemy in grabberEnemies)
                {
                    enemy.Draw(gameTime);
                }
            }

            //draw a transparent water tile over top
            foreach (Rectangle waterTile in waterTiles)
            {
                ScreenManager.SpriteBatch.Draw(atlas, waterTile, ImageTools.GetSourceRect(3, 0), Color.White);
            }

            ScreenManager.EndCameraSpriteBatch();
        }
Exemplo n.º 2
0
 /// <summary>
 /// load tile with the collumn index
 /// </summary>
 /// <param name="textureName"></param>
 /// <param name="collision"></param>
 /// <returns></returns>
 private Tile LoadTile(int collumnIndex, TileCollision collision)
 {
     return(new Tile(ImageTools.GetSourceRect(TileSetRow, collumnIndex), collision));
 }