/// <summary> /// Lets the game respond to player input. Unlike the Update method, /// this will only be called when the gameplay screen is active. /// </summary> public override void HandleInput(VirtualController vtroller) { // there was a bug where if you exit the toolbox without // selecting a platform the toolbox was unreachable. //toolboxLaunched = false; //I was going to handle launching the gameplayscreen here but im not sure how to. -Brian if (Controller.IsButtonPressed(VirtualButtons.Mode)) { launchToolbox = true; } if (launchToolbox && !toolboxLaunched) { String message = "Select a platform to add to the level"; if (editableLevel.AdditionsLeft > 0) { toolbox = new ToolboxScreen(TopLevel, editableLevel, message, false); } else { message = "Platform addition limit reached"; toolbox = new ToolboxScreen(TopLevel, editableLevel, message, true); } ScreenList.AddScreen(toolbox); launchToolbox = false; //toolboxLaunched = true; //Console.WriteLine(addedPlatform.Origin) } //Calls the UpdateMovement method to move object on the scree UpdateMovement(); //Check if there is collisions in the simulation. if (editableLevel.FindCollision()) { foundCollision = true; } else { foundCollision = false; } }
/// <summary> /// Lets the game respond to player input. Unlike the Update method, /// this will only be called when the gameplay screen is active. /// </summary> public override void HandleInput(VirtualController vtroller) { //I was going to handle launching the gameplayscreen here but im not sure how to. -Brian if (Controller.IsButtonPressed(VirtualButtons.Mode)) { launchToolbox = true; } if (launchToolbox && !toolboxLaunched) { String message = "Select an object to add to the level"; if (editableLevel.AdditionsLeft > 0) { toolbox = new ToolboxScreen(TopLevel, editableLevel, message, false); } else { message = "Object addition limit reached"; toolbox = new ToolboxScreen(TopLevel, editableLevel, message, true); } ScreenList.AddScreen(toolbox); launchToolbox = false; if(!editableLevel.FindCollision()) LevelSaver.SaveLevel(editableLevel); } //Calls the UpdateMovement method to move object on the scree UpdateMovement(); //Check if there is collisions in the simulation. if (editableLevel.FindCollision()) { foundCollision = true; } else { foundCollision = false; } }