// Use this for initialization
	void Start() {    
		//Set high to be out of pickable range
		location = 0;
		//
		minZombies = 4;
		maxZombies = 5;
		zombieSpeed = 3;
		zombieSpawn = 5;
		timeToSpawn = 5;
		
		// Init Lists //
		zombies = new List<GameObject>();
		currentZombies = new List<GameObject>();
		zombieWave = new List<int>();

		//Add Zombies to List//
		zombies.Add(zombie1);
		zombies.Add(zombie2);
		zombies.Add(zombie3);
		zombies.Add(zombie4);
		//
		spawnLocations = new List<Vector3>();
		//Store locations in list
		for (int x = -150; x < 180; x += 30) {
			spawnLocations.Add(new Vector3(x, 0, 1500));
		}
		//LINK Scripts//
		bc = gameObject.GetComponent<BuildingControl>();
		gs = GameObject.Find ("GameController").GetComponent<GameState>();

	}
Example #2
0
 public void IncrementDmg(BuildingControl enem)
 {
     dmg += enem.netWorth;
     enem.onDestroyed -= IncrementDmg;
     PlayerPrefs.SetInt("dmg", dmg);
     dmgText.text = "Damage : " + dmg;
 }
	// Use this for initialization
	void Start () {
		playing = gameOver = false;

		//Link scripts
		gs = gameObject.GetComponent<GameState>();
		bc = gameObject.GetComponent<BuildingControl>();


		//grab player health
		noLives = gs.playerHealth;
		heartPos = 20;
	}
	// Use this for initialization
	public void Start () {
	
		sunTimer = gameTime;
		playerHealth = 3;
		hit = false;
		gameover = false;
		bc = gameObject.GetComponent<BuildingControl>();

		sl = GameObject.Find ("_SilverLiningSky").GetComponent<SilverLining>();
		sl.minutes = 0;

		sz = gameObject.GetComponent<SpawnZombie>();

	}
Example #5
0
        public void DrawCity(City city)
        {
            _Canvas.Children.Clear();

            foreach (var building in city.Buildings)
            {
                var b1 = new BuildingControl(Screen, building);
                _Canvas.Children.Add(b1);
            }

            foreach (var road in city.Roads)
            {
                _Canvas.Children.Add(new RoadControl(Screen, road));
            }

            foreach (var intersection in city.Intersections)
            {
                _Canvas.Children.Add(new IntersectionControl(Screen, intersection));
            }
        }
Example #6
0
    public void Build()
    {
        StoreBuilding _storeBuilding = EventSystem.current.currentSelectedGameObject.GetComponent <StoreBuilding>();

        lastBuilding     = _storeBuilding.GetBuilding();
        lastBuildingTemp = _storeBuilding.GetTempBuilding();
        BuildingControl buildingData = _storeBuilding.GetBuilding().GetComponent <BuildingControl>();

        int[] buildCost = buildingData.buildCost;
        lastBuildingHeight = buildingData.height;
        lastBuildingWidth  = buildingData.width;
        Text[] costText = GameObject.Find("BuildingCostParent").GetComponentsInChildren <Text>();

        foreach (Text item in costText)
        {
            item.text = "0";
        }
        costText[0].text = _storeBuilding.GetBuilding().GetComponent <BuildingControl>().buildingName;
        for (int i = 1; i < costText.Length; i++)
        {
            costText[i].text = buildCost[i - 1].ToString();
        }
    }
	void Start () {


		Screen.SetResolution(1600, 2400, false);

		isKeyboard = true;
		isSFloor = false;
		movementScore = 0;

		PlayerX = 0;

		Shaking = false; 

		//Link Game State script	
		gs = GameObject.Find ("GameController").GetComponent<GameState>();
		bc = GameObject.Find ("GameController").GetComponent<BuildingControl>();
		receive = GameObject.Find ("SmartFloor Prefab").GetComponent<UDPReceive>();
		settings = GameObject.Find("SmartFloor Prefab").GetComponent<Settings>();




	}
Example #8
0
 void Start()
 {
     launcherControl = GameObject.Find("Launchers").GetComponent <LauncherControl>();
     buildingControl = GameObject.Find("Buildings").GetComponent <BuildingControl>();
     StartGame();
 }
Example #9
0
 private void Awake()
 {
     current = this;
 }