public StartScreen(GraphicsDeviceManager gdm, SpriteBatch sb, ContentManager cm) { this.gdm = gdm; this.sb = sb; this.cm = cm; background = cm.Load<Texture2D>("TitleScreen/title-screen"); title = cm.Load<Texture2D>("TitleScreen/DinoLaserAssaultTitle"); dino = cm.Load<Texture2D>("TitleScreen/title-dino"); landscape = cm.Load<Texture2D>("TitleScreen/title-foreground"); smallBush = cm.Load<Texture2D>("TitleScreen/dry-bush-small"); largeBush = cm.Load<Texture2D>("TitleScreen/dry-bush-large"); gameModeText = cm.Load<Texture2D>("TitleScreen/player-option-text"); bgMusic = new BackgroundMusic(cm, BackgroundMusic.playAt.Opening); highlightColor.A = 50; highlightColor.R = 255; highlightColor.G = 255; highlightColor.B = 255; singleSelected = true; highlightedRect = new Texture2D(gdm.GraphicsDevice, 400, 100); highlightedRect.SetData(ColorPicker.setTexture(highlightedRect.Width, highlightedRect.Height, highlightColor)); fire = CreateMovingFire(8, "light-fire", 256, gdm.PreferredBackBufferHeight - 180, 300); backgroundFire = CreateMovingFire(16, "fire", 128, gdm.PreferredBackBufferHeight - 300, 150); }
public CharacterSelectionScreen(GraphicsDeviceManager gdm, ContentManager cm) { this.gdm = gdm; background = new Texture2D(gdm.GraphicsDevice, gdm.PreferredBackBufferWidth, gdm.PreferredBackBufferHeight); menuBackgroundRect = new Texture2D(gdm.GraphicsDevice, gdm.PreferredBackBufferWidth - 100, gdm.PreferredBackBufferHeight - 100); caption = cm.Load<Texture2D>("CharacterSelectionScreen/CharacterSelectionScreen-Caption"); brontoRect = new Texture2D(gdm.GraphicsDevice, 400, 400); rexRect = new Texture2D(gdm.GraphicsDevice, 400, 400); pteraRect = new Texture2D(gdm.GraphicsDevice, 400, 400); triceraRect = new Texture2D(gdm.GraphicsDevice, 400, 400); finishedButton = new Texture2D(gdm.GraphicsDevice, 400, 150); brontoSelected = true; brontSprite = cm.Load<Texture2D>("CharacterSelectionScreen/Bronto"); rexSprite = cm.Load<Texture2D>("CharacterSelectionScreen/Trex"); pterySprite = cm.Load<Texture2D>("CharacterSelectionScreen/Pteradactyl"); ceraSprite = cm.Load<Texture2D>("CharacterSelectionScreen/Triceratops"); moveMenuSound = cm.Load<SoundEffect>("Sounds/moveMenu"); PteraSound = cm.Load<SoundEffect>("Sounds/Ptera"); triSound = cm.Load<SoundEffect>("Sounds/tri"); brontoSound = cm.Load<SoundEffect>("Sounds/bronto"); trexSound = cm.Load<SoundEffect>("Sounds/trex"); subTitleFont = cm.Load<SpriteFont>("Fonts/SubtextFont"); finishedFont = cm.Load<SpriteFont>("Fonts/FinishButtonFont"); menuItemColor.A = 150; menuItemColor.R = 50; menuItemColor.G = 50; menuItemColor.B = 50; background.SetData(ColorPicker.setTexture(background.Width, background.Height, Color.DarkGray)); menuBackgroundRect.SetData(ColorPicker.setTexture(menuBackgroundRect.Width, menuBackgroundRect.Height, menuItemColor)); brontoRect.SetData(ColorPicker.setTexture(brontoRect.Width, brontoRect.Height, menuItemColor)); rexRect.SetData(ColorPicker.setTexture(rexRect.Width, rexRect.Height, menuItemColor)); pteraRect.SetData(ColorPicker.setTexture(pteraRect.Width, pteraRect.Height, menuItemColor)); triceraRect.SetData(ColorPicker.setTexture(triceraRect.Width, triceraRect.Height, menuItemColor)); finishedButton.SetData(ColorPicker.setTexture(finishedButton.Width, finishedButton.Height, menuItemColor)); bgMusic = new BackgroundMusic(cm, BackgroundMusic.playAt.CharacterSelectScreen); }
/// <summary> /// /// </summary> /// <param name="gdm"></param> /// <param name="cm"></param> /// <param name="firstPlayerControl"></param> public Lobby(GraphicsDeviceManager gdm, ContentManager cm, ChosenControl firstPlayerControl) { this.firstPlayerControl = firstPlayerControl; secondPlayerControl = ChosenControl.Unchosen; playerOne = Player.Chara.Unchosen; playerTwo = Player.Chara.Unchosen; gamepadTwoHighlighted = true; brontoOneHighlighted = true; rexTwoHighlighted = true; titleText = cm.Load<Texture2D>("Multiplayer Lobby/lobby-title-text"); playerOneOk = cm.Load<Texture2D>("Multiplayer Lobby/player-one-ok"); playerTwoOk = cm.Load<Texture2D>("Multiplayer Lobby/player-two-ok"); keyboardOne = cm.Load<Texture2D>("Multiplayer Lobby/keyboard-graphic"); keyboardTwo = cm.Load<Texture2D>("Multiplayer Lobby/keyboard-graphic"); gamepadOne = cm.Load<Texture2D>("Multiplayer Lobby/gamepad-graphic"); gamepadTwo = cm.Load<Texture2D>("Multiplayer Lobby/gamepad-graphic"); brontoBox = cm.Load<Texture2D>("Multiplayer Lobby/bronto-box"); rexBox = cm.Load<Texture2D>("Multiplayer Lobby/rex-box"); pteraBox = cm.Load<Texture2D>("Multiplayer Lobby/ptera-box"); triceraBox = cm.Load<Texture2D>("Multiplayer Lobby/tricera-box"); bront = cm.Load<Texture2D>("CharacterSelectionScreen/Bronto"); rex = cm.Load<Texture2D>("CharacterSelectionScreen/Trex"); ptery = cm.Load<Texture2D>("CharacterSelectionScreen/Pteradactyl"); cera = cm.Load<Texture2D>("CharacterSelectionScreen/Triceratops"); background = new Texture2D(gdm.GraphicsDevice, gdm.PreferredBackBufferWidth, gdm.PreferredBackBufferHeight); background.SetData(ColorPicker.setTexture(background.Width, background.Height, Color.Gray)); c.A = 180; c.R = 50; c.G = 50; c.B = 50; unselectedOne = new Texture2D(gdm.GraphicsDevice, 400, 400); unselectedTwo = new Texture2D(gdm.GraphicsDevice, 400, 400); unselectedOne.SetData(ColorPicker.setTexture(unselectedOne.Width, unselectedOne.Height, c)); unselectedTwo.SetData(ColorPicker.setTexture(unselectedTwo.Width, unselectedTwo.Height, c)); bgMusic = new BackgroundMusic(cm, BackgroundMusic.playAt.CharacterSelectScreen); moveMenuSound = cm.Load<SoundEffect>("Sounds/moveMenu"); menuDone = cm.Load<SoundEffect>("Sounds/menuDone"); PteraSound = cm.Load<SoundEffect>("Sounds/Ptera"); triSound = cm.Load<SoundEffect>("Sounds/tri"); brontoSound = cm.Load<SoundEffect>("Sounds/bronto"); trexSound = cm.Load<SoundEffect>("Sounds/trex"); }
/// <summary> /// UnloadContent will be called once per game and is the place to unload /// all content. /// </summary> protected override void UnloadContent() { gameState = GameState.TitleScreen; previousState = gameState; upgradeScreen = null; startScreen = null; characterScreen = null; multiplayerLobby = null; deathScreen = null; levelBeginning = null; pauseScreen = null; loadingScreen = null; levelCreator = null; Random rand = new Random(); currentLevel = null; enemies = null; explosions = null; shotBehavior = null; enemyShots = null; playerShots = null; hbOne = null; hbTwo = null; bossLifeBar = null; cbOne = null; cbTwo = null; backGroundMusic = null; playerOneMeterTitle = null; playerTwoMeterTitle = null; meterLabel = null; playerOneMarker = null; playerTwoMarker = null; dinosaurOne = null; dinosaurTwo = null; playerOneSprite = null; playerTwoSprite = null; collisions = null; font = null; playerOneCounter = 0; playerTwoCounter = 0; levelIncrement = 0; singlePlayer = false; explodedOne = false; explodedTwo = false; input = null; padInput = null; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { gameState = GameState.TitleScreen; spriteBatch = new SpriteBatch(GraphicsDevice); backGroundMusic = new BackgroundMusic(Content, BackgroundMusic.playAt.Level1); startScreen = new StartScreen(graphics, spriteBatch, Content); fadeScreen = new FadeScreen(graphics); enemies = new List<Sprite>(); explosions = new List<AnimatedSprite>(); collisions = new Collisions(Content, explosions); input = new KeyboardInput(); padInput = new GamepadInput(); hbOne = new HealthBar(Content, graphics, new Vector2(50, graphics.PreferredBackBufferHeight - 125)); cbOne = new ChargeMeter(Content, graphics, new Vector2(50, graphics.PreferredBackBufferHeight - 75)); meterLabel = Content.Load<Texture2D>("Images/meter-labels"); playerOneMeterTitle = Content.Load<Texture2D>("Images/meter-player-one"); playerTwoMeterTitle = Content.Load<Texture2D>("Images/meter-player-two"); playerOneMarker = Content.Load<Texture2D>("Images/P1-Marker"); playerTwoMarker = Content.Load<Texture2D>("Images/P2-Marker"); bossLifeBar = new HealthBar(Content, graphics, new Vector2(graphics.PreferredBackBufferWidth / 2 - 140, 50)); bossLifeBar.IsVisible = false; font = Content.Load<SpriteFont>("Font"); levelCreator = new LevelCreator(Content); pauseScreen = new PauseScreen(graphics, Content); creditScreen = new CreditScreen(graphics, Content); }
//GraphicsDeviceManager graphics; //SpriteBatch spriteBatch; public Level(GraphicsDeviceManager graphics, SpriteBatch spriteBatch, ContentManager content, LevelSelected levelSelected, List<Sprite> randomObjects) { this.Content = content; rand = new Random(); this.randomObjects = new List<Sprite>(); enemies = new List<Enemy>(); enemySprites = new List<Sprite>(); groups = new List<EnemyGroup>(); healthBars = new List<HealthBar>(); this.levelSelected = levelSelected; background = new Background(levelSelected, graphics.GraphicsDevice, spriteBatch, content); bossSound = content.Load<SoundEffect>("Sounds/Wow"); if (levelSelected == LevelSelected.Level1) { BGMusic = new BackgroundMusic(content, BackgroundMusic.playAt.Level1); BossBGMusic = new BackgroundMusic(content, BackgroundMusic.playAt.Level1Boss); border = new Border(levelSelected, graphics.GraphicsDevice, spriteBatch, content); //clouds = null; } else if (levelSelected == LevelSelected.Level2) { BGMusic = new BackgroundMusic(content, BackgroundMusic.playAt.Level2); BossBGMusic = new BackgroundMusic(content, BackgroundMusic.playAt.Level2Boss); border = null; clouds = new List<Clouds> { new Clouds(levelSelected, graphics.GraphicsDevice, spriteBatch, content, rand), new Clouds(levelSelected, graphics.GraphicsDevice, spriteBatch, content, rand), new Clouds(levelSelected, graphics.GraphicsDevice, spriteBatch, content, rand), new Clouds(levelSelected, graphics.GraphicsDevice, spriteBatch, content, rand), new Clouds(levelSelected, graphics.GraphicsDevice, spriteBatch, content, rand), new Clouds(levelSelected, graphics.GraphicsDevice, spriteBatch, content, rand), new Clouds(levelSelected, graphics.GraphicsDevice, spriteBatch, content, rand) }; } else if (levelSelected == LevelSelected.Level3) { BGMusic = new BackgroundMusic(content, BackgroundMusic.playAt.Level3); BossBGMusic = new BackgroundMusic(content, BackgroundMusic.playAt.Level3Boss); border = null; //clouds = null; } else if (levelSelected == LevelSelected.Level4) { BGMusic = new BackgroundMusic(content, BackgroundMusic.playAt.Level4); BossBGMusic = new BackgroundMusic(content, BackgroundMusic.playAt.Level4Boss); border = null; } else if (levelSelected == LevelSelected.Level5) { BGMusic = new BackgroundMusic(content, BackgroundMusic.playAt.Level4); BossBGMusic = new BackgroundMusic(content, BackgroundMusic.playAt.Level5Boss); border = null; } foreach (Sprite rObj in randomObjects) { rObj.Position = new Vector2(rand.Next(50, graphics.PreferredBackBufferWidth - 50),rand.Next(-1000, -100)); } this.randomObjects = randomObjects; }