Esempio n. 1
0
    public void ShowPanel(LevelEndCondition endCondition)
    {
        LevelSceneManager.GameIsActive = false;

        int maxLevel = LevelEditorDataManager.Instance.GetLevelsDictionary().Last().Key;

        switch (endCondition)
        {
        case LevelEndCondition.LevelComplete:
            LevelEndPanelText.key = CompleteKey;
            if (currentLevel != maxLevel)
            {
                NextLevelButton.SetActive(true);
            }
            sfxManager.PlayClip(sfxManager.LevelComplete);
            break;

        case LevelEndCondition.LevelFailed:
            LevelEndPanelText.key = FailKey;
            RetryButton.SetActive(true);
            sfxManager.PlayClip(sfxManager.LevelFailed);
            break;
        }
        LevelEndPanel.SetActive(true);
    }
Esempio n. 2
0
    IEnumerator FROM()
    {
        for (int i = 0; i < amount; i++)
        {
            var VFX = (GameObject)Instantiate(ThingToSpawn, originButton.transform.position, Quaternion.identity);
            VFX.transform.SetParent(parentForObject.transform);
            yield return(new WaitForSeconds(0.3f));

            iTween.MoveTo(VFX, iTween.Hash("position", Destination.transform.position + offset, "easytype", easeType, "ignoretimescale", true, "time", time));
            Destroy(VFX, time);
            yield return(new WaitForSeconds(rate));
        }
        originButton.SetActive(false);
        ShopManager.Instance.AddDiamond(shopmanagerScript.EarningDiamonds);
        Debug.Log("vfx wali script se kara add");

        if (giftReward != true)
        {
            RetryButton.SetActive(true);
        }
        if (giftReward == true)
        {
            BackButton.SetActive(true);
        }
        //Make the coin increase explosion here
    }
Esempio n. 3
0
    public void OnTapLoseButton()
    {
        switch (GameObject.Find("MAINLOOP").GetComponent <MainLoop>().GetStage())
        {
        case 1:
            RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_1);
            Sound.StopBgm();
            GameObject.Find("Fade").GetComponent <Fade>().FadeStart(Fade.NEXTSCENE.GAMEOVER);
            break;

        case 2:
            RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_2);
            Sound.StopBgm();
            GameObject.Find("Fade").GetComponent <Fade>().FadeStart(Fade.NEXTSCENE.GAMEOVER);
            break;

        case 3:
            RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_3);
            Sound.StopBgm();
            GameObject.Find("Fade").GetComponent <Fade>().FadeStart(Fade.NEXTSCENE.GAMEOVER);
            break;

        case 4:
            RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_4);
            Sound.StopBgm();
            GameObject.Find("Fade").GetComponent <Fade>().FadeStart(Fade.NEXTSCENE.GAMEOVER);
            break;

        case 5:
            RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_5);
            Sound.StopBgm();
            GameObject.Find("Fade").GetComponent <Fade>().FadeStart(Fade.NEXTSCENE.GAMEOVER);
            break;
        }
    }
        void ReleaseDesignerOutlets()
        {
            if (ErrorTextView != null)
            {
                ErrorTextView.Dispose();
                ErrorTextView = null;
            }

            if (IllustrationContainer != null)
            {
                IllustrationContainer.Dispose();
                IllustrationContainer = null;
            }

            if (RetryButton != null)
            {
                RetryButton.Dispose();
                RetryButton = null;
            }

            if (iTunesButton != null)
            {
                iTunesButton.Dispose();
                iTunesButton = null;
            }

            if (SpotifyButton != null)
            {
                SpotifyButton.Dispose();
                SpotifyButton = null;
            }
        }
Esempio n. 5
0
        private void RevealMineCell(MineCell revealingMineCell)
        {
            string[] parsedCoords = revealingMineCell.Name.ToString().Split(',');
            int      proxXCoord   = Convert.ToInt32(parsedCoords[0]);
            int      proxYCoord   = Convert.ToInt32(parsedCoords[1]);
            string   proxCellName; //the name of the proximity mine cell
            MineCell proxCell;     //the proximity mine cell

            int[,] proxCoords =
            {
                { proxXCoord + 1, proxYCoord - 1 },//all 8 adjacent coordinates of `revealingMineCell`
                { proxXCoord + 1, proxYCoord     },
                { proxXCoord + 1, proxYCoord + 1 },
                { proxXCoord - 1, proxYCoord - 1 },
                { proxXCoord - 1, proxYCoord     },
                { proxXCoord - 1, proxYCoord + 1 },
                { proxXCoord,     proxYCoord - 1 },
                { proxXCoord,     proxYCoord + 1 }
            };
            if (revealingMineCell.HasMine)//if the mine cell revealed has mine in it
            {
                MineField.Enabled    = false;
                GameOverSign.Visible = true;
                RetryButton.Enabled  = true;
                RetryButton.Visible  = true;
                RetryButton.BringToFront();
            }
            else if (revealingMineCell.ProxMineCount == 0)//if the mine cell revealed is empty
            {
                revealingMineCell.Enabled    = false;
                revealingMineCell.BackColor  = SystemColors.ControlDark;
                revealingMineCell.IsRevealed = true;
                for (int i = 0; i < 8; i++)
                {
                    proxCellName = Convert.ToString(proxCoords[i, 0]) + "," + Convert.ToString(proxCoords[i, 1]);
                    proxCell     = (MineCell)MineField.Controls.Find(proxCellName, true).FirstOrDefault();
                    if (proxCell != null && proxCell.IsRevealed == false && proxCell.IsFlagged)
                    {
                        proxCell.IsFlagged = false;
                        proxCell.BackColor = SystemColors.ControlDark;
                        RevealMineCell(proxCell);
                    }
                    else if (proxCell != null && proxCell.IsRevealed == false) //reminder: `proxCell` is impossible to have a mine in it as `revealingMineCell` is empty in the first place
                    {
                        RevealMineCell(proxCell);                              //repeat the process until all adjacent empty mine cells are all revealed
                    }
                }
            }
            else
            {
                revealingMineCell.Enabled    = false;
                revealingMineCell.Text       = Convert.ToString(revealingMineCell.ProxMineCount);
                revealingMineCell.BackColor  = SystemColors.ControlDark;
                revealingMineCell.IsRevealed = true;
            }
        }
Esempio n. 6
0
 public void GameOver(int points) //вывод результатов игры
 {
     m_gameMusic.Stop();
     m_endMusic.PlayLooping();
     GameOverLabel.Show();
     RetryButton.Show();
     ExitButton.Show();
     MartianBattleLabel.Show();
     PointsLabel.Text = "POINTS: " + points.ToString();
     PointsLabel.Show();
 }
Esempio n. 7
0
        private void AddButtons()
        {
            buttonBack     = new ReturnButton("result_button_back", AnchorUtil.FindScreenPosition(Anchor.BottomLeft));
            buttonRetry    = new RetryButton("result_button_retry", AnchorUtil.FindScreenPosition(Anchor.BottomRight));
            buttonAdvanced = new ButtonAdvanced(AnchorUtil.FindScreenPosition(Anchor.BottomLeft));

            // Move the advanced button to the right spot
            float width  = buttonAdvanced.Texture.Width;
            float height = buttonAdvanced.Texture.Height;

            buttonAdvanced.Move(new Vector2(width, -height));
        }
Esempio n. 8
0
 private void RetryButtonHandler(object sender, EventArgs e) //кнопка повторного запуска игры
 {
     //скрытие всех лишних элементов формы
     GameOverLabel.Hide();
     RetryButton.Hide();
     ExitButton.Hide();
     MartianBattleLabel.Hide();
     PointsLabel.Hide();
     NumbersOfLives.Value = 100;
     m_endMusic.Stop();
     m_gameMusic.PlayLooping();
     m_controlGame.StartGame(); //повторный запуск игры
 }
