/// <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);

            // TODO: use this.Content to load your game content here
            // instantiate all scenes here
            startScene = new StartScene(this, spriteBatch);
            this.Components.Add(startScene);

            actionScene = null;
            //actionScene = new ActionScene(this, spriteBatch);
            //this.Components.Add(actionScene);

            helpScene = new HelpScene(this, spriteBatch);
            this.Components.Add(helpScene);

            scoreScene = new ScoreScene(this, spriteBatch);
            this.Components.Add(scoreScene);

            aboutScene = new AboutScene(this, spriteBatch);
            this.Components.Add(aboutScene);
            // instantiation ends

            //make only startscene active
            startScene.show();
        }
Beispiel #2
0
        //-----------------------------------------------------------------------------
        // Game::LoadContent()
        //		Allows you to load all content needed for your engine,
        //	    such as objects, graphics, etc.
        //-----------------------------------------------------------------------------
        public override void LoadContent()
        {
            // Moving this line into Initialize() causes
            // stupid AccessViolationExceptions
            SpriteCollisionManager.Self.Preallocate(2, 4);
            // The NULL one is for resizable sprites
            SpriteCollisionManager.Self.Create(Sprite.Name.NULL);

            // Create all the AudioSources
            AudioFactory audioFactory = new AudioFactory();

            audioFactory.LoadAllAudio();

            // Initilize the texture system
            TextureManager.Self.Create(Texture.Name.InvadersFromSpace, "invaders-from-space.tga");

            // Create all the Images ever needed
            ImageFactory imageFactory = new ImageFactory();

            imageFactory.Create();

            // Create all the SpriteEntites and SpriteCollisions ever needed
            SpriteEntityFactory spriteFactory = new SpriteEntityFactory();

            spriteFactory.Create();


            Console.WriteLine(" ");
            Console.WriteLine("//////////////////////////////////////////////////");
            Console.WriteLine("//          INSTRUCTIONS                        //");
            Console.WriteLine("//                                              //");
            Console.WriteLine("//    Left Arrow  = Go Left                     //");
            Console.WriteLine("//    Right Arrow = Go Right                    //");
            Console.WriteLine("//    Space       = Fire Missile                //");
            Console.WriteLine("//    D           = Toggle Collider Rendering   //");
            Console.WriteLine("//////////////////////////////////////////////////");
            Console.WriteLine(" ");


            ///////////////////
            // Begin Scene Setup
            ///////////////////

            // Create first scene
            StartScene firstScene = new StartScene();

            SceneManager.Self.LoadScene(firstScene);
        }