Пример #1
0
 public DrawData(Texture2D texture, Rectangle position, String text, SpriteFont font, bool clickable)
 {
     Texture = texture;
     _firstPosition = position;
     Position = position;
     Text = text;
     Font = font;
     this.clickable = clickable;
     TextureColor = Color.White;
     TextColor = Color.Red;
     TextPosition = new Vector2(Position.X + (Texture.Width / 2) - (Font.MeasureString(Text).X / 2), Position.Y + 15);
     _mouse = new MouseClass(_firstPosition);
 }
Пример #2
0
        protected override void LoadContent()
        {
            base.LoadContent();
            _spriteBatch = new SpriteBatch(Game.GraphicsDevice);
            _content = Game.Content;
            clientBounds = game.Window.ClientBounds;

            _player1Position = new Vector2(10, 10);
            _player2Position = new Vector2(clientBounds.Width - 30, clientBounds.Height - 30);

            _snakeFood = new SnakeFood(_spriteBatch, _content, clientBounds);
            _player1 = new SnakeHead(_spriteBatch, _content, clientBounds, _player1Position, 1);
            _player2 = new SnakeHead(_spriteBatch, _content, clientBounds, _player2Position, 2);
            _startMenu = new StartMenu(_spriteBatch, _content, clientBounds);
            _controlsMenu = new ControlsMenu(_spriteBatch, _content, clientBounds);
            _mouse = new MouseClass(_spriteBatch, _content);
            _sound = new SoundEffects(_content);
            _music = new BackgroundMusic(_content);

            _drawStartMenu = true;
            _playStartSound = true;
        }