//Pulls the map, camera, heroes and model from the gamestate. public void pullChanges() { this.worldMap = gameState.getMap("OverWorld"); this.worldCamera = gameState.Camera; this.heroes = gameState.Party.Heroes; this.model = gameState.WorldModel; }
/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> //When new game is chosen from the main menu this method initializes some basic values to party, camera etc. public void NewGame() { maps = new Dictionary<string, Map>(); Hero hero1 = new Hero("Taistelu Jaska", new Vector3(50, 12.1f, -100)); party = new Party(); party.addCompany(hero1); party.attachObserver(new CameraObserver(this)); party.addItem("Potion"); party.addItem("Ether"); party.addItem("Grenade"); setModels(); worldModel = ModelManager.instance(game).models["Taistelu Jaska"]; worldModel.setPosition(party.Position, party.PartyRotation); maps.Add("OverWorld", new Map("eternia", game)); maps.Add("Battle1", new Map("battle1", game)); camera = new Camera(game.GraphicsDevice); camera.SetUpCamera(Party.Position, Party.PartyRotation); }