Exemplo n.º 1
0
        protected override void OnEnter()
        {
            Board.Instance.gameObject.SetActive(true);

            this.creditsScene          = Object.Instantiate(Resources.Load <CreditsScene>("Prefabs/Credits"));
            this.creditsScene.Skipped += OnCreditsSkipped;
            this.creditsScene.Initialize();

            Container.Instance.Resolve <Interactor>().EnterDisabledState();
        }
Exemplo n.º 2
0
        //private RotatingBarrel m_Barrel;

        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            //spriteBatch = new SpriteBatch(GraphicsDevice);
            m_Scheduler          = new SceneScheduler();
            m_Scheduler.MainTune = Music.GetMenuTune();
            m_PlayingScene       = new PlayingScene();
            m_ChooseModeScene    = new ChooseModeScene(@"Backgrounds\ChooseMode");
            m_SelectPlayerScene  = new SelectPlayerScene(@"Backgrounds\JoinPlayers");
            m_SplashScreen       = new SplashScene(@"Backgrounds\Splash");
            m_WinScene           = new WinScene(@"Backgrounds\Score");
            m_CreditsScene       = new CreditsScene(@"Backgrounds\Credits");

            m_Scheduler.AddSceneChange(
                new SceneChange(m_SplashScreen, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
//            m_Scheduler.AddSceneChange(new SceneChange(m_SelectPlayerScene, m_ChooseModeScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
            m_Scheduler.AddSceneChange(new SceneChange(m_SelectPlayerScene, m_PlayingScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
            //m_Scheduler.AddSceneChange(new SceneChange(m_ChooseModeScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.B)));
            //m_Scheduler.AddSceneChange(new SceneChange(m_ChooseModeScene, m_PlayingScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
//            m_Scheduler.AddSceneChange(new SceneChange(m_PlayingScene, m_ChooseModeScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.B)));
//            m_Scheduler.AddSceneChange(new SceneChange(m_PlayingScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.B)));
            m_Scheduler.AddSceneChange(new SceneChange(m_PlayingScene, m_WinScene, gt => m_PlayingScene.GameOver()));
//            m_Scheduler.AddSceneChange(new SceneChange(m_PlayingScene, m_WinScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
            //            m_Scheduler.AddSceneChange(new SceneChange(m_WinScene, m_ChooseModeScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
            m_Scheduler.AddSceneChange(new SceneChange(m_WinScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));
            m_Scheduler.AddSceneChange(new SceneChange(m_WinScene, m_CreditsScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.Y)));
            m_Scheduler.AddSceneChange(new SceneChange(m_CreditsScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.A)));

            m_Scheduler.AddSceneChange(new SceneChange(m_PlayingScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.Back)));
            m_Scheduler.AddSceneChange(new SceneChange(m_WinScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.Back)));
            m_Scheduler.AddSceneChange(new SceneChange(m_CreditsScene, m_SelectPlayerScene, gt => Conditions.ButtonClickedOnAnyController(Buttons.Back)));

            Components.Add(m_CreditsScene);
            Components.Add(m_WinScene);
            Components.Add(m_SplashScreen);
            Components.Add(m_SelectPlayerScene);
            Components.Add(m_ChooseModeScene);
            Components.Add(m_PlayingScene);
            Components.Add(m_Scheduler);

            //Components.Add(m_Barrel);

            base.LoadContent();


            // TODO: use this.Content to load your game content here
        }
Exemplo n.º 3
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            _resources = new Resources(this);

            // Add startScene
            startScene = new StartScene(this, spriteBatch);
            Components.Add(startScene);
            startScene.Show(true);

            // Add playScene
            playScene = new GameScene(this, spriteBatch);
            Components.Add(playScene);
            playScene.Show(false);

            // Add creditsScene
            creditsScene = new CreditsScene(this, spriteBatch);
            Components.Add(creditsScene);
            creditsScene.Show(false);

            // Add helpScene
            helpScene = new HelpScene(this, spriteBatch);
            Components.Add(helpScene);
            helpScene.Show(false);

            // Add highScoreScene
            highScoreScene = new HighScoreScene(this, spriteBatch);
            Components.Add(highScoreScene);
            highScoreScene.Show(false);

            // Create enterSound
            enterSoundIns = this.Content.Load <SoundEffect>("Sounds/enterSound").CreateInstance();

            // Create and play music
            menuMusic = this.Content.Load <Song>("Sounds/pauseMenu");
            MediaPlayer.Play(menuMusic);
        }
Exemplo n.º 4
0
    private void Awake()
    {
        player = FindObjectOfType <Player>();
        if (player)
        {
            player.InitializePlayer(this);
        }

        playerCamera = FindObjectOfType <FirstPersonCamera>();
        if (playerCamera)
        {
            playerCamera.InitializePlayerCamera(this);
        }
        titleScreen = FindObjectOfType <TitleScreen>();
        if (titleScreen)
        {
            titleScreen.InitializeTitleScreen(this);
        }


        checkObjectCamera = FindObjectOfType <CheckObjectCamera>();
        if (checkObjectCamera)
        {
            checkObjectCamera.InitializeCheckObjectCamera(this);
        }

        playerCamera.target = player.headPosition;

        interfactableObjectList = new List <InteractableObject>();

        InteractableObject[] interactableObjects = FindObjectsOfType <InteractableObject>();

        foreach (InteractableObject i in interactableObjects)
        {
            i.InitializeInteractableObject(this);
            interfactableObjectList.Add(i);
        }

        titaDialogue = FindObjectOfType <TitaDialogue>();
        if (titaDialogue)
        {
            titaDialogue.InitializeDialogue(this);
        }

        creditsScene = FindObjectOfType <CreditsScene>();
        if (creditsScene)
        {
            creditsScene.InitializeCreditsScene(this);
        }
        miniGame = MiniGame.None;

        loadingScreen = FindObjectOfType <LoadingScreen>();
        if (loadingScreen)
        {
            loadingScreen.InitializeLoadingScreen(this);
        }


        InitializeLumpiaMiniGame();
        InitializeLechonMiniGame();
        volume = 0.5f;

        audioSource      = GetComponent <AudioSource>();
        audioSource.clip = introMusic;
        audioSource.Play();
    }