Exemplo n.º 1
0
        public TitleScene(GraphicsDevice graphicsDevice,
                          IContentProvider content,
                          IMouseEvents mouse,
                          IGameStateFactory gameStateFactory,
                          CImage img,
                          CSound snd,
                          WorldCollection worlds,
                          HighscoreCollection highscores,
                          BBXConfig config)
        {
            this.graphicsDevice   = graphicsDevice;
            this.content          = content;
            this.gameStateFactory = gameStateFactory;
            this.img         = img;
            this.snd         = snd;
            this.config      = config;
            this.spriteBatch = new SpriteBatch(graphicsDevice);

            this.random = new Random();

            this.worlds     = worlds;
            this.highscores = highscores;
            this.worlds.LoadWorlds(content);

            this.mouse = mouse;

            mouse.MouseMove += Mouse_MouseMove;
            mouse.MouseUp   += Mouse_MouseUp;

            keyboard          = new KeyboardEvents();
            keyboard.KeyDown += Keyboard_KeyDown;
            font              = new Font(img.Fonts.Default);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var config = new BBXConfig();

            config.ParseArgs(args);

            using (var game = new BallBusterDesktopGame(config))
            {
                game.Run();
            }
        }
        public BallBusterDesktopGame(BBXConfig config)
        {
            Config = config;

            graphics = new GraphicsDeviceManager(this);

            graphics.PreferredBackBufferWidth  = 800;
            graphics.PreferredBackBufferHeight = 600;

            graphics.IsFullScreen = !Config.Windowed;

            Content.RootDirectory = "Content";


            IsFixedTimeStep   = true;
            TargetElapsedTime = TimeSpan.FromMilliseconds(15);
        }
Exemplo n.º 4
0
        public GameScene(GraphicsDevice graphicsDevice,
                         GameState gameState,
                         IMouseEvents mouse,
                         CImage img,
                         CSound snd,
                         BBXConfig config)
        {
            this.gameState      = gameState;
            this.graphicsDevice = graphicsDevice;
            this.mouse          = mouse;
            this.img            = img;
            this.snd            = snd;
            this.config         = config;
            this.spriteBatch    = new SpriteBatch(graphicsDevice);

            mouse.MouseMove += Mouse_MouseMove;
            mouse.MouseDown += Mouse_MouseDown;

            keyboard        = new KeyboardEvents();
            keyboard.KeyUp += Keyboard_KeyUp;

            InitializeLevel(true);
        }