Exemplo n.º 1
0
        private void placementLasers(Laser premierLaser, Laser secondLaser)
        {
            Random r = new Random();
            int nbr = r.Next(Global.largeurFenetre - vaisseau.Texture.Width*2)+vaisseau.Texture.Width*2;

            if (premierLaser.first)
            {
                premierLaser.Position.X -= nbr;
                premierLaser.first = false;
            }

            if (premierLaser.Position.Y >= Global.hauteurFenetre)
            {
                    premierLaser.Position.X = 0;
                    premierLaser.Position.X -= nbr;
            }
            secondLaser.Position.X= premierLaser.Position.X+premierLaser.Texture.Width+(int)((vaisseau.Texture.Width)*2.7);
        }
Exemplo n.º 2
0
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            Global.largeurFenetre = Window.ClientBounds.Width;
            Global.hauteurFenetre = Window.ClientBounds.Height;
            laser = new Laser();
            laser2 = new Laser();
            laser3 = new Laser();
            laser4 = new Laser();
            vie = new Life();
            Global.pad = GamePad.GetState(PlayerIndex.One);

            vaisseau = new Vaisseau();
               // vaisseau.Initialize();
            base.Initialize();
        }