Exemple #1
0
    public void InitWinScren()
    {
        PlayerPrefs.SetInt("playerLevel", 2);
        _playerControlManager.canPlayerMakeMove = false;
        Camera.main.transform.DOMove(new Vector3(-0.1f, 1f, 0.54f), 0.5f);
        fruitParent.DOMoveY(0.3f, 0.5f).SetEase(Ease.OutBack).SetRelative(true).onComplete = () =>
        {
            fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetEase(Ease.Linear);
            fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetDelay(0.19f).SetEase(Ease.Linear);
            fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetDelay(0.38f).SetEase(Ease.Linear);
            fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetDelay(0.57f).SetEase(Ease.Linear);
            fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetDelay(0.76f).SetEase(Ease.Linear);
            fruit.DORotateQuaternion(Quaternion.Euler(new Vector3(0, 0f, 180f)), 0.2f).SetRelative(true).SetDelay(0.95f).SetEase(Ease.Linear).onComplete = () =>
            {
                fruitParent.gameObject.SetActive(false);
            };
        };

        DOVirtual.DelayedCall(0.7f, () =>
        {
            winScreen.Init();
        });

        DOVirtual.DelayedCall(8f, () =>
        {
            DOTween.KillAll();
            DOTween.ClearCachedTweens();
            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        });
    }
Exemple #2
0
    protected void Win()
    {
        Time.timeScale = 0;

        hud.gameObject.SetActive(false);

        int leftCount  = players[0].CubesInPlayerCount;
        int rightCount = players[1].CubesInPlayerCount;

        if (leftCount > rightCount)
        {
            winScreen.Init(WinScreen.StateWin.LEFT_WIN);
        }
        else if (leftCount < rightCount)
        {
            winScreen.Init(WinScreen.StateWin.RIGHT_WIN);
        }
        else
        {
            winScreen.Init(WinScreen.StateWin.DRAW);
        }
    }
Exemple #3
0
        static void Main(string[] args)
        {
            settings.AntialiasingLevel = 8;

            MainWindow = new RenderWindow(new VideoMode(WidthWindow, HeightWindow), "Story of one Cube", Styles.None, settings);
            MainWindow.SetVerticalSyncEnabled(true);
            MainWindow.Closed             += MainWindow_Closed;
            MainWindow.KeyPressed         += MainWindow_KeyPressed;
            MainWindow.KeyReleased        += MainWindow_KeyReleased;
            MainWindow.MouseMoved         += MainWindow_MouseMoved;
            MainWindow.MouseButtonPressed += MainWindow_MouseButtonPressed;

            MainWindow.SetVerticalSyncEnabled(true);

            CharacterMovesAnimation.Init();
            DeadScreen.Init(MainWindow);
            WinScreen.Init(MainWindow);
            MainMenu.Init(MainWindow);
            Background.Init(MainWindow);
            Sounds.Init();
            Musics.Init();
            Inventory.Init();
            Interface.Init();
            LevelChoosePage.Init(MainWindow);

            levelNow = new Level1();

            Background.Set(0);

            musicNow = Musics.MainMenu;
            musicNow.Play();

            while (MainWindow.IsOpen)
            {
                MainWindow.Clear();

                Background.Draw(MainWindow);

                if (Background.IsLoaded)
                {
                    if (windowModeNow == WindowMode.Menu)
                    {
                        MainMenu.DrawAndUpdate(MainWindow);
                    }

                    if (windowModeNow == WindowMode.LevelsChoose)
                    {
                        LevelChoosePage.DrawAndUpdate(MainWindow);
                    }

                    if (windowModeNow == WindowMode.Game)
                    {
                        levelNow.Update(MainWindow);
                        levelNow.Draw(MainWindow);
                    }

                    if (windowModeNow == WindowMode.Dead)
                    {
                        levelNow.Draw(MainWindow);
                        DeadScreen.DrawAndUpdate(MainWindow);
                    }

                    if (windowModeNow == WindowMode.Pause)
                    {
                        levelNow.Draw(MainWindow);
                        DeadScreen.DrawAndUpdate(MainWindow);
                    }

                    if (windowModeNow == WindowMode.Win)
                    {
                        levelNow.Draw(MainWindow);
                        WinScreen.DrawAndUpdate(MainWindow);
                    }

                    MainWindow.DispatchEvents();
                }

                MainWindow.Display();
            }
        }