Esempio n. 1
0
        public static void Initialize(GameScreen initialGameScreen)
        {
            _currentGameState = CurrentGameState.Loading;

              _loadingScreen = new SplashScreen();
              _loadingScreen.Initialise();
        }
Esempio n. 2
0
        public static void ShowTitleScreen()
        {
            _titleScreen = new TitleScreen();
              _currentGameState = CurrentGameState.TitleScreen;

              _titleScreen.Initialise();
        }
Esempio n. 3
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(RaymondsCloneWasTheCulprit)));
 }
Esempio n. 4
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(RaymondsCloneLaunchedTheShip)) &&
            CurrentGameState.IsThinking(nameof(YourBeingRidiculous)));
 }
Esempio n. 5
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(ElectricDischarge)));
 }
Esempio n. 6
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(WarrenIntroduction)));
 }
Esempio n. 7
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(ElectricDischarge)) &&
            (CurrentGameState.IsThinking(nameof(YouAreStillResposible)) ||
             CurrentGameState.IsThinking(nameof(WontTurnYouInForRaymondsAction))));
 }
Esempio n. 8
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(RaymondsCorpse)));
 }
Esempio n. 9
0
    void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.transform.parent.tag == "Player1")
        {
            if (playerThatLost == "Player2")
            {
                bothPlayersLost = true;
            }

            playerThatLost = "Player1";
            currentGameState = CurrentGameState.DelayBeforeWin;

            player1Script.GameOver = true;
            player2Script.GameOver = true;
        }
        else if (collider.transform.parent.tag == "Player2")
        {
            if (playerThatLost == "Player1")
            {
                bothPlayersLost = true;
            }
            playerThatLost = "Player2";
            currentGameState = CurrentGameState.DelayBeforeWin;

            player1Script.GameOver = true;
            player2Script.GameOver = true;
        }
    }
Esempio n. 10
0
        public static void StartNewGame()
        {
            _inGameScreen = new IngameScreen();
            _currentGameState = CurrentGameState.Ingame;

            _inGameScreen.Initialise();
        }
Esempio n. 11
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(UnencryptedDataDrive)));
 }
Esempio n. 12
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(YouAreAHacker)) &&
            !CurrentGameState.IsThinking(nameof(IWontReportDataRaven)));
 }
Esempio n. 13
0
 private void Instance_OnGameStop(RealmEventArgs args)
 {
     CurrentGameState.Save(Kernel.Get <IRealmLiveDbContext>());
 }
Esempio n. 14
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(MatterRemovalBruises)));
 }
Esempio n. 15
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(ZaidLaunchedTheShip)) &&
            (CurrentGameState.IsThinking(nameof(IWontSealYourFate)) ||
             CurrentGameState.IsThinking(nameof(YouBroughtThisOnYourself))));
 }
Esempio n. 16
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(ZaidHackedTheDoor)) && CurrentGameState.IsThinking(nameof(ZaidsAccount)));
 }
Esempio n. 17
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(YouAreAHacker)) &&
            !CurrentGameState.IsThinking(nameof(DeckersMakeTheWorldWorse)));
 }
Esempio n. 18
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(FoundYouRaymondsClone)));
 }
Esempio n. 19
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(NeedASearchOrder)) && !CurrentGameState.IsThinking(nameof(ZaidsAccount)));
 }
Esempio n. 20
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(ViolentExperimentalResearch)));
 }
 public NavigationRoutine(CurrentGameState gameState)
 {
     GameState = gameState;
 }
Esempio n. 22
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(YourBeingRidiculous)) &&
            !CurrentGameState.IsThinking(nameof(YouCanKeepYourLife)));
 }
Esempio n. 23
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(ResortManagerZaid)) || CurrentGameState.IsThinking(nameof(WhoAreYouZaid)));
 }
