Esempio n. 1
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);
        }