Esempio n. 1
0
 /// <summary>
 /// creates a minimap at _position
 /// </summary>
 /// <param name="_position">top left position of the minimap</param>
 /// <param name="map">the map the minimap ist created from</param>
 public Minimap(Vector2 _position, Map map)
 {
     position = _position;
     individualScale = .5f;
     itemList = new List<Icon>();
     playerList = new List<Icon>();
     miniMap = new Icon[Settings.getMapSizeX(), Settings.getMapSizeZ()];
     for (int x = 0; x < Settings.getMapSizeX(); x++)
     {
         for (int z = 0; z < Settings.getMapSizeZ(); z++)
         {
             miniMap[x, z] = map.getBlockAt(x, z).minimapIcon;
             miniMap[x, z].setIndividualScale(individualScale);
             miniMap[x, z].setPosition(new Vector2(position.X + miniMap[0, 0].getWidth() * x, position.Y + miniMap[0, 0].getHeight() * z));
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Initializes the Map, Items, the Player, the PlayerInterface and the Minimap
        /// </summary>
        public virtual void initialize()
        {
            mapCreator = new MapCreator();
            mapCreator.initialize();
            map = mapCreator.generateMap();

            itemMap = new ItemMap();
            itemSpawner = new ItemSpawner();
            itemSpawner.initialSpawn(itemMap, map, playerList);

            initializePlayer();

            minimap = new Minimap(new Vector2(0, 0), map);
            if (playerList.Count == 1)
                minimap.setPosition(new Vector2(Settings.getResolutionX() - minimap.getWidth(), 0));
            else
                minimap.setPosition(new Vector2(Settings.getResolutionX() / 2 - minimap.getWidth() / 2, Settings.getResolutionY() / 2 - minimap.getHeight() / 2));

            Game1.sounds.menuSound.Stop();
            Game1.sounds.inGameSound.Play();
        }
Esempio n. 3
0
 /// <summary>
 /// Constructor for MapCreator, initializes mapType and map
 /// </summary>
 public MapCreator()
 {
     mapType = new int[Settings.getMapSizeX(), Settings.getMapSizeZ()];
     map = new Map();
 }