Exemple #1
0
 public Weapon(Mob owner, RangedStats ranged, MeleeStats melee, Texture2D pTexture, Texture2D mTexture, SoundEffect soundEffect)
 {
     this.Owner       = owner;
     this.pTexture    = pTexture;
     this.mTexture    = mTexture;
     this.meleeStats  = melee;
     this.rangedStats = ranged;
     this.soundEffect = soundEffect;
 }
Exemple #2
0
        private void RestartGame()
        {
            endRainLoop.Stop();
            this.IsMouseVisible = false;
            fadeTimer           = 0;
            fadeRatio           = 0;
            KeyControls controls = new KeyControls(Keys.W, Keys.S, Keys.A, Keys.D, Keys.Up, Keys.Down, Keys.Left, Keys.Right, Keys.F);

            player = new Player(400, 400, controls, Content.Load <Texture2D>("player"), Content.Load <SoundEffect>("grunt"), this);
            RangedStats rangedStats = BasicWeapon.BASE_RANGED_STATS;
            MeleeStats  meleeStats  = new MeleeStats(ZombieWeapon.BASE_M_KNOCK_BACK_AMOUNT, ZombieWeapon.BASE_M_KNOCK_BACK_SPEED, ZombieWeapon.BASE_M_RELOAD_TIME_MS, ZombieWeapon.BASE_M_RANGE + 25);

            player.Weapon = new BasicWeapon(player, rangedStats, meleeStats, Content.Load <Texture2D>("bullet"), whiteTexture, Content.Load <SoundEffect>("BasicGunshot"));
            //player.Weapon = new Shotgun(player, rangedStats, meleeStats, Content.Load<Texture2D>("bullet"), whiteTexture, Content.Load<SoundEffect>("BasicGunshot"));
            shotgun              = new Shotgun(player, Shotgun.BASE_RANGED_STATS, null, Content.Load <Texture2D>("bullet"), whiteTexture, Content.Load <SoundEffect>("shotgun"));
            Arena_Bounds         = new Rectangle(50, 50, 800, 800);
            projectiles          = new List <Projectile>();
            monsters             = new List <Monster>();
            projectileRemoveList = new List <Projectile>();
            monsterRemoveList    = new List <Monster>();
            meleeAttacks         = new List <MeleeAttack>();
            powerups             = new List <Powerup>();
            powerupRemoveList    = new List <Powerup>();
            spawner              = new Spawner(player, Content.ServiceProvider);
            spawner.AddSpawners(new Vector2(Arena_Bounds.X + Arena_Bounds.Width / 4, Arena_Bounds.Y), new Vector2(Arena_Bounds.X + (3 * Arena_Bounds.Width) / 4, Arena_Bounds.Y),
                                new Vector2(Arena_Bounds.X + Arena_Bounds.Width / 4, Arena_Bounds.Y + Arena_Bounds.Height), new Vector2(Arena_Bounds.X + (3 * Arena_Bounds.Width) / 4, Arena_Bounds.Y + Arena_Bounds.Height)
                                );
            if (firstTime)
            {
                UpdateApp      = UpdateTutorial;
                DrawApp        = DrawTutorial;
                IsMouseVisible = true;
                firstTime      = false;
            }
            else
            {
                UpdateApp = UpdateGame;
                DrawApp   = DrawGame;
                spawner.StartWave();
            }
        }
Exemple #3
0
 public Shotgun(Mob owner, RangedStats ranged, MeleeStats melee, Texture2D pTexture, Texture2D mTexture, SoundEffect soundEffect)
     : base(owner, ranged, melee, pTexture, mTexture, soundEffect)
 {
 }
Exemple #4
0
 public MeleeAttack(Mob owner, Vector2 loc, Vector2 dir, MeleeStats meleeStats, Texture2D texture) : base(owner, loc, dir, texture)
 {
     meleeDir        = dir;
     meleeLoc        = loc + dir * meleeStats.Range;
     this.meleeStats = meleeStats;
 }