Example #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();
     hud = new HUD();
     oMenu = new OptionsMenu(graphics, Content);
     intro = new AsteroidsIntro();
     screenHeight = graphics.PreferredBackBufferHeight;
     screenWidth = graphics.PreferredBackBufferWidth;
     numOfAsteroids = 3;
     currentGameState = 1;
 }
Example #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            structOptionsMain = new StructOptionsMain();
            structOptionsMain.Graphics = graphics;
            structOptionsMain.Content = Content;
            structOptionsMain.SpriteBatch = spriteBatch;
            structOptionsMain.SpriteFont = Content.Load<SpriteFont>("MenuFont");
            structOptionsMain.Ch = ch;
            oMenu = new OptionsMenu(structOptionsMain);

            p.Load(Content);
            p.SetPlayerPos(spriteBatch);
            hud.Load(Content);
            intro.Load(Content, graphics);
            credit.Load(Content, graphics);
            oMenu.Init();
            gameOverMenu.Load();
            shield.Load();
            pickUp.Load(Content);
            if (spawnPickup >= 70)
            {
                pickUp.Load(Content);
            }
            machineGun.Load();
            extraLife.Load();

            speedUp.Load();

            mainMenu.Load(graphics.GraphicsDevice, scores);
            background = new Background(GraphicsDevice, Content);
            loadingScreen = new LoadingScreen(Content, graphics.GraphicsDevice);
            kbm.Load();

            foreach (Weapon wep in p.weapList)
            {
                wep.Load(Content, p.GetDirection());
            }
        }