Ejemplo n.º 1
0
        private void ShootProjectile()
        {
            var aProjectile = new Projectile {IsEnemyProjectile = true};
            aProjectile.LoadContent(_mContentManager);

            aProjectile.Fire(Position + new Vector2(Size.Width / 4, Size.Height), new Vector2(-200, -200), new Vector2(0, 1));
            MProjectiles.Add(aProjectile);
        }
Ejemplo n.º 2
0
 private void ShootProjectile()
 {
     var aProjectile = new Projectile();
     aProjectile.LoadContent(_mContentManager);
     aProjectile.IsEnemyProjectile = false;
     aProjectile.Fire(Position + new Vector2(Size.Width / 4, 0 /*Size.Height / 2*/), new Vector2(-200, -200), new Vector2(0, -1));
     MProjectiles.Add(aProjectile);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Load graphics content for the game.
        /// </summary>
        public override void LoadContent()
        {
            if (_content == null)
                _content = new ContentManager(ScreenManager.Game.Services, "Content");

            _gameFont = _content.Load<SpriteFont>("Downlink");

            //Load Ship
            _mShipTexture = _content.Load<Texture2D>("ship-1");

            //Default Ship State Texture
            _shipBodySourceRectangle = new Rectangle(96, 0, 48, 56);

            _mPlayerShipSprite = new PlayerShip();
            _mProjectileSprite = new Projectile();

            _mPlayerShipSprite.Scale = 1.0f;
            _mPlayerShipSprite.Source = _shipBodySourceRectangle;

            _mBossTestSprite = new BossTest();

            _mProjectileSprite.LoadContent(_content);
            _mPlayerShipSprite.LoadContent(_content);
            _mBossTestSprite.LoadContent(_content);

            //Game Music
            _gameMusic = _content.Load<SoundEffect>("Rock Garden");
            GameMusicInstance = _gameMusic.CreateInstance();

            // A real game would probably have more content than this sample, so
            // it would take longer to load. We simulate that by delaying for a
            // while, giving you a chance to admire the beautiful loading screen.
            Thread.Sleep(1000);

            // once the load has finished, we use ResetElapsedTime to tell the game's
            // timing mechanism that we have just finished a very long frame, and that
            // it should not try to catch up.
            ScreenManager.Game.ResetElapsedTime();
        }