void Start()
 {
     _itemScript   = GameObject.Find("Game manager").GetComponent <Item_script>();
     _gameManager  = GameObject.Find("Game manager").GetComponent <Game_manager>();
     _notification = GameObject.Find("Notification").GetComponent <Ingame_notification_script>();
     _questManager = GameObject.Find("Game manager").GetComponent <Quest_manager_script>();
 }
Пример #2
0
 void Start()
 {
     thescoremanager = FindObjectOfType <Score_manager>();
     theplatformgen  = FindObjectOfType <Platform_gen>();
     thegamemanager  = FindObjectOfType <Game_manager>();
     values          = FindObjectOfType <Option_values>();
 }
Пример #3
0
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            bulletAmt--;

            if (bulletCount < 3)
            {
                bulletCount++;
                gui.DisableBullet(bulletCount);
            }

            if (bulletAmt <= 0)
            {
                Game_manager.OnDuckMiss();
            }
            Vector3 mousePos = Input.mousePosition;
            mousePos.z = Camera.main.transform.position.z;
            if (Physics.Raycast(Camera.main.ScreenToWorldPoint(mousePos), Camera.main.transform.forward, out hit, Mathf.Infinity))
            {
                if (hit.transform.tag == "Duck")
                {
                    hit.transform.GetComponent <Duck_Health>().KillDuck();
                }
            }
        }
    }
    public void Update()
    {
        Vector3 WantedDir = Vector3.zero;

        for (int i = 0; i < WASD_Controls.Length; i++)
        {
            if (Input.GetKey(WASD_Controls[i]))
            {
                WantedDir += new Vector3((i - 2) % 2, 0, -(i - 1) % 2);
            }
        }
        if (WantedDir == Vector3.zero)
        {
            MovingDir *= 1 - Speed;
        }
        else
        {
            MovingDir = Vector3.Lerp(MovingDir, WantedDir.normalized, (1 - Smoothness)).normalized;
        }
        if (Input.GetKey(BuildCityKey))
        {
            Game_manager.BuildCity(transform.position + transform.forward * 10);
        }
        if (Input.GetKey(InvestKey))
        {
            Game_manager.InvestInCity(transform.position);
        }
        if (Input.GetKey(StealKey))
        {
            Game_manager.StealFromCity(transform.position);
        }
    }
Пример #5
0
 void Start()
 {
     _gameManager    = GameObject.Find("Game manager").GetComponent <Game_manager>();
     _combatManager  = GameObject.Find("Game manager").GetComponent <Combat_manager_script>();
     _notification   = GameObject.Find("Notification").GetComponent <Ingame_notification_script>();
     _characterStats = GameObject.Find("Game manager").GetComponent <Character_stats>();
     _spellScript    = GameObject.Find("Game manager").GetComponent <Spell_script>();
 }
 public void KillDuck()
 {
     if (isInvincible == false)
     {
         anim.Play("DuckDeath");
         Game_manager.OnDuckShot();
     }
 }
    private void Start()
    {
        _notification   = GameObject.Find("Notification").GetComponent <Ingame_notification_script>();
        _gameManager    = GameObject.Find("Game manager").GetComponent <Game_manager>();
        _characterStats = GameObject.Find("Game manager").GetComponent <Character_stats>();

        checkAvailableQuests();
    }
Пример #8
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Player")
     {
         ani.clip = clip;
         ani.Play();
         Game_manager.set_key_exists(false);
     }
 }
Пример #9
0
    void Start()
    {
        _characterStats     = GameObject.Find("Game manager").GetComponent <Character_stats>();
        _questManager       = GameObject.Find("Game manager").GetComponent <Quest_manager_script>();
        _conversationScript = GameObject.Find("Game manager").GetComponent <Conversation_script>();
        _gameManager        = GameObject.Find("Game manager").GetComponent <Game_manager>();

        nameText.GetComponent <Text_animation>().startAnim(character_name, 0.01f);
    }
Пример #10
0
 void Start()
 {
     _instance = this;
     //if (dataSave != null) {
     score = dataSave.score;
     //}
     gamestop    = false;
     GameisPause = false;
 }
