Elemental Tower Defense is my first tower defense game, where you need to defend your base against skeleton enemies with your elemental towers. Such as a fire tower that fires rapidly or an ice tower that slows the enemy down.
This was my first tower defense project that I created at school with help from classmates and AI. I struggled most with starting scripts and structuring my code properly. It was also difficult to make my game good replayability wise.
• Wave system
• Music
• Different towers
• Tower sell mechanic
void Update()
{
if (isPlacingTower)
{
FollowMouseWithTower();
if (Input.GetMouseButtonDown(0))
{
Tower tower = currentTower.GetComponent();
tower.isPlaced = true;
PlaceTower();
}
}
}
With left mouse button you can place towers around the map up to 7 towers.
public void SellTower()
private void SellTowers()
{
foreach (Transform t in towerList)
{
currency.AddMoney(50);
Destroy(t.gameObject);
}
towerList.Clear();
placement.towerAmount = 0;
}
The towers sell mechanic lets players sell all their towers at once for currency
void Start()
{
m_CurrencyText.text = "$: " + Money.ToString();
}
void Update()
{
}
public void AddMoney(int money)
{
Money += money;
m_CurrencyText.text = "$: " + Money.ToString();
}
public void RemoveMoney(int money)
{
Money -= money;
m_CurrencyText.text = "$: " + Money.ToString();
}
The currency system lets players earn money by killing enemies to buy new towers.
Project Type: Tower defense game
Genre: TD
Engine: Unity
Role: Solo Dev
Status: Done