Beispiel #1
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            gsm = new GamestateManager();
            //graphics.IsFullScreen = true;
            graphics.PreferredBackBufferHeight = 500;
            graphics.PreferredBackBufferWidth = 900;
            Content.RootDirectory = "Content";
            ExitGame = this;
            ch = new ControlHandler();
            r = new Random();
            p = new Player(ch);
            scores = new Highscores();

            intro = new AsteroidsIntro();
            credit = new Credit();

            screenHeight = graphics.PreferredBackBufferHeight;
            screenWidth = graphics.PreferredBackBufferWidth;
            drawShield = false;
            intersected = false;
            randomized = false;
            shield = new Classes.Perks.ShieldPerk(Content, p);
            speedUp = new Classes.Perks.SpeedUpPerk(Content, p);
            extraLife = new Classes.Perks.ExtraLifePerk(Content, p);
            machineGun = new Classes.Perks.MachineGunPerk(Content, p);
            hud = new HUD(screenWidth, screenHeight, shield);
            pickUp = new Pickup();

            numOfAsteroids = 3;
            currentGameState = 1;
        }
Beispiel #2
0
 public void ResetPickups()
 {
     pickUp = new Classes.Pickup();
     randomized = false;
     spawnPickup = r.Next(0, 100);
     shield.SetShieldLives(1);
     shield.SetIsActive(false);
     p.SetMaxDelay(25);
     pickUp.SetTexture(Content.Load<Texture2D>("PickupItem"));
     p.SetMaxSpeed(3.0f);
     shield.SetElapsedFrames(0);
     machineGun.SetElapsedFrames(0);
     extraLife.SetElapsedFrames(0);
     speedUp.SetElapsedFrames(0);
     //p.SetTexture(Content.Load<Texture2D>("RocketIdle"));
     intersected = false;
 }