Esempio n. 24
0
    public void Update()
    {
        if (!canInput)
        {
            return;
        }
        //if (Time.timeScale == 0 && Input.anyKey) return;


        timer += Time.deltaTime;
        if (timer >= 3f)
        {
            GameStatusCheck();
            timer = 0;
        }

        if (currentGameState == CurrentGameState.Dialog)
        {
            if (Input.GetKeyDown(KeyCode.Mouse0) || Input.GetKeyDown(KeyCode.Space))
            {
                UserInterface.Instance.Dialog.NextDialog();
            }
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (currentGameState == CurrentGameState.Dialog ||
                currentGameState == CurrentGameState.Loading ||
                currentGameState == CurrentGameState.MissionClear ||
                UserInterface.Instance.MissionSelectionUICanvas.activeSelf)
            {
                return;
            }

            if (
                MCSceneManager.currentScene != MCSceneManager.TITLE &&
                currentGameState != CurrentGameState.Loading &&
                currentGameState != CurrentGameState.Dialog &&
                currentGameState != CurrentGameState.Product &&
                currentGameState != CurrentGameState.MissionClear)
            {
                isPause = !isPause;
                Debug.Log("Press Escape : " + isPause);
                CanvasInfo.PauseMenuActive(isPause);
                GameManager.Instance.IsPuase = isPause;
                UserInterface.BlurSet(isPause, 10f);
                SetCurrentGameState(isPause ? CurrentGameState.Pause : prevState);
            }

            if (currentGameState == CurrentGameState.Product)
            {
                if (MCSceneManager.currentScene == MCSceneManager.BOSS)
                {
                    BossDirector.Instance.PlayScene();
                }
                if (MCSceneManager.currentScene == MCSceneManager.TITLE)
                {
                    FindObjectOfType <TitleCutScene>().CineEnd();
                }
            }
        }


        if (GameStatus.currentGameState != CurrentGameState.Product)
        {
            if (UserInterface.Instance.ClearMission.gameObject.activeSelf &&
                (Input.GetKeyDown(KeyCode.Space) ||
                 Input.GetKeyDown(KeyCode.Mouse0)))
            {
                UserInterface.Instance.ClearMission.gameObject.SetActive(false);
                currentGameState = CurrentGameState.Wait;

                PlayerFSMManager.Instance.GetComponent <PlayerCLEAR>().CMSet.gameObject.SetActive(false);
                PlayerFSMManager.Instance.SetState(PlayerState.IDLE);
                PlayerFSMManager.Instance.mainCamera.gameObject.SetActive(true);

                Invoke("DialogCheck", 0.5f);

                MissionManager.Instance.CurrentMission.PortalPlay();
            }
        }

#if UNITY_STANDALONE
#endif
        if (currentGameState == CurrentGameState.Start &&
            MissionManager.Instance.CurrentMission.MissionOperate &&
            !MissionManager.Instance.CurrentMission.missionEnd)
        {
            _LimitTime -= Time.deltaTime;
        }
    }
Esempio n. 25
0
    void Update()
    {
        if (currentGameState == CurrentGameState.Playing)
        {

        }
        else if (currentGameState == CurrentGameState.DelayBeforeWin)
        {
            elapsedTime += Time.deltaTime;
            if (elapsedTime >= timeUntilPersonLoses)
            {
                volcanoParticles.Play();
                currentGameState = CurrentGameState.SomeoneWins;

                if (bothPlayersLost)
                {
                    winText.text = "Nobody Wins...";

                    if (SoundManager.instance != null)
                    {
                        Debug.Log("Tried to play boo");
                        if (!SoundManager.instance.sfxSource.isPlaying)
                        {
                            SoundManager.instance.PlaySound("Boo");
                        }

                    }
                }
                else if (playerThatLost == "Player1")
                {
                    winText.text = "Player 2 Wins!";
                    winningPlayerSkeleton = Player2.GetComponent<SkeletonRagdoll2D>();
                    winningPlayerRigidBody = winningPlayerSkeleton.GetRigidbody("Torso");
                    winningPlayerParticles = Player2.GetComponentInChildren<ParticleSystem>();
                    winningPlayerParticles.Play();
                    ExplosionCollider.transform.position = new Vector3(winningPlayerRigidBody.transform.position.x, ExplosionCollider.transform.position.y, ExplosionCollider.transform.position.z);
                    Moon.transform.position = ExplosionCollider.transform.position;
                    TopHitBox.gameObject.SetActive(false);
                    Destroy(GetComponent<BoxCollider2D>());
                }
                else if (playerThatLost == "Player2")
                {
                    winText.text = "Player 1 Wins!";
                    winningPlayerSkeleton = Player1.GetComponent<SkeletonRagdoll2D>();
                    winningPlayerRigidBody = winningPlayerSkeleton.GetRigidbody("Torso");
                    winningPlayerParticles = Player1.GetComponentInChildren<ParticleSystem>();
                    winningPlayerParticles.Play();
                    ExplosionCollider.transform.position = new Vector3(winningPlayerRigidBody.transform.position.x, ExplosionCollider.transform.position.y, ExplosionCollider.transform.position.z);
                    Moon.transform.position = ExplosionCollider.transform.position;
                    TopHitBox.gameObject.SetActive(false);
                    Destroy(GetComponent<BoxCollider2D>());
                }
                winControlText.gameObject.SetActive(true);
                elapsedTime = 0;
            }
        }
        else if (currentGameState == CurrentGameState.SomeoneWins)
        {
            elapsedTime += Time.deltaTime;
            if (elapsedTime >= timePerFlash)
            {
                elapsedTime = 0;
                winText.gameObject.SetActive(!winText.gameObject.activeSelf);
            }

            if (!bothPlayersLost)
            {
                winningPlayerParticles.transform.position = winningPlayerRigidBody.transform.position;
                winningPlayerRigidBody.velocity = new Vector2(0, floatingForce);
                if (DEBUG)
                {
                    Debug.Log("Winning player is being lifted");
                }

                if (Camera.main.transform.position.y < winningPlayerRigidBody.position.y && Camera.main.transform.position.y < ExplosionCollider.transform.position.y)
                {
                    Camera.main.transform.position = new Vector3(Camera.main.transform.position.x, winningPlayerRigidBody.position.y, Camera.main.transform.position.z);
                }
                else if (Camera.main.transform.position.y > ExplosionCollider.transform.position.y)
                {
                    winningPlayerParticles.Stop();
                    floatingForce = 0;
                }
            }
            else
            {
                if (Input.GetButton("B1") || Input.GetKeyDown(KeyCode.B))
                {
                    SceneManager.LoadScene("TeamSelect");
                }
                else if (Input.GetButton("A1") || Input.GetKeyDown(KeyCode.A))
                {
                    SceneManager.LoadScene("Game");
                }
            }
        }
    }