Пример #11
0
 void Awake()
 {
     instance = this;
     for (int i = 0; i < 7; ++i)
         this.shuffle_bag.Add(i, 1);
     for (int k = 0; k < 4; ++k)
     {
         incoming_id[k] = this.shuffle_bag.Next();
     }
 }
    public void KillDuck()
    {
        if (isInvincible == false)
        {
            anim.Play("DuckDeath");
            Game_manager.OnDuckShot();
            Manage_Score.score += scoreValue;

            dUI.UpdateDucks();
        }
    }
    public void DirectionChanger(Vector3 _dir)
    {
        direction = new Vector3(direction.x * _dir.x, direction.y * _dir.y);

        bounce++;

        if (bounce >= bounceMax)
        {
            direction = new Vector3(0, 1, 0);
            Game_manager.OnDuckMiss();
        }
    }
Пример #14
0
 private void Awake()
 {
     //singleton
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
    //void Update () {

    //}
    void OnTriggerEnter(Collider hit)
    {
        if (hit.tag == "Killzone")
        {
            Destroy(this.gameObject);
            Game_manager.OnDuckDeath();
        }
        if (hit.tag == "Flyawayzone")
        {
            Game_manager.OnDuckFlyAway();
            Destroy(this.gameObject);
        }
    }
Пример #16
0
        static void Main(string[] args)
        {
            bool    keepPlaying = false;
            Program p1          = new Program();

            do
            {
                Console.Clear(); // clears old stuff if they choose to play again
                Game_manager mgr = new Game_manager();
                mgr.Playgame();
                keepPlaying = p1.KeepPlaying();
            } while (keepPlaying);
        }
Пример #17
0
    // Start is called before the first frame update
    void Start()
    {
        //normalizamos los valores
        sake    = sake / 10;
        vodka   = vodka / 10;
        absenta = absenta / 10;
        whisky  = whisky / 10;
        wine    = wine / 10;

        mouth         = body.GetComponent <Mouth_class>();
        my_shoulder   = new Shoulder_class();
        my_elbow_up   = new Elbow_up_class();
        my_elbow_down = new Elbow_down_class();
        if (my_player == player_number.player_1)
        {
            sake    = PlayerPrefs.GetInt("sake");
            vodka   = PlayerPrefs.GetInt("vodka");
            absenta = PlayerPrefs.GetInt("absenta");
            whisky  = PlayerPrefs.GetInt("whisky");
            wine    = PlayerPrefs.GetInt("wine");
            my_shoulder.Start(my_shoulder_transform, max_angle_shoulder, min_angle_shoulder, active_key_shoulder, aceleration_axis_shoulder, speed_animation_shoulder, true);
        }
        else
        {
            sake    = PlayerPrefs.GetInt("sake_2");
            vodka   = PlayerPrefs.GetInt("vodka_2");
            absenta = PlayerPrefs.GetInt("absenta_2");
            whisky  = PlayerPrefs.GetInt("whisky_2");
            wine    = PlayerPrefs.GetInt("wine_2");
            my_shoulder.Start(my_shoulder_transform, max_angle_shoulder, min_angle_shoulder, active_key_shoulder, aceleration_axis_shoulder, speed_animation_shoulder, false);
        }

        my_elbow_up.Start(my_elbow_transform, max_angle_elbow, min_angle_elbow, active_key_elbow_up, aceleration_axis_elbow, speed_animation_elbow);
        my_elbow_down.Start(my_elbow_transform, max_angle_elbow, min_angle_elbow, active_key_elbow_down, aceleration_axis_elbow, speed_animation_elbow);

        //HUD
        if (isPlayerLeft)
        {
            barraBorracho = GameObject.Find("Fill Amonut Left").GetComponent <Image>();
        }
        else
        {
            barraBorracho = GameObject.Find("Fill Amonut Right").GetComponent <Image>();
        }

        //Referencia al gameManager
        GameManager = GameObject.Find("GameManager").GetComponent <Game_manager>();

        drinked_glasses = 0;
    }
    void OnTriggerEnter2D(Collider2D Get)
    {
        if (Get.gameObject.name == "dish")
        {
            Destroy(this.gameObject);
            Game_manager.checkBuggerStack(this.tag);
        }


        if (Get.gameObject.name == "GarbageDestory")
        {
            Destroy(this.gameObject);
        }
    }
Пример #19
0
    // Start is called before the first frame update
    void Start()
    {
        //Cargamos el vaso de la carpeta Resources/Props
        glass = Resources.Load <GameObject>("Props/Glass");
        //Inicializamos las listas para el OP
        objetosActivos      = new List <GameObject>();
        objetosDesactivados = new List <GameObject>();
        //Creamos el objeto pool
        poolGlass      = new GameObject();
        poolGlass.name = "PoolGlass";
        Instantiate(poolGlass, originPosition, Quaternion.identity);

        gameManager = GameObject.Find("GameManager").GetComponent <Game_manager>();
        shots       = gameManager.getListShot();
        spawnGlass();
    }
    void Start()
    {
        _itemScript        = GameObject.Find("Game manager").GetComponent <Item_script>();
        _gameManagerScript = GameObject.Find("Game manager").GetComponent <Game_manager>();
        _characterStats    = GameObject.Find("Game manager").GetComponent <Character_stats>();

        var tmp = slot_text.GetComponent <TextMeshPro>();

        switch (ID)
        {
        case 0:
            tmp.SetText("Head");
            break;

        case 1:
            tmp.SetText("Body");
            break;

        case 2:
            tmp.SetText("Legs");
            break;

        case 3:
            tmp.SetText("Left");
            break;

        case 4:
            tmp.SetText("Shoulder");
            break;

        case 5:
            tmp.SetText("Gadget");
            break;

        case 6:
            tmp.SetText("Feet");
            break;

        case 7:
            tmp.SetText("Right");
            break;

        default:
            break;
        }
        slot_text.GetComponent <Text_animation>().startAnim(tmp.text, 0.01f);
    }
Пример #21
0
    private IEnumerator DoDamage(GameObject city)
    {
        while (city.activeSelf)
        {
            yield return(new WaitForSeconds(cooldown));

            if (city == null || !city.activeSelf)
            {
                yield break;
            }

            if (city.GetComponent <Health>().DoDamage(power))
            {
                Game_manager.KillCity(city.GetComponent <Stadt>());
            }
        }
    }
Пример #22
0
    public bool Steal()
    {
        Health H = transform.GetComponent <Health>();

        if (Level > 0)
        {
            SetLevel(Level - 1); return(true);

            Game_manager.ChatMessage("Downgrading Tower...");
        }
        if (H.CurrentHealth > 10)
        {
            Game_manager.ChatMessage("Robbing Tower...");
            H.DoDamage(10); return(true);
        }
        Game_manager.ChatMessage("Don't kill Towers! plz?");
        return(false);
    }
Пример #23
0
    public bool Invest(int Amount)
    {
        Health H = transform.GetComponent <Health>();

        if (H.CurrentHealth < H.MaxHealth)
        {
            H.DoDamage(-10 * Amount);
            Game_manager.ChatMessage("Healing Tower...");
            return(true);
        }
        if (Level < 2 && Game_manager.DecreaseKapital(Game_manager.Kapital / 20 + 20))
        {
            Game_manager.ChatMessage("Upgrading Tower...");
            SetLevel(Level + 1);
            return(true);
        }
        else
        {
            Game_manager.ChatMessage("Tower maxed.");
        }
        return(false);
    }
    // Update is called once per frame
    void Start()
    {
        _hair  = hair.GetComponent <SpriteRenderer>();
        _eyes  = eyes.GetComponent <SpriteRenderer>();
        _nose  = nose.GetComponent <SpriteRenderer>();
        _mouth = mouth.GetComponent <SpriteRenderer>();
        _body  = body.GetComponent <SpriteRenderer>();

        _equipment_head     = equipment_head.GetComponent <SpriteRenderer>();
        _equipment_body     = equipment_body.GetComponent <SpriteRenderer>();;
        _equipment_legs     = equipment_legs.GetComponent <SpriteRenderer>();;
        _equipment_left     = equipment_left.GetComponent <SpriteRenderer>();;
        _equipment_shoulder = equipment_shoulder.GetComponent <SpriteRenderer>();;
        _equipment_gadget   = equipment_gadget.GetComponent <SpriteRenderer>();;
        _equipment_feet     = equipment_feet.GetComponent <SpriteRenderer>();;
        _equipment_right    = equipment_right.GetComponent <SpriteRenderer>();;


        _itemScript     = GameObject.Find("Game manager").GetComponent <Item_script>();
        _characterStats = GameObject.Find("Game manager").GetComponent <Character_stats>();
        _gameManager    = GameObject.Find("Game manager").GetComponent <Game_manager>();
    }
Пример #25
0
    public bool Shoot()
    {
        if (EnemiesInRange.Count == 0)
        {
            return(false);
        }
        System.Random R      = new System.Random();
        Transform     Target = null;

        foreach (Transform turret in ActiveTurrets)
        {
            Target = EnemiesInRange[R.Next(0, EnemiesInRange.Count - 1)];
            Lasers[ActiveTurrets.IndexOf(turret)].SetPositions(new Vector3[] { turret.GetChild(turret.childCount - 1).transform.position, Target.position });
            turret.rotation = Quaternion.LookRotation(Vector3.ProjectOnPlane(Target.position - turret.position, Vector3.up), Vector3.up);

            if (Target.GetComponent <Health>().DoDamage(10))
            {
                EnemiesInRange.Remove(Target);
                Game_manager.ChatMessage("Enemy down!");
            }
        }
        return(true);
    }
Пример #26
0
 // Use this for initialization
 void Start()
 {
     ani = GetComponent <Animation>();
     Game_manager.set_key_exists(true);
 }
 // Use this for initialization
 void Start()
 {
     Instance = this;
 }
Пример #28
0
 private void Start()
 {
     gm = GameObject.Find("GameManager").GetComponent <Game_manager>();
 }
Пример #29
0
 void Awake()
 {
     instance = this;
 }
Пример #30
0
        // Update is called once per frame
        void Update()
        {
            gamemanagerscript = GameObject.Find("Game manager").GetComponent <Game_manager>();


            switch (currentState)
            {
            case (BattleStates.LOSE):
                deadenemys = 0;
                break;


            case (BattleStates.Start):
                nextstate();

                break;



            case (BattleStates.Playerchose):
                if (selected == false && currentState == BattleStates.Playerchose)
                {
                    button1.SetActive(true);
                    button4.SetActive(true);
                    button3.SetActive(true);
                    button2.SetActive(true);
                    selected = true;
                }


                break;



            case (BattleStates.PlayerAnimation):
                selected = false;
                button1.SetActive(false);
                button4.SetActive(false);
                button3.SetActive(false);
                button2.SetActive(false);
                nextstate();
                break;



            case (BattleStates.Playerinfo):
                if (working == false)
                {
                    StartCoroutine(playerinfodialog());
                }
                break;



            case (BattleStates.Enemyanimation):
                if (alreadyattacked == false)
                {
                    StartCoroutine(Enemyattacks());
                }
                break;



            case (BattleStates.Enemyinfo):
                alreadyattacked = false;
                if (playerdead)
                {
                    currentState = BattleStates.LOSE;
                }

                // or sign: || : if there is an enemy with more then 1 opponent put it here!
                if (deadenemys >= 3 || deadenemys == 1 && Game_manager.WhatEnemyAreYouFacing != "Sinister Crow")
                {
                    deadenemys = 0;
                    Win();
                }
                else
                {
                    if (deadenemys < 3)
                    {
                        if (enemyworking == false)
                        {
                            StartCoroutine(enemyinfodialog());
                        }
                    }
                }

                break;
            }
        }
 private void Start()
 {
     _itemScript        = GameObject.Find("Game manager").GetComponent <Item_script>();
     _gameManagerScript = GameObject.Find("Game manager").GetComponent <Game_manager>();
     _characterStats    = GameObject.Find("Game manager").GetComponent <Character_stats>();
 }
Пример #32
0
 void Awake()
 {
     instance = this;
     for (int i = 0; i < 7; ++i)
         this.shuffle_bag.Add(i, 1);
     for (int k = 0; k < 4; ++k)
     {
         incoming_id[k] = this.shuffle_bag.Next();
     }
     this.lines = 0;
     this.score = 0;
     this.game_pause = false;
     this.menu_pause = false;
     this.storage = -1;
     this.current_face = -1;
 }
//	void Update () {

//	}
//}

    public void SpawnDucks()
    {
        Game_manager.OnSpawnDucks();
    }