public PlayableCharacter(Vector2 position, string characterState)
        {
            Position = position;
            FuturePosition = position;  // make the unit not move when spawned.
            Velocity = new Vector2(1f, 1f);

            IsSelected = false;
            Hand = new Hand(this, false, "AttackHand");

            if (characterState == "King")
            {
                PlayableObjectState = new King(this);
            }

            else if (characterState == "TownGuard")
            {
                PlayableObjectState = new TownGuard(this);
            }

            CollisionRectangle = PlayableObjectState.CollisionRectangle;
        }
Example #2
0
        public PlayableCharacter(Vector2 position, string characterState)
        {
            Position       = position;
            FuturePosition = position;  // make the unit not move when spawned.
            Velocity       = new Vector2(1f, 1f);

            IsSelected = false;
            Hand       = new Hand(this, false, "AttackHand");

            if (characterState == "King")
            {
                PlayableObjectState = new King(this);
            }

            else if (characterState == "TownGuard")
            {
                PlayableObjectState = new TownGuard(this);
            }

            CollisionRectangle = PlayableObjectState.CollisionRectangle;
        }