1. Hey! Guest! The 33rd GMC Jam will take place between May 23rd, 12:00 UTC (Friday noon) and May 27th, 12:00 UTC (Monday noon). Why not join in! Click here to find out more!
    Dismiss Notice

Asset - Project TMC Tower Defense Engine

Discussion in 'Marketplace' started by icuurd12b42, Apr 22, 2016.

  1. icuurd12b42

    icuurd12b42 TMC Founder GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    1,832
    [​IMG]

    TMC Tower Defense Engine

    Outputs: All

    Type: Template/Starter Project

    Included: Scripts, Example Sprites, Example Objects and Starter Rooms

    Demo: https://onedrive.liv...45D1EA9168D!745

    Marketplace: https://marketplace....-defense-engine



    Description:

    Engine to quickly make Tower Defense Genre games.

    Includes 2 Krepper types: Shooting and Non Shooting
    New types can easily be created

    Includes 6 Towers
    Gun Tower, Laser Tower, Fire Tower, Freeze Tower, Lightning Tower, Stall Tower
    New types can easily be created

    Money system included
    Level Point System
    Wave Count System
    Keeper Group System
    Incoming Wave System
    Kreeper Search System
    Targeting System
    Turret Placement Tile System
    Sell, Repair and Upgrade Turret System
    Pause, Fast Forward, Simple Menu Included

    Tested on Windows and Android, Normal and YYC output

    Youtube



    Screen Shots:

    [​IMG]
    [​IMG]
     
    Last edited: Aug 14, 2018
  2. icuurd12b42

    icuurd12b42 TMC Founder GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    1,832
    tower parent
    user event 1
    Code:
    //each tower can have it's own event1 to react differently
    if(m_MnuAction == "CanISell")
    {
        m_MnuResponse = true;
    }
    else if(m_MnuAction == "Sell")
    {
        global.Money+=m_SellCost * m_Health/m_MaxHealth;
        instance_destroy();
    }
    else if(m_MnuAction == "CanIRepair")
    {
        //componted logic, can be confusing
        m_MnuResponse = ((m_RepairCost * (1-m_Health/m_MaxHealth)) <=  global.Money) && m_Health<m_MaxHealth;
    }
    else if(m_MnuAction == "Repair")
    {
        global.Money-=(m_RepairCost * (1-m_Health/m_MaxHealth));
        m_Health = m_MaxHealth;
    }
    else if(m_MnuAction == "CanIUpgrade")
    {
        m_MnuResponse = true;
        if(m_Health<m_MaxHealth)
        {
            m_MnuResponse = false;
        }
        else if(m_LevelAt >= 5)
        {
            m_MnuResponse = false;
        }
        else if(m_UpgradeCost > global.Money)
        {
            m_MnuResponse = false;
        }
    }
    else if(m_MnuAction == "Upgrade")
    {
        //here I would instance_change to a better tower
        //I'll just add to the level up var
        m_LevelAt +=1;
        //and increase the range
        m_Range+=10;
    }
    
    Code:
    else if(m_MnuAction == "Sell")
    {
        global.Money+=m_SellCost * m_Health/m_MaxHealth;
        instance_destroy();
    }
    
    if the menu action is sell, restore the money, destroy the tower
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice