Example #1
0
        //create new character based on old in new location
        public character(character oldCharacter, CCPoint setLocation) : base()
        {
            myChar = oldCharacter.myChar; //set sprite based on the name of a passed in string
            this.AddChild(myChar); //connect the sprite to the character
            this.Position = setLocation;
            health = oldCharacter.health;
            maxHealth = oldCharacter.maxHealth;

            weapon = oldCharacter.weapon;
            this.AddChild(weapon);
            AddChild(weapon);

        }
Example #2
0
        //public bool inCombat { get; set; }


        public character(string spriteString,int setHealth,CCPoint setLocation, weapon equippedWeapon ) : base()
        {
            myChar = new CCSprite(spriteString); //set sprite based on the name of a passed in string
            this.AddChild(myChar); //connect the sprite to the character
            this.Position = setLocation;
            health = setHealth;
            maxHealth = setHealth;

            weapon = equippedWeapon;
            this.AddChild(weapon);
            AddChild(weapon);
            
        }