Beispiel #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            floorTiles = Content.Load<Texture2D>("TempleFloor.png");
            //playerTexture = Content.Load<Texture2D>("protagonistBodyAnimations");
            playerTexture = Content.Load<Texture2D>("dreamManAnimations.png");
            debugSquare = Content.Load<Texture2D>("debugSquare");
            arielBlackFont = Content.Load<SpriteFont>("SpriteFont1");

            device = graphics.GraphicsDevice;
            spriteBatch = new SpriteBatch(GraphicsDevice);
            origin.X = graphics.PreferredBackBufferWidth / 2;
            origin.Y = graphics.PreferredBackBufferHeight / 2;
            inputHandler = new InputHandler(origin);
            random = new Random();

            tileRect = new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            cam = new Camera(spriteBatch, tileRect, debugSquare);
            //actors = new List<Actor>();
            aiController = new AIController();
            actorController = new ActorController();
            physicsController = new PhysicsController();
            worldManager = new WorldManager(random);
            worldManager.initWorldConfig(Content, "content/Worlds.xml");
            worldManager.initStartingWorld();
            soundManager = new SoundManager();
            soundManager.initSoundConfig(Content, "content/sfx/Sounds.xml");
            actorManager = new ActorManager();
            actorManager.initActorConfig(Content, "content/Actors.xml");
            actorManager.spawnActors(worldManager.curWorld.getSpawns());
        }
Beispiel #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()
        {
            
            //arielBlackFont = Content.Load<SpriteFont>("SpriteFont1");
            //splashScreen;

            device = graphics.GraphicsDevice;
            spriteBatch = new SpriteBatch(GraphicsDevice);
            origin.X = graphics.PreferredBackBufferWidth / 2;
            origin.Y = graphics.PreferredBackBufferHeight / 2;
            inputHandler = new InputHandler(origin);
            random = new Random();
            tileRect = new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);
            //tileRect = Window.ClientBounds;
            cam = new Camera(spriteBatch, tileRect);
            cam.loadGuiTextures(Content);

            aiController = new AIController();
            physicsController = new PhysicsController();
            worldManager = new WorldManager(random);
            worldManager.initWorldConfig(Content, "Content/Worlds.xml");

            SoundManager.Instance.initSoundConfig(Content, "Content/Sounds.xml", "Content/Music.xml");
            actorController = new ActorController();
            actorManager = new ActorManager();
            actorManager.initAnimationConfig(Content, "Content/Animations.xml");
            actorManager.initActorConfig(Content, "Content/Actors.xml");
            
            itemManager = new ItemManager();
            itemManager.initWeaponConfig(Content, "Content/Weapons.xml");

            propManager = new PropManager();
            propManager.initPropConfig(Content, "Content/Props.xml");

            cam.enterStartMenu();
            cam.NewGame += new EventHandler<EventArgs>(NewGameSelected);
            cam.Tutorial += new EventHandler<EventArgs>(TutorialSelected);
            cam.Credits += new EventHandler<EventArgs>(CreditsSelected);
            cam.CreditsExit += new EventHandler<EventArgs>(CreditsExited);
            WorldManager.worldChange += new EventHandler<EventArgs>(WorldManager_worldChange);

        }