public WelcomeScreen(Game i_Game) : base(i_Game) { ScreenBackground background = new ScreenBackground(i_Game, Color.DarkCyan, @"GameAssets\BG_Space01_1024x768"); SpaceInvadersTitleSprite welcomeSprite = new SpaceInvadersTitleSprite(i_Game); m_WelcomeText = new Text(this.Game, Color.YellowGreen); m_WelcomeText.Scales *= 1 / k_ScaleDownText; this.Add(background); this.Add(welcomeSprite); this.Add(m_WelcomeText); }
public static ScreenBackground LoadBackground(StreamReader reader, GameScreen screen) { // create le background ScreenBackground background = new ScreenBackground(screen); // get lines and load stuff string line; while ((line = GetLine(reader)) != "---") { switch (line) { case "Path": background.LoadTexture(GetLine(reader)); break; case "X": background.Position.X = float.Parse(GetLine(reader), CultureInfo.InvariantCulture); break; case "Y": background.Position.Y = float.Parse(GetLine(reader), CultureInfo.InvariantCulture); break; case "ParalaxAmount": background.ParalaxAmount = float.Parse(GetLine(reader), CultureInfo.InvariantCulture); break; case "Depth": background.Depth = float.Parse(GetLine(reader), CultureInfo.InvariantCulture); break; case "FollowCamera": background.FollowCamera = true; break; case "RepeatX": background.RepeatX = true; break; case "RepeatY": background.RepeatY = true; break; } } // return that shi return(background); }
public GameOverScreen(Game i_Game) : base(i_Game) { ScreenBackground background = new ScreenBackground(i_Game, Color.DarkRed, @"GameAssets\BG_Space01_1024x768"); GameOverSprite gameOverSprite = new GameOverSprite(i_Game); m_GameStatsText = new Text(i_Game, Color.YellowGreen); m_GameOverInstructionsText = new Text(i_Game, Color.YellowGreen); m_GameStatsText.Scales *= 1 / k_ScaleDownText; m_GameOverInstructionsText.Scales *= 1 / k_ScaleDownText; this.Add(background); this.Add(gameOverSprite); this.Add(m_GameStatsText); this.Add(m_GameOverInstructionsText); }
public PlayScreen(Game i_Game) : base(i_Game) { GameManager gameManager; ScreenBackground background = new ScreenBackground(i_Game, Color.DarkCyan, @"GameAssets\BG_Space01_1024x768"); MotherShip motherShip = new MotherShip(i_Game, Color.Red); gameManager = this.Game.Services.GetService(typeof(IGameManager)) as GameManager; gameManager.LevelPassed += gameManager_LevelPassed; gameManager.GameOver += gameManager_GameOver; m_EnemyMatrix = new EnemyMatrix(i_Game); m_BarrierList = new BarrierList(i_Game, Color.LightGreen); m_PauseScreen = new PauseScreen(i_Game); this.Add(background); this.Add(m_EnemyMatrix); createPlayers(gameManager); this.Add(motherShip); this.Add(m_BarrierList); }
protected override void LoadContent() { //load background image backgroundTexture = content.Load<Texture2D>("Images/versusmode_background"); background = new ScreenBackground(theGame, backgroundTexture); //add the grids gridP1 = new Grid(theGame, 390, 520, 65, false); gridP1.DrawOrder = 1; gridP2 = new Grid(theGame, 390, 520, 65, true); gridP2.DrawOrder = 1; //add the selection boxes selectionBoxP1 = new SelectionBox(theGame, false); selectionBoxP1.DrawOrder = 2; theGame.Components.Add(selectionBoxP1); selectionBoxP2 = new SelectionBox(theGame, true); selectionBoxP2.DrawOrder = 2; theGame.Components.Add(selectionBoxP2); base.LoadContent(); }
protected override void LoadContent() { //load background image backgroundTexture = content.Load<Texture2D>("Images/startscreen_background"); background = new ScreenBackground(theGame, backgroundTexture); //load sprite font spriteFont = content.Load<SpriteFont>("Fonts/menu"); //load menu menu = new Menu(theGame, menuItems, spriteFont, Color.Yellow, Color.Red); menuPosition = new Vector2( (theGame.Window.ClientBounds.Width - menu.Width) / 2, (theGame.Window.ClientBounds.Height - menu.Height) / 2); menu.Position = menuPosition; base.LoadContent(); }
protected override void LoadContent() { //load background image backgroundTexture = content.Load<Texture2D>("Images/endlessmode_background"); background = new ScreenBackground(theGame, backgroundTexture); //add the grid grid = new Grid(theGame, 390, 520, 65, false); grid.DrawOrder = 1; //add the selection box selectionBox = new SelectionBox(theGame, false); selectionBox.DrawOrder = 2; theGame.Components.Add(selectionBox); //load statistics font statisticsFont = content.Load<SpriteFont>("Fonts/statistics"); base.LoadContent(); }
public MenuScreen(Game i_Game) : base(i_Game) { List <object> volumeHops, offOnList; ScreenBackground background = new ScreenBackground(i_Game, Color.DarkCyan, @"GameAssets\BG_Space01_1024x768"); MenuMananger menuManager; Menu soundMenu, screenMenu; ActivatableMenuItem play, quit; ToggleMenuItem players; ToggleMenuItem backgroundMusicVolume, soundEffectsVolume, toggleSound; ToggleMenuItem mouseVisability, allowWindowResizing, fullScreenMode; m_SoundManager = this.Game.Services.GetService(typeof(ISoundManager)) as ISoundManager; volumeHops = new List <object> { 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0 }; offOnList = new List <object> { "Off", "On" }; m_GameManager = i_Game.Services.GetService(typeof(IGameManager)) as IGameManager; menuManager = new MenuMananger(i_Game); m_MainMenu = new Menu(i_Game, "Main Menu"); soundMenu = new Menu(i_Game, "Sound Options"); backgroundMusicVolume = new ToggleMenuItem(i_Game, "Background Music Volume", volumeHops); soundEffectsVolume = new ToggleMenuItem(i_Game, "Sound Effects Volume", volumeHops); toggleSound = new ToggleMenuItem(i_Game, "Toggle Sound", new List <object> { "On", "Off" }); screenMenu = new Menu(i_Game, "Screen Options"); mouseVisability = new ToggleMenuItem(i_Game, "Mouse Visability", new List <object> { "Invisible", "Visible" }); allowWindowResizing = new ToggleMenuItem(i_Game, "Allow Window Resizing", offOnList); fullScreenMode = new ToggleMenuItem(i_Game, "Full Screen Mode", offOnList); players = new ToggleMenuItem(i_Game, "Players", new List <object> { "One", "Two" }); play = new ActivatableMenuItem(i_Game, "Play"); quit = new ActivatableMenuItem(i_Game, "Quit"); m_MainMenu.MenuManager = menuManager; soundMenu.AddItem(backgroundMusicVolume); soundMenu.AddItem(soundEffectsVolume); soundMenu.AddItem(toggleSound); screenMenu.AddItem(mouseVisability); screenMenu.AddItem(allowWindowResizing); screenMenu.AddItem(fullScreenMode); m_MainMenu.AddItem(soundMenu); m_MainMenu.AddItem(screenMenu); m_MainMenu.AddItem(players); m_MainMenu.AddItem(play); m_MainMenu.AddItem(quit); backgroundMusicVolume.ItemChosen += backgroundMusicVolumeToggleItem_ItemChosen; soundEffectsVolume.ItemChosen += soundEffectsVolumeToggleItem_ItemChosen; toggleSound.ItemChosen += toggleSoundToggleItem_ItemChosen; mouseVisability.ItemChosen += mouseVisabilityToggleItem_ItemChosen; allowWindowResizing.ItemChosen += allowWindowResizingToggleItem_ItemChosen; fullScreenMode.ItemChosen += fullScreenModeToggleItem_ItemChosen; players.ItemChosen += playersToggleItem_ItemChosen; play.ItemChosen += playItem_ItemChosen; quit.ItemChosen += quitItem_ItemChosen; menuManager.SetCurrentItem(m_MainMenu); this.Add(background); this.Add(menuManager); }
public override int GetHashCode() { int hash = 1; if (Id.Length != 0) { hash ^= Id.GetHashCode(); } hash ^= professionRanks_.GetHashCode(); if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (Desc.Length != 0) { hash ^= Desc.GetHashCode(); } if (Icon.Length != 0) { hash ^= Icon.GetHashCode(); } if (MentorName.Length != 0) { hash ^= MentorName.GetHashCode(); } if (MentorDesc.Length != 0) { hash ^= MentorDesc.GetHashCode(); } if (MentorIcon.Length != 0) { hash ^= MentorIcon.GetHashCode(); } if (ScreenBackground.Length != 0) { hash ^= ScreenBackground.GetHashCode(); } if (IconStamp.Length != 0) { hash ^= IconStamp.GetHashCode(); } if (ScreenBackgroundHeader.Length != 0) { hash ^= ScreenBackgroundHeader.GetHashCode(); } if (ShowComingSoon != false) { hash ^= ShowComingSoon.GetHashCode(); } if (IconHighlighted.Length != 0) { hash ^= IconHighlighted.GetHashCode(); } if (ShowProfessionRankMeter != false) { hash ^= ShowProfessionRankMeter.GetHashCode(); } if (ProfessionActivatedSfx.Length != 0) { hash ^= ProfessionActivatedSfx.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }