private Fighter GetFighter(Vector2 pos, Texture2D overlay, FighterInput input, bool flip, String type)
        {
            switch (type)
            {
                case ("wasp"):
                    float speed = .7f;
                    double health = 100;
                    double power = 10;

                    var waspIdle = LoadAnim("waspIdle");
                    var waspPunch = LoadAnim("waspPunch");
                    var waspRecoil = LoadAnim("waspRecoil");
                    List<HitBox.HitBoxFrame> hitFrames = new List<HitBox.HitBoxFrame>();
                    hitFrames.Add(new HitBox.HitBoxFrame(waspPunch.GetNumFrames() / waspPunch.GetFps(), new Rectangle(waspPunch.GetWidth(), 50, 10, 10), power));
                    var punch = new HitBox(p1, Load<SoundEffect>("Audio/waspPunch"), hitFrames); //Gets null for p1


                    return new Fighter(pos, overlay, waspIdle, waspPunch, waspRecoil, input, punch, flip, speed, health, power);
                case ("beetle"):
                    float speed2 = .4f;
                    double health2 = 100;
                    double power2 = 11;

                    var beetleIdle = LoadAnim("beetleIdle");
                    var beetlePunch = LoadAnim("beetlePunch");
                    var beetleRecoil = LoadAnim("beetleRecoil");
                    List<HitBox.HitBoxFrame> hitFrames2 = new List<HitBox.HitBoxFrame>();
                    hitFrames2.Add(new HitBox.HitBoxFrame(beetlePunch.GetNumFrames(), new Rectangle(beetlePunch.GetWidth(), 50, 10, 10), power2));
                    var punch2 = new HitBox(p2, Load<SoundEffect>("Audio/beetlePunch"), hitFrames2); //Gets null for p2, fix is below

                    return new Fighter(pos, overlay, beetleIdle, beetlePunch, beetleRecoil, input, punch2, flip, speed2, health2, power2);
            }

            return null;
        }
Beispiel #2
0
        public Fighter(Vector2 pos, Texture2D overlay_, AnimatedTexture2D idleAnim_, AnimatedTexture2D punchAnim_, AnimatedTexture2D recoilAnim_, FighterInput input_, HitBox punch_, bool flip_, float speed_, double health_, double power_)
            : base(pos)
        {
            idleAnim = idleAnim_;
            punchAnim = punchAnim_;
            recoilAnim = recoilAnim_;

            Vector2 ov = getOverlayPos();
            overlay = new Image((int) ov.X, (int) ov.Y, overlay_);

            input = input_;
            flip = flip_;
            speed = speed_;
            Health = health_;
            Power = power_;
            punch = punch_;
            invulnTime = 0;

            punching = false;
            gettingPunched = false;
            punch.parent = this;
        }
Beispiel #3
0
        public Fighter(Vector2 pos, Texture2D overlay_, AnimatedTexture2D idleAnim_, AnimatedTexture2D punchAnim_, AnimatedTexture2D recoilAnim_, FighterInput input_, HitBox punch_, bool flip_, float speed_, double health_, double power_)
            : base(pos)
        {
            idleAnim   = idleAnim_;
            punchAnim  = punchAnim_;
            recoilAnim = recoilAnim_;

            Vector2 ov = getOverlayPos();

            overlay = new Image((int)ov.X, (int)ov.Y, overlay_);

            input      = input_;
            flip       = flip_;
            speed      = speed_;
            Health     = health_;
            Power      = power_;
            punch      = punch_;
            invulnTime = 0;

            punching       = false;
            gettingPunched = false;
            punch.parent   = this;
        }