public Menu(ContentManager Content, SpriteBatch spriteBatch) { menuTexture = new AnimatedSprite(Content.Load<Texture2D>("Graphics\\MainMenu"), 3, 2, animationSpeed); startButton = new Button(new Vector2(startButtonLX, startButtonLY), new Vector2(startButtonRX, startButtonRY), "", Vector2.Zero); controlsButton = new Button(new Vector2(controlsButtonLX, controlsButtonLY), new Vector2(controlsButtonRX, controlsButtonRY), "", Vector2.Zero); skipButton = new Button(new Vector2(skipButtonLX, skipButtonLY), new Vector2(skipButtonRX, skipButtonRY), "", Vector2.Zero); buttonList = new List<Button>() { startButton, skipButton, controlsButton }; buttonListHover = new List<bool>() { hoverFlag, hoverFlagSkip, hoverFlagControls }; pixel = new Texture2D(spriteBatch.GraphicsDevice, 1, 1, false, SurfaceFormat.Color); pixel.SetData(new[] { Color.White }); isInControllerMenu = false; controllerMenu = new ControllerMenu(Content, spriteBatch); selectedButton = 0; menuBgm = (Content.Load<SoundEffect>("Music\\Cylinder_Eight.wav")).CreateInstance(); windEffectInstance = (Content.Load<SoundEffect>("Music\\Wind.wav")).CreateInstance(); flagEffectInstance = (Content.Load<SoundEffect>("Music\\Flag.wav")).CreateInstance(); scrollClickEffectInstance = (Content.Load<SoundEffect>("Music\\Click.wav")).CreateInstance(); confirmClickEffectInstance = (Content.Load<SoundEffect>("Music\\Click2.wav")).CreateInstance(); menuBgm.IsLooped = true; menuBgm.Play(); windEffectInstance.IsLooped = true; windEffectInstance.Volume = windVolume; flagEffectInstance.IsLooped = true; flagEffectInstance.Volume = flagVolume; scrollClickEffectInstance.Volume = clickVolume; confirmClickEffectInstance.Volume = clickVolume; windEffectInstance.Play(); flagEffectInstance.Play(); }
public override void Initialize(ContentManager content, Vector2 position, Loot theLoot, Wave theWave) { EnemyDeathTexture = content.Load<Texture2D>("Graphics\\Enemy1Dead"); FiringTexture = content.Load<Texture2D>("Graphics\\Enemy1Firing"); EnemyTextureMap = new AnimatedSprite(content.Load<Texture2D>("Graphics\\Enemy1Map"), numMapRows, numMapColumns, animationSpeed); speed = E1Speed; regions = enemyRegions; damages = enemyDamages; sounds = enemySounds; health = enemyHealth; base.Initialize(content, position, theLoot, theWave); }
public override void Initialize(ContentManager content, Vector2 position, Loot theLoot, Wave theWave) { dogBiteSound = (content.Load<SoundEffect>("Music\\DogBite.wav")).CreateInstance(); EnemyDeathTexture = content.Load<Texture2D>("Graphics\\DogDead"); FiringTexture = content.Load<Texture2D>("Graphics\\DogBite"); EnemyTextureMap = new AnimatedSprite(content.Load<Texture2D>("Graphics\\DogMap"), numMapRows, numMapColumns, animationSpeed); speed = E1Speed; regions = enemyRegions; damages = enemyDamages; sounds = enemySounds; health = enemyHealth; base.Initialize(content, position, theLoot, theWave); firingAnimationRate = firinganimationRate; isLooted = true; //Dogs can't be looted Position.Y += heightOffset; }
public override void Initialize(ContentManager Content) { layoutBackdrop = new AnimatedSprite(Content.Load<Texture2D>("Graphics\\LadderLevel"), 1, 1, 10); gameOverSprite = new AnimatedSprite(Content.Load<Texture2D>("Graphics\\LadderGameOver"), 1, 1, 10); base.Initialize(Content); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { font = Content.Load<SpriteFont>("Fonts\\Font"); player = new Player(); crosshair = new Crosshair(); sniperRifle = new SniperRifle(); machineGun = new MachineGun(); weapon = sniperRifle; sniperRifle.isSelected = true; machineGun.isSelected = false; waveManager = new WaveManager(); scavengerManager = new ScavengerManager(); currentScavengeCommand = 0; victoryTexture = new AnimatedSprite(Content.Load<Texture2D>("Graphics\\Victory"), 3, 2, animationSpeed); base.Initialize(); }
public virtual void Initialize(ContentManager content, int scavPositionNumber, int HUDPosition, bool activeNow, ScavengerManager manager) { idleTexture = content.Load<Texture2D>("Graphics\\TrooperIdle"); deathTexture = content.Load<Texture2D>("Graphics\\TrooperDead"); trenchDeathTexture = content.Load<Texture2D>("Graphics\\TrooperDeadInTrench"); scavengingTexture = content.Load<Texture2D>("Graphics\\TrooperScavenging"); activeTexture = new AnimatedSprite(content.Load<Texture2D>("Graphics\\Trooper"), numMapRows, numMapColumns, animationSpeed); sentOutHudTexture = content.Load<Texture2D>("Graphics\\SendOutIcon"); sentBackHudTexture = content.Load<Texture2D>("Graphics\\SendBackIcon"); notSentHudTexture = content.Load<Texture2D>("Graphics\\NotSentIcon"); speed = speedValue; positionNumber = scavPositionNumber; scavengerManager = manager; Position = scavengerManager.waveManager.getWave().layout.getScavengerTrenchPlacement(positionNumber); hudSeat = HUDPosition; Alive = true; isLooted = false; action = 0; scavengedLoot = new List<Loot>(); whenScavengeBegan = 0; Active = activeNow; movingTowardsTrench = false; }