예제 #1
0
        protected override void Initialize()
        {
            _screenSizeInformation = ScreenSizeCalculator
                                     .Calculate(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height - 100);

            _inputDataProvider = new InputDataReader();
            base.Initialize();
        }
예제 #2
0
 public GameMediator(ScreenSizeInformation screenSizeInformation)
 {
     _screenSizeInformation = screenSizeInformation;
     _arena = new Area((int)_screenSizeInformation.WidhtInnerScreen,
                       (int)_screenSizeInformation.HeightInnerScreen);
     _physicsEngine = new PhysicsEngine();
     _gameObjects   = new List <GameObject>();
     _inputHandler  = new InputHandler();
 }
예제 #3
0
        public GameScreenContext(
            GraphicsDevice graphicsDevice,
            ContentManager contentManager,
            ScreenSizeInformation screenSizeInformation)
        {
            GraphicsDevice        = graphicsDevice;
            ContentManager        = contentManager;
            ScreenSizeInformation = screenSizeInformation;

            ActivateState(new StateMainMenuGame(this));
        }
        internal static ScreenDescription CreateTestLevelScreen(ScreenSizeInformation info)
        {
            float WALL_THICKNESS = 10 * info.ScaleFactor;

            float width  = info.WidhtInnerScreen;
            float height = info.HeightInnerScreen;

            List <GameObjectDescription> descriptions = new List <GameObjectDescription>
            {
                new GameObjectDescription()
                {
                    AssetName         = "wallvertical",
                    CurrentPosition   = new Vector2(150, 200),
                    Width             = WALL_THICKNESS * info.ScaleFactor,
                    Height            = 500 * info.ScaleFactor,
                    ObjectOrientation = ObjectOrientation.Vertical,
                    Stability         = 100000,
                    GameObjectType    = GameObjectType.WALL
                },
                new GameObjectDescription()
                {
                    AssetName         = "blockredgray",
                    CurrentPosition   = new Vector2(350, 700),
                    Width             = 50 * info.ScaleFactor,
                    Height            = 50 * info.ScaleFactor,
                    ObjectOrientation = ObjectOrientation.Vertical,
                    Stability         = 1000,
                    GameObjectType    = GameObjectType.BLOCK
                }
            };

            descriptions.AddRange(CreateArenaBorder(width, height, info.ScaleFactor));
            descriptions.Add(CreateBall(info.ScaleFactor));

            ScreenDescription testscreen = ScreenDescription.Create(info, descriptions, "BackgroundMamor",
                                                                    WellKnownGameScreenExecutions.RUNNING_GAME_BALANCE_SCREEN, TimeSpan.FromDays(1));

            return(testscreen);
        }
        internal static ScreenDescription CreateMainScreen(ScreenSizeInformation info)
        {
            ScreenDescription mainscreen = ScreenDescription.Create(info, null, "RollingBallsMainScreen", WellKnownGameScreenExecutions.MENUE_MAIN_SCREEN, TimeSpan.FromDays(360));

            return(mainscreen);
        }