Ejemplo n.º 1
0
        public WeaponShopScreen(int playerIndex, Player player, World world)
            : base("Player " + (playerIndex + 1) + ": Weapon Shop")
        {
            this.player = player;
            this.world = world;
            guns = new BasicGun[5];
            shopEntries = new MenuEntry[5];

            // create menu entries
            for (int i = 0; i < shopEntries.Length; i++)
                shopEntries[i] = new MenuEntry(string.Empty);

            SetMenuEntryText();

            MenuEntry back = new MenuEntry("Exit Shop");

            // hook up event handlers
            back.Selected += OnCancel;
            for (int i = 0; i < shopEntries.Length; i++)
            {
                shopEntries[i].Selected += ShopMenuEntrySelected;
            }

            // add menu entries to screen
            for (int i = 0; i < shopEntries.Length; i++)
                MenuEntries.Add(shopEntries[i]);
            MenuEntries.Add(back);
        }
Ejemplo n.º 2
0
        public StatusDisplay(Player boundedPlayer, Vector2 position, Texture2D barTexture, Texture2D blankTexture, Texture2D[] weaponHuds, Texture2D screenBloodTexture, SpriteFont hudFont)
        {
            this.boundedPlayer = boundedPlayer;
            this.position = position;
            this.barTexture = barTexture;
            this.blankTexture = blankTexture;
            this.weaponTextures = weaponHuds;
            this.screenBloodTexture = screenBloodTexture;
            this.hudFont = hudFont;

            this.gradbar = boundedPlayer.MaxHealth;
            this.health = boundedPlayer.Health;
            this.maxHealth = boundedPlayer.MaxHealth;
        }
Ejemplo n.º 3
0
        public GameOverScreen(PlayerIndex p1Index, PlayerIndex? p2Index, Player p1, Player p2, Cue actionBgm)
            : base("Game Over")
        {
            this.p1Index = p1Index;
            this.p2Index = p2Index;
            this.p1 = p1;
            this.p2 = p2;

            if (actionBgm.IsPlaying) actionBgm.Stop(AudioStopOptions.Immediate);

            MenuEntry share = new MenuEntry("Share Highscore");
            MenuEntry restart = new MenuEntry("Restart Game");
            MenuEntry back = new MenuEntry("Exit to Menu");

            share.Selected += ShareSelected;
            restart.Selected += RestartSelected;
            back.Selected += BackSelected;

            MenuEntries.Add(restart);
            MenuEntries.Add(share);
            MenuEntries.Add(back);
        }
Ejemplo n.º 4
0
        public WeaponModScreen(int playerIndex, Player player, BasicGun gun, World world)
            : base("Player " + (playerIndex + 1) + ": Modding " + gun.GunType.ToString())
        {
            this.player = player;
            this.gun = gun;
            this.world = world;

            // create menu entries
            lazerMenuEntry = new MenuEntry(string.Empty);
            extendedClipMenuEntry = new MenuEntry(string.Empty);
            fullAutoMenuEntry = new MenuEntry(string.Empty);
            fastReloadMenuEntry = new MenuEntry(string.Empty);
            moreAmmoMenuEntry = new MenuEntry(string.Empty);
            fmjMenuEntry = new MenuEntry(string.Empty);

            SetMenuEntryText();

            MenuEntry back = new MenuEntry("Exit Shop");

            // hook up event handlers
            lazerMenuEntry.Selected += LazerMenuEntrySelected;
            extendedClipMenuEntry.Selected += ExtendedClipMenuEntrySelected;
            fullAutoMenuEntry.Selected += FullAutoMenuEntrySelected;
            fastReloadMenuEntry.Selected += FastReloadMenuEntrySelected;
            moreAmmoMenuEntry.Selected += MoreAmmoMenuEntrySelected;
            fmjMenuEntry.Selected += FmjMenuEntrySelected;
            back.Selected += OnCancel;

            // add menu entries to screen
            MenuEntries.Add(lazerMenuEntry);
            MenuEntries.Add(extendedClipMenuEntry);
            MenuEntries.Add(fullAutoMenuEntry);
            MenuEntries.Add(fastReloadMenuEntry);
            MenuEntries.Add(moreAmmoMenuEntry);
            MenuEntries.Add(fmjMenuEntry);

            MenuEntries.Add(back);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Attack target player using fake bullets.
 /// </summary>
 /// <param name="playerToAttack"></param>
 private void Attack(Player playerToAttack)
 {
     Vector2 direction = playerToAttack.Position - this.position;
     world.bulletList.Add(new Bullet(this.position, direction / direction.Length() * 30, attackDamage, attackRadius, null, targetList, this, world));
 }
Ejemplo n.º 6
0
 public virtual void TriggerPowerUp(Player player)
 {
     triggered = true;
 }
Ejemplo n.º 7
0
 // this thing doesnt need to be updated.
 // but a method is required to decide whether player is in shop
 public bool IsInShop(Player playerToCheck)
 {
     return (playerToCheck.Position.X > position.X && playerToCheck.Position.X < position.X + size.X &&
         playerToCheck.Position.Y > position.Y && playerToCheck.Position.Y < position.Y + size.Y);
 }