Ejemplo n.º 1
0
 /// <summary>
 /// Initalizes the map with the loaded file 
 /// </summary>
 /// <param name="map"></param>
 public static void Start(Map map, TPLayer[] layers)
 {
     MapCreator mc = new MapCreator(map);
     mc.load("CurrentMapData.txt");
     Enemy.findend();
     TDLayers = layers;
     UICreator.CreateUI();
     LastWaveUpdate = TimeSpan.Zero;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Loads the resources used by this state
        /// </summary>
        protected override void Load()
        {
            base.Load();

            tdMouse = new TDPointer(new Vector2(200, 200));
            TDLayers = new TPLayer[numLayers];
            for (int i = 0; i < numLayers; i++)
            {
                TDLayers[i] = new TPLayer(layers);
            }
            backgroundTexture = new TPSprite(TPEngine.Get().TextureManager.LoadTexture(@"art/TowerDefense/CurrentMap"));

            //backgroundTexture = new TPSprite(TPEngine.Get().TextureManager.LoadTexture(@"art/TowerDefense/mob"));
            TDLayers[0].AddEntity(backgroundTexture);
            TDLayers[5].AddEntity(tdMouse);

            map = new Map(1280, 720);
            TowerBuilder.Load(map);
            mp = new MapCreator(map);
            TowerDefenseManager.numLayers = numLayers;
            TowerDefenseManager.Start(map, TDLayers);
            Font = TPEngine.Get().FontManager.LoadFont(@"fonts/testfont");
        }