Esempio n. 9
0
        private void CheckIfWon(bool byFlaging)
        {
            int totalMineFound    = 0;
            int totalRevealedCell = 0;
            int flaggedCount      = 0;
            int flaggedMineCount  = 0;

            foreach (MineCell mineCell in MineField.Controls)
            {
                if (mineCell.HasMine && mineCell.IsRevealed == false)
                {
                    totalMineFound++;
                }
                if (mineCell.IsRevealed)
                {
                    totalRevealedCell++;
                }
                if (byFlaging == true)
                {
                    if (mineCell.IsFlagged && mineCell.HasMine)
                    {
                        flaggedMineCount++;
                    }
                    if (mineCell.IsFlagged)
                    {
                        flaggedCount++;
                    }
                }
            }
            if (totalMineFound == GameInfo.TotalMineCount && totalRevealedCell == (GameInfo.BoardX * GameInfo.BoardY) - GameInfo.TotalMineCount)//check if all non-mine cells have been revealed
            {
                MineField.Enabled   = false;
                WinSign.Visible     = true;
                RetryButton.Enabled = true;
                RetryButton.Visible = true;
                RetryButton.BringToFront();
            }
            else if (flaggedCount == flaggedMineCount && flaggedCount == GameInfo.TotalMineCount && byFlaging)//if all mines have been flagged and no excess flag was used
            {
                MineField.Enabled   = false;
                WinSign.Visible     = true;
                RetryButton.Enabled = true;
                RetryButton.Visible = true;
                RetryButton.BringToFront();
            }
        }
Esempio n. 10
0
        public KinectSensorChooser()
        {
            InitializeComponent();
            this.Loaded += this.KinectSensorChooserLoaded;

            this.IsRequired = true;

            // Setup bindings via code
            Binding binding = new Binding("Mensaje")
            {
                Source = this
            };

            MessageTextBlock.SetBinding(TextBlock.TextProperty, binding);
            Binding binding2 = new Binding("Mas informacion")
            {
                Source = this
            };

            TellMeMoreLink.SetBinding(TextBlock.ToolTipProperty, binding2);
            Binding binding3 = new Binding("Mas informacion")
            {
                Source = this, Converter = new NullToVisibilityConverter()
            };

            TellMeMore.SetBinding(TextBlock.VisibilityProperty, binding3);
            Binding binding4 = new Binding("ShowRetry")
            {
                Source = this, Converter = new BoolToVisibilityConverter()
            };

            RetryButton.SetBinding(Button.VisibilityProperty, binding4);
            Binding binding5 = new Binding("MoreInfoUri")
            {
                Source = this
            };

            TellMeMoreLink.SetBinding(Hyperlink.NavigateUriProperty, binding5);

            this.UpdateMessage(
                KinectStatus.Undefined,
                "Required",
                "This application needs a Kinect for Windows sensor in order to function. Please plug one into the PC.",
                new Uri("http://go.microsoft.com/fwlink/?LinkID=239815"),
                false);
        }
Esempio n. 11
0
        private void Finder_Load(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.ShouldCloseWhenSuccess)
            {
                HideOnSuccessTick.Checked = true;
            }
            RetryButton.Hide();
            SetMessage("Looking for Path of Exile Process...");
            SetStatus("Searching...");
            if (PathofExileIsPresent())
            {
                Count = new Timer();

                // Every 3.5 seconds check if POE has closed.
                // I'd rather poll and be safe than to hook into POE's process and get banned there too...
                Count.Interval = 3500;
                Count.Tick    += CheckPathofExile;

                Count.Start();

                SetMessage("Found Path of Exile.\nStarting Trade Script");

                try
                {
                    SetStatus("Working!");
                    Process.Start("Run_TradeMacro.ahk");
                }
                catch
                {
                    SetMessage("It seems you havent placed this .exe\nNext to Run_TradeMacro.ahk.");
                    Count.Dispose();
                    Count = null;
                    RetryButton.Show();
                    SetStatus("Failed to find Run_TradeMacro.ahk!");
                }
            }
            else
            {
                SetStatus("You are not playing Path of Exile.");
                SetMessage("Could not find Path of Exile. \n Start the game then retry.");
                RetryButton.Show();
            }
        }
