/// <summary> /// Do logic involved with the mob reaching the end of the map here. /// </summary> protected void MobReachedEnd() { dead = true; map.map[ypos][xpos] = -2; enemySprite.Kill(); TowerDefenseManager.TDLayers[2].RemoveEntity(enemySprite); enemyList.Remove(this); TDPlayerStats.Grade -= 5; }
/// <summary> /// Updates this instance of the builder /// tower building is done here /// </summary> /// <param name="mousex">mouse x position</param> /// <param name="mousey">mouse y position</param> public static void Update(int mousex, int mousey) { Tower newtower; switch (towertype) { case "normal": if (NormalTower.Unlocked && isValidLoc_NormalTower(mousex, mousey)) { newtower = new NormalTower(mousex, mousey, UICreator.CurrentColor); cliamLocation_NormalTower(mousex, mousey); holdingTower = false; TowerHeld.Kill(); TowerDefenseManager.TDLayers[TowerDefenseManager.numLayers - 1].RemoveEntity(TowerHeld); TowerHeld = null; } break; case "fast": if (FastTower.Unlocked && isValidLoc_NormalTower(mousex, mousey)) { newtower = new FastTower(mousex, mousey, UICreator.CurrentColor); cliamLocation_NormalTower(mousex, mousey); holdingTower = false; TowerHeld.Kill(); TowerDefenseManager.TDLayers[TowerDefenseManager.numLayers - 1].RemoveEntity(TowerHeld); TowerHeld = null; } break; case "strong": if (StrongTower.Unlocked && isValidLoc_NormalTower(mousex, mousey)) { newtower = new StrongTower(mousex, mousey, UICreator.CurrentColor); cliamLocation_NormalTower(mousex, mousey); holdingTower = false; TowerHeld.Kill(); TowerDefenseManager.TDLayers[TowerDefenseManager.numLayers - 1].RemoveEntity(TowerHeld); TowerHeld = null; } break; case "spray": if (SprayTower.Unlocked && isValidLoc_NormalTower(mousex, mousey)) { newtower = new SprayTower(mousex, mousey, UICreator.CurrentColor); cliamLocation_NormalTower(mousex, mousey); holdingTower = false; TowerHeld.Kill(); TowerDefenseManager.TDLayers[TowerDefenseManager.numLayers - 1].RemoveEntity(TowerHeld); TowerHeld = null; } break; } }