Exemplo n.º 1
0
        ActionScene(Game game, Texture2D theTexture, Texture2D backgroundTexture, SpriteFont font)
            : base(game)
        {
            _audio = (AudioLibrary)Game.Services.GetService(typeof(AudioLibrary));
            _background = new ImageComponent(game, backgroundTexture, ImageComponent.DrawMode.Stretch);
            Components.Add(_background);

            _actionTexture = theTexture;

            _spriteBatch = (SpriteBatch) Game.Services.GetService(typeof (SpriteBatch));
            _meteors = new MeteorsManager(Game, ref _actionTexture);
            Components.Add(_meteors);

            _scoreFont = font;

            _scorePlayer1 = new Score(game, font, _player1FontColor) {Position = new Vector2(10, 10)};
            Components.Add(_scorePlayer1);

            _rumblePad = new SimpleRumblePad(game);
            Components.Add(_rumblePad);

            _powerSource = new PowerSource(game, ref _actionTexture);
            _powerSource.Initialize();
            Components.Add(_powerSource);

            _wrench = new Wrench(game, game.Content.Load<Texture2D>("wrench"));
            _wrench.Initialize();
            Components.Add(_wrench);

            #if DEBUG
            _positionDebugText=new TextComponent(game,_scoreFont,new Vector2(),Color.Red);
            Components.Add(_positionDebugText);
            #endif
        }