Example #1
0
        public override void LoadContent(Player player, MapBase theMap)
        {
            base.LoadContent(player, theMap);

            player.MapBoundry = MapBoundry;

            MapTiles = new DungeonTiles(Game1.Textures["dungeonTiles"]);

            datasource = new TileLayoutDataSource(@"Map\Dungeon1TileLayout.csv", MapTiles);
            datasource.LoadContent();

            Texture2D playerTexture = Game1.Textures["player"];

            textBox = new TextBox(Game1.gameFont, Game1.Textures["textBox"]);

            testCharacter = new Enemy(Game1.Textures["blackKnight"], new Vector2(175, 350), theMap, MapBoundry);
            enemy2 = new Enemy(Game1.Textures["blackKnight"], new Vector2(550, 350), theMap, MapBoundry);

            basicSword = new Sword("Basic Sword", Game1.Textures["sword"], new Vector2(200, 300), ItemType.Weapon, true);

            swordChest = new Chest(basicSword, new Vector2(400, 200), Game1.Textures["chest"]);

            MovingElements.Add(player);
            MovingElements.Add(testCharacter);

            MovingElements.Add(enemy2);
            ImmovableObjects.AddRange(datasource.GetCollisionTiles());
            ImmovableObjects.Add(swordChest);
            ItemsAvailable.Add(basicSword);
        }
Example #2
0
 public virtual void LoadContent(Player player, Player2 player2, MapBase currentMap)
 {
     userPlayer = player;
     userPlayer2 = player2;
 }
Example #3
0
 public virtual void LoadContent(Player player, MapBase theMap)
 {
     userPlayer = player;
 }
Example #4
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Textures.Add("player", Content.Load<Texture2D>(@"images/Hero Sprite Sheet"));
            Textures.Add("inventory", Content.Load<Texture2D>(@"images/Inventory"));
            Textures.Add("sword", Content.Load<Texture2D>(@"images/Sword"));
            Textures.Add("blackKnight", Content.Load<Texture2D>(@"images/Black Knight Sheet"));
            Textures.Add("mario", Content.Load<Texture2D>(@"images/Mario"));
            Textures.Add("tiles", Content.Load<Texture2D>(@"images/Tiles"));
            Textures.Add("dungeonTiles", Content.Load<Texture2D>(@"images/DungeonTiles"));
            Textures.Add("textBox", Content.Load<Texture2D>(@"images/TextBox"));
            Textures.Add("chest", Content.Load<Texture2D>(@"images/Chest"));
            Textures.Add("heartFull", Content.Load<Texture2D>(@"images/Heart Full"));
            Textures.Add("heartHalf",Content.Load<Texture2D>(@"images/Heart Half"));
            Textures.Add("heartEmpty", Content.Load<Texture2D>(@"images/Heart Empty"));

            gameFont = Content.Load<SpriteFont>(@"font\gameFont");

            currentMap = new Dungeon1(spriteBatch, new Rectangle(156, 116, Window.ClientBounds.Width, Window.ClientBounds.Height));

            userPlayer = new Player(Textures["player"], new Vector2(0, 0), Textures["inventory"], gameFont, currentMap);

            currentMap.LoadContent(userPlayer,currentMap);

            //testCharacter = new Enemy(playerTexture, new Vector2(100, 100));
            //basicSword = new Sword("Basic Sword", Textures["sword"], new Vector2(200, 50), ItemType.Weapon);

            //movingElements.Add(userPlayer);

            //movingElements.Add(testCharacter);

            //itemsAvailable.Add(basicSword);
        }