public Tower(string towerID, Type type, Vector2 position, Coordinates coords, int level = 1, int range = 200, int health = 100, int damage = 500, float fireRate = 2f) { TowerID = towerID; TowerListener.Add(this); TypeofTower = type; TowerProjectiles = new List <Projectile>(); Rotation = 0; Position = position; Level = level; Range = range; Health = health; Damage = damage; FireRate = fireRate; shootTimer = fireRate; switch (type) { case Type.Gun: Sprite = Art.TowerGun[level - 1]; Damage = 500; TowerType = "Gun"; break; case Type.Rocket: Sprite = Art.TowerRocket[level - 1]; Damage = 1700; FireRate = 0.5f; TowerType = "Rocket"; break; case Type.SAM: Sprite = Art.TowerSAM[level - 1]; Damage = 250; TowerType = "SAM"; break; case Type.Tesla: Sprite = Art.TowerTesla[level - 1]; Damage = 40; FireRate = 100; TowerType = "Tesla"; break; } towerCoords = new Coordinates(coords.x, coords.y); healthBar = new UiStatusBars(health, new Vector2(32, 12), Position - new Vector2(Art.TowerGun[0].Width / 2, 20), Art.HpBar[0], Art.HpBar[1]); }
public UiTopGameScreen(GraphicsDevice graphicsDevice) : base(GameManager.WIDTH, GameManager.HEIGHT) { healthBar = new UiStatusBars(graphicsDevice, 100, new Vector2(100, 25), new Vector2(300, 10), Color.Red, Color.Green); waveStats = new List <UiTextString>(); currencyStats = new List <UiTextString>(); timers = new List <UiTextString>(); popUpText = new List <UiTextString>(); Add(ref waveStats); Add(ref currencyStats); Add(ref timers); Add(ref popUpText); Add(ref healthBar); CreateUi(graphicsDevice); }
public UiTopGameScreen(GraphicsDevice graphicsDevice) : base(GameManager.WIDTH, GameManager.HEIGHT) { healthBar = new UiStatusBars(100, new Vector2(437, 39), new Vector2(384, 45), Art.HpBar[0], Art.HpBar[1]); waveStats = new List<UiTextBox>(); currencyStats = new List<UiTextBox>(); timers = new List<UiTextBox>(); popUpText = new List<UiTextString>(); topScreenButtons = new List<UiButton>(); Add(ref waveStats); Add(ref currencyStats); Add(ref timers); Add(ref popUpText); Add(ref healthBar); Add(ref topScreenButtons); CreateUi(graphicsDevice); }
public Tower(string towerID, Type type, Vector2 position, Coordinates coords, int level = 1, int range = 200, int health = 100, int damage = 500, float fireRate = 2f) { TowerID = towerID; TowerListener.Add(this); TypeofTower = type; TowerProjectiles = new List<Projectile>(); Rotation = 0; Position = position; Level = level; Range = range; Health = health; Damage = damage; FireRate = fireRate; shootTimer = fireRate; switch (type) { case Type.Gun: Sprite = Art.TowerGun[level - 1]; Damage = 500; TowerType = "Gun"; break; case Type.Rocket: Sprite = Art.TowerRocket[level - 1]; Damage = 1700; FireRate = 0.5f; TowerType = "Rocket"; break; case Type.SAM: Sprite = Art.TowerSAM[level - 1]; Damage = 250; TowerType = "SAM"; break; case Type.Tesla: Sprite = Art.TowerTesla[level - 1]; Damage = 40; FireRate = 100; TowerType = "Tesla"; break; } towerCoords = new Coordinates(coords.x, coords.y); healthBar = new UiStatusBars(health, new Vector2(32, 12), Position - new Vector2(Art.TowerGun[0].Width / 2, 20), Art.HpBar[0], Art.HpBar[1]); }