Esempio n. 26
0
 public static void SetCurrentGameState(CurrentGameState state)
 {
     prevState        = currentGameState;
     currentGameState = state;
 }
Esempio n. 27
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(TravissAccount)));
 }
 public NavigationRoutine(CurrentGameState gameState)
 {
     GameState = gameState;
 }
Esempio n. 29
0
 public override bool IsActive()
 {
     return((CurrentGameState.IsThinking(nameof(YouAreStillResposible)) ||
             CurrentGameState.IsThinking(nameof(WontTurnYouInForRaymondsAction))) &&
            CurrentGameState.IsThinking(nameof(YourBrotherWasKilled)));
 }
Esempio n. 30
0
 public override string WhereAreYou()
 {
     return(CurrentGameState.IsThinking(nameof(BetweenSevenAMToEightPM))
         ? nameof(DockingBay)
         : nameof(PoliceCruiserInterior));
 }
Esempio n. 31
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(ZaidWasTheCulprit)) && CurrentGameState.IsThinking(nameof(YouWereNotAcceptedForBetaTesting)));
 }
Esempio n. 32
0
 public void GoNext()
 {
     CurrentGameState.goNext(this);
 }
Esempio n. 33
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(WhoIsStayingAtYourResort)));
 }
Esempio n. 34
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(HackerMeleena)) && CurrentGameState.IsThinking(nameof(WhoAreYou)));
 }
Esempio n. 35
0
 public override bool IsActive()
 {
     return(CurrentGameState.IsThinking(nameof(FromAnytimeUntilEightPM)));
 }
Esempio n. 36
0
 public void ValidateRoundSkip(CurrentGameState gameState, int userId)
 {
     BaseGameValidations(gameState, userId);
 }
Esempio n. 37
0
        public MainRoutine(CurrentGameState currentGameState)
        {
            GameState = currentGameState;

            NavRout = new NavigationRoutine(GameState);
        }
Esempio n. 38
0
        public static void StartNewGame()
        {
            _inGameScreen = new IngameScreen();

            _inGameScreen.Initialise();

            LevelManager.Initialise();

            LevelManager.SetLevel(4);

            var allElements = LevelManager.CurrentLevel.GetAllElements();

            allElements.ForEach(c => _inGameScreen.Elements.Add(c));

            // Add player frogs
            Actor player = new Frog()
            {
                Sprite = GraphicsManager.GetSprite(FroggerGame.Textures.GreenFrog),
                X = 320,
                Y = 448,
                MovementBehaviour = new KeyboardMovementBehaviour(0)
            };

            Players.Add(player);

            Actor car = new Car()
            {
                Sprite = GraphicsManager.GetSprite(FroggerGame.Textures.Car),
                X = GraphicsManager.RESOLUTION_X,
                Y = 230
            };

            _inGameScreen.Elements.Add(player);
            _inGameScreen.Elements.Add(car);

            car.Initialize();
            player.Initialize();

            _currentGameState = CurrentGameState.Ingame;
        }