Esempio n. 12
0
        void ReleaseDesignerOutlets()
        {
            if (progressView != null)
            {
                progressView.Dispose();
                progressView = null;
            }

            if (RetryButton != null)
            {
                RetryButton.Dispose();
                RetryButton = null;
            }

            if (statusLabel != null)
            {
                statusLabel.Dispose();
                statusLabel = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (MessageLabel != null)
            {
                MessageLabel.Dispose();
                MessageLabel = null;
            }

            if (RetryButton != null)
            {
                RetryButton.Dispose();
                RetryButton = null;
            }

            if (TitleLabel != null)
            {
                TitleLabel.Dispose();
                TitleLabel = null;
            }
        }
Esempio n. 14
0
        /// <summary>
        /// Make a shadow copy of the element at the current state which stays available even the element is gone.
        /// </summary>
        /// <returns>A shadow copy of the current element.</returns>
        public new BasicMessageBoxData GetDataCopy()
        {
            var data = new BasicMessageBoxData();

            FillData(data);

            data.Icon = GetSafeData(() =>
            {
                if (Icon == null)
                {
                    return(null);
                }
                return(Icon.GetDataCopy());
            });

            data.Text = GetSafeData(() => Text);

            data.OKButton = GetSafeData(() =>
            {
                if (OKButton == null)
                {
                    return(null);
                }
                return(OKButton.GetDataCopy());
            });

            data.CancelButton = GetSafeData(() =>
            {
                if (CancelButton == null)
                {
                    return(null);
                }
                return(CancelButton.GetDataCopy());
            });

            data.AbortButton = GetSafeData(() =>
            {
                if (AbortButton == null)
                {
                    return(null);
                }
                return(AbortButton.GetDataCopy());
            });

            data.RetryButton = GetSafeData(() =>
            {
                if (RetryButton == null)
                {
                    return(null);
                }
                return(RetryButton.GetDataCopy());
            });

            data.IgnoreButton = GetSafeData(() =>
            {
                if (IgnoreButton == null)
                {
                    return(null);
                }
                return(IgnoreButton.GetDataCopy());
            });

            data.YesButton = GetSafeData(() =>
            {
                if (YesButton == null)
                {
                    return(null);
                }
                return(YesButton.GetDataCopy());
            });

            data.NoButton = GetSafeData(() =>
            {
                if (NoButton == null)
                {
                    return(null);
                }
                return(NoButton.GetDataCopy());
            });

            return(data);
        }
 public void onTapButton()
 {
     RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_1);               // ゲームオーバーに, 負けたシーンを渡す
     Fade_cs.FadeStart(Fade.NEXTSCENE.GAMEOVER);                     // 遷移したいシーンを選択
 }
