Example #1
0
        public SinglePlayerSubScene(int backBufferWidth, int backBufferHeight)
            : base(backBufferWidth, backBufferHeight)
        {
            _motionController    = new MotionController();
            _animationController = new AnimationController();
            _timerController     = new TimerController();

            _pauseController = new PauseController();
            _pauseController.AddPausableObject(_timerController);
            _pauseController.AddPausableObject(_animationController);

            _cameraController          = new Bopscotch.Gameplay.Controllers.PlayerTrackingCameraController();
            _cameraController.Viewport = new Rectangle(0, 0, backBufferWidth, backBufferHeight);
            _cameraController.ScrollBoundaryViewportFractions = new Vector2(Definitions.Horizontal_Scroll_Boundary_Fraction, Definitions.Vertical_Scroll_Boundary_Fraction);

            Renderer.ClipOffCameraRendering(_cameraController, Camera_Clipping_Margin);

            _playerCollisionController = new OneToManyCollisionController();

            _opaqueParticleEffectManager   = new OpaqueLayerParticleEffectManager(_cameraController);
            _additiveParticleEffectManager = new AdditiveLayerParticleEffectManager(_cameraController);

            _levelFactory = new Bopscotch.Gameplay.LevelFactory(RegisterGameObject, _timerController.RegisterUpdateCallback);
            _levelFactory.BackgroundDimensions = new Point(backBufferWidth, backBufferHeight);

            _smashBlockItemFactory = new Effects.SmashBlockItems.SmashBlockItemFactory(RegisterGameObject, _timerController.RegisterUpdateCallback);

            _speedometer = new Bopscotch.Gameplay.Objects.Display.Speedometer();
            _speedometer.CenterPosition       = new Vector2(backBufferWidth, 0.0f);
            _playerEventPopup                 = new PlayerEventPopup();
            _playerEventPopup.DisplayPosition = new Vector2(backBufferWidth / 2.0f, backBufferHeight / 4.0f);

            _active = false;
        }
        public GameplaySceneBase(string sceneID)
            : base(sceneID)
        {
            _inputProcessor = Input.TouchControls.CreateController();

            _motionController    = new MotionController();
            _animationController = new AnimationController();
            _timerController     = new TimerController();

            _pauseController = new PauseController();
            _pauseController.AddPausableObject(_timerController);
            _pauseController.AddPausableObject(_animationController);

            _cameraController          = new Bopscotch.Gameplay.Controllers.PlayerTrackingCameraController();
            _cameraController.Viewport = new Rectangle(0, 0, Definitions.Back_Buffer_Width, Definitions.Back_Buffer_Height);
            _cameraController.ScrollBoundaryViewportFractions = new Vector2(Definitions.Horizontal_Scroll_Boundary_Fraction, Definitions.Vertical_Scroll_Boundary_Fraction);

            Renderer.ClipOffCameraRendering(_cameraController, Camera_Clipping_Margin);

            _playerCollisionController = new OneToManyCollisionController();

            _opaqueParticleEffectManager   = new OpaqueLayerParticleEffectManager(_cameraController);
            _additiveParticleEffectManager = new AdditiveLayerParticleEffectManager(_cameraController);

            _levelFactory = new Bopscotch.Gameplay.LevelFactory(RegisterGameObject, _timerController.RegisterUpdateCallback);

            _smashBlockItemFactory = new Effects.SmashBlockItems.SmashBlockItemFactory(RegisterGameObject, _timerController.RegisterUpdateCallback);

            _speedometer      = new Bopscotch.Gameplay.Objects.Display.Speedometer();
            _playerEventPopup = new Bopscotch.Gameplay.Objects.Display.PlayerEventPopup();

            _objectWithGlowEffect = new List <ICanHaveGlowEffect>();
        }