public Sprite(GammaDraconis game, Rectangle source) : base(game) { color = Color.White; this.source = source; useSource = true; }
/// <summary> /// Create the main menu. /// </summary> /// <param name="game">The game instance.</param> public MainMenu(GammaDraconis game) : base(game) { skybox = new Skybox(); screenScene.track(skybox, GO_TYPE.SKYBOX); Skybox.lights[0] = new Light(new Vector3(-0.05f, 0.1f, -1f), new Vector3(0.9f, 0.7f, 0.7f), new Vector3(1f,1f,1f)); Skybox.lights[1] = new Light(new Vector3(0.95f, -0.9f, 1f), new Vector3(0.4f, 0.4f, 0.4f), new Vector3(0.5f, 0.5f, 0.5f)); racer = (((new Random()).Next(1, 3) == 1) ? Proto.getRacer("Thor") : Proto.getRacer("Raptor")); racer.position = new Coords(startLocation.X, startLocation.Y, startLocation.Z, 0.2f, 1.5f, 1.0f); racer.models[0].scale *= 1; racer.size *= 1; screenScene.track(racer, GO_TYPE.RACER); GameObject planet = new GameObject(); planet.position = new Coords(500f, -300f, -1250f); planet.models.Add(new FBXModel("Resources/Models/Planet", "", 1f)); screenScene.track(planet, GO_TYPE.SCENERY); Sprite NameText = new Sprite(game); NameText.textureName = "Resources/Textures/Logo"; NameText.RelativeRotation = 0.2f; NameText.RelativePosition = new Vector2(300.0f, 20.0f); screenInterface.AddComponent(NameText); }
/// <summary> /// Starts up a game engine for the specified map /// </summary> /// <param name="mapName">The name given to the map in the file system</param> public Engine(GammaDraconis game, String mapName, List<Player> players) { if (instance != null) { #region Cleanup the old instance instance.Cleanup(); instance = null; #endregion } instance = this; this.game = game; // Initialize the Renderer SetupGameRenderer(); //Setup a course this.players = players.ToArray(); SetupCourse(mapName); foreach (Player player in this.players) { player.setupDust(); } }
/// <summary> /// Creates a new Screen /// </summary> /// <param name="game">The instance of the game.</param> protected Screen(GammaDraconis game) : base(game) { gammaDraconis = game; screenScene = new Scene(); screenInterface = new Interface(gammaDraconis); screenInterface.Visible = Visible; }
/// <summary> /// Constructor for the screen /// </summary> /// <param name="game">The instance of the game.</param> public LevelLoadingScreen(GammaDraconis game) : base(game, GammaDraconis.GameStates.Game) { loadingText = new Text(gammaDraconis); loadingText.color = Color.White; loadingText.text = loadingTextValue; loadingText.SpriteFontName = "Resources/Fonts/Menu"; loadingText.RelativePosition = new Vector2(game.Window.ClientBounds.Width / 2, game.Window.ClientBounds.Height / 2); loadingText.center = true; screenInterface.AddComponent(loadingText); }
public InterfaceComponent(GammaDraconis game) : base(game) { gammaDraconis = game; game.Components.Add(this); RelativePosition = Vector2.Zero; RelativeScale = Vector2.One; RelativeRotation = 0; Visible = true; Enabled = false; }
/// <summary> /// Constructor for the screen /// </summary> /// <param name="game">Gamma Draconis instance</param> public MenuScreen(GammaDraconis game) : base(game) { SetupMenuItems(); for (int index = 0; index < menuItems.Length; index++) { bool selected = index == menuItemIndex; menuItems[index].RelativeScale = selected ? GetSelectedScale() : GetUnselectedScale(); menuItems[index].color = selected ? GetSelectedColor() : GetUnselectedColor(); menuItems[index].SpriteFontName = GetFontName(); menuItems[index].Spacing = 5; } ready = true; }
/// <summary> /// Set up the renderer. /// </summary> /// <param name="game"></param> public Renderer(GammaDraconis game) : base(game) { aspectRatio = 0; viewingAngle = 60f; viewingDistance = 15000f; this.game = game; game.Window.ClientSizeChanged += new EventHandler(Window_ClientSizeChanged); viewports = new Viewport[9]; bloomShader = new Bloom(game); game.Components.Add(bloomShader); reset(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="game">The game instance.</param> public ControlsMenu(GammaDraconis game) : base(game) { skybox = new Skybox(); screenScene.track(skybox, GO_TYPE.SKYBOX); xbox360PadFront = new Sprite(game); xbox360PadFront.textureName = "Resources/Textures/Xbox 360 Controller Front"; xbox360PadFront.RelativePosition = new Vector2(112.0f, 100.0f); screenInterface.AddComponent(xbox360PadFront); xbox360PadTop = new Sprite(game); xbox360PadTop.textureName = "Resources/Textures/Xbox 360 Controller Top"; xbox360PadTop.RelativePosition = new Vector2(112.0f, 480.0f); screenInterface.AddComponent(xbox360PadTop); keyboardWASD = new Text(game, "W - Accelerate Forward\nS - Accelerate Backward\nA - Roll Left\nD - Roll Right\n" + "Arrow Keys - Steer Ship/Navigate Menus\n\nSpace - Fire Beam Weapons\nEnter - Fire Mine Weapons\nQ - Reset Ship\n\n" + "P - Pause\nEnter - Start Game\nEsc - Back/Quit Game"); keyboardWASD.RelativePosition = new Vector2(1024 / 2, 768 / 2); keyboardWASD.center = true; keyboardWASD.color = Color.White; keyboardWASD.SpriteFontName = "Resources/Fonts/Menu"; screenInterface.AddComponent(keyboardWASD); keyboardNumPad = new Text(game, "0 - Accelerate Forward\n5 - Accelerate Backward\n7 - Roll Left\n9 - Roll Right\n" + "Arrow Keys - Steer Ship/Navigate Menus\n\n1 - Fire Beam Weapons\n3 - Fire Mine Weapons\n. - Reset Ship\n\n" + "P - Pause\nEnter - Start Game\nEsc - Back/Quit Game"); keyboardNumPad.RelativePosition = new Vector2(1024 / 2, 768 / 2); keyboardNumPad.center = true; keyboardNumPad.color = Color.White; keyboardNumPad.SpriteFontName = "Resources/Fonts/Menu"; screenInterface.AddComponent(keyboardNumPad); pageSelector = new Selector(game, "Xbox 360 Controller", "Keyboard - WASD", "Keyboard - NumPad"); pageSelector.RelativePosition = new Vector2(1024 / 2, 40.0f); pageSelector.center = true; pageSelector.color = Color.White; pageSelector.SpriteFontName = "Resources/Fonts/Menu"; screenInterface.AddComponent(pageSelector); }
/// <summary> /// Constructor for the screen. /// </summary> /// <param name="game">The instance of the game.</param> public LevelOverScreen(GammaDraconis game) : base(game, GammaDraconis.GameStates.MainMenu) { resultText = new Text(gammaDraconis); resultText.color = Color.White; resultText.text = ""; resultText.SpriteFontName = "Resources/Fonts/Menu"; resultText.RelativePosition = new Vector2(1024 / 2, 768 / 2); resultText.center = true; screenInterface.AddComponent(resultText); titleText = new Text(gammaDraconis, "Race Results"); titleText.color = Color.White; titleText.SpriteFontName = "Resources/Fonts/Title"; titleText.center = true; titleText.RelativePosition = new Vector2(1024 / 2, 50); titleText.RelativeScale = new Vector2(0.9f, 0.9f); screenInterface.AddComponent(titleText); skybox = new Skybox(); screenScene.track(skybox, GO_TYPE.SKYBOX); }
/// <summary> /// Create this menu. /// </summary> /// <param name="game">The game instance.</param> public VideoSettingsMenu(GammaDraconis game) : base(game) { skybox = new Skybox(); screenScene.track(skybox, GO_TYPE.SKYBOX); racer = Proto.getRacer("Raptor"); racer.position = new Coords(startLocation.X, startLocation.Y, startLocation.Z, 0.2f, 1.5f, 1.0f); racer.models[0].scale *= 1; racer.size *= 1; screenScene.track(racer, GO_TYPE.RACER); GameObject planet = new GameObject(); planet.position = new Coords(500f, -300f, -1250f); planet.models.Add(new FBXModel("Resources/Models/Planet", "", 1f)); screenScene.track(planet, GO_TYPE.SCENERY); Sprite NameText = new Sprite(game); NameText.textureName = "Resources/Textures/Logo"; NameText.RelativeRotation = 0.2f; NameText.RelativePosition = new Vector2(300.0f, 20.0f); screenInterface.AddComponent(NameText); }
public Interface(GammaDraconis game) : base(game) { subComponents = new List<InterfaceComponent>(); }
/// <summary> /// Sets up the loading screen /// </summary> /// <param name="game">The Gamma Draconis instance</param> /// <param name="nextState">The game state that the loading screen transitions into</param> protected LoadingScreen(GammaDraconis game, GammaDraconis.GameStates nextState) : base(game) { this.nextState = nextState; ready = true; }
/// <summary> /// Creates the menu item /// </summary> /// <param name="text">The text of the menu item</param> /// <param name="screen">The screen this menu item is on</param> /// <param name="position">The location of this menu item</param> public MenuItem(GammaDraconis game, String command) : base(game) { this.command = command; }
/// <summary> /// Constructor for the screen /// </summary> /// <param name="game">Gamma Draconis Instance</param> public GameScreen(GammaDraconis game) : base(game) { ready = false; }
public Text(GammaDraconis game) : base(game) { }
public Text(GammaDraconis game, string text) : base(game) { this.text = text; }
public Sprite(GammaDraconis game) : base(game) { color = Color.White; }
public Text(GammaDraconis game, string text, float spacing) : base(game) { this.text = text; spriteFontSpacing = spacing; }