예제 #1
0
        void GameStart()
        {
            Game1_Leveling.ResetGame(gController.mainMenu.Item4.IsSelect);
//			MoleSpawner.ClearHole ();
            MoleSpawner.GameStart();
            Catcher.CreateCatcher(snailCount);
        }
예제 #2
0
        public void startHole()
        {
            MoleAnimator = GetComponent <Animator> ();
            Debug.Log("HoleStart");
            MoleAnimator.Play("HoleStart");
            //random Tag
            SnailLeveling lvl       = Game1_Leveling.GetLvling();
            float         randomTag = Random.Range(0.0f, lvl.RightMoleRate + lvl.WrongMoleRate + lvl.DangerMoleRate);

            if (randomTag < lvl.RightMoleRate)
            {
                type = MoleType.MOLE_RIGHT;
                MoleTag.SetTagIdx(type);
            }
            else if (randomTag > lvl.RightMoleRate + lvl.WrongMoleRate)
            {
                //IsDangerMole
                type = MoleType.MOLE_DANGER;
                MoleTag.SetTagIdx(type);
            }
            else
            {
                //wrong mole
                type = MoleType.MOLE_WRONG;
                MoleTag.SetTagIdx(type);
            }
            StartCoroutine("PopMole");
        }
예제 #3
0
        public void ChangeShell(ShellType shell)
        {
            SpriteRenderer spr = GetComponent <SpriteRenderer> ();

            Sprite[] shellSpriteList = Game1_Leveling.GetShellList();
            switch (shell)
            {
            case ShellType.SHELL_CAN:
            {
                spr.sprite = shellSpriteList[0];
            } break;

            case ShellType.SHELL_NORMAL:
            {
                spr.sprite = shellSpriteList[1];
            } break;

            case ShellType.SHELL_TEMPLE:
            {
                spr.sprite = shellSpriteList[2];
            } break;

            case ShellType.SHELL_SPIKE:
            {
                spr.sprite = shellSpriteList[3];
            } break;

            case ShellType.SHELL_WING:
            {
                spr.sprite = shellSpriteList[4];
            } break;
            }
        }
예제 #4
0
        public void setLevel()
        {
            SnailLeveling lvl = Game1_Leveling.GetLvling();

            speed    = lvl.CatcherSpeed / 100.0f;
            idleTime = lvl.CatcherIdleTime;
            shell.ChangeShell(Game1_Leveling.GetLvling().Shell);
        }
예제 #5
0
 public static void BoringCatcher()
 {
     Game1_Leveling.PlayScoreSound(false);
     foreach (Catcher snail in CatcherList)
     {
         snail.face.BoredSnail();
     }
 }
예제 #6
0
        // Update is called once per frame
        void Update()
        {
            if (!IsPlay)
            {
                return;
            }
            GameState gState = GlobalGuage.GetGameState();

            if (gState == GameState.GS_PLAY)
            {
                if ((RandomHole.Count > 0) && (HoleList.Count < Game1_Leveling.GetLvling().MoleMax))
                {
                    ForceSpawn();
                }
            }
        }
예제 #7
0
        IEnumerator PopMole()
        {
            MoleAnimator = GetComponent <Animator> ();
            waitTime     = Random.Range(Game1_Leveling.GetLvling().MinWaitTime, Game1_Leveling.GetLvling().MaxWaitTime);
            yield return(StartCoroutine(Wait(waitTime)));

            Debug.Log("HolePop");
            MoleAnimator.Play("HolePop");
            yield return(StartCoroutine(Wait(0.1f)));

            yield return(StartCoroutine(Wait(MoleAnimator.GetCurrentAnimatorStateInfo(0).length - 0.1f)));

            Debug.Log("HolePop : Get State Info");
            IsPop = true;
            if (type != MoleType.MOLE_RIGHT)
            {
                StartCoroutine("Countdown");
            }
        }
예제 #8
0
        void catchHole()
        {
            if (targetHole != null)
            {
                if (targetHole.CatchHole())
                {
                    if (targetHole.type == MoleType.MOLE_RIGHT)
                    {
                        //Plus Score
                        face.HappySnail();
                        Game1_Leveling.PlayScoreSound(true);

                        //Gain EXP
                        Game1_Leveling.AddEXP();
                        setLevel();
                        GlobalGuage.AddScore(Game1_Leveling.GetCatchMoleScore());
                    }
                    else if (targetHole.type == MoleType.MOLE_WRONG)
                    {
                        //decrease life
                        face.ShockSnail();
                        Game1_Leveling.PlayScoreSound(false);
                        GameObject hpObj = GameObject.Instantiate(HPNotify) as GameObject;
                        hpObj.SetActive(true);
                        hpObj.transform.position = this.transform.position;
                        hpObj.GetComponent <HPNotification>().DecreaseLife(1);
                        GlobalGuage.DecreaseLife();
                        GlobalGuage.BrokeCombo();
                    }
                    else
                    {
                        //Game Over
                        GameObject hpObj = GameObject.Instantiate(HPNotify) as GameObject;
                        hpObj.transform.position = this.transform.position;
                        hpObj.GetComponent <HPNotification>().DecreaseLife(2);
                        GlobalGuage.DangerMole();
                    }
                }
                targetHole = null;
            }
            StartCoroutine("FindHole");
        }
예제 #9
0
        IEnumerator DestroyHole()
        {
            IsPop = false;
            LockOn.SetActive(false);
            MoleAnimator = GetComponent <Animator> ();
            GetComponent <AudioSource>().PlayOneShot(hitSound[Random.Range(0, 2)]);
            MoleAnimator.Play("HoleTouch");
            if (type == MoleType.MOLE_RIGHT)
            {
                Catcher.BoringCatcher();
                //catcher make bored face here
                GameObject hpObj = GameObject.Instantiate(HPNortify) as GameObject;
                hpObj.SetActive(true);
                hpObj.transform.position = this.transform.position;
                hpObj.GetComponent <HPNotification>().DecreaseLife(1);
                GlobalGuage.DecreaseLife();
                GlobalGuage.BrokeCombo();
            }
            else
            {
                GlobalGuage.AddScore(Game1_Leveling.GetTouchMoleScore());
                GlobalGuage.AddCombo();
            }
            while ((MoleAnimator != null) && MoleAnimator.GetCurrentAnimatorStateInfo(0).IsName("HolePop"))
            {
                yield return(null);
            }
            if (MoleAnimator == null)
            {
                yield break;
            }
            yield return(StartCoroutine(Wait(MoleAnimator.GetCurrentAnimatorStateInfo(0).length)));

            MoleSpawner.DestroyHole(this);
            if (!IsLock)
            {
                MoleSpawner.ReleaseHole(this);
            }
        }
예제 #10
0
 // Use this for initialization
 void Awake()
 {
     GameLvlingObject = this;
     ResetGame();
 }