Ejemplo n.º 1
0
 public Projectile(Mob owner, Vector2 fireLoc, Vector2 shotDir, RangedStats rangedStats, Texture2D texture, Color color) : base(owner, fireLoc, shotDir, texture)
 {
     vel              = shotDir * rangedStats.BulletSpeed;
     this.texture     = texture;
     bounds           = new Rectangle((int)fireLoc.X, (int)fireLoc.Y, rangedStats.BulletWidth, rangedStats.BulletHeight);
     IsInactive       = false;
     this.rangedStats = rangedStats;
     this.color       = color;
 }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
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();
            }
        }
Ejemplo n.º 4
0
 public Shotgun(Mob owner, RangedStats ranged, MeleeStats melee, Texture2D pTexture, Texture2D mTexture, SoundEffect soundEffect)
     : base(owner, ranged, melee, pTexture, mTexture, soundEffect)
 {
 }