Example #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            tileMap = new TileMap(this, Registry.Lookup<Scenegraph>(), @"Content\main.tmx");
            //tileMap.SetScale(new Vector2(2f, 2f));
            // tileMap.SetLocalPosition(new Vector2(32, 32));
            Console.WriteLine("TM pos= " + tileMap.GetLocalPosition());
            playerStartCell = tileMap.GetCellsWithProperty("placement", "Type", "Player")[0];
            playerStartCell.Y -= 2;

            // player movement speed
            SpriteFont font = Content.Load<SpriteFont>(@"ScreenFont");
            player = new JumpingPlayer(font, tileMap, tileMap, GetPlayerImages(), 75);
            //player = new JumpingPlayer(font, tileMap, tileMap, new SimpleSpriteImage(playerImage), 50);
            ResetPlayer();
            // load level monsters
            /* Vector2[] monsterCells = tileMap.GetCellsWithProperty("placement", "Type", "MOB");
             foreach (Vector2 monsterCell in monsterCells)
             {
                 int tileIndex = tileMap.GetTileIndex("placement",monsterCell);
                 Dictionary<string, string> monsterProperties = tileMap.GetTileProperties(tileIndex);
                 Monster monster = new Monster(tileMap,tileMap,playerImage, 50f,monsterProperties);
                 monster.SetLocalCellPosition(monsterCell);
                 player.CollidesWith(monster);
             }*/

            // TODO: use this.Content to load your game content here*/
        }