Exemplo n.º 1
0
 public override void Draw(TwoDRenderer renderer)
 {
     if (mTint.A > 0)
     {
         renderer.Draw(mTextures, new Vector3(Position, NormalZ), mTint);
     }
 }
Exemplo n.º 2
0
        public Scene(String pSceneName)
        {
            this.mName   = pSceneName;
            mSpriteBatch = new SpriteBatch(EngineSettings.Graphics.GraphicsDevice);
            mRenderer    = new TwoDRenderer(EngineSettings.Graphics.GraphicsDevice, EngineSettings.VirtualResWidth, EngineSettings.VirtualResHeight);

            mRenderTargetDiffuse     = new RenderTarget2D(EngineSettings.Graphics.GraphicsDevice, EngineSettings.VirtualResWidth, EngineSettings.VirtualResHeight);
            mRenderTargetNormal      = new RenderTarget2D(EngineSettings.Graphics.GraphicsDevice, EngineSettings.VirtualResWidth, EngineSettings.VirtualResHeight);
            mRenderTargetAO          = new RenderTarget2D(EngineSettings.Graphics.GraphicsDevice, EngineSettings.VirtualResWidth, EngineSettings.VirtualResHeight);
            mRenderTargetDepthObject = new RenderTarget2D(EngineSettings.Graphics.GraphicsDevice, EngineSettings.VirtualResWidth, EngineSettings.VirtualResHeight);
            mRenderTargetDepthGame   = new RenderTarget2D(EngineSettings.Graphics.GraphicsDevice, EngineSettings.VirtualResWidth, EngineSettings.VirtualResHeight);
            mRenderTargetLight       = new RenderTarget2D(EngineSettings.Graphics.GraphicsDevice, EngineSettings.VirtualResWidth, EngineSettings.VirtualResHeight);
            mRenderTargetFinal       = new RenderTarget2D(EngineSettings.Graphics.GraphicsDevice, EngineSettings.VirtualResWidth, EngineSettings.VirtualResHeight);
        }
Exemplo n.º 3
0
        public void Update(Savegame pSavegame, ref SceneData pScene, Hansel pHansel, Gretel pGretel, Camera pCamera, TwoDRenderer pRenderer, ref GameScene.GameState pGameState)
        {
            //Update Logic Parts
            SceneSwitchHandler.Update(pSavegame, ref pScene, pHansel, pGretel, pCamera, pRenderer);
            ActivityHandler.Update(pScene, pHansel, pGretel, pSavegame);
            ItemHandler.Update(pScene, pHansel, pGretel, pSavegame, ref pGameState);
            EventHandler.Update(pScene, pHansel, pGretel);
            TemperatureHandler.Update(pHansel, pGretel);

            AIManager.Instance.Update();

            EnemyHandler.Update();
            SoundHandler.Instance.Update();

            //Check whether Player may move
            HanselMayMove = true;
            GretelMayMove = true;
            if (SceneSwitchHandler.CurrentState != SceneSwitchHandler.State.Idle)
            {
                HanselMayMove = false;
                GretelMayMove = false;
            }
        }
        public void Update(Savegame pSavegame, ref SceneData pScene, Hansel pHansel, Gretel pGretel, Camera pCamera, TwoDRenderer pRenderer)
        {
            switch (CurrentState)
            {
            case State.Idle:
                TestForSwitch(pScene, pHansel, pGretel, pSavegame.Scenes);
                break;

            case State.Switching:
                Switch(pSavegame, ref pScene, pHansel, pGretel, pCamera, pRenderer);
                break;

            case State.Entering:
                Enter(pScene, pHansel, pGretel, pSavegame);
                break;

            default:
                throw new Exception("SwitchScene.CurrentState not set!");
            }
        }
        /// <summary>
        /// Aktualisiert den FadingProgress des Switchings.
        /// </summary>
        public void Switch(Savegame pSavegame, ref SceneData pScene, Hansel pHansel, Gretel pGretel, Camera pCamera, TwoDRenderer pRenderer)
        {
            AIManager.Instance.ClearAgents();
            FadingProgress += EngineSettings.Time.ElapsedGameTime.Milliseconds;
            pHansel.MoveManually(LeaveHansel, 1f, pScene);
            pGretel.MoveManually(LeaveGretel, 1f, pScene);
            if (FadingProgress >= FadingDuration)
            {
                //Switch
                pHansel.MoveInteractiveObject(DestinationHansel - pHansel.SkeletonPosition);
                pGretel.MoveInteractiveObject(DestinationGretel - pGretel.SkeletonPosition);
                pSavegame.SceneId  = DestinationScene;
                pScene             = pSavegame.Scenes[DestinationScene];
                pCamera.GameScreen = pScene.GamePlane;
                pScene.SetupRenderList(pHansel, pGretel);
                pRenderer.AmbientLight = pScene.SceneAmbientLight;
                //Show on new Scene
                FadingProgress = 0;
                CurrentState   = State.Entering;

                GameReferenzes.Level = pScene;
                AIManager.Instance.ChangeMap(pCamera.GameScreen, pScene.MoveArea);

                // Für alle weiteren Felder die nicht betreten werden können.
                AIManager.Instance.SetInterActiveObjects(pScene.InteractiveObjects);
                AIManager.Instance.SetAgents(pScene.Enemies);

                GameReferenzes.SceneID = DestinationScene;

                SoundHandler.Instance.ResetTime();
                FmodMediaPlayer.Instance.SetBackgroundSong(GameReferenzes.GetBackgroundMusic());
                GameReferenzes.IsSceneSwitching = false;
            }
        }
Exemplo n.º 6
0
 public virtual void Draw(TwoDRenderer renderer)
 {
 }