public void Use(AABB interactingParty) { if (cooldownTimer > cooldown) { if (interactingParty is Player) { subbedForPorting = true; cooldownTimer = 0.0f; player = (Player)interactingParty; Game.SoundManager.PlaySound("PortalUse", null, 0, false); } else throw new Exception("interacting party (with portal) is not player"); } }
protected override void Initialize() { base.Initialize(); menu = new Menu(Content); // Setup frame buffer. graphics.SynchronizeWithVerticalRetrace = false; graphics.PreferredBackBufferWidth = GameConstants.windowWidth; graphics.PreferredBackBufferHeight = GameConstants.windowHeight; graphics.PreferMultiSampling = true; graphics.ApplyChanges(); player = new Player(this, GameConstants.PLAYER_START_POS); player.inv.AddItem(new InventoryItem(new Compass(Content), "compass")); // Initial position for text rendering. fontPos = new Vector2(5.0f, -20.0f); world = new World(player.Cam); world.LoadContent(GraphicsDevice, Content); Services.AddService(typeof(World), world); ToggleFullScreen(); menu.EnterMenu(GameStates.MainMenu, GameStates.MainMenu); currentGameState = GameStates.MainMenu; }