Esempio n. 1
0
 public void update(Camera cam, Actor Actor)
 {
     if (drawSpace.Center.X != Actor.hitBox.Center.X || drawSpace.Center.Y != Actor.hitBox.Center.Y)
         setFocus(Actor.hitBox.Center.X, Actor.hitBox.Center.Y);
 }
Esempio n. 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()
        {
            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;

            random = new Random();

            //actors = new List<Actor>();
            worldManager = new WorldManager(random);
            worldManager.initWorldConfig(Content, "content/Worlds.xml");
            worldManager.initStartingWorld();
            actorManager = new ActorManager(worldManager, random);
            actorManager.initActorConfig(Content, "content/Actors.xml");
            aiController = new AIController();


            //spawnTile = worldManager.curWorld.getSpawnTile();
            tileRect = new Rectangle(0,0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight);

            cam = new Camera(spriteBatch, tileRect, worldManager, debugSquare);
            player = new Actor(playerTexture, 25, 25, 64, 64);
            player.isPlayer = true;
            //Point spawnPosition = new Point(spawnTile.X * tileSize + tileSize / 2, spawnTile.Y * tileSize + tileSize / 2);
            actorManager.spawnActor(player, worldManager.curWorld.getSpawnPos(), 1);
            actorManager.spawnActors(worldManager.curWorld.getSpawns());
        }
Esempio n. 3
0
 public void update(Camera cam)
 {
     if (drawSpace.Center.X != protagonist.hitBox.Center.X || drawSpace.Center.Y != protagonist.hitBox.Center.Y)
         setFocus(protagonist.hitBox.Center.X, protagonist.hitBox.Center.Y);
 }
Esempio n. 4
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());
        }
Esempio n. 5
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);

        }