예제 #1
0
 //Constructor
 public Manager(Graphics graphics, Random random)
 {
     this.random    = random;
     this.graphics  = graphics;
     motherShip     = new MotherShip(graphics, GlobalVariable.bitmapMotherShip, new Point(0, GlobalVariable.boundries.Height - GlobalVariable.bitmapMotherShip.Height), GlobalVariable.bitmapMotherShip.Width, GlobalVariable.bitmapMotherShip.Height, MOTHERSHIP_SPEED, 1, Direction.Right);
     enemyShipFleet = new EnemyShipFleet(graphics);
     missileFleet   = new MissileFleet(graphics);
 }
예제 #2
0
        protected override void Update(GameTime gameTime)
        {
            this.Window.Title = "SpaceInvaders!!!";

            if (!m_MotherShipInTheGame)
            {
                if (GameManager.GameManager.Random.Next(1, m_GameManager.MotherShipRandomParameter) == 1)
                {
                    m_MotherShip = new MotherShip(this);
                    this.Components.Add(m_MotherShip);
                    m_MotherShip.Disposed += motherShip_Disposed;
                    m_MotherShipInTheGame  = true;
                }
            }

            base.Update(gameTime);
        }
예제 #3
0
        /// <summary>
        /// Creates the spriteBatch and the ship.
        /// </summary>
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            imageShip   = game.Content.Load <Texture2D>("mothership");

            startingPositions[0] = new Vector2();
            startingPositions[1] = new Vector2();

            startingPositions[0].X = GraphicsDevice.Viewport.Width + 1;
            startingPositions[0].Y = 40;
            startingPositions[1].X = 0 - imageShip.Width;
            startingPositions[1].Y = 40;

            ship = new MotherShip((int)setDirection().X, (int)startingPositions[0].Y,
                                  imageShip.Width, imageShip.Height, GraphicsDevice.Viewport.Width, 3);
            base.LoadContent();
        }
예제 #4
0
        /// <summary>
        /// Creates the spriteBatch and the ship.
        /// </summary>
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            imageShip = game.Content.Load<Texture2D>("mothership");

            startingPositions[0] = new Vector2();
            startingPositions[1] = new Vector2();

            startingPositions[0].X = GraphicsDevice.Viewport.Width + 1;
            startingPositions[0].Y = 40;
            startingPositions[1].X = 0 - imageShip.Width;
            startingPositions[1].Y = 40;

            ship = new MotherShip((int)setDirection().X, (int)startingPositions[0].Y,
                imageShip.Width, imageShip.Height, GraphicsDevice.Viewport.Width, 3);
            base.LoadContent();
        }