/// <summary> /// Initializes a new instance of the <see cref="LabGame" /> class. /// </summary> public GameController(MainPage mainPage) { // Creates a graphics manager. This is mandatory. graphicsDeviceManager = new GraphicsDeviceManager(this); //Slider Values // Setup the relative directory to the executable directory // for loading contents with the ContentManager Content.RootDirectory = "Content"; // Create the keyboard manager keyboardManager = new KeyboardManager(this); random = new Random(); input = new GameInput(); size = 10; generateGhost = 0.99; // Set boundaries. boundaryNorth = 2.6f; boundaryEast = size * 10 - 2.6f; boundarySouth = size * 10 - 2.6f; boundaryWest = 2.6f; // Initialise event handling. input.gestureRecognizer.Tapped += Tapped; input.gestureRecognizer.ManipulationStarted += OnManipulationStarted; input.gestureRecognizer.ManipulationUpdated += OnManipulationUpdated; input.gestureRecognizer.ManipulationCompleted += OnManipulationCompleted; this.mainPage = mainPage; }
/// <summary> /// Initializes a new instance of the <see cref="LabGame" /> class. /// </summary> public LabGame(MainPage mainPage) { // Creates a graphics manager. This is mandatory. graphicsDeviceManager = new GraphicsDeviceManager(this); // Setup the relative directory to the executable directory // for loading contents with the ContentManager Content.RootDirectory = "Content"; // Create the keyboard manager keyboardManager = new KeyboardManager(this); assets = new Assets(this); random = new Random(); input = new GameInput(); // Set boundaries. boundaryLeft = -4.5f * Camera.MaxModelSize / 5; boundaryRight = 4.5f * Camera.MaxModelSize / 5; boundaryTop = 4 * Camera.MaxModelSize / 5; boundaryBottom = -4.5f; // Initialise event handling. input.gestureRecognizer.Tapped += Tapped; input.gestureRecognizer.ManipulationStarted += OnManipulationStarted; input.gestureRecognizer.ManipulationUpdated += OnManipulationUpdated; input.gestureRecognizer.ManipulationCompleted += OnManipulationCompleted; this.mainPage = mainPage; score = 0; difficulty = 1; }
private Stack<GameObject> removedGameObjects; //game objects to be removed from the active list #endregion Fields #region Constructors /// <summary> /// Initializes a new instance of the <see cref="LabGame" /> class. /// </summary> public LabGame(MainPage mainPage) { // Creates a graphics manager. This is mandatory. graphicsDeviceManager = new GraphicsDeviceManager(this); // Setup the relative directory to the executable directory // for loading contents with the ContentManager Content.RootDirectory = "Content"; // Create the keyboard manager keyboardManager = new KeyboardManager(this); //Assets utility class assets = new Assets(this); //Input parser input = new GameInput(); // Initialise event handling. input.gestureRecognizer.Tapped += Tapped; input.gestureRecognizer.ManipulationStarted += OnManipulationStarted; input.gestureRecognizer.ManipulationUpdated += OnManipulationUpdated; input.gestureRecognizer.ManipulationCompleted += OnManipulationCompleted; //Create main XAML interface this.mainPage = mainPage; //Initialise game state score = 0; difficulty = 1; gameOver = false; size = 7; edgemax = (int)Assets.WORLD_WIDTH; }
/// <summary> /// Initializes a new instance of the <see cref="LabGame" /> class. /// </summary> public LabGame(MainPage mainPage) { // Creates a graphics manager. This is mandatory. graphicsDeviceManager = new GraphicsDeviceManager(this); // Setup the relative directory to the executable directory // for loading contents with the ContentManager Content.RootDirectory = "Content"; // Create the keyboard manager keyboardManager = new KeyboardManager(this); assets = new Assets(this); random = new Random(Environment.TickCount); input = new GameInput(); // Set boundaries. boundaryLeft = -4.5f; boundaryRight = 4.5f; boundaryTop = 4; boundaryBottom = -4.5f; boundaryFront = -4.5f; boundaryBack = 4.5f; // Initialise event handling. input.gestureRecognizer.Tapped += Tapped; input.gestureRecognizer.ManipulationStarted += OnManipulationStarted; input.gestureRecognizer.ManipulationUpdated += OnManipulationUpdated; input.gestureRecognizer.ManipulationCompleted += OnManipulationCompleted; this.mainPage = mainPage; score = 0; difficulty = 1; currentGameTimeSecond = 0; //make it safe mazeSeed=random.Next(1,Int32.MaxValue-1); }
/// <summary> /// Initializes a new instance of the <see cref="Project2Game" /> class. /// </summary> public Project2Game(MainPage mainPage) { // Creates a graphics manager. This is mandatory. graphicsDeviceManager = new GraphicsDeviceManager(this); // Setup the relative directory to the executable directory // for loading contents with the ContentManager Content.RootDirectory = "Content"; input = new GameInput(); input.gestureRecognizer.Tapped += Tapped; // Create the keyboard and mouse manager keyboardManager = new KeyboardManager(this); mouseManager = new MouseManager(this); this.mainPage = mainPage; }
/// <summary> /// Initializes a new instance of the <see cref="ProjectGame" /> class. /// </summary> public ProjectGame(MainPage mainPage) { // Creates a graphics manager. This is mandatory. graphicsDeviceManager = new GraphicsDeviceManager(this); //graphicsDeviceManager.PreferredGraphicsProfile = new FeatureLevel[] { FeatureLevel.Level_10_0, }; graphicsDeviceManager.PreferredGraphicsProfile = new FeatureLevel[] { FeatureLevel.Level_10_1, }; // Setup the relative directory to the executable directory // for loading contents with the ContentManager Content.RootDirectory = "Content"; // Create the keyboard manager keyboardManager = new KeyboardManager(this); random = new Random(); input = new GameInput(); // Initialise event handling. input.gestureRecognizer.Tapped += Tapped; input.gestureRecognizer.ManipulationStarted += OnManipulationStarted; input.gestureRecognizer.ManipulationUpdated += OnManipulationUpdated; input.gestureRecognizer.ManipulationCompleted += OnManipulationCompleted; this.mainPage = mainPage; difficulty = 1; score = 0; }