Esempio n. 16
0
    // Update is called once per frame
    void Update()
    {
        if (!bGameStart)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.Q))
        {
            CameraChange();
        }

        if (CameraChangeFlg)
        {
            CameraCnt += Time.deltaTime;
            if (CameraCnt >= 1)
            {
                CameraCnt       = 0;
                CameraChangeFlg = false;
                CatIncamera.SetActive(false);
                GameCamera.SetActive(true);
                Par.SetActive(false);
            }
        }

        pauseF = Pause_cs.m_bPause;

        if (!Pause_cs.m_bPause)
        {
            PuzzleMain_cs.Up();
            Playerspown_cs.Up();
            SpeedUp_cs.Up();
            switch (StageNumber)
            {
            case 1:
                Enemyspown_1_cs.Up();
                break;

            case 2:
                Enemyspown_2_cs.Up();
                break;

            case 3:
                Enemyspown_3_cs.Up();
                break;

            case 4:
                Enemyspown_4_cs.Up();
                break;

            case 5:
                Enemyspown_5_cs.Up();
                break;
            }

            if (PlayerEndFlg == true)
            {
                // 花吹雪作成
                if (!bKami)
                {
                    bKami = true;
                    Instantiate(Kamihubuki);
                }

                EndTime += Time.deltaTime;
                if (EndTime >= 3.0f)
                {
                    switch (StageNumber)
                    {
                    case 1:
                        ResultNextButton.SetClearStage(Fade.NEXTSCENE.STAGE_1);
                        EnemyCatapult.SetClearStage(Fade.NEXTSCENE.STAGE_1);
                        Sound.StopBgm();
                        GameObject.Find("Fade").GetComponent <Fade> ().FadeStart(Fade.NEXTSCENE.RESULR);
                        break;

                    case 2:
                        ResultNextButton.SetClearStage(Fade.NEXTSCENE.STAGE_2);
                        EnemyCatapult.SetClearStage(Fade.NEXTSCENE.STAGE_2);
                        Sound.StopBgm();
                        GameObject.Find("Fade").GetComponent <Fade> ().FadeStart(Fade.NEXTSCENE.RESULR);
                        break;

                    case 3:
                        ResultNextButton.SetClearStage(Fade.NEXTSCENE.STAGE_3);
                        EnemyCatapult.SetClearStage(Fade.NEXTSCENE.STAGE_3);
                        Sound.StopBgm();
                        GameObject.Find("Fade").GetComponent <Fade> ().FadeStart(Fade.NEXTSCENE.RESULR);
                        break;

                    case 4:
                        ResultNextButton.SetClearStage(Fade.NEXTSCENE.STAGE_4);
                        EnemyCatapult.SetClearStage(Fade.NEXTSCENE.STAGE_4);
                        Sound.StopBgm();
                        GameObject.Find("Fade").GetComponent <Fade> ().FadeStart(Fade.NEXTSCENE.RESULR);
                        break;

                    case 5:
                        ResultNextButton.SetClearStage(Fade.NEXTSCENE.STAGE_5);
                        EnemyCatapult.SetClearStage(Fade.NEXTSCENE.STAGE_5);
                        Sound.StopBgm();
                        GameObject.Find("Fade").GetComponent <Fade> ().FadeStart(Fade.NEXTSCENE.RESULR);
                        break;
                    }
                }
            }

            if (EnemyEndFlg == true)
            {
                EndTime += Time.deltaTime;
                if (EndTime >= 2.0f)
                {
                    EnemyEndFlg = false;
                    switch (StageNumber)
                    {
                    case 1:
                        RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_1);
                        Sound.StopBgm();
                        GameObject.Find("Fade").GetComponent <Fade> ().FadeStart(Fade.NEXTSCENE.GAMEOVER);
                        break;

                    case 2:
                        RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_2);
                        Sound.StopBgm();
                        GameObject.Find("Fade").GetComponent <Fade> ().FadeStart(Fade.NEXTSCENE.GAMEOVER);
                        break;

                    case 3:
                        RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_3);
                        Sound.StopBgm();
                        GameObject.Find("Fade").GetComponent <Fade> ().FadeStart(Fade.NEXTSCENE.GAMEOVER);
                        break;

                    case 4:
                        RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_4);
                        Sound.StopBgm();
                        GameObject.Find("Fade").GetComponent <Fade> ().FadeStart(Fade.NEXTSCENE.GAMEOVER);
                        break;

                    case 5:
                        RetryButton.SetLoseStage(Fade.NEXTSCENE.STAGE_5);
                        Sound.StopBgm();
                        GameObject.Find("Fade").GetComponent <Fade> ().FadeStart(Fade.NEXTSCENE.GAMEOVER);
                        break;
                    }
                }
            }

            //for (int i = 0; i < Player_csList.Count; i ++)
            //	Player_csList [i].Up ();
            //for (int i = 0; i < Enemy_csList.Count; i ++)
            //	Enemy_csList [i].Up ();
        }
        else
        {
            Pause_cs.Up();
        }
    }
Esempio n. 17
0
 public LooseGameState(RetryButton retryButton)
 {
     this.retryButton = retryButton;
 }
Esempio n. 18
0
 public override void StopAnimations()
 {
     base.StopAnimations();
     RetryButton.StopAnimations();
 }