Esempio n. 1
0
    public void Complete()
    {
        if (LevelProgress == null)
        {
            return;
        }

        LevelProgress.Complete(Time);
        LevelProgress.Save();

        Pix.Game.GetInstance().ReportScores();
    }
Esempio n. 2
0
    public void SaveProgress()
    {
        if (LevelProgress == null)
        {
            return;
        }

        var tiles = ImageProgress.GetTiles();

        if (tiles == null)
        {
            return;
        }

        LevelProgress.SaveProgress(Time, tiles);
        LevelProgress.Save();

        Pix.Game.GetInstance().ReportScores();
    }
Esempio n. 3
0
        void OnTriggerEnter2D(Collider2D other)
        {
            if (other.tag == "Spring")
            {
                jumpsfx.Play();
                jumpForce = 2500;
                Move(0f, false, true);
                jumpForce = 1050;
            }

            if (other.tag == "Spring2")
            {
                jumpsfx.Play();
                jumpForce = 3500;
                Move(0f, false, true);
                jumpForce = 1050;
            }

            if (other.tag == "Duri")
            {
                CoreGame.health -= 10;
                hurtSFX.Play();
                if (10 + CoreGame.health - 10 <= 0)
                {
                    mati = true;
                }
            }

            if (other.tag == "Koin")
            {
                poin.text = (int.Parse(poin.text) + 10).ToString();
                Destroy(other.gameObject);
                beepCoin.Play();
            }

            if (other.tag == "Kunci")
            {
                Kunci1.SetActive(true);
                hasKunci = true;
                Destroy(other.gameObject);
                //BGM.mute = false;
                getKey.Play();
                //BGM.PlayDelayed(1);
            }

            if (other.tag == "Pintu")
            {
                if (hasKunci == false)
                {
                }
                else if (hasKunci == true)
                {
                    //Application.LoadLevel("Select Level");
                    windowText.text = "\t\tSelamat, Kita lanjut ke lantai berikutnya";
                    window.GetComponent <Animator>().SetTrigger("Open");
                    sfxPintu.Play();
                    if (Application.loadedLevelName == "Level 1")
                    {
                        if (LevelProgress.level.Count == 0)
                        {
                            LevelProgress.Save();
                        }
                    }
                    if (Application.loadedLevelName == "Level 2")
                    {
                        if (LevelProgress.level.Count == 1)
                        {
                            LevelProgress.Save();
                        }
                    }
                    if (Application.loadedLevelName == "Level 3")
                    {
                        Application.LoadLevel("Credit");
                    }
                    BGM.Pause();
                }
            }

            if (other.tag == "Info1")
            {
                windowinfo.GetComponent <Animator>().SetTrigger("Open");
                gambarMap.sprite = map1;
                //isiWindowInfo = windowinfo.GetComponent<Text>();
                isiWindowInfo.text = "\t\tInformasi:\n\nIni adalah peta yang tersedia pada level ini."
                                     + "\nAnda bisa menembak saat ini..\nHarap berhati-hati terhadap robot rusak yang ada . . .";
            }

            if (other.tag == "Info2")
            {
                windowinfo.GetComponent <Animator>().SetTrigger("Open");
                gambarMap.sprite = map2;
                //isiWindowInfo = windowinfo.GetComponent<Text>();
                isiWindowInfo.text = "\t\tInformasi:\n\nPercayalah dan yakinlah, apa yang didepan mata, belum tentu seperti yang anda pikirkan";
            }

            if (other.tag == "Info3")
            {
                windowinfo.GetComponent <Animator>().SetTrigger("Open");
                gambarMap.sprite = map3;
                //isiWindowInfo = windowinfo.GetComponent<Text>();
                isiWindowInfo.text = "\t\tInformasi:\n\nAnda harus mendapatkan kunci terlebih dahulu";
            }

            if (other.tag == "Info4")
            {
                windowinfo.GetComponent <Animator>().SetTrigger("Open");
                gambarMap.sprite = map4;
                //isiWindowInfo = windowinfo.GetComponent<Text>();
                isiWindowInfo.fontSize = 20;
                isiWindowInfo.text     = "\t\tInformasi:\n\nTombol dipojok kiri bawah berguna untuk menggerakkan karakter\nTombol di pojok kanan bawah untuk melakukan aksi : \n- Tombol A = menembak (di level 1 belum ada fitur menembak)\n- Tombol B = melompat";
            }

            if (other.tag == "Info5")
            {
                windowinfo.GetComponent <Animator>().SetTrigger("Open");
                gambarMap.sprite       = map5;
                isiWindowInfo.fontSize = 35;
                //isiWindowInfo = windowinfo.GetComponent<Text>();
                isiWindowInfo.text = "\t\tInformasi:\n\nIni adalah peta yang tersedia pada level ini. \nHarap ingat dengan baik-baik.";
            }

            if (other.tag == "Info6")
            {
                windowinfo.GetComponent <Animator>().SetTrigger("Open");
                gambarMap.sprite       = map6;
                isiWindowInfo.fontSize = 35;
                //isiWindowInfo = windowinfo.GetComponent<Text>();
                isiWindowInfo.text = "\t\tInformasi:\n\nAnda harus mendapatkan kunci terlebih dahulu";
            }

            if (other.tag == "Info 7")
            {
                windowinfo.GetComponent <Animator>().SetTrigger("Open");
                gambarMap.sprite   = map7;
                isiWindowInfo.text = "\t\tInformasi:\n\nIni adalah peta yang tersedia pada level ini. \nHarap ingat dengan baik-baik.\nHarap berhati-hati terhadap duri yang ada...";
            }

            if (other.tag == "Info 8")
            {
                windowinfo.GetComponent <Animator>().SetTrigger("Open");
                gambarMap.sprite   = map8;
                isiWindowInfo.text = "\t\tInformasi:\n\nIni adalah peta yang tersedia pada level ini. \nPosisi Anda Berada di sini.\n";
            }


            if (other.tag == "Info 9")
            {
                windowinfo.GetComponent <Animator>().SetTrigger("Open");
                gambarMap.sprite   = map9;
                isiWindowInfo.text = "\t\tInformasi:\n\nAnda harus mengambil kunci terlebih dahulu";
            }


            if (other.tag == "KillZone")
            {
                if (tempCounter == 0)
                {
                    mati = true;

                    CoreGame.nyawa--;
                    tempCounter = 1;
                }
            }
        }