//Generates a new portion if none exists inte the given bounds. public void CheckNewPortion(BoundingBox bounds) { if (!IsGenerated(bounds)) { Portion newPortion = new Portion(bounds); newPortion.AddPortion(generatedPortions, engine.Entities); } }
/* Generates initial portions around the player. */ public void initPortions(Player player) { BoundingBox portionBounds = new BoundingBox(new Vector3(0, 0, 0), new Vector3(Portion.PORTION_WIDTH, Portion.PORTION_HEIGHT, 0)); Portion portion = new Portion(portionBounds); portion.AddPortion(generatedPortions, engine.Entities); entityObserver.CheckPortions(player); }
private void LoadGame(EventArgs e) { engine.ClearEntities(); engine.ClearViewPositions(); currentState = GameState.Game; backgroundSound = new SoundEntity(2.0F, 10.0F); //TODO: Add Menus //MenuController menuController = new MenuController (new StartMenu(), new OptionMenu(), new PlayGameMenu()); //Defines all keybindings InitializeKeyBinds(); BoundingBox portionBounds = new BoundingBox(new Vector3(0, 0, 0), new Vector3(Portion.PORTION_WIDTH, Portion.PORTION_HEIGHT, 0)); Portion portion = new Portion(portionBounds); portion.AddPortion(generatedPortions, engine.Entities); InitializePlayers(); InitializeViewports(); }