/// <summary> /// Constructor of the TDStartState /// </summary> public TDStartState() { tdMouse = new TDPointer(new Vector2(200, 200)); TDLayers = new TPLayer[numLayers]; for (int i = 0; i < numLayers; i++) { TDLayers[i] = new TPLayer(layers); } background = new TPSprite(TPEngine.Get().TextureManager.LoadTexture(@"art/TowerDefense/StartScreenBackground")); TDLayers[0].AddEntity(background); TDLayers[numLayers-1].AddEntity(tdMouse); TowerDefenseManager.setLayers(TDLayers); menuwindow = new Window(menuxpos, menuypos, true, TPEngine.Get().TextureManager.LoadTexture(@"art/TowerDefense/startscreenWindow")); menuwindow.addButton(TPEngine.Get().TextureManager.LoadTexture(@"art/TowerDefense/StartButton"), "start", startGame); menuwindow.addButton(TPEngine.Get().TextureManager.LoadTexture(@"art/TowerDefense/ExitButton"), "exit", quitGame); }
/// <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"); }