Пример #1
0
        public Game(int width = 0, int height = 0)
        {
            SuspendLayout();

#if ANDROID
            Graphics = new GraphicsDeviceManager(this)
            {
            };
            Graphics.IsFullScreen              = true;
            Graphics.PreferredBackBufferWidth  = width;  // set this value to the desired width of your window
            Graphics.PreferredBackBufferHeight = height; // set this value to the desired height of your window

            Graphics.ApplyChanges();
#else
            Graphics = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth  = (int)(500 * 1.5), // set this value to the desired width of your window
                PreferredBackBufferHeight = (int)(400 * 1.5)  // set this value to the desired height of your window
            };
            Graphics.ApplyChanges();
            this.IsMouseVisible = true;
#endif

            Content.RootDirectory = "Content";


            _memoryGameControl = new MemoryGameControl(this, Graphics);
            _menuesStack       = new Stack <GameMenu>();

            _buttonApearance  = new ControlApearance();
            _textBoxApearance = new ControlApearance();
            _menuApearance    = new ControlApearance();

            InitMenues();
        }
Пример #2
0
        public DrawScoreBars(GamePrototype gameParent) : base(gameParent)
        {
            BkgTransparent     = true;
            _scoreBarApearance = new ControlApearance();

            Player1ScoreBar = new ScoreBar(gameParent)
            {
                IsLeft           = true,
                ControlApearance = _scoreBarApearance
            };
            Player2ScoreBar = new ScoreBar(gameParent)
            {
                IsLeft           = false,
                SpriteEffect     = SpriteEffects.FlipHorizontally,
                ControlApearance = _scoreBarApearance
            };


            Controls.AddRange(Player1ScoreBar, Player2ScoreBar);
        }