Ejemplo n.º 1
0
        public Arm(Gun gun)
        {
            joints = new Vector2[3];

            joints[0] = new Vector2(gun.X - ARM_LENGTH, gun.Y - ARM_LENGTH);  //shoulder
            joints[1] = new Vector2(gun.X - ARM_LENGTH, gun.Y);        //elbow
            joints[2] = new Vector2(gun.X, gun.Y);              //hand

            this.gun = gun;
            gun.setArm(this);
            handTexture = Game1.IMAGE_SPIN_HAND;

            upperArmTexture = Game1.IMAGE_UPPER_ARM;
            foreArmTexture = Game1.IMAGE_FORE_ARM;
            effect = SpriteEffects.None;

            if (gun.player == PlayerIndex.Two)
            {
                upperArmTexture = Game1.IMAGE_UPPER_ARM2;
                foreArmTexture = Game1.IMAGE_FORE_ARM2;
                effect = SpriteEffects.FlipHorizontally;
            }
        }
Ejemplo n.º 2
0
        public DuelScreen(Game1 game, PlayerIndex player)
            : base(game)
        {
            movementVector = Vector2.Zero;
            accellerationVector = Vector2.Zero;
            gun = new Gun(player);
            arm = new Arm(gun);
            P1Score = new Score(this);
            bullets = 6;
            firedBullets = new ArrayList(12);
            textPopups = new ArrayList(20);
            this.player = player;
            this.dead = false;
            this.droppedGun = false;
            this.droppedGunTimer = 0f;
            this.won = false;
            this.deathTimer = 0f;
            dropping = false;

            this.fallForces = new Vector2[8];
            Random rand = new Random();
            for (int i = 0; i < 8; i++)
            {
                fallForces[i] = new Vector2(rand.Next(5), rand.Next(10));
                //fallForces[i].X *= rand.Next(2) == 0 ? -1 : 1;
                fallForces[i].X += 5;
            }

            //set up cowboy body parts drawing locations
            if (player == PlayerIndex.One)
            {
                leftArmPos = new Vector2(280, 275);
                bodyPos = new Vector2(148, 240);
                headPos = new Vector2(245, 157);
                leftLegPos = new Vector2(216, 430);
                rightLegPos = new Vector2(36, 430);
                holsterPos = new Vector2(140, 418);

                leftArmText = Game1.IMAGE_LEFTARM;
                bodyText = Game1.IMAGE_BODY;
                headText = Game1.IMAGE_HEAD;
                leftLegText = Game1.IMAGE_LEFTLEG;
                rightLegText = Game1.IMAGE_RIGHTLEG;
                holsterText = Game1.IMAGE_HOLSTER;

                camera = game.p1Camera;
            }
            else
            {
                leftArmPos = new Vector2(280, 238);
                bodyPos = new Vector2(45, 192);
                headPos = new Vector2(245, 157);
                leftLegPos = new Vector2(30, 440);
                rightLegPos = new Vector2(206, 428);
                holsterPos = new Vector2(140, 418);

                leftArmText = Game1.IMAGE_LEFTARM2;
                bodyText = Game1.IMAGE_BODY2;
                headText = Game1.IMAGE_HEAD2;
                leftLegText = Game1.IMAGE_LEFTLEG2;
                rightLegText = Game1.IMAGE_RIGHTLEG2;
                holsterText = Game1.IMAGE_HOLSTER2;

                camera = game.p2Camera;
            }
        }