コード例 #1
0
 public void Update()
 {
     if (startedTransition)
     {
         return;
     }
     if (end.transform.position.y < 0.0f)
     {
         int gm = objects.Count;
         for (int i = 0; i < gm; i++)
         {
             GameObject g = objects[i];
             if (g == null)
             {
                 continue;
             }
             Vector3 p = g.transform.position;
             p.y += Time.deltaTime * 0.475f;
             if (g.transform.position.y < -6.0f && p.y >= -6.0f)
             {
                 g.SetActive(true);
             }
             else if (g.transform.position.y < 3.0f && p.y >= 3.0f)
             {
                 Destroy(g);
                 objects[i] = null;
             }
             g.transform.position = p;
         }
     }
     else
     {
         if (finalTimeout-- < 0 && !PD.sounds.IsMusicPlaying())
         {
             startedTransition = true; PD.DoWin(0, 0, true, false);
         }
         if (lastun != null && lastun.transform.position.y < 3.0f)
         {
             Vector3 p = lastun.transform.position;
             p.y += Time.deltaTime * 0.475f;
             lastun.transform.position = p;
         }
     }
     UpdateMouseInput();
     if (clicker.isDown() || PD.controller.Pause() || PD.controller.G_Launch() || PD.controller.M_Confirm())
     {
         startedTransition = true; PD.DoWin(0, 0, true, false);
     }
 }
コード例 #2
0
 protected override bool HandleGameOver()
 {
     if (!gameOver)
     {
         return(false);
     }
     timeUntilProgression -= Time.deltaTime;
     if (timeUntilProgression <= 0 && !calledDoWin)
     {
         calledDoWin = true;
         Debug.Log(PD.currentRound + "/" + PD.rounds);
         PD.DoWin(board1.GetScore(), hud.GetTimeInSeconds(), board1.IsDead());
     }
     return(true);
 }
コード例 #3
0
ファイル: GameController.cs プロジェクト: ozgurtt/Blockara
 private bool HandleGameOver()
 {
     if (!gameOver || (PD.gameType == PersistData.GT.Challenge && board1.IsDead()))
     {
         return(false);
     }
     if (((board1.IsKeyPressAccepted() && cursor1.launchOrPause()) || clicker.isDown()) && end == null)
     {
         if (PD.gameType == PersistData.GT.Challenge)
         {
             PD.DoWin(board1.GetScore(), (hud as PuzzleHUD).GetRemainingMoves(), board1.IsDead());
         }
         else
         {
             PD.DoWin(board1.GetScore(), hud.GetTimeInSeconds(), board1.IsDead());
         }
     }
     return(true);
 }
コード例 #4
0
ファイル: GameController.cs プロジェクト: ozgurtt/Blockara
    private void HandleVictory()
    {
        if (PD.isDemo)
        {
            if (!PD.isTransitioning)
            {
                PD.MoveOutOfDemo();
            }
            return;
        }
        if (gameOver)
        {
            if (isTransitioning)
            {
                return;
            }
            if (PD.gameType == PersistData.GT.Challenge && board1.IsDead())
            {
                switch ((hud as PuzzleHUD).retryMenu.state)
                {
                case 1: isTransitioning = true; PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Confirm); PD.LowerPuzzleLevel(); PD.SaveAndPuzzleSelect(hud.GetTimeInSeconds()); break;

                case 2: isTransitioning = true; PD.sounds.SetSoundAndPlay(SoundPaths.S_Menu_Confirm); PD.SaveAndReset(hud.GetTimeInSeconds()); break;
                }
                return;
            }
            if (PD.gameType != PersistData.GT.Arcade && !PD.isDemo)
            {
                return;
            }
            if (--endCounter > 0)
            {
                return;
            }
            if (end != null)
            {
                if (PD.isDemo)
                {
                    PD.MoveOutOfDemo(); return;
                }
                bool lop = clicker.isDown() || (board1.actionDelay <= 0 && cursor1.launchOrPause());
                if (lop)
                {
                    board1.actionDelay = PD.KEY_DELAY;
                }
                bool isTheEnd = end.doUpdate(lop);
                if (isTheEnd)
                {
                    isTransitioning = true; PD.DoWin(board1.GetScore(), hud.GetTimeInSeconds(), board1.IsDead());
                }
                return;
            }
            GetGameObject(Vector3.zero, "Tharsabin", Resources.Load <Sprite>(SpritePaths.TransparentBlackCover), false, "Cover HUD");
            end = gameObject.AddComponent <EndArcadeMatchOverlay>();
            end.Setup(!board1.IsDead());
        }
        if (!gameOver)
        {
            PD.totalP1RoundScore += board1.GetScore();
            PD.totalP2RoundScore += board2.GetScore();
        }
        gameOver = true;
        paused   = true;
        Vector3 p1Pos, p2Pos;
        int     winningPlayer = 0;

        winningPlayer = board1.IsDead() ? 2 : 1;
        actor1.DoReaction(CutsceneChar.Reaction.win, winningPlayer == 1);
        actor2.DoReaction(CutsceneChar.Reaction.win, winningPlayer == 2);
        if (player2Human)
        {
            p1Pos = new Vector3(-1.4f, 0.0f); p2Pos = new Vector3(1.4f, 0.0f);
        }
        else
        {
            p1Pos = Vector3.zero; p2Pos = Vector3.zero;
        }
        hud.ShowVictoryText(winningPlayer, p1Pos, p2Pos, player2Human);
        PD.FadeMusic(winningPlayer == 1 || player2Human ? SoundPaths.M_WinMusic : SoundPaths.M_LoseMusic);
        if (PD.gameType == PersistData.GT.Arcade || PD.isDemo)
        {
            endCounter = 60;
        }
        else if (PD.gameType == PersistData.GT.Challenge && winningPlayer == 2)
        {
            (hud as PuzzleHUD).DisplayGameOverRetryScreen();
        }
    }