text:
<repo_name>5ahmnm1920MTIN-3h/inclass-progbasics-chollweger<file_sep>/README.md
# inclass-progbasics-chollweger


text:
<repo_name>arag1/Selenium-Code<file_sep>/README.md
# Selenium-Code
Using different code to extract data with beautiful soup

branch_name: refs/heads/master

repo_language: Markdown


text:
<repo_name>jtoneill/BattleShapez<file_sep>/Unity/BareBones/Assets/Scripts/CharacterBase.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public class CharacterBase : MonoBehaviour
{

    public Animator anim;
    public Transform mTarget;

    public int myHealth;
    public int myAttackDamage;
    public int mySpeed;

    public bool touching;

    //public float mSpeed = 3.0f;

    public PlayerStats ps;
    public EnemyStats es;

    public NavMeshAgent agent;

    public float EPSILON;

    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {

    }

    public void takeDamage(int hurts)
    {

        myHealth -= hurts;

        print(gameObject.name + "'s HP = " + myHealth);

        if (myHealth <= 0)
        {

            if (gameObject.name == "OrbP")
            {
                print("You Lose!");

                Time.timeScale = 0f;
                //figure out how to pause the enemy waves and display an win/lose menu

            }
            else if (gameObject.name == "OrbE")
            {
                print("You Won!");

                Time.timeScale = 0f;

            }
            else if (gameObject.tag == "Enemy")
            {
                ps.expPoints(2);
            }

            Die();

        }
    }

    public void Die()
    {

        Destroy(gameObject);
        print(gameObject.name + " dead");
    }

    public void Guidance()
    {
        transform.LookAt(mTarget.position);
        if ((transform.position - mTarget.position).magnitude >= EPSILON)
        {
            anim.SetInteger("AnimPar", 0);

            //transform.Translate(0.0f, 0.0f, mSpeed * Time.deltaTime);
            //commented out above moves the character towards the closest opponent but does not account for obstructions to direct path

            //below, this uses the nav mesh agent AI to map out shortest path to opponent moving around obstructions
            agent.SetDestination(mTarget.position);

            //e1attacking = false;
            //untag the sword while walking by retagging it to 'untagged', wait, then re tag it back to E1Sword or E2Sword
            //that way the swords cant harm anyone while a character is walking
        }
        else
        {
            anim.SetInteger("AnimPar", 1);

        }
    }

}
<file_sep>/Unity/BareBones/Assets/Scripts/Enemy.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Enemy : CharacterBase
{

    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {

    }

    public void FindClosestPlayer()
    {
        float distanceToClosestPlayer = Mathf.Infinity;
        Player closestPlayer = null;
        Player[] allPlayers = GameObject.FindObjectsOfType<Player>();

        foreach (Player currentPlayer in allPlayers)
        {
            float distanceToPlayer = (currentPlayer.transform.position - this.transform.position).sqrMagnitude;
            if (distanceToPlayer < distanceToClosestPlayer)
            {
                distanceToClosestPlayer = distanceToPlayer;
                closestPlayer = currentPlayer;

            }
        }
        if (closestPlayer.transform.position != null && this.transform.position != null)
        {
            if (closestPlayer.transform == null)
            {
                return;
            }
            Debug.DrawLine(this.transform.position, closestPlayer.transform.position);
            mTarget = closestPlayer.transform;
        }

    }
}
<file_sep>/Unity/BareBones/Assets/Scripts/PlayerStats.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class PlayerStats : MonoBehaviour
{

    public int bank = 0;

    public int levelingPoints = 0;

    public int campaignLevel;
    public int exp;
    public int nextLvlExp = 10;

    public Slider lvlUpBar;
    public Text currentLvlPause;

    public Slider gameplayExpBar;
    public Text currentLvlGameplay;

    //base stats - used for calculating final upgrade value
    public int healthCubeBase = 40;
    public int damageCubeBase = 10;
    public int speedCubeBase = 3;
    public int healthSphereBase = 30;
    public int damageSphereBase = 5;
    public int speedSphereBase = 3;
    public int healthCylinderBase = 200;
    public int damageCylinderBase = 15;
    public int speedCylinderBase = 2;
    public int healthPyramidBase = 400;
    public int damagePyramidBase = 5;
    public int speedPyramidBase = 1;

    //Cube (character 1)
    //stat1
    public int healthCube = 40;
    //stat2
    public int damageCube = 10;
    //stat3
    public int speedCube = 3;

    public int costCube = 2;

    public int hpLevelCube = 0;
    public int damageLevelCube = 0;
    public int speedLevelCube = 0;

    public int hpMultCube = 5;
    public int damageMultCube = 2;
    public int speedMultCube = 1;

    //Sphere (character 2)
    public int healthSphere = 30;
    public int damageSphere = 5;
    public int speedSphere = 3;

    public int costSphere = 10;

    public int hpLevelSphere = 0;
    public int damageLevelSphere = 0;
    public int speedLevelSphere = 0;

    public int hpMultSphere = 5;
    public int damageMultSphere = 2;
    public int speedMultSphere = 1;

    //Cylinder (character 3)
    public int healthCylinder = 200;
    public int damageCylinder = 15;
    public int speedCylinder = 2;

    public int costCylinder = 20;

    public int hpLevelCylinder = 0;
    public int damageLevelCylinder = 0;
    public int speedLevelCylinder = 0;

    public int hpMultCylinder = 5;
    public int damageMultCylinder = 4;
    public int speedMultCylinder = 1;

    //Pyramid (character 4)
    public int healthPyramid = 400;
    public int damagePyramid = 5;
    public int speedPyramid = 1;

    public int costPyramid = 40;

    public int hpLevelPyramid = 0;
    public int damageLevelPyramid = 0;
    public int speedLevelPyramid = 0;

    public int hpMultPyramid = 5;
    public int damageMultPyramid = 3;
    public int speedMultPyramid = 1;

    public int playerOrbHealth = 1000;

    public int character;

    public GameController gc;

    public Text expToGo;
    public Text lvlPointText;

    // Use this for initialization
    void Start ()
    {
        //linked to gc so we can call refresh functions for different text elements after upgrading.
        gc = GameController.FindObjectOfType<GameController>();

        lvlUpBar.value = exp;
        lvlUpBar.maxValue = nextLvlExp;
        currentLvlPause.text = "Campaign Level: " + campaignLevel.ToString();

        gameplayExpBar.value = exp;
        gameplayExpBar.maxValue = nextLvlExp;
        currentLvlGameplay.text = campaignLevel.ToString();

        expInfo();
        lvlPoint();

    }

    // Update is called once per frame
    void Update () {

	}

    //called in the die method in characterBase only if its an enemy character
    public void expPoints(int points)
    {
        exp += points;

        expInfo();

        if (exp >= nextLvlExp)
        {
            campaignLevel += 1;
            levelingPoints += 1;
            exp = 0;
            print("exp maxed: " + nextLvlExp);
            nextLvlExp = nextLvlExp + (nextLvlExp / 2);
            print("exp to next lvl: " + nextLvlExp);

            lvlUpBar.value = exp;
            lvlUpBar.maxValue = nextLvlExp;
            currentLvlPause.text = "Campaign Level: " + campaignLevel.ToString();
            currentLvlGameplay.text = campaignLevel.ToString();
            lvlPoint();
            expInfo();
        }

    }

    public void lvlPoint()
    {
        lvlPointText.text = "*" + levelingPoints;
    }

    public void expInfo()
    {
        lvlUpBar.value = exp;
        gameplayExpBar.value = exp;

        expToGo.text = "Exp.\n" + exp + " / " + nextLvlExp;
    }

    //These are called by the Pause Menu character buttons. They set the character variable which lets
    //... us know which character's stats to display in the pause menu for upgrading.
    public void setCharCube()
    {
        character = 1;
        Debug.Log("Cube Selected");
        gc.cubeUpgradeOffer();
    }

    public void setCharSphere()
    {
        character = 2;
        Debug.Log("Sphere Selected");
        gc.sphereUpgradeOffer();
    }

    public void setCharCylinder()
    {
        character = 3;
        Debug.Log("Cylinder Selected");
        gc.cylinderUpgradeOffer();
    }

    public void setCharPyramid()
    {
        character = 4;
        Debug.Log("Pyramid Selected");
        gc.pyramidUpgradeOffer();
    }

    //This function is called by the upgrade buttons.
    //The 'stat' parameter(1-3) is set in unity at the OnClick connection for each button.
    //speed might level too fast, so maybe switch to floats somewhere at some point...
    public void UpgradeStat(int stat)
    {
        //check that you have enough levelingPoints for the selected upgrade
        if(levelingPoints >= 1)
        {

            if (character == 1)
            {
                if (stat == 1)
                {
                    hpLevelCube += 1;
                    healthCube = healthCubeBase + (hpLevelCube * hpMultCube);
                }
                else if (stat == 2)
                {
                    damageLevelCube += 1;
                    damageCube = damageCubeBase + (damageLevelCube * damageMultCube);
                }
                else if (stat == 3)
                {
                    speedLevelCube += 1;
                    speedCube = speedCubeBase + (speedLevelCube * speedMultCube);
                }

                //refreshes pause menu info
                gc.cubeUpgradeOffer();

                print("cube - HP: " + hpLevelCube + ", Attack: " + damageLevelCube + ", Speed: " + speedLevelCube);

                //subtract a leveling point for the purchase
                levelingPoints -= 1;
            }
            else if (character == 2)
            {
                if (stat == 1)
                {
                    hpLevelSphere += 1;
                    healthSphere = healthSphereBase + (hpLevelSphere * hpMultSphere);
                }
                else if (stat == 2)
                {
                    damageLevelSphere += 1;
                    damageSphere = damageSphereBase + (damageLevelSphere * damageMultSphere);
                }
                else if (stat == 3)
                {
                    speedLevelSphere += 1;
                    speedSphere = speedSphereBase + (speedLevelSphere * speedMultSphere);
                }

                gc.sphereUpgradeOffer();

                print("sphere - HP: " + hpLevelSphere + ", Attack: " + damageLevelSphere + ", Speed: " + speedLevelSphere);

                levelingPoints -= 1;
            }
            else if (character == 3)
            {
                if (stat == 1)
                {
                    hpLevelCylinder += 1;
                    healthCylinder = healthCylinderBase + (hpLevelCylinder * hpMultCylinder);
                }
                else if (stat == 2)
                {
                    damageLevelCylinder += 1;
                    damageCylinder = damageCylinderBase + (damageLevelCylinder * damageMultCylinder);
                }
                else if (stat == 3)
                {
                    speedLevelCylinder += 1;
                    speedCylinder = speedCylinderBase + (speedLevelCylinder * speedMultCylinder);
                }

                gc.cylinderUpgradeOffer();

                print("cylinder - HP: " + hpLevelCylinder + ", Attack: " + damageLevelCylinder + ", Speed: " + speedLevelCylinder);

                levelingPoints -= 1;
            }
            else if (character == 4)
            {
                if (stat == 1)
                {
                    hpLevelPyramid += 1;
                    healthPyramid = healthPyramidBase + (hpLevelPyramid * hpMultPyramid);
                }
                else if (stat == 2)
                {
                    damageLevelPyramid += 1;
                    damagePyramid = damagePyramidBase + (damageLevelPyramid * damageMultPyramid);
                }
                else if (stat == 3)
                {
                    speedLevelPyramid += 1;
                    speedPyramid = speedPyramidBase + (speedLevelPyramid * speedMultPyramid);
                }

                gc.pyramidUpgradeOffer();

                print("pyramid - HP: " + hpLevelPyramid + ", Attack: " + damageLevelPyramid + ", Speed: " + speedLevelPyramid);

                levelingPoints -= 1;
            }

            lvlPoint();

        }
        else
        {
            print("not enough levelingPoints");
        }

    }

}
<file_sep>/Unity/BareBones/Assets/Scripts/Weapon.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Weapon : MonoBehaviour {

    public PlayerStats ps;
    public EnemyStats es;
    public int myAttackDamage;

    public bool touching = false;
    public Transform shooter;

    // Use this for initialization
    void Start ()
    {
        ps = GameController.FindObjectOfType<PlayerStats>();
        es = GameController.FindObjectOfType<EnemyStats>();

        if (gameObject.tag == "CubeWeaponP")
        {
            myAttackDamage = ps.damageCube;
        }
        else if (gameObject.tag == "SphereWeaponP")
        {
            myAttackDamage = ps.damageSphere;
        }
        else if (gameObject.tag == "CylinderWeaponP")
        {
            myAttackDamage = ps.damageCylinder;
        }
        else if (gameObject.tag == "PyramidWeaponP")
        {
            myAttackDamage = ps.damagePyramid;
        }
        else if (gameObject.tag == "CubeWeaponE")
        {
            myAttackDamage = es.damageCube;
        }
        else if (gameObject.tag == "SphereWeaponE")
        {
            myAttackDamage = es.damageSphere;
        }
        else if (gameObject.tag == "CylinderWeaponE")
        {
            myAttackDamage = es.damageCylinder;
        }
        else if (gameObject.tag == "PyramidWeaponE")
        {
            myAttackDamage = es.damagePyramid;
        }
    }

	// Update is called once per frame
	void Update () {

	}

    //
    public void OnTriggerEnter(Collider col)
    {
        if (touching == false && col.gameObject.tag != shooter.tag)
        {
            col.gameObject.SendMessage("takeDamage", myAttackDamage);

            print(gameObject.tag + " dealt " + myAttackDamage + " damage to " + col.gameObject.name);

            touching = true;
        }
    }

    void OnTriggerExit()
    {
        if (touching == true)
        {
            touching = false;
        }
    }

}
<file_sep>/Unity/BareBones/Assets/Scripts/MenuScripts/PauseMenu.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class PauseMenu : MonoBehaviour {

    public bool GameIsPaused = false;

    public GameObject pauseMenuUI;
    public GameObject gameplayControllerUI;
    public EnemyWaves ew;

    public PlayerStats ps;

    void Start()
    {
        pauseMenuUI.SetActive(false);
        gameplayControllerUI.SetActive(true);
        Time.timeScale = 1f;

        ew = GameController.FindObjectOfType<EnemyWaves>();

        ps = GameController.FindObjectOfType<PlayerStats>();

    }

	void update()
    {

    }

    public void Resume()
    {
        pauseMenuUI.SetActive(false);
        gameplayControllerUI.SetActive(true);
        Time.timeScale = 1f;
        GameIsPaused = false;
        ew.pauseFalse();
    }

    public void Pause(bool isPauseButton)
    {
        if (isPauseButton)
        {
            pauseMenuUI.SetActive(true);
            gameplayControllerUI.SetActive(false);
        }

        Time.timeScale = 0f;
        GameIsPaused = true;
        ew.pauseTrue();
    }

    public void LoadMenu()
    {
        Debug.Log("Loading Main Menu");
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex - 1);
    }

}
<file_sep>/Unity/BareBones/Assets/Scripts/EnemyWaves.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyWaves : MonoBehaviour {

    private float waitTime = 0;

    public GameObject[] enemyCharacter;

    public Vector3 spawnValues;
    public GameController gc;
    public PlayerStats ps;
    public EnemyStats es;

    public bool gamePaused;

    public int numToSpawn;
    public int pause;
    public int rand;

    // Use this for initialization
    void Start ()
    {
        ps = GameController.FindObjectOfType<PlayerStats>();
        es = GameController.FindObjectOfType<EnemyStats>();
        gc = GameController.FindObjectOfType<GameController>();

        StartCoroutine(Wave1());
    }

	// Update is called once per frame
	void Update ()
    {

	}

    public void onEnemyCharacterPurchase(int choice)
    {
        Vector3 spawnPosition = new Vector3(Random.Range(-spawnValues.x, spawnValues.x), 1, Random.Range(-spawnValues.z, spawnValues.z));

        Instantiate(enemyCharacter[choice], spawnPosition + transform.TransformPoint(0, 0, 0), gameObject.transform.rotation);

    }

    void wait(int pauseTime)
    {
        waitTime += Time.deltaTime;
        if (waitTime > pauseTime)
        {

            waitTime = 0;
        }
    }

    public void purchaseEnemyCube()
    {
        if (es.Ebank >= es.costCube)
        {
            onEnemyCharacterPurchase(0);
            es.Ebank -= es.costCube;
            print("Enemy Purchased Cube");
        }
        else
        {
            print("Not enough funds!");
        }

    }

    public void purchaseEnemySphere()
    {
        if (es.Ebank >= es.costSphere)
        {
            onEnemyCharacterPurchase(1);
            es.Ebank -= es.costSphere;
            print("Purchased Sphere");
        }
        else
        {
            print("Not enough funds!");
        }

    }

    public void purchaseEnemyCylinder()
    {
        if (es.Ebank >= es.costCylinder)
        {
            onEnemyCharacterPurchase(2);
            es.Ebank -= es.costCylinder;
            print("Purchased Cylinder");
        }
        else
        {
            print("Not enough funds!");
        }

    }

    public void purchaseEnemyPyramid()
    {
        if (es.Ebank >= es.costPyramid)
        {
            onEnemyCharacterPurchase(3);
            es.Ebank -= es.costPyramid;
            print("Purchased Pyramid");
        }
        else
        {
            print("Not enough funds!");
        }

    }

    //Called at the end of each enemy wave, this function keeps the waves coming
    //chooses a random # between 1 and the number of waves, then starts corrisponding wave/co-routine
    public void randomWave()
    {
        rand = Random.Range(1, 5);

        if(rand == 1)
        {
            StartCoroutine(Wave1());
        }
        else if(rand == 2)
        {
            StartCoroutine(Wave2());
        }
        else if (rand == 3)
        {
            StartCoroutine(Wave3());
        }
        else if (rand == 4)
        {
            StartCoroutine(Wave4());
        }
        else if (rand == 5)
        {
            StartCoroutine(Wave5());
        }
        else if (rand == 6)
        {
            StartCoroutine(Wave6());
        }
    }

    //purchases enemy character x number of times. where x is based on numToSpawn
    public void purchaseEnemy(int chosen)
    {
        if (chosen == 0)
        {
            while (numToSpawn > 0)
            {
                purchaseEnemyCube();
                numToSpawn--;
            }
        }
        else if (chosen == 1)
        {
            while (numToSpawn > 0)
            {
                purchaseEnemySphere();
                numToSpawn--;
            }
        }
        else if (chosen == 2)
        {
            while (numToSpawn > 0)
            {
                purchaseEnemyCylinder();
                numToSpawn--;
            }
        }
        else if (chosen == 3)
        {
            while (numToSpawn > 0)
            {
                purchaseEnemyPyramid();
                numToSpawn--;
            }
        }
    }

    public void pauseTrue()
    {
        gamePaused = true;
    }

    public void pauseFalse()
    {
        gamePaused = false;
    }

    public void PauseCheck()
    {

    }

    IEnumerator Wave1()
    {

        print("wave1");

        while (gamePaused)
        {
            yield return null;
        }

        //Random number of cubes spawned (2-4)
        numToSpawn = Random.Range(2, 4);
        print("numToSpawnCubes: " + numToSpawn);
        //waits until there is enough funds, then buys/spawns enemy characters
        if(numToSpawn * es.costCube > es.Ebank)
        {
            pause = (numToSpawn * es.costCube) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }

        purchaseEnemy(0);

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = Random.Range(2, 3);
        print("numToSpawnSpheres: " + numToSpawn);
        if (numToSpawn * es.costSphere > es.Ebank)
        {
            pause = (numToSpawn * es.costSphere) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(1);

        randomWave();

    }

    IEnumerator Wave2()
    {

        print("wave2");

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = Random.Range(1, 2);
        print("numToSpawnCylinders: " + numToSpawn);
        if (numToSpawn * es.costCylinder > es.Ebank)
        {
            pause = (numToSpawn * es.costCylinder) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(2);

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = Random.Range(3, 4);
        print("numToSpawnCubes: " + numToSpawn);
        if(numToSpawn * es.costCube > es.Ebank)
        {
            pause = (numToSpawn * es.costCube) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(0);

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = Random.Range(2, 4);
        print("numToSpawnSpheres: " + numToSpawn);
        if (numToSpawn * es.costSphere > es.Ebank)
        {
            pause = (numToSpawn * es.costSphere) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(1);

        randomWave();

    }

    IEnumerator Wave3()
    {

        print("wave3");

        numToSpawn = 1;
        print("numToSpawnPyramid: " + numToSpawn);
        if (numToSpawn * es.costPyramid > es.Ebank)
        {
            pause = (numToSpawn * es.costPyramid) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(3);

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = Random.Range(3, 4);
        print("numToSpawnCubes: " + numToSpawn);
        if (numToSpawn * es.costCube > es.Ebank)
        {
            pause = (numToSpawn * es.costCube) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(0);

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = Random.Range(3, 4);
        print("numToSpawnCubes: " + numToSpawn);
        if (numToSpawn * es.costCube > es.Ebank)
        {
            pause = (numToSpawn * es.costCube) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(0);

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = Random.Range(3, 4);
        print("numToSpawnSpheres: " + numToSpawn);
        if (numToSpawn * es.costSphere > es.Ebank)
        {
            pause = (numToSpawn * es.costSphere) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(1);

        randomWave();

    }

    IEnumerator Wave4()
    {

        print("wave4");

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = Random.Range(3, 5);
        print("numToSpawnCubes: " + numToSpawn);
        if (numToSpawn * es.costCube > es.Ebank)
        {
            pause = (numToSpawn * es.costCube) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(0);

        randomWave();

    }

    IEnumerator Wave5()
    {

        print("wave5");

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = Random.Range(3, 4);
        print("numToSpawnSpheres: " + numToSpawn);
        if (numToSpawn * es.costSphere > es.Ebank)
        {
            pause = (numToSpawn * es.costSphere) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(1);

        randomWave();

    }

    IEnumerator Wave6()
    {

        print("wave6");

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = 1;
        print("numToSpawnPyramid: " + numToSpawn);
        if (numToSpawn * es.costPyramid > es.Ebank)
        {
            pause = (numToSpawn * es.costPyramid) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(3);

        StartCoroutine(Wave4());

    }

    IEnumerator Wave7()
    {

        print("wave7");

        while (gamePaused)
        {
            yield return null;
        }

        numToSpawn = Random.Range(1, 2); ;
        print("numToSpawnCylinder: " + numToSpawn);
        if (numToSpawn * es.costCylinder > es.Ebank)
        {
            pause = (numToSpawn * es.costCylinder) - es.Ebank;

            print(Time.time + " waiting for " + pause + " seconds");
            yield return new WaitForSecondsRealtime(pause);
            print(Time.time + " done");
        }
        purchaseEnemy(2);

        StartCoroutine(Wave4());

    }

}
<file_sep>/Unity/BareBones/Assets/Scripts/GameController.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GameController : MonoBehaviour
{

    //references to text fields in the gui (drag and dropped)
    public Text cubeHP;
    public Text cubeA;
    public Text cubeS;
    public Text sphereHP;
    public Text sphereA;
    public Text sphereS;
    public Text cylinderHP;
    public Text cylinderA;
    public Text cylinderS;
    public Text pyramidHP;
    public Text pyramidA;
    public Text pyramidS;

    public Text cubeC;
    public Text sphereC;
    public Text cylinderC;
    public Text pyramidC;

    public Text upgradeHPText;
    public Text upgradeAttackText;
    public Text upgradeSpeedText;

    //Currency GUI text
    public Text currencyText;

    private float timer = 0f;

    public PlayerStats ps;
    public EnemyStats es;

    // Use this for initialization
    void Start ()
    {
        updateStats();

    }

	// Update is called once per frame
	void Update ()
    {
        currencyCounter();
    }

    public void currencyCounter()
    {
        //updates each frame, Time.delatTime is the amount of time since the last frame.
        //keep adding this passed time into 'timer' until it is more than say 2 seconds.
        //reset the timer and start over.
        timer += Time.deltaTime;
        if (timer > 2f)
        {
            ps.bank += 2;
            es.Ebank += 2;
            currencyText.text = "$" + ps.bank.ToString();
            timer = 0;
        }
    }

    public void bankPurchase()
    {
        //refreshes the GUI currency amount after you make a purchase
        currencyText.text = ps.bank.ToString();
    }

    public void updateStats()
    {
        updateCubeStats();
        updateSphereStats();
        updateCylinderStats();
        updatePyramidStats();
    }

    public void updateCubeStats()
    {
        cubeHP.text = ps.healthCube.ToString();
        cubeA.text = ps.damageCube.ToString();
        cubeS.text = ps.speedCube.ToString();
        cubeC.text = "$" + ps.costCube.ToString();
        print("CubeStatsUpdated");
    }

    public void updateSphereStats()
    {
        sphereHP.text = ps.healthSphere.ToString();
        sphereA.text = ps.damageSphere.ToString();
        sphereS.text = ps.speedSphere.ToString();
        sphereC.text = "$" + ps.costSphere.ToString();
        print("SphereStatsUpdated");
    }

    public void updateCylinderStats()
    {
        cylinderHP.text = ps.healthCylinder.ToString();
        cylinderA.text = ps.damageCylinder.ToString();
        cylinderS.text = ps.speedCylinder.ToString();
        cylinderC.text = "$" + ps.costCylinder.ToString();
        print("CylinderStatsUpdated");
    }

    public void updatePyramidStats()
    {
        pyramidHP.text = ps.healthPyramid.ToString();
        pyramidA.text = ps.damagePyramid.ToString();
        pyramidS.text = ps.speedPyramid.ToString();
        pyramidC.text = "$" + ps.costPyramid.ToString();
        print("PyramidStatsUpdated");
    }

    //Updates the text in the pause menu depending on which button you select.

    public void cubeUpgradeOffer()
    {
        upgradeHPText.text = "Current HP: " + ps.healthCube.ToString() + " += " + ps.hpMultCube + "; *1";
        upgradeAttackText.text = "Current AttackDamage: " + ps.damageCube.ToString() + " += " + ps.damageMultCube + "; *1";
        upgradeSpeedText.text = "Current Speed: " + ps.speedCube.ToString() + " += " + ps.speedMultCube + "; *1";

        print("CubeStatsUpgraded/Updated");
    }

    public void sphereUpgradeOffer()
    {
        upgradeHPText.text = "Current HP: " + ps.healthSphere.ToString() + " += " + ps.hpMultSphere + "; *1";
        upgradeAttackText.text = "Current AttackDamage: " + ps.damageSphere.ToString() + " += " + ps.damageMultSphere + "; *1";
        upgradeSpeedText.text = "Current Speed: " + ps.speedSphere.ToString() + " += " + ps.speedMultSphere + "; *1";

        print("SphereStatsUpgraded/Updated");
    }

    public void cylinderUpgradeOffer()
    {
        upgradeHPText.text = "Current HP: " + ps.healthCylinder.ToString() + " += " + ps.hpMultCylinder + "; *1";
        upgradeAttackText.text = "Current AttackDamage: " + ps.damageCylinder.ToString() + " += " + ps.damageMultCylinder + "; *1";
        upgradeSpeedText.text = "Current Speed: " + ps.speedCylinder.ToString() + " += " + ps.speedMultCylinder + "; *1";

        print("CylinderStatsUpgraded/Updated");
    }

    public void pyramidUpgradeOffer()
    {
        upgradeHPText.text = "Current HP: " + ps.healthPyramid.ToString() + " += " + ps.hpMultPyramid + "; *1";
        upgradeAttackText.text = "Current AttackDamage: " + ps.damagePyramid.ToString() + " += " + ps.damageMultPyramid + "; *1";
        upgradeSpeedText.text = "Current Speed: " + ps.speedPyramid.ToString() + " += " + ps.speedMultPyramid + "; *1";

        print("PyramidStatsUpgraded/Updated");
    }

}
<file_sep>/Unity/BareBones/Assets/Scripts/PlayerCube.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerCube : Player
{

    // Use this for initialization
    void Start()
    {

        Weapon weapon = gameObject.GetComponentInChildren(typeof(Weapon)) as Weapon;

        if (weapon != null)
        {
            weapon.shooter = transform;
        }

        anim = gameObject.GetComponentInChildren<Animator>();
        ps = GameController.FindObjectOfType<PlayerStats>();
        es = GameController.FindObjectOfType<EnemyStats>();

        myHealth = ps.healthCube;
        myAttackDamage = ps.damageCube;

        mySpeed = ps.speedCube;
        agent.speed = mySpeed;

    }

    // Update is called once per frame
    void Update()
    {
        FindClosestEnemy();
        Guidance();
    }
}
<file_sep>/Unity/BareBones/Assets/Scripts/EnemyOrb.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyOrb : Enemy {

	// Use this for initialization
	void Start ()
    {
        ps = GameController.FindObjectOfType<PlayerStats>();
        es = GameController.FindObjectOfType<EnemyStats>();

        myHealth = es.enemyOrbHealth;
    }

	// Update is called once per frame
	void Update () {

	}
}
<file_sep>/Unity/BareBones/Assets/Scripts/Spawner.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Spawner : MonoBehaviour
{
    public GameObject[] character;

    public Vector3 spawnValues;
    public GameController gc;
    public PlayerStats ps;

    public void onCharacterPurchase(int choice)
    {
        Vector3 spawnPosition = new Vector3(Random.Range(-spawnValues.x, spawnValues.x), 1, Random.Range(-spawnValues.z, spawnValues.z));

        Instantiate(character[choice], spawnPosition + transform.TransformPoint(0, 0, 0), gameObject.transform.rotation);

    }

    public void purchaseCube()
    {
        if(ps.bank >= ps.costCube)
        {
            onCharacterPurchase(0);
            ps.bank -= ps.costCube;
            gc.bankPurchase();
            print("Purchased Cube");
        } else
        {
            print("Not enough funds!");
        }

    }

    public void purchaseSphere()
    {
        if(ps.bank >= ps.costSphere)
        {
            onCharacterPurchase(1);
            ps.bank -= ps.costSphere;
            gc.bankPurchase();
            print("Purchased Sphere");
        } else
        {
            print("Not enough funds!");
        }

    }

    public void purchaseCylinder()
    {
        if(ps.bank >= ps.costCylinder)
        {
            onCharacterPurchase(2);
            ps.bank -= ps.costCylinder;
            gc.bankPurchase();
            print("Purchased Cylinder");
        } else
        {
            print("Not enough funds!");
        }

    }

    public void purchasePyramid()
    {
        if(ps.bank >= ps.costPyramid)
        {
            onCharacterPurchase(3);
            ps.bank -= ps.costPyramid;
            gc.bankPurchase();
            print("Purchased Pyramid");
        } else
        {
            print("Not enough funds!");
        }

    }

    /*
        public GameObject[] enemies;
        public Vector3 spawnValues;
        public float spawnWait;
        public float spawnMostWait;
        public float spawnLeastWait;
        public float startWait;
        public bool stop;

        int randEnemy;

        void Start()
        {
            StartCoroutine(waitSpawner());
        }

        void Update()
        {
            spawnWait = Random.Range(spawnLeastWait, spawnMostWait);
        }

        IEnumerator waitSpawner()
        {
            yield return new WaitForSeconds(startWait);

            while (!stop)
            {
                //randEnemy = Random.Range(0, 2);

                Vector3 spawnPosition = new Vector3(Random.Range(-spawnValues.x, spawnValues.x), 1, Random.Range(-spawnValues.z, spawnValues.z));

                Instantiate(enemies[0], spawnPosition + transform.TransformPoint(0, 0, 0), gameObject.transform.rotation);
                //instead of enemies[0] use enemies[randEnemy] when spawning more than one prefab
                //print("spawned");

                yield return new WaitForSeconds(spawnWait);
            }

        }
        */
}
<file_sep>/Unity/BareBones/Assets/Scripts/EnemyStats.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyStats : MonoBehaviour
{
    public int Ebank = 0;

    //base stats

    //Cube
    public int healthCube = 40;
    public int damageCube = 10;
    public int speedCube = 3;
    public int costCube = 2;

    //Sphere
    public int healthSphere = 30;
    public int damageSphere = 5;
    public int speedSphere = 3;
    public int costSphere = 10;

    //Cylinder
    public int healthCylinder = 200;
    public int damageCylinder = 15;
    public int speedCylinder = 2;
    public int costCylinder = 20;

    //Pyramid
    public int healthPyramid = 400;
    public int damagePyramid = 5;
    public int speedPyramid = 1;
    public int costPyramid = 40;

    public int enemyOrbHealth = 1000;

    // Use this for initialization
    void Start () {

	}

	// Update is called once per frame
	void Update () {

	}
}
<file_sep>/Unity/BareBones/Assets/Scripts/EnemyCube.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyCube : Enemy
{

    // Use this for initialization
    void Start()
    {

        Weapon weapon = gameObject.GetComponentInChildren(typeof(Weapon)) as Weapon;

        if (weapon != null)
        {
            weapon.shooter = transform;
        }

        anim = gameObject.GetComponentInChildren<Animator>();
        ps = GameController.FindObjectOfType<PlayerStats>();
        es = GameController.FindObjectOfType<EnemyStats>();

        myHealth = es.healthCube;
        myAttackDamage = es.damageCube;

        mySpeed = es.speedCube;
        agent.speed = mySpeed;

    }

    // Update is called once per frame
    void Update()
    {
        FindClosestPlayer();
        Guidance();
    }
}

repo_language: C#

repo_name: jtoneill/BattleShapez