Ejemplo n.º 1
0
Archivo: Level.cs Proyecto: serkts/RPG
        public void Draw(SpriteBatch sb)
        {
            //transform matrix used to account for the camera in the level
            sb.Begin(SpriteSortMode.FrontToBack, transformMatrix: camera.Transform);
            foreach (Tile tile in tiles)
            {
                tile.Draw(sb);
            }
            player.Draw(sb);
            treeloader.Draw(sb);
            bushLoader.Draw(sb);
            sb.DrawString(spriteFont, "x: " + (int)player.Position.X / tileSize + "\ny: " + (int)player.Position.Y / tileSize, new Vector2(player.Position.X - Game1.WIDTH / 2.1f, player.Position.Y - Game1.HEIGHT / 2.3f), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0.5f);
            //sb.DrawString(spriteFont, "fps: " + framerate, new Vector2(player.Position.X - Game1.WIDTH / 2.1f, player.Position.Y - Game1.HEIGHT / 2.6f), Color.White, 0, Vector2.Zero, 1, SpriteEffects.None, 0.5f);

            /*if (levelState == LevelState.Town)
             * {
             *  npc1.Draw(sb);
             *  if (drawText)
             *      npcText.Draw(sb);
             * }*/
            sb.